daily_automated
This commit is contained in:
20
trunk/workspace/Python/nmap_scanner/nmap-scanner.py
Normal file
20
trunk/workspace/Python/nmap_scanner/nmap-scanner.py
Normal file
@@ -0,0 +1,20 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
#file_name="/tmp/nmap.log"
|
||||
file_name="nmap.log"
|
||||
|
||||
print'\n'
|
||||
_f=file(file_name,'r')
|
||||
l=_f.readline()
|
||||
while l:
|
||||
if "Nmap scan report for" in l:
|
||||
addr = l.find('(')+1
|
||||
name = l.find('for ',)+4
|
||||
l2=_f.readline()
|
||||
lat = l2.find('(')+1
|
||||
stat = l2.find('is ',)+3
|
||||
print '%15s %30s %5s %18s' % (l[addr:-2],l[name:addr-1],l2[stat:lat-2],l2[lat:-3])
|
||||
l=_f.readline()
|
||||
_f.close()
|
||||
|
||||
print "Done."
|
||||
4
trunk/workspace/Python/nmap_scanner/nmap-scanner.sh
Normal file
4
trunk/workspace/Python/nmap_scanner/nmap-scanner.sh
Normal file
@@ -0,0 +1,4 @@
|
||||
#!/bin/sh
|
||||
nmap -sn 192.168.2.0/24 > /tmp/nmap.log
|
||||
python nmap-scanner.py
|
||||
|
||||
15
trunk/workspace/Python/nmap_scanner/nmap.log
Normal file
15
trunk/workspace/Python/nmap_scanner/nmap.log
Normal file
@@ -0,0 +1,15 @@
|
||||
|
||||
Starting Nmap 5.35DC1 ( http://nmap.org ) at 2018-10-19 08:04 CEST
|
||||
Nmap scan report for fritz.box (192.168.2.1)
|
||||
Host is up (0.0012s latency).
|
||||
Nmap scan report for Zichichi-2.fritz.box (192.168.2.73)
|
||||
Host is up (0.00079s latency).
|
||||
Nmap scan report for FireTV-Stick.fritz.box (192.168.2.107)
|
||||
Host is up (0.045s latency).
|
||||
Nmap scan report for Nexus7.fritz.box (192.168.2.109)
|
||||
Host is up (0.025s latency).
|
||||
Nmap scan report for retropie.fritz.box (192.168.2.119)
|
||||
Host is up (0.0083s latency).
|
||||
Nmap scan report for WebRadio-Cucina.fritz.box (192.168.2.195)
|
||||
Host is up (0.077s latency).
|
||||
Nmap done: 256 IP addresses (6 hosts up) scanned in 4.39 seconds
|
||||
Reference in New Issue
Block a user