Thanks to visit codestin.com
Credit goes to github.com

Skip to content

HTTPRequest crash with AttributeError 'headers' #218

@alanlucena

Description

@alanlucena

Describe the bug

the HTTPRequest class accesses self.headers on several properties (content_type, host, protocol, raw_headers, etc.) without ensuring that the headers are initialized after parse_request, causing an AttributeError on runs via -r when the parsing routine does not populate the attribute

sample:

ghauri -r request-test.txt (Request Saved from Burp Suite Pro).

To Reproduce

  1. Save a Request with SQLi param
  2. Use ghauri -r .txt or .req
  3. Error crash

Screenshots

Image

Desktop (please complete the following information):

  • OS: Ubuntu 24.04.3 LTS (VPS)
  • Ghauri version which is causing the error is 1.4.3
  • Type of SQL injection which cause the error: error based
  • Phase where error occur: in initial (run command)

Additional context

Dear all, I managed to fix it by changing some lines in ghauri/common/utils.py. After the change, it was also necessary to move it to /usr/local/lib/python3.12/dist-packages/ghauri/common/utils.py (I did not use venv for this example).

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions