Repository navigation
fix(core): export all three evilginx token maps, stop pruning cookie-only captures - #18
Merged
Merged
Conversation
…ie-only captures
export_capture_cookies now reads tokens, body_tokens, and http_tokens. JSON
output returns { cookies, body_tokens, http_tokens }; Netscape output emits a
note when there are no cookie tokens but body/http material exists.
Adds capture_has_material as the single has-material check, used by both the
exporter and prune_empty_captures so they cannot drift. prune previously only
looked at body_tokens, so cookie-only captures were wrongly pruned.
Fixes #17
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.
Fixes #17
What was wrong
Captured session cookies were not making it out of PhishKit. Two spots in
crates/phishkit-core(the shared core used by both the CLI inapps/cliand the desktop UI inapps/desktop) only looked at a subset of evilginx's token maps:export_capture_cookiesinsrc/sessions.rsread only thetokensmap and ignoredbody_tokensandhttp_tokens, so material captured in those maps never showed up in an export.prune_empty_capturesinsrc/db.rsdecided a capture was empty by checkingbody_tokensalone. A cookie-only capture (material intokens) looked empty to prune and got removed.Because both live in the shared core, this affected the CLI and the desktop UI, not one surface.
Changes
export_capture_cookiesnow reads all three maps (tokens,body_tokens,http_tokens). JSON output returns{ "cookies": ..., "body_tokens": ..., "http_tokens": ... }. Netscape output still emits browser-importable cookie lines fromtokens; when there are no cookie tokens but body or http tokens hold material, it writes a short comment naming which map has the material and pointing to--format json, instead of a bare header that looks like an empty capture.capture_has_materialreturns true when any oftokens,body_tokens,http_tokens,custom,username, orpasswordis set.prune_empty_capturesnow uses it, so the prune check and the has-material judgment share one definition and cannot drift.src/sessions.rs:Compatibility note
The JSON export shape changed. It used to return the bare
tokensobject; it now returns{ cookies, body_tokens, http_tokens }, wherecookiesholds whattokensused to be. Anything parsing the JSON export directly should read.cookiesfor the old value. Netscape output is unchanged for captures that have cookie tokens. The change was needed to surface body and http material at all, which is the point of the fix.Tests
cargo test -p phishkit-core, all green:The integration test binaries also pass (recon, secret_store).
Testing help
@seth-stitik if you can repro against a live evilginx run, it would help to confirm the end-to-end path: capture a session that lands tokens in
body_tokens/http_tokensbut nottokens, runexport --format jsonand check all three keys are present, then run prune and confirm a cookie-only capture survives.