October 2017
Beginner to intermediate
316 pages
8h
English
To know what hosts are running on your local network, with SSH access enabled, I offer you this little script:
#!/bin/bashport=22for ordi in `nmap -sn 192.168.0.1-100 /25 | egrep "scan report" | awk '{print $5}'`do echo Found IP $ordi on network. echo --------------------------------------doneecho Now trying them for port $port , sorry for the timeout on successful connectionsechofor ordi in `nmap -sn 192.168.0.1-100 /25 | egrep "scan report" | awk '{print $5}'`do echo Trying $ordi on port $port cat < /dev/tcp/$ordi/$port echo --------------------------------------done
You may need to adapt this to change the IP range. Unix super users may wonder why there is a /25 instead of a /24. The answer is to avoid having the ...
Read now
Unlock full access