mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2024-11-25 11:03:47 +03:00
Struggling with Github Actions
This commit is contained in:
parent
6ce9e40a90
commit
954a8e6ee7
|
@ -60,6 +60,7 @@ _conn = None
|
||||||
_cursor = None
|
_cursor = None
|
||||||
_lock = None
|
_lock = None
|
||||||
_server = None
|
_server = None
|
||||||
|
_alive = False
|
||||||
|
|
||||||
def init(quiet=False):
|
def init(quiet=False):
|
||||||
global _conn
|
global _conn
|
||||||
|
@ -236,14 +237,18 @@ class ReqHandler(BaseHTTPRequestHandler):
|
||||||
return
|
return
|
||||||
|
|
||||||
def run(address=LISTEN_ADDRESS, port=LISTEN_PORT):
|
def run(address=LISTEN_ADDRESS, port=LISTEN_PORT):
|
||||||
|
global _alive
|
||||||
global _server
|
global _server
|
||||||
try:
|
try:
|
||||||
|
_alive = True
|
||||||
_server = ThreadingServer((address, port), ReqHandler)
|
_server = ThreadingServer((address, port), ReqHandler)
|
||||||
print("[i] running HTTP server at 'http://%s:%d'" % (address, port))
|
print("[i] running HTTP server at 'http://%s:%d'" % (address, port))
|
||||||
_server.serve_forever()
|
_server.serve_forever()
|
||||||
except KeyboardInterrupt:
|
except KeyboardInterrupt:
|
||||||
_server.socket.close()
|
_server.socket.close()
|
||||||
raise
|
raise
|
||||||
|
finally:
|
||||||
|
_alive = False
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
try:
|
try:
|
||||||
|
|
|
@ -20,7 +20,7 @@ from thirdparty import six
|
||||||
from thirdparty.six import unichr as _unichr
|
from thirdparty.six import unichr as _unichr
|
||||||
|
|
||||||
# sqlmap version (<major>.<minor>.<month>.<monthly commit>)
|
# sqlmap version (<major>.<minor>.<month>.<monthly commit>)
|
||||||
VERSION = "1.5.9.31"
|
VERSION = "1.5.10.0"
|
||||||
TYPE = "dev" if VERSION.count('.') > 2 and VERSION.split('.')[-1] != '0' else "stable"
|
TYPE = "dev" if VERSION.count('.') > 2 and VERSION.split('.')[-1] != '0' else "stable"
|
||||||
TYPE_COLORS = {"dev": 33, "stable": 90, "pip": 34}
|
TYPE_COLORS = {"dev": 33, "stable": 90, "pip": 34}
|
||||||
VERSION_STRING = "sqlmap/%s#%s" % ('.'.join(VERSION.split('.')[:-1]) if VERSION.count('.') > 2 and VERSION.split('.')[-1] == '0' else VERSION, TYPE)
|
VERSION_STRING = "sqlmap/%s#%s" % ('.'.join(VERSION.split('.')[:-1]) if VERSION.count('.') > 2 and VERSION.split('.')[-1] == '0' else VERSION, TYPE)
|
||||||
|
|
|
@ -31,6 +31,7 @@ from lib.core.data import logger
|
||||||
from lib.core.data import paths
|
from lib.core.data import paths
|
||||||
from lib.core.data import queries
|
from lib.core.data import queries
|
||||||
from lib.core.patch import unisonRandom
|
from lib.core.patch import unisonRandom
|
||||||
|
from lib.core.settings import MAX_CONSECUTIVE_CONNECTION_ERRORS
|
||||||
from lib.core.settings import IS_WIN
|
from lib.core.settings import IS_WIN
|
||||||
|
|
||||||
def vulnTest():
|
def vulnTest():
|
||||||
|
@ -100,18 +101,26 @@ def vulnTest():
|
||||||
thread.daemon = True
|
thread.daemon = True
|
||||||
thread.start()
|
thread.start()
|
||||||
|
|
||||||
while True:
|
success = False
|
||||||
|
for i in xrange(MAX_CONSECUTIVE_CONNECTION_ERRORS):
|
||||||
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
|
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
|
||||||
try:
|
try:
|
||||||
s.connect((address, port))
|
s.connect((address, port))
|
||||||
s.send(b"GET / HTTP/1.0\r\n\r\n")
|
s.send(b"GET / HTTP/1.0\r\n\r\n")
|
||||||
if b"vulnserver" in s.recv(4096):
|
if b"vulnserver" in s.recv(4096):
|
||||||
|
success = True
|
||||||
break
|
break
|
||||||
except:
|
except:
|
||||||
time.sleep(1)
|
time.sleep(1)
|
||||||
finally:
|
finally:
|
||||||
s.close()
|
s.close()
|
||||||
|
|
||||||
|
if not success:
|
||||||
|
logger.error("problem occurred in vulnserver instantiation (address: 'http://%s:%s', alive: %s)" % (address, port, vulnserver._alive))
|
||||||
|
return False
|
||||||
|
else:
|
||||||
|
logger.info("vulnserver running at 'http://%s:%s'..." % (address, port))
|
||||||
|
|
||||||
handle, config = tempfile.mkstemp(suffix=".conf")
|
handle, config = tempfile.mkstemp(suffix=".conf")
|
||||||
os.close(handle)
|
os.close(handle)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user