made compatible py2/py3

This commit is contained in:
lgandx 2021-03-25 23:06:48 -03:00
commit 6658c2b98f

View file

@ -16,12 +16,12 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
from socket import * from socket import *
print('MSSQL Server Finder 0.2') print('MSSQL Server Finder 0.3')
s = socket(AF_INET,SOCK_DGRAM) s = socket(AF_INET,SOCK_DGRAM)
s.setsockopt(SOL_SOCKET, SO_BROADCAST, 1) s.setsockopt(SOL_SOCKET, SO_BROADCAST, 1)
s.settimeout(2) s.settimeout(5)
s.sendto('\x02',('255.255.255.255',1434)) s.sendto(b'\x02',('255.255.255.255',1434))
try: try:
while 1: while 1:
@ -31,7 +31,7 @@ try:
else: else:
print("===============================================================") print("===============================================================")
print(("Host details: %s"%(address[0]))) print(("Host details: %s"%(address[0])))
print((data[2:])) print((data[2:]).decode('latin-1'))
print("===============================================================") print("===============================================================")
print("") print("")
except: except: