Entry 3231
bash2map
Submitted by jms
on Feb. 19, 2010 at 10:39 p.m.
Language: Bash. Code size: 343 bytes.
if [ -z $1 ]; then echo "Usage: [ip|hostname]" exit 1 fi echo -e "bash2map.sh 1.0\n" echo -e "Port\t\tState\t\tService" (for ((p=0; p < 1024; p++)); do echo "0" >/dev/tcp/$1/$p \ && service=$( awk -v p=$p '{if ($2 ~p) print $1 }'</etc/services | head -n1 ) \ && echo -e "$p/tcp\t\topen\t\t$service" >&1; done) 2>/dev/null
This snippet took 0.00 seconds to highlight.
Back to the Entry List or Home.