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

Higher version SQLMAP fails to correctly identify the port in the request message, resulting in error 502 #5563

Closed
VBPush opened this issue Nov 8, 2023 · 3 comments

Comments

@VBPush
Copy link

VBPush commented Nov 8, 2023

Higher version SQLMAP fails to correctly identify the port in the request message, resulting in error 502

To Reproduce

  1. Create a txt file for the POST request package and set the host to ip:port (not 80 or 443).
  2. Run the command with python3: "..\Python311\python.exe sqlmap.py -r sql.txt --batch --dbs”
  3. "testing connection to the target URL" - phase error:unable to retrieve page content, HTTP error codes detected during run: 502 (Bad Gateway) -1 times
  4. Use the --proxy=http://127.0.0.1:8080 parameter to capture the request. It is found that the host of the test request packet sent by SQLMAP at this stage is only the ip address, not the ip:port specified in the file, resulting in 502 response returned by the server.

For example, my request package is (only the core parameters are shown, there are many parameters) :
**POST /jc6/servlet/uploaddoc HTTP/1.1
Host: 0.0.0.0:8962
Content-Length: 50

a=x***

The test request packet sent by SQLMAP is:
**POST /jc6/servlet/uploaddoc HTTP/1.1
Host: 0.0.0.0
Content-Length: 50

a=x***

Expected behavior
Make SQLMAP use the complete host value (such as 127.0.0.1:8968) in my request packet when sending the test package, instead of only extracting the ip value for packet sending (this will cause the server to respond to 502 error, so that the test can not be carried out normally).I studied for a long time during testing, including using -p, --host and other parameters to try to specify the value of Post, but failed, SQLMAP still sends the test link through request without the request packet or the Port value specified by the parameter.

Screenshots
image
image
image

Running environment :

  • sqlmap version 1.7.10#stable
  • Installation Method After downloading from github, use python3 to invoke
  • OS: Microsoft Windows 11
  • Python version 3.8.0

Target details :

  • DBMS Microsoft SQL Server
  • sqlmap delayed injection
  • WAF/IPS None
  • Related console output None

Other context
1.7#stable does not have this issue

Note:I used SQLMAP in one of the integration applications, and while there was no such issue here, the test was stuck in something like the figure below, and there was no end flag.The Python version is unknown.
image
The situation in the above picture has been quiet since the start time to 17:30. Through communication with the author of the integration program, it is confirmed that the python version used is 2.7.1

@VBPush VBPush closed this as completed Nov 13, 2023
@VBPush VBPush reopened this Nov 13, 2023
@VBPush
Copy link
Author

VBPush commented Nov 13, 2023

I have the first problem again, I don't know why SQLMAP sends the connectivity test package without the port I specify in the request package, resulting in 502 error o(╥ ╥)o

@VBPush
Copy link
Author

VBPush commented Nov 14, 2023

I am very sorry for the trouble caused to the working group, I have found the cause of this problem.The main reason is that I enabled the "Global proxy" function of the proxy service.It overrides the IE proxy Settings, and SQLMAP seems to be the default IE proxy so sending packets will show error 502.

@VBPush VBPush closed this as completed Nov 14, 2023
@Tripse
Copy link

Tripse commented May 30, 2024

Here, I would like to make a supplement and share my experience on MacOS. My problem is also a proxy problem, but my operating system is MacOS. After trying to close clash-verge and other proxies, sqlmap can work normally.
image
turn off too
image

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

No branches or pull requests

2 participants