def scan_network():
scanner = nmap.PortScanner()
myIP = subprocess.check_output(['hostname -I'], shell=True)
myIP = str(myIP, 'utf-8').split('.')
print(myIP[:3])
scannedData = scanner.scan(hosts = '.'.join(myIP[:3]) + '.1/24', arguments = '-sP')
# printing all the IP addresses of connected devices
for hostnames in scannedData['scan']:
print(hostnames)
P12_ScriptToFindDevicesConnectedInNetwork.py 文件源码
python
阅读 22
收藏 0
点赞 0
评论 0
评论列表
文章目录