i'm new in python, and i need to do this: if the software print in somewhere (443) the code stop and print (aborted).
My code is here:
import os
alvos = [
'site1.com',
'site2.com',
'site3.com',
'site4.com',
]
stopwhen = "443"
for alvo in alvos:
msg = os.system('nmap ' + alvo + ' -F' )
if stopwhen in msg:
print("Stop")
break
else:
continue
I got this error:
Starting Nmap 7.92 ( https://nmap.org ) at 2021-12-17 17:30 EST
Note: Host seems down. If it is really up, but blocking our ping probes, try -Pn
Nmap done: 1 IP address (0 hosts up) scanned in 3.30 seconds
Traceback (most recent call last):
File "nmap-test1.py", line 15, in <module>
if stopwhen in msg:
TypeError: argument of type 'int' is not iterable