Skip to content

Commit 954a8e6

Browse files
committed
Struggling with Github Actions
1 parent 6ce9e40 commit 954a8e6

File tree

3 files changed

+16
-2
lines changed

3 files changed

+16
-2
lines changed

extra/vulnserver/vulnserver.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@
6060
_cursor = None
6161
_lock = None
6262
_server = None
63+
_alive = False
6364

6465
def init(quiet=False):
6566
global _conn
@@ -236,14 +237,18 @@ def log_message(self, format, *args):
236237
return
237238

238239
def run(address=LISTEN_ADDRESS, port=LISTEN_PORT):
240+
global _alive
239241
global _server
240242
try:
243+
_alive = True
241244
_server = ThreadingServer((address, port), ReqHandler)
242245
print("[i] running HTTP server at 'http://%s:%d'" % (address, port))
243246
_server.serve_forever()
244247
except KeyboardInterrupt:
245248
_server.socket.close()
246249
raise
250+
finally:
251+
_alive = False
247252

248253
if __name__ == "__main__":
249254
try:

lib/core/settings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
from thirdparty.six import unichr as _unichr
2121

2222
# sqlmap version (<major>.<minor>.<month>.<monthly commit>)
23-
VERSION = "1.5.9.31"
23+
VERSION = "1.5.10.0"
2424
TYPE = "dev" if VERSION.count('.') > 2 and VERSION.split('.')[-1] != '0' else "stable"
2525
TYPE_COLORS = {"dev": 33, "stable": 90, "pip": 34}
2626
VERSION_STRING = "sqlmap/%s#%s" % ('.'.join(VERSION.split('.')[:-1]) if VERSION.count('.') > 2 and VERSION.split('.')[-1] == '0' else VERSION, TYPE)

lib/core/testing.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
from lib.core.data import paths
3232
from lib.core.data import queries
3333
from lib.core.patch import unisonRandom
34+
from lib.core.settings import MAX_CONSECUTIVE_CONNECTION_ERRORS
3435
from lib.core.settings import IS_WIN
3536

3637
def vulnTest():
@@ -100,18 +101,26 @@ def _thread():
100101
thread.daemon = True
101102
thread.start()
102103

103-
while True:
104+
success = False
105+
for i in xrange(MAX_CONSECUTIVE_CONNECTION_ERRORS):
104106
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
105107
try:
106108
s.connect((address, port))
107109
s.send(b"GET / HTTP/1.0\r\n\r\n")
108110
if b"vulnserver" in s.recv(4096):
111+
success = True
109112
break
110113
except:
111114
time.sleep(1)
112115
finally:
113116
s.close()
114117

118+
if not success:
119+
logger.error("problem occurred in vulnserver instantiation (address: 'http://%s:%s', alive: %s)" % (address, port, vulnserver._alive))
120+
return False
121+
else:
122+
logger.info("vulnserver running at 'http://%s:%s'..." % (address, port))
123+
115124
handle, config = tempfile.mkstemp(suffix=".conf")
116125
os.close(handle)
117126

0 commit comments

Comments
 (0)