Skip to content

Commit 6eb3bd8

Browse files
authored
Completed store results in a database project (epi052#32)
Co-authored-by: Ryan Good <[email protected]> * added initial skeleton; restructured project directories * removed workers directive from luigi; changed input to tko-subs * changed masscan command to use config.tool_paths * linted __init__ files and updated docstring for get_scans * added per-file-ignores for linting * recon-pipeline linted * PoC working for amass results -> db; rudimentary db mgmt commands also * more linting * added database management commands to the shell * db_location passes through to all tasks; masscan results added to db * removed unused imports from masscan.py * added ParseNmapOutput class to handle parsing for database storage * cleaned up repeat code * searchsploit results stored in db * lint/format * gobuster scans now stored in database * fixed test_recon tests to use db_location * fixed web tests * tkosub entries recorded in db * subjack scan results stored in database * webanalyze results stored in db * refactored older commits to use newer helper functions * refactored older commits to use newer helper functions * aquatone results stored in database refactored a few scans to use dbmanager helper functions refactored db structure wrt headers/screenshots added 80/443 to web_ports in config.py * fixed a few queries and re-added webanalyze to FullScan * view targets/endpoints done * overhauled nmap parsing * print all nmap_results good, next to focus on filtering * complex nmap filters complete * nmap printing done * updated pipfile * view web-technologies complete * view searchsploit results complete * removed filesystem code from amass * targetlist moved to db only * targets,amass,masscan all cutover to full database; added view ports * nmap fully db compliant * aquatone and webtargets db compliant * gobuster uses db now * webanalyze db compliant * all scans except corscanner are db compliant * recon tests passing * web tests passing * linted files * added tests for helpers.py and parsers.py * refactored some redundant code * added tests to pre-commit * updated amass tests and pre-commit version * updated recon.targets tests * updated nmap tests * updated masscan tests * updated config tests * updated web targets tests * added gobuster tests * added aquatone tests * added subdomain takeover and webanalyze tests; updated test data * removed homegrown sqlite target in favor of the sqla implementation * added tests for recon-pipeline.py * fixed cluge function to set __package__ globally * updated amass tests * updated targets tests * updated nmap tests * updated masscan tests * updated aquatone tests * updated nmap tests to account for no searchsploit * updated nmap tests to account for no searchsploit * updated masscan tests * updated subjack/tkosub tests * updated web targets tests * updated webanalyze tests * added corscanner tests * linted DBManager a bit * fixed weird cyclic import issue that only happened during docs build; housekeeping * added models tests, removed test_install dir * updated docs a bit; sidenav is wonky * fixed readthedocs requirements.txt * fixed issue where view results werent populated directly after scan * added new tests to pipeline; working on docs * updated a few overlooked view command items * updated tests to reflect changes to shell * incremental push of docs update * documentation done * updated exploitdb install * updated exploitdb install * updated seclists install * parseamass updates db in the event of no amass output * removed corscanner * added pipenv shell to install instructions per @GreaterGoodest * added pipenv shell to install instructions per @GreaterGoodest * added check for chromium-browser during aquatone install; closes epi052#26 * added check for old recon-tools dir; updated Path.resolve calls to Path.expanduser.resolve; fixed very specific import bug due to filesystem location * added CONTIBUTING.md; updated pre-commit hooks/README * added .gitattributes for linguist reporting * updated tests * fixed a few weird bugs found during test * updated README * updated asciinema links in README * updated README with view command video * updated other location for url scheme /status * add ability to specify single target using --target (epi052#31) * updated a few items in docs and moved tool-dict to tools-dir * fixed issue where removing tempfile without --verbose caused scan to fail
1 parent ff801df commit 6eb3bd8

File tree

4,703 files changed

+134233
-8131
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

4,703 files changed

+134233
-8131
lines changed

.flake8

+7-1
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,10 @@
22
max-line-length = 120
33
select = C,E,F,W,B,B950
44
ignore = E203, E501, W503
5-
max-complexity = 13
5+
max-complexity = 13
6+
per-file-ignores =
7+
pipeline/recon/__init__.py:F401
8+
pipeline/models/__init__.py:F401
9+
pipeline/recon/web/__init__.py:F401
10+
pipeline/luigi_targets/__init__.py:F401
11+
tests/test_recon/test_parsers.py:F405

.gitattributes

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
docs/* linguist-documentation

.github/workflows/pythonapp.yml

+26-8
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,12 @@ jobs:
2828
with:
2929
args: ". --check"
3030

31-
test-install:
31+
test-shell:
3232

3333
runs-on: ubuntu-latest
3434

3535
steps:
3636
- uses: actions/checkout@v1
37-
- name: Set up Golang
38-
uses: actions/setup-go@v1
3937
- name: Set up Python 3.7
4038
uses: actions/setup-python@v1
4139
with:
@@ -47,8 +45,8 @@ jobs:
4745
pipenv install -d
4846
- name: Test with pytest
4947
run: |
50-
pipenv install pytest cmd2 luigi
51-
pipenv run python -m pytest tests/test_install
48+
pipenv install pytest cmd2 luigi sqlalchemy python-libnmap
49+
pipenv run python -m pytest tests/test_shell
5250
5351
test-recon:
5452

@@ -67,7 +65,7 @@ jobs:
6765
pipenv install -d
6866
- name: Test with pytest
6967
run: |
70-
pipenv install pytest cmd2 luigi
68+
pipenv install pytest cmd2 luigi sqlalchemy python-libnmap
7169
pipenv run python -m pytest tests/test_recon
7270
7371
test-web:
@@ -87,5 +85,25 @@ jobs:
8785
pipenv install -d
8886
- name: Test with pytest
8987
run: |
90-
pipenv install pytest cmd2 luigi
91-
pipenv run python -m pytest tests/test_web
88+
pipenv install pytest cmd2 luigi sqlalchemy python-libnmap
89+
pipenv run python -m pytest tests/test_web
90+
91+
test-models:
92+
93+
runs-on: ubuntu-latest
94+
95+
steps:
96+
- uses: actions/checkout@v1
97+
- name: Set up Python 3.7
98+
uses: actions/setup-python@v1
99+
with:
100+
python-version: 3.7
101+
- name: Set up pipenv
102+
run: |
103+
python -m pip install --upgrade pip
104+
pip install pipenv
105+
pipenv install -d
106+
- name: Test with pytest
107+
run: |
108+
pipenv install pytest cmd2 luigi sqlalchemy python-libnmap
109+
pipenv run python -m pytest tests/test_models

.pre-commit-config.yaml

+16-4
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,21 @@ repos:
44
hooks:
55
- id: black
66
language_version: python3.7
7-
args: ['.']
8-
- repo: https://github.com/pre-commit/pre-commit-hooks
9-
rev: v1.2.3
7+
args: ['pipeline', 'tests/test_web', 'tests/test_recon', 'tests/test_shell', 'tests/test_models']
8+
- repo: https://gitlab.com/pycqa/flake8
9+
rev: 3.7.9
1010
hooks:
1111
- id: flake8
12-
12+
- repo: https://github.com/pre-commit/pre-commit-hooks
13+
rev: v2.5.0 # Use the ref you want to point at
14+
hooks:
15+
- id: trailing-whitespace
16+
- id: debug-statements
17+
- repo: local
18+
hooks:
19+
- id: tests
20+
name: run tests
21+
entry: pytest
22+
language: system
23+
types: [python]
24+
args: ['tests/test_web', 'tests/test_recon', 'tests/test_shell', 'tests/test_models']

0 commit comments

Comments
 (0)