securisec / chepy

Chepy is a python lib/cli equivalent of the awesome CyberChef tool.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Allow http_request to include state data

geekscrapy opened this issue · comments

To create a full automatic recipe with the use of http_request, it would be great to be able to utilise state data in the request itself. This should mainly be available in Request payload, params etc.

An option for this maybe to have special characters which are replaced by the state values at runtime. i.e.:

>>> c = Chepy("https://en4qpftrmznwq.x.pipedream.net")
>>> c.http_request(
>>>    method="POST",
>>>    headers={"My-header": "some header"},
>>>    json={"some": "$state"}
>>> )

Suggestion is, to be able to replace $state with the current state, and $state[1] with the first state index etc...

Just an idea to make it more flexible. My use case at the moment is that I have a bunch of simple APIs that I want to POST the state data to but I have to create a new plugin for each one...! This would also make it more versatile on the command line!

This already exists in the form of States and Buffers when Chepy is used as a library. If automation is required, then Chepy library is the way to go. As Chepy is written to be a library first, and then the cli was built on top of it, this type of variable swapping is not feasible. It is too much of an edge case.