mirror of
https://github.com/trustedsec/social-engineer-toolkit
synced 2025-02-16 21:38:41 +00:00
fix repeat bug in sql port
This commit is contained in:
parent
b7595913bd
commit
9fdd8356d9
4 changed files with 19 additions and 8 deletions
|
@ -1,3 +1,9 @@
|
|||
~~~~~~~~~~~~~~~~
|
||||
version 7.3.15
|
||||
~~~~~~~~~~~~~~~~
|
||||
|
||||
* fix repetative sqlport issue bug for non existent hosts
|
||||
|
||||
~~~~~~~~~~~~~~~~
|
||||
version 7.3.14
|
||||
~~~~~~~~~~~~~~~~
|
||||
|
|
|
@ -92,8 +92,7 @@ try:
|
|||
if choice != "2":
|
||||
# sql_servers
|
||||
sql_servers = ''
|
||||
print_status(
|
||||
"Hunting for SQL servers.. This may take a little bit.")
|
||||
print_status("Hunting for SQL servers.. This may take a little bit.")
|
||||
if "/" or " " in str(range):
|
||||
if "/" in str(range):
|
||||
iprange = printCIDR(range)
|
||||
|
@ -103,14 +102,17 @@ try:
|
|||
pool.close()
|
||||
pool.join()
|
||||
for sql in sqlport:
|
||||
if sql != None: sql_servers = sql_servers + sql + ","
|
||||
if sql != None:
|
||||
if sql != "":
|
||||
sql_servers = sql_servers + sql + ","
|
||||
|
||||
else:
|
||||
range1 = range.split(" ")
|
||||
for ip in range1:
|
||||
sqlport = get_sql_port(ip)
|
||||
if sqlport != None:
|
||||
sql_servers = sql_servers + sqlport + ","
|
||||
if sqlport != "":
|
||||
sql_servers = sql_servers + sqlport + ","
|
||||
|
||||
else:
|
||||
# use udp discovery to get the SQL server UDP 1434
|
||||
|
@ -118,7 +120,8 @@ try:
|
|||
# if its not closed then check nmap - if both fail then
|
||||
# nada
|
||||
if sqlport != None:
|
||||
sql_servers = sqlport + ","
|
||||
if sqlport != "":
|
||||
sql_servers = sqlport + ","
|
||||
|
||||
# specify choice 2
|
||||
if choice == "2":
|
||||
|
|
|
@ -1 +1 @@
|
|||
7.3.14
|
||||
7.3.15
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#!/usr/bin/env python
|
||||
1#!/usr/bin/env python
|
||||
#
|
||||
# Centralized core modules for SET
|
||||
#
|
||||
|
@ -1786,7 +1786,9 @@ def get_sql_port(host):
|
|||
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
|
||||
s.settimeout(.2)
|
||||
s.connect((host, int(sql_port)))
|
||||
return host + ":" + sql_port
|
||||
return_host = host + ":" + sql_port
|
||||
if return_host != ":" + sql_port:
|
||||
return host + ":" + sql_port
|
||||
|
||||
# if port is closed
|
||||
except: return None
|
||||
|
|
Loading…
Add table
Reference in a new issue