Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

💡 [REQUEST] - Implement http_request action type #528

Open
d0n601 opened this issue Feb 27, 2025 · 0 comments
Open

💡 [REQUEST] - Implement http_request action type #528

d0n601 opened this issue Feb 27, 2025 · 0 comments
Labels
question Clarification and/or additional information required to move forward

Comments

@d0n601
Copy link
Contributor

d0n601 commented Feb 27, 2025

Implementation PR

No response

Reference Issues

No response

Summary

We should have a step/action type called http_request that works like this:

GET

---
 http_request: https://facebook.com
    type: GET
    proxy: http://localhost:8080
    cleanup:
      inline: |
        echo "No cleanup required."

POST

    http_request: https://api.someexample.com/api/v1/someendoint/
    type: POST
    headers:
      - field: User-Agent
        value: {{.Args.user_agent}}
      - field: Content-Type
        value: application/x-www-form-urlencoded; charset=UTF-8
      - field: Accepted-Encoding
        value: gzip, deflate
    body: >
      params={
        "client_input_params": {
          "username_input": "",
        },
        "server_params": {
          "is_from_logged_out": 0,
          "device_id": "android-3072a22f5cc5db69",
          "waterfall_id": null,
          "event_source": "login_home_page",
        }
      }
      bloks_versioning_id=bda53c582346682c04dc1a0c2e6c3a8722128bacb46018428c2e82f7376c46f7
    regex: |
      [^"]*arm
    cleanup:
      inline: |
        echo "No cleanup required."

The fields shouldhave the following meaning:

http_request: 
  `url`: URL to which the request is made.
  `type`: The http request type (GET, POST, PUT, PATCH, DELETE).
  `headers`: The http request headers, `field` and `value`.
  `parameters`: The http request parameters, `name` and `value`.
  `body`:  String for request body data.
  `proxy`: The http proxy to use for requests
  `regex`: Regular expression, if specified return only matching string. 
  `response`: Shell variable name to store request's response. 

Basic Example

see above

Drawbacks

It is an additional action type, and a potentially complex one at that. This seems very useful for automating kill chains with many http requests.

Unresolved questions

No response

@d0n601 d0n601 added the question Clarification and/or additional information required to move forward label Feb 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Clarification and/or additional information required to move forward
Projects
None yet
Development

No branches or pull requests

1 participant