The Archives

  • 22.Apr.09
    Need to know your public IP? network | rafacas | (0)
    Some times you may need to know your public IP address. With this simple command you can find it out: $ curl -s | egrep -o "[0-9.]+" There are some other sites where we can discover it like whatismyip or whatismyipaddress, but the user-agent needs to be spoofed beacuse they ban curl, so the solution is using the -A option: $ curl -A "Mozilla/4.0" -s With the above command you will get the entire page bypassing the ban. But as the HTML of this pages is more complex and we do not want to fool them spoofing the user agent, we prefer ...
  • 09.Apr.09
    ARP control and information network | fernape | (0)
    ARP is the protocol used to map IP to hardware addresses. This information is kept in a cache for some time (20 m. in the original implementation). The arp command can help you to know and control the ARP cache (This command is from a FreeBSD 7.1 box and it could differ in options or flags from your own version): $ arp -a ( at 00:13:f7:96:53:02 on re0 [ethernet] Shows all the entries in the arp cache. In my case, I know of my router IP and hardware address. $ arp -i re0 -a The same as the previous one but limiting the scope to ...