Random Project

Port check is bullshit

let’s simple check for ssh-port 22

this is the part of code used – then it looks if there is at least ONE line

netstat -an | grep LISTEN | grep 22

result:
*.22 *.* 0 0 49152 0 LISTEN
*.22 *.* 0 0 49152 0 LISTEN
*.11221 *.* 0 0 49152 0 LISTEN
*.11222 *.* 0 0 49152 0 LISTEN
*.22 *.* 0 0 49152 0 LISTEN

(you get any line containing “22” not only where the PORT is 22!!