Skip to content

added ability to force JSON parameters as boolean#1164

Open
callightmn wants to merge 2 commits into
kgretzky:masterfrom
vaadata:feature/force_json_tp
Open

added ability to force JSON parameters as boolean#1164
callightmn wants to merge 2 commits into
kgretzky:masterfrom
vaadata:feature/force_json_tp

Conversation

@callightmn
Copy link
Copy Markdown

Hello,

Currently, Evilginx only force posts JSON parameter values as string but it may happen that the server expects values of a certain type only (boolean in my case). I added an optional type parameter in the force section of force_post to be able to later cast the injected value in SetJSONVariable.

For now, only booleans and strings (which is the default not to break backward compatibility) are supported but integers may be a good addition for instance. The code should be relatively simple to patch to add new types:

  • add a switch case in SetJSONVariable and call the adequate method from strconv
  • add to the condition to support other values for *op_f.Type

Phishlet snippet:

  - path: '/api/users.login'
    search:
      - {key: 'token', search: '.*'}
    force:
      - {key: 'trusted', value: 'true', type: "boolean"}
    type: 'json'

Current and default behavior (without type or type: "string") - modified request (from Evilginx to remote site):

image

Expected behavior (with snippet above) - modified request (from Evilginx to remote site):

image

@matejsmycka
Copy link
Copy Markdown

Hi, could you also open a pull request to our fork at https://github.com/CSIRT-MU/evilginx2? I’m not sure if the maintainer is actively updating this version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants