Skip to content

Commit 1f955b4

Browse files
WillowSauceRWillowSauceR
authored andcommitted
fix
1 parent 14ab125 commit 1f955b4

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

scan.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,10 @@
55

66
localHostIP = socket.gethostbyname(socket.gethostname())
77
localHostPort = randint(1024, 65535)
8-
BDSIP = str(sys.argv[1])
8+
try:
9+
TargetAddr = str(sys.argv[1])
10+
except:
11+
TargetAddr = input("Target IP: ")
912
motdData = b'\x01\x00\x00\x00\x00$\r\x12\xd3\x00\xff\xff\x00\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfd\x124Vx\n'
1013
serverCount = 0
1114

@@ -15,7 +18,7 @@ def sendPacket(startNum, count):
1518
Time = time.strftime('%H:%M:%S')
1619
if port % 1000 == 0:
1720
print(f"[{Time} I] Scaning port: {str(port)} ~ {str(port + 1000)}")
18-
send(IP(src=localHostIP, dst=BDSIP) / UDP(sport=localHostPort, dport=port) /
21+
send(IP(src=localHostIP, dst=TargetAddr) / UDP(sport=localHostPort, dport=port) /
1922
motdData,
2023
verbose=False)
2124
if port == 65535:

0 commit comments

Comments
 (0)