You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Can't use custom preprocess scripts because of errors from sqlmap which I don't understand.
With certain scripts sqlmap runs smoothly, but as soon as I put for example getattribute(), calls to requests methods, or even subprocess, I get the below error.
Run sqlmap on whatever with --preprocess=./preprocess.py
Get this error: [14:13:21] [CRITICAL] function 'preprocess(req)' in preprocess script 'preprocess.py' appears to be invalid (Note: find template script at '/tmp/sqlmaptiax05q726027/sqlmappreprocess-0n3_58t2.py')
Expected behavior
Run smoothly
Running environment:
sqlmap version [1.7.10.5#dev]
Installation method [apt]
Operating system: [Debian 12]
Python version [3.11.2]
Additional context
I could not find anything on the above error and can't figure out why or what is going wrong and how to fix it.
The text was updated successfully, but these errors were encountered:
If certain functionalities are restricted, consider modifying your approach to achieve the desired result without using those specific functions. For example, if requests are not allowed, you might need to find an alternative method to achieve the same goal.
#!/usr/bin/env python
def preprocess(req):
# Your custom preprocessing logic here
req['url'] = 'http://localhost'
return req
@freetom you've put a pure junk into there, where sqlmap had problems in a test run. With the latest revision you'll have a more verbose error message:
[20:26:05] [INFO] loading preprocess module 'preprocess'
[20:26:05] [CRITICAL] function 'preprocess(req)' in preprocess script './preprocess.py' had issues in a test run ('HTTPConnectionPool(host='localhost', port=80): Max retries exceeded with url: / (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f316b908750>: Failed to establish a new connection: [Errno 111] Connection refused'))'). You can find a template script at '/tmp/sqlmapcrjz76tp33899/sqlmappreprocess-1rzlk8b8.py'
Describe the bug
Can't use custom preprocess scripts because of errors from
sqlmap
which I don't understand.With certain scripts
sqlmap
runs smoothly, but as soon as I put for examplegetattribute()
, calls torequests
methods, or evensubprocess
, I get the below error.Why is that?
To Reproduce
preprocess.py
in current folder with:Run sqlmap on whatever with --preprocess=./preprocess.py
Get this error:
[14:13:21] [CRITICAL] function 'preprocess(req)' in preprocess script 'preprocess.py' appears to be invalid (Note: find template script at '/tmp/sqlmaptiax05q726027/sqlmappreprocess-0n3_58t2.py')
Expected behavior
Run smoothly
Running environment:
Additional context
I could not find anything on the above error and can't figure out why or what is going wrong and how to fix it.
The text was updated successfully, but these errors were encountered: