admin_scan reports the homepage as an admin page
Maintainers usually reply within 1 day
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 75/100
Research direction
Start with read_from_file() in nettacker/core/fuzzer.py and the wordlist checks in test_wordlists.py; compare how trailing and leading blank lines are handled. Reproduce with the admin wordlist or a custom -W list, then confirm the empty trailing entry is gone while the intentional blank password remains. Done when the tests pass and admin_scan no longer requests the homepage as an admin path.
Written by the indexing model from the issue text.
Description
While testing admin_scan locally I noticed it reports the homepage as a finding, even on a site with no admin pages at all.
Looks like it's the trailing newline in admin_wordlist.txt (added in #1366). read_from_file() in fuzzer.py does .split("\n"), so the last entry ends up empty:
python -c 'from nettacker.core.fuzzer import read_from_file; w = read_from_file("wordlists/admin_wordlist.txt"); print(len(w), repr(w[-1]))'
507 ''
test_wordlists.py expects 506. That empty entry turns into a request for just http://target:port/, and admin.yaml matches 200/401/403, so basically any site with a working homepage gets flagged.
To reproduce:
mkdir -p /tmp/site && echo home > /tmp/site/index.html
python -m http.server 18080 --bind 127.0.0.1 --directory /tmp/site
# in another terminal
python nettacker.py -i 127.0.0.1 -g 18080 -d -m admin_scan
All the admin paths 404, but http://127.0.0.1:18080/ still shows up as found (507 requests instead of 506).
Same thing shows up in a few other places:
- the password list also ends with a newline, so brute modules try the blank password twice per user (Modules.md actually mentions this)
- a custom
-Wlist with a trailing newline makes dir_scan report// - #1440 adds trailing newlines to 6 more wordlists, so dir/pma/config/wp scans would start doing it too
I tried dropping just the trailing newline in read_from_file() (.read().removesuffix("\n").split("\n")) so the blank first line in the password list still works. With that, admin_scan sends 506 requests, no false hit, and still finds a real /administrator/ page. Brute modules go back to 1,001 passwords per user like the docs say.
Linux Mint 22.3, Python 3.12.3, Nettacker 0.4.2 (master f333cee7)
Can I take this one?
- Dominant language
- Python
- Stars
- 5.7k
- Forks
- 1.2k
- Avg merge
- 5d 1h
- Merged PRs (30d)
- 10
Getting set up
- Ships a Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from OWASP/Nettacker
-
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
Maintainers usually reply within 1 day
-
List indices must be integers or slices in find_and_replace_dependent_values()Possibly taken @vishalmore90 claimed this 5 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
OWASP/Nettacker#1829 · 1 comment ·
Maintainers usually reply within 1 day
-
Discovered ports from service discovery are never propagated to modules in Module.load()Possibly taken @vishalmore90 claimed this 5 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
OWASP/Nettacker#1828 · 2 comments ·
Maintainers usually reply within 1 day
-
Add a timeout to RIPE IP range lookupsMay be free again @Dikshant-Neupane claimed this 12 days ago, and no pull request is open. Open
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
OWASP/Nettacker#1806 · 7 comments ·
Maintainers usually reply within 1 day
-
Add Marathi (mr) language libraryPossibly taken @yashspidey claimed this 16 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
OWASP/Nettacker#1771 · 1 comment · 1 assignee ·
Maintainers usually reply within 1 day
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
pylint-dev/pylint#11791 ·
Maintainers usually reply within 1 day
-
Rasterio granule reads never retry, so one 503 (Service Unavailable) fails the whole requestPossibly taken @chuckwondo claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
developmentseed/titiler-cmr#305 ·
Maintainers usually reply within 1 day
-
community enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
Maintainers usually reply within 1 day