Category: computer networks

Show elapsed (round-trip) time of packets.

$fping -e www.gnu.org www.gnu.org is alive (301 ms) $fping -e www.gnu.org www.gnu.org is alive (302 ms) $fping -e www.rajagiritech.edu.in www.rajagiritech.edu.in is alive (62.2 ms) $fping www.gnu.org www.gnu.org is alive $ping www.gnu.org PING wildebeest.gnu.org (208.118.235.148) 56(84) bytes of data. 64 bytes from wildebeest.gnu.org (208.118.235.148): icmp_seq=1 ttl=49 time=302 ms 64 bytes from wildebeest.gnu.org (208.118.235.148): icmp_seq=2 ttl=49 time=301

Installing dig command on Debian

$sudo apt-get install -y dnsutils Reading package lists… Done Building dependency tree Reading state information… Done The following packages were automatically installed and are no longer required: libcaribou-gtk-module libcaribou-gtk3-module libebur128-1 libevent-2.0-5 libgdict-1.0-10 libgdict-common libgmime-2.6-0 libgnome-autoar-common libgom-1.0-common libjavascriptcoregtk-3.0-0 libnotmuch4 libpcre16-3 libperl5.24 libraw15 libsexy2 libwebkitgtk-3.0-0 libwebpmux2 python-olefile rename tcpd Use ‘sudo apt autoremove’ to remove them. The

finding the current state of a network cable

$sudo cat /sys/class/net/eth0/speed 100 $sudo cat /sys/class/net/eth0/ca carrier carrier_changes $sudo cat /sys/class/net/eth0/carrier 1 $sudo cat /sys/class/net/eth0/carrier_changes 2 $sudo cat /sys/class/net/eth0/operstate up $sudo ethtool eth0 Settings for eth0: Supported ports: [ TP MII ] Supported link modes: 10baseT/Half 10baseT/Full 100baseT/Half 100baseT/Full 1000baseT/Half 1000baseT/Full Supported pause frame use: No Supports auto-negotiation: Yes Advertised link modes: 10baseT/Half 10baseT/Full

httping with sending of username and password and flood ping

$httping -U www.beautifulwork.org No URL/host to ping given $httping -U http://www.beautifulwork.org No URL/host to ping given $httping http://www.beautifulwork.org PING www.beautifulwork.org:80 (/): connected to 89.36.208.169:80 (224 bytes), seq=0 time=455.10 ms connected to 89.36.208.169:80 (224 bytes), seq=1 time=458.34 ms connected to 89.36.208.169:80 (224 bytes), seq=2 time=447.45 ms ^CGot signal 2 — http://www.beautifulwork.org/ ping statistics — 4 connects,

a typical hack with strace command which traces a ping command

$sudo strace -p “`pidof ping`” strace: Process 2447 attached poll([{fd=3, events=POLLIN|POLLERR}], 1, 738) = 1 ([{fd=3, revents=POLLIN}]) recvmsg(3, {msg_name(16)={sa_family=AF_INET, sin_port=htons(0), sin_addr=inet_addr(“208.118.235.148”)}, msg_iov(1)=[{“E(\0T

sample session with “ss” command to show details on network

$ss -t State Recv-Q Send-Q Local Address:Port Peer Address:Port ESTAB 0 0 192.168.0.100:57982 216.58.197.34:https ESTAB 0 0 192.168.0.100:56572 216.58.196.98:https ESTAB 0 0 192.168.0.100:51440 216.58.220.34:https ESTAB 0 0 192.168.0.100:56850 216.58.196.110:https ESTAB 0 0 192.168.0.100:42946 216.58.220.46:https ESTAB 0 0 192.168.0.100:42758 216.58.197.46:https ESTAB 0 0 192.168.0.100:32912 216.58.220.33:https ESTAB 0 0 192.168.0.100:40452 216.58.220.38:https ESTAB 0 0 192.168.0.100:51128 182.79.251.80:https ESTAB

Capturing TCP Flags with tcpdump. Capture all ACK packets

$sudo tcpdump ‘tcp[13] & 16 != 0’ [sudo] password for jeffrin: tcpdump: verbose output suppressed, use -v or -vv for full protocol decode listening on eth0, link-type EN10MB (Ethernet), capture size 262144 bytes 01:59:54.623431 IP debian.47234 > bam-3.nr-data.net.https: Flags [.], ack 2505712066, win 45760, options [nop,nop,TS val 3370986 ecr 326803908], length 0 01:59:54.915008 IP bam-3.nr-data.net.https

Hacking with debian netselect-apt command

$sudo netselect-apt -t 2 -c IN Using distribution stable. Retrieving the list of mirrors from www.debian.org… –2014-08-31 23:00:07– http://www.debian.org/mirror/mirrors_full Resolving www.debian.org (www.debian.org)… 140.211.15.34, 128.31.0.51 Connecting to www.debian.org (www.debian.org)|140.211.15.34|:80… connected. HTTP request sent, awaiting response… 200 OK Length: 350858 (343K) [text/html] Saving to: ‘/tmp/netselect-apt.Pjgwxz’ 100%[====================================================================================>] 3,50,858 110KB/s in 3.1s 2014-08-31 23:00:11 (110 KB/s) – ‘/tmp/netselect-apt.Pjgwxz’ saved

Tinkering with the fping command

$fping 192.168.0.1 192.168.0.1 is alive $fping 192.168.0.2 ICMP Host Unreachable from 192.168.0.103 for ICMP Echo sent to 192.168.0.2 ICMP Host Unreachable from 192.168.0.103 for ICMP Echo sent to 192.168.0.2 ICMP Host Unreachable from 192.168.0.103 for ICMP Echo sent to 192.168.0.2 ICMP Host Unreachable from 192.168.0.103 for ICMP Echo sent to 192.168.0.2 192.168.0.2 is unreachable $fping

Hacking with httping for simple speed study

$httping www.beautifulwork.org PING www.beautifulwork.org:80 (www.beautifulwork.org): connected to 80.79.116.205:80 (490 bytes), seq=0 time=809.49 ms connected to 80.79.116.205:80 (490 bytes), seq=1 time=807.21 ms connected to 80.79.116.205:80 (490 bytes), seq=2 time=788.23 ms connected to 80.79.116.205:80 (490 bytes), seq=3 time=796.85 ms ^CGot signal 2 — www.beautifulwork.org ping statistics — 5 connects, 4 ok, 0.00% failed, time 7256ms round-trip min/avg/max