Skip to content
This repository has been archived by the owner on Dec 3, 2024. It is now read-only.

[Snyk] Fix for 2 vulnerabilities #10

Open
wants to merge 43 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
b103616
Update README.md
sscottgvit Jan 8, 2019
65e16d9
Add requirements file
sscottgvit Jan 8, 2019
3510d7a
Converted to library
jchoy14 Jan 18, 2019
c8c1c6e
Added comments
jchoy14 Jan 18, 2019
1a7ada2
Added comments
jchoy14 Jan 18, 2019
92842c1
Fixed incorrect variable declaration in searchIp method
jchoy14 Jan 24, 2019
03bd758
Added comments
jchoy14 Feb 5, 2019
7af7fd0
Added missing import + bugfixes
jchoy14 Feb 5, 2019
ff9d858
Cleanup
jchoy14 Feb 5, 2019
9f3bfac
Cleaned up all methods and removed duplicate code
jchoy14 Feb 5, 2019
9e5bfe5
Pushed to PyPi (test)
jchoy14 Feb 12, 2019
4bdaf3c
Added gitignore
jchoy14 Feb 20, 2019
7b2bfb1
gitignore
jchoy14 Feb 20, 2019
d210171
Fixed untracked files
jchoy14 Feb 20, 2019
c538776
travis-ci
jchoy14 Feb 20, 2019
af804db
travis-ci
jchoy14 Feb 20, 2019
e680b2f
travis-ci
jchoy14 Feb 20, 2019
50d0bd8
Bug fixes
sscottgvit May 6, 2019
7204792
Add IP class detection
sscottgvit May 6, 2019
2d14627
Minor fixes
sscottgvit May 7, 2019
e72df4b
Fix deps
sscottgvit May 7, 2019
2887ee8
Updated broken import
jchoy14 Sep 28, 2020
a4a02d8
Updated test script
jchoy14 Oct 9, 2020
7502ea0
Update README.md
Tdeforge Dec 11, 2020
dcd3358
Fixed searchList function
jchoy14 Jan 15, 2021
709a81e
Update to 0.2.4
sscottgvit Jun 2, 2021
00cd8a2
Fix dep typo
sscottgvit Jun 2, 2021
32a4431
Create setup.cfg
jcavanguard Oct 18, 2021
9c4a9f2
Increment version number for published py libraries.
dcallaway-govanguard Jun 8, 2022
69604ba
Added Changelog.txt per Shane.
dcallaway-govanguard Jun 8, 2022
59b2993
Code improvements, Add git actions, other cleanup
sscottgvit May 3, 2024
514e822
Bump version to 0.2.7 and update ChangeLog
actions-user May 3, 2024
e353c5e
Update of sample script
sscottgvit May 3, 2024
1c6699f
Merge branch 'master' of github.com:GoVanguard/pyShodan
sscottgvit May 3, 2024
89567a1
Bump version to 0.2.8 and update ChangeLog
actions-user May 3, 2024
e6ca02e
Update sample script
sscottgvit May 3, 2024
fbf0dfd
Merge branch 'master' of github.com:GoVanguard/pyShodan
sscottgvit May 3, 2024
ba6debf
Bump version to 0.2.9 and update ChangeLog
actions-user May 3, 2024
608feb5
Update readme
sscottgvit May 3, 2024
a9d5c06
Merge branch 'master' of github.com:GoVanguard/pyShodan
sscottgvit May 3, 2024
fe5a1a4
Bump version to 0.2.10 and update ChangeLog
actions-user May 3, 2024
b054c4a
Bump version to 0.2.11 and update ChangeLog
actions-user May 3, 2024
60c5892
fix: requirements.txt to reduce vulnerabilities
snyk-bot Aug 9, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
103 changes: 103 additions & 0 deletions .github/workflows/master.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
name: Python package

on:
push:
tags:
- 'package*'
workflow_dispatch:

jobs:
prepare:
runs-on: ubuntu-latest
outputs:
new_version: ${{ steps.version.outputs.new_version }}

steps:
- uses: actions/checkout@v2

- name: Extract and increment version using sed and awk
id: increment_version
run: |
version=$(sed -n "s/^ *version=['\"]\([^'\"]*\)['\"],/\1/p" setup.py)
new_version=$(echo $version | awk -F. -v OFS=. '{$NF += 1; print}')
sed -i "s;$version;$new_version;g" setup.py
echo "new_version=$new_version" >> $GITHUB_ENV

