Posts

Showing posts with the label ports

Open for business?

Image
This is two scripts one to find and record machines on the system at the time and the second script is to find open ports on those systems below 1024. alive.sh [code] #!/bin/bash rm /tmp/goodips is_alive_ping() {   ping -c 1 $1 > /dev/null   [ $? -eq 0 ] && echo $i >> /tmp/goodips } for i in 192.168.1.{1..255} do is_alive_ping $i & disown done [/code] /tmp/goodips 192.168.1.1 192.168.1.2 192.168.1.3 192.168.1.4 Now the second script. scannet.sh [code] datafile="/tmp/goodips" a=1 m="not done" while read line do fdata[$a]=$line echo echo $line        let a=a+1        for p in {1..1023};        do        (echo >/dev/tcp/$line/$p) >/dev/null 2>&1 && echo "$p open"        done done < $datafile [/code] results: 192.168.1.1 23 open 53 open ...

What's on the network?

Image
Our goal here to see what is live on the network and how possibly vulnerable those machines are. Might be interesting to use with a wifi network. First lets get the live systems at the moment. You will need to change your code depending on your network, alive.sh [code]  #!/bin/bash rm goodips is_alive_ping() {   ping -c 1 $1 > /dev/null   [ $? -eq 0 ] && echo $i >> goodips } for i in 192.168.1.{1..255} do is_alive_ping $i & disown done [/code] Generated goodips file: 192.168.1.1 192.168.1.32 192.168.1.99 192.168.1.126 Then we can run a sort of network scanner. scannet.sh [code] datafile="goodips" a=1 m="not done" while read line do fdata[$a]=$line echo $line         let a=a+1        for p in {1..1023};        do        (echo >/dev/tcp/$line/$p) >/dev/null 2>&1 && e...

What is your computer listening to?

Ever wondered what your computer is looking for. Some of these could be avenues for hackers to get into your machine. Actually this is looking for processes bound to specific ports. Use the following command  to see wbat particular port your computer is listening for: Terminal - Look for the process bound to a certain port: sudo netstat -tulpn | grep :8080 Look for the process bound to a certain port  Or you could look at all the ports to 1000; $ cat portscan.sh for i in {1..1000} do echo $i sudo netstat -tulpn | grep :$i done $./portscan.sh > portscan.file You might see something  like this in the file. ... ... 628 629 630 631 tcp        0      0 127.0.0.1:631           0.0.0.0:*               LISTEN   ...