mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2026-01-22 14:19:03 +00:00
Automating even more switch --tor
This commit is contained in:
@@ -119,6 +119,7 @@ from lib.core.settings import IP_ADDRESS_REGEX
|
||||
from lib.core.settings import ISSUES_PAGE
|
||||
from lib.core.settings import IS_WIN
|
||||
from lib.core.settings import LARGE_OUTPUT_THRESHOLD
|
||||
from lib.core.settings import LOCALHOST
|
||||
from lib.core.settings import MIN_ENCODED_LEN_CHECK
|
||||
from lib.core.settings import MIN_TIME_RESPONSES
|
||||
from lib.core.settings import MIN_VALID_DELAYED_RESPONSE
|
||||
@@ -2400,6 +2401,29 @@ def extractErrorMessage(page):
|
||||
|
||||
return retVal
|
||||
|
||||
def findLocalPort(ports):
|
||||
"""
|
||||
Find the first opened localhost port from a given list of ports (e.g. for Tor port checks)
|
||||
"""
|
||||
|
||||
retVal = None
|
||||
|
||||
for port in ports:
|
||||
try:
|
||||
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
|
||||
s.connect((LOCALHOST, port))
|
||||
retVal = port
|
||||
break
|
||||
except socket.error:
|
||||
pass
|
||||
finally:
|
||||
try:
|
||||
s.close()
|
||||
except socket.error:
|
||||
pass
|
||||
|
||||
return retVal
|
||||
|
||||
def findMultipartPostBoundary(post):
|
||||
"""
|
||||
Finds value for a boundary parameter in given multipart POST body
|
||||
|
||||
Reference in New Issue
Block a user