- name: Get last commit details
id: last_commit
run: |
commit_message=$(git log -1 --pretty=%B)
commit_author=$(git log -1 --pretty=%an)
echo "commit_message=$commit_message" >> $GITHUB_ENV
echo "commit_author=$commit_author" >> $GITHUB_ENV

- name: Update ChangeLog
run: |
echo "## v${{ env.new_version }} - $(date +'%Y-%m-%d')" >> ChangeLog.md
echo "- Last commit by ${{ env.commit_author }}: ${{ env.commit_message }}" >> ChangeLog.md

- name: Commit and push changes
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git add setup.py ChangeLog.md
git commit -m "Bump version to ${{ env.new_version }} and update ChangeLog"
git push


build:
needs: prepare
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
python-version: [3.11]
os: [ubuntu-latest]

steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}

- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install flake8 semgrep setuptools wheel build twine
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi

- name: Lint with flake8
run: |
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=128 --statistics

- name: Security scan with Semgrep
run: |
semgrep --config=p/r2c

- name: Patch version using sed and awk (not because we can't pull the commited update in prepare)
run: |
version=$(sed -n "s/^ *version=['\"]\([^'\"]*\)['\"],/\1/p" setup.py)
new_version=$(echo $version | awk -F. -v OFS=. '{$NF += 1; print}')
sed -i "s;$version;$new_version;g" setup.py

- name: Build the package
run: python setup.py sdist bdist_wheel

- name: Build and publish
if: success()
run: |
twine upload dist/*
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}

- name: Upload artifacts
if: success()
uses: actions/upload-artifact@v4
with:
name: dist-${{ matrix.python-version }}-${{ matrix.os }}
path: dist/*
if-no-files-found: error
retention-days: 90
96 changes: 96 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# OSX Stuff
.DS_Store

# C extensions
*.so

# Distribution / packaging
.Python
env/
build/
.build/
develop-eggs/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
*.egg-info/
.installed.cfg
*.egg

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*,cover
.hypothesis/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
target/

# IPython Notebook
.ipynb_checkpoints

# pyenv
.python-version

# celery beat schedule file
celerybeat-schedule

# dotenv
.env

# virtualenv
.venv/
venv/
ENV/

# Spyder project settings
.spyderproject

# Rope project settings
.ropeproject

# local test
test.py
13 changes: 13 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
language: python

sudo: true

python:

- 3.6

install:
- pip install -r requirements.txt

script:
- python ./pyShodan/__init__.py
10 changes: 10 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
## v0.2.7 - 2024-05-03
- Last commit by sscottgvit: Code improvements, Add git actions, other cleanup
## v0.2.8 - 2024-05-03
- Last commit by sscottgvit: Merge branch 'master' of github.com:GoVanguard/pyShodan
## v0.2.9 - 2024-05-03
- Last commit by sscottgvit: Merge branch 'master' of github.com:GoVanguard/pyShodan
## v0.2.10 - 2024-05-03
- Last commit by sscottgvit: Merge branch 'master' of github.com:GoVanguard/pyShodan
## v0.2.11 - 2024-05-03
- Last commit by GitHub Action: Bump version to 0.2.10 and update ChangeLog
165 changes: 165 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,165 @@
GNU LESSER GENERAL PUBLIC LICENSE
Version 3, 29 June 2007

Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.


This version of the GNU Lesser General Public License incorporates
the terms and conditions of version 3 of the GNU General Public
License, supplemented by the additional permissions listed below.

0. Additional Definitions.

As used herein, "this License" refers to version 3 of the GNU Lesser
General Public License, and the "GNU GPL" refers to version 3 of the GNU
General Public License.

"The Library" refers to a covered work governed by this License,
other than an Application or a Combined Work as defined below.

An "Application" is any work that makes use of an interface provided
by the Library, but which is not otherwise based on the Library.
Defining a subclass of a class defined by the Library is deemed a mode
of using an interface provided by the Library.

A "Combined Work" is a work produced by combining or linking an
Application with the Library. The particular version of the Library
with which the Combined Work was made is also called the "Linked
Version".

The "Minimal Corresponding Source" for a Combined Work means the
Corresponding Source for the Combined Work, excluding any source code
for portions of the Combined Work that, considered in isolation, are
based on the Application, and not on the Linked Version.

The "Corresponding Application Code" for a Combined Work means the
object code and/or source code for the Application, including any data
and utility programs needed for reproducing the Combined Work from the
Application, but excluding the System Libraries of the Combined Work.

1. Exception to Section 3 of the GNU GPL.

You may convey a covered work under sections 3 and 4 of this License
without being bound by section 3 of the GNU GPL.

2. Conveying Modified Versions.

If you modify a copy of the Library, and, in your modifications, a
facility refers to a function or data to be supplied by an Application
that uses the facility (other than as an argument passed when the
facility is invoked), then you may convey a copy of the modified
version:

a) under this License, provided that you make a good faith effort to
ensure that, in the event an Application does not supply the
function or data, the facility still operates, and performs
whatever part of its purpose remains meaningful, or

b) under the GNU GPL, with none of the additional permissions of
this License applicable to that copy.

3. Object Code Incorporating Material from Library Header Files.

The object code form of an Application may incorporate material from
a header file that is part of the Library. You may convey such object
code under terms of your choice, provided that, if the incorporated
material is not limited to numerical parameters, data structure
layouts and accessors, or small macros, inline functions and templates
(ten or fewer lines in length), you do both of the following:

a) Give prominent notice with each copy of the object code that the
Library is used in it and that the Library and its use are
covered by this License.

b) Accompany the object code with a copy of the GNU GPL and this license
document.

4. Combined Works.

You may convey a Combined Work under terms of your choice that,
taken together, effectively do not restrict modification of the
portions of the Library contained in the Combined Work and reverse
engineering for debugging such modifications, if you also do each of
the following:

a) Give prominent notice with each copy of the Combined Work that
the Library is used in it and that the Library and its use are
covered by this License.

b) Accompany the Combined Work with a copy of the GNU GPL and this license
document.

c) For a Combined Work that displays copyright notices during
execution, include the copyright notice for the Library among
these notices, as well as a reference directing the user to the
copies of the GNU GPL and this license document.

d) Do one of the following:

0) Convey the Minimal Corresponding Source under the terms of this
License, and the Corresponding Application Code in a form
suitable for, and under terms that permit, the user to
recombine or relink the Application with a modified version of
the Linked Version to produce a modified Combined Work, in the
manner specified by section 6 of the GNU GPL for conveying
Corresponding Source.

1) Use a suitable shared library mechanism for linking with the
Library. A suitable mechanism is one that (a) uses at run time
a copy of the Library already present on the user's computer
system, and (b) will operate properly with a modified version
of the Library that is interface-compatible with the Linked
Version.

e) Provide Installation Information, but only if you would otherwise
be required to provide such information under section 6 of the
GNU GPL, and only to the extent that such information is
necessary to install and execute a modified version of the
Combined Work produced by recombining or relinking the
Application with a modified version of the Linked Version. (If
you use option 4d0, the Installation Information must accompany
the Minimal Corresponding Source and Corresponding Application
Code. If you use option 4d1, you must provide the Installation
Information in the manner specified by section 6 of the GNU GPL
for conveying Corresponding Source.)

5. Combined Libraries.

You may place library facilities that are a work based on the
Library side by side in a single library together with other library
facilities that are not Applications and are not covered by this
License, and convey such a combined library under terms of your
choice, if you do both of the following:

a) Accompany the combined library with a copy of the same work based
on the Library, uncombined with any other library facilities,
conveyed under the terms of this License.

b) Give prominent notice with the combined library that part of it
is a work based on the Library, and explaining where to find the
accompanying uncombined form of the same work.

6. Revised Versions of the GNU Lesser General Public License.

The Free Software Foundation may publish revised and/or new versions
of the GNU Lesser General Public License from time to time. Such new
versions will be similar in spirit to the present version, but may
differ in detail to address new problems or concerns.

Each version is given a distinguishing version number. If the
Library as you received it specifies that a certain numbered version
of the GNU Lesser General Public License "or any later version"
applies to it, you have the option of following the terms and
conditions either of that published version or of any later version
published by the Free Software Foundation. If the Library as you
received it does not specify a version number of the GNU Lesser
General Public License, you may choose any version of the GNU Lesser
General Public License ever published by the Free Software Foundation.

If the Library as you received it specifies that a proxy can decide
whether future versions of the GNU Lesser General Public License shall
apply, that proxy's public statement of acceptance of any version is
permanent authorization for you to choose that version for the
Library.
Loading