User Tools

Site Tools


connetctions_to_port

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
connetctions_to_port [2015/08/28 14:06] – luke7858connetctions_to_port [2015/11/16 15:57] (current) – luke7858
Line 3: Line 3:
 \\ \\
 Show static view of connections to port 80: Show static view of connections to port 80:
 +\\
 +\\
 +==== NEW AWESOME COMMAND ====
 <sxh bash> <sxh bash>
-netstat -plan|grep :80|awk {'print $5'}|cut -d: -f 1|sort|uniq -c|sort -nk 1+ netstat -punt | grep ':80.*ESTAB' | awk '{ print $5}' | cut -d':' -f4 | sort | uniq -c | sort -rn | while read i; do echo -n "$i "; curl -s http://ip-api.com/csv/$(echo "$i" | awk '{ print $2 }') | cut -d',' -f2; sleep 1; done
 </sxh> </sxh>
-\\+Example output:
 <sxh bash> <sxh bash>
-netstat -ant | egrep ":80|:443" | egrep "ESTABLISHED|SYN_RECV" | awk '{ print $5 }' | sed -e 's/\:\:ffff\://g' | awk -F: '{print $1}' | sort | uniq -c | sort -nr |awk '{print $1 " "$2}'+6 x.x.x.x "United States" 
 +5 x.x.x.x Ireland 
 +2 x.x.x.x "United Kingdom" 
 +2 x.x.x.x "South Africa" 
 +2 x.x.x.x China 
 +1 x.x.x.x "United Kingdom" 
 +1 x.x.x.x "Czech Republic"
 </sxh> </sxh>
 \\ \\
 +\\
 +Second Best command:
 <sxh bash> <sxh bash>
 netstat -nap | awk '$4~/:80$/{print$5}' | awk -F: '{print$(NF-1)}' | sort | uniq -c | sort -nr | head -20 netstat -nap | awk '$4~/:80$/{print$5}' | awk -F: '{print$(NF-1)}' | sort | uniq -c | sort -nr | head -20
 </sxh> </sxh>
 +\\
 +<sxh bash>
 +netstat -plan|grep :80|awk {'print $5'}|cut -d: -f 1|sort|uniq -c|sort -nk 1
 +</sxh>
 +\\
 +\\
 +<sxh bash>
 +netstat -ant | egrep ":80|:443" | egrep "ESTABLISHED|SYN_RECV" | awk '{ print $5 }' | sed -e 's/\:\:ffff\://g' | awk -F: '{print $1}' | sort | uniq -c | sort -nr |awk '{print $1 " "$2}'
 +</sxh>
 +\\
 +\\
 Show a live view of current connections Show a live view of current connections
 <sxh bash> <sxh bash>
connetctions_to_port.1440770799.txt.gz · Last modified: (external edit)

Except where otherwise noted, content on this wiki is licensed under the following license: Public Domain
Public Domain Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki