Interfaces

  • Get the list of all wireless networks reachable by the wlan0 interface:

    $ iwlist wlan0 scanning | grep ESSID
  • Get some information about open ports:

    $ netstat --taupen
    $ netstat --lapute
  • Watch network activity in real-time:

    $ watch -n 1 "lsof -i"
  • Reboot machine if the 192.168.0.254 host doesn’t reply to at least one ping after 15 attempts or 600 seconds:

    $ ping -c 15 -o -t 600 192.168.0.254 || shutdown -r now

Domain names

  • Get the IP address where a domain points to:

    $ host kevin.deldycke.com
  • Get different kind of DNS records of the example.com domain:

    $ dig example.com CNAME
    $ dig example.com MX

Content inspection

  • Save all images passing through eth0:

    $ driftnet -i eth0 -a -d ./http-pics

Samba / CIFS

  • Mount a samba share:

    $ mkdir /mnt/freebox
    $ mount_smbfs -I 192.168.0.254 //Guest@/Disque\ 1/ /mnt/freebox