Repository navigation
Make the AiTM cookie demo path runnable end to end - #8
Closed
adamsiwiec1 wants to merge 1 commit into
Closed
adamsiwiec1 wants to merge 1 commit into
adamsiwiec1 wants to merge 1 commit into
Conversation
The shipped demo-cookie phishlet pointed proxy_hosts, login, and auth_tokens all at demo-cookie.local.phishkit — the same host as the lure. evilginx dialed itself, failed to clone the upstream cert, and never captured a session. ensure-destination also scaffolded a colliding demo-cookie-local-phishkit yaml. start-lure reported "did not bind HTTPS port 443" while evilginx was already LISTEN, because the probe only used lsof (often missing). make setup never installed screen or pexpect, which configure_lure needs. This change: - Rewrites demo-cookie.yaml so upstream is cookie-origin.local.phishkit (distinct from the lure host). - Adds make demo-cookie-https: HTTPS mock on 127.0.0.2:443 (same port, other IP, so it does not collide with evilginx on 127.0.0.1). - Fixes the bind probe to try a real TCP connect, then ss, then lsof, with FileNotFoundError handling and a longer timeout plus grace re-check. - Extends make setup to install scripts/requirements.txt into venv and to document screen + setcap for :443/:53. - Reuses the shipped demo-cookie phishlet for demo hosts instead of scaffolding a colliding name. - Fixes upstream_domain for compound public suffixes (.co.uk, github.io, local.phishkit, …) so phishlet generation does not strip to co.uk. Tests: - engagement::tests (incl. co.uk / github.io / local.phishkit eTLD+1) - engagement::demo_phishlet_tests::demo_cookie_phishlet_does_not_self_proxy - destination::demo_reuse_tests::shipped_demo_cookie_hosts_reuse_demo_cookie_phishlet - scripts/test-https-bind-probe.sh (free port / listening / late bind) Run: cargo test -p phishkit-core --lib && bash scripts/test-https-bind-probe.sh Result: 10 rust passed; 3 bind-probe checks passed.
Contributor
Author
|
Closing in favor of #9 ( #9 covers the same C1 ground with more complete wiring: CI job for the AiTM checks, Python unit tests for the bind poll and port selection, smoke scripts, TLS cert helper, walkthrough/README updates, and a CHANGELOG entry. I compared the two branches file-by-file; the only paths unique to this PR were Nothing unique from this PR needs to be folded into #9 before merge. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What was wrong (C1)
The headline AiTM path did not complete out of the box:
make setupnever installedscreenorpexpect, whichconfigure_lure.pyneeds.:443/:53privileges with no documented setcap path.lsof, which is often missing, and reported "did not bind HTTPS port 443" while evilginx was alreadyLISTEN.demo-cookie.yamlsetproxy_hosts,login, andauth_tokensall todemo-cookie.local.phishkit— the same host as the lure — so evilginx dialed itself and never captured a session.ensure-destinationscaffolded a collidingdemo-cookie-local-phishkitphishlet.upstream_domainstripped compound public suffixes toco.uk/github.io, which fed broken phishlet generation (M1).Fix
demo-cookie.yamlso upstream iscookie-origin.local.phishkit(distinct from the lure host).make demo-cookie-https: HTTPS mock on127.0.0.2:443(same port, other IP, so it does not collide with evilginx on127.0.0.1).ss, thenlsof, withFileNotFoundErrorhandling, longer timeout, and a grace re-check.make setupinstallsscripts/requirements.txtintovenvand documentsscreen+setcapfor:443/:53.demo-cookiephishlet for demo hosts instead of scaffolding a colliding name.upstream_domainunderstands common multi-part public suffixes (.co.uk,github.io,local.phishkit, …).Defaults are not weakened: the HTTPS mock and privileged ports stay explicit operator steps.
Tests
Unit:
engagement::tests(includingacme.co.uk,github.io,local.phishkiteTLD+1)engagement::demo_phishlet_tests::demo_cookie_phishlet_does_not_self_proxydestination::demo_reuse_tests::shipped_demo_cookie_hosts_reuse_demo_cookie_phishletIntegration/smoke (committed script):
scripts/test-https-bind-probe.sh— free port / listening / late bindCommand run before pushing:
Result: 10 rust passed; 3 bind-probe checks passed.
Full live evilginx capture on this shared box still needs
setcap(or root) for:443on both evilginx and the HTTPS mock; that is documented rather than silently skipped.