Category

network

  • 05.Aug.12
    How to find alive hosts in our network network | rafacas | (0)
    Sometimes I need to know all the alive hosts' IP addresses in the LAN I am connected. The following command will show that information: $ nmap -n -sP 192.168.10.0/24 Starting Nmap 5.21 ( http://nmap.org ) at 2012-08-05 11:24 BST Nmap scan report for 192.168.10.1 Host is up (0.00086s latency). Nmap scan report for 192.168.10.40 Host is up (0.00057s latency). Nmap scan report for 192.168.10.50 Host is up (0.00056s latency). Nmap scan report for 192.168.10.100 Host is up (0.00051s latency). Nmap done: 256 IP addresses (4 hosts up) scanned in 13.44 seconds The option -sP tells nmap to do a ping scan, that is, to go no further than determining if host ...
  • 15.Sep.11
    Resume rsync file transfers network | rafacas | (1)
    I did not know that rsync had the resume capability till last week when I had to transfer almost 200GB between two servers with no good connection. I think some context is needed here: My company has two servers in two different cities where the backups are stored. There is a daily syncronization between the backup tree between the servers. That is, a cron task that calls a script that basically runs rsync. Due to the bad connection, I have had to add the -P option to the rsync command so that the command run by the cron task is: $ rsync ...
  • 28.Jun.11
    The Sibyl going to the No cON Name network, news, security | pfortuny | (0)
    Both rafacas and pfortuny are going next September to Barcelona to the No cON Name conference, to talk about The Sibyl, of which we have already written here. If any of you is interested in IT Security and can make it to Barcelona in September (14-17), it would be nice to meet you there.
  • 01.Nov.10
    gleeBox: mouseless browsing for Chrome, Safari & Firefox cmd, network | pfortuny | (2)
    I bet you are already tired of using the mouse for browsing. Download gleeBox and forget about it. Simply GREAT. (To be honest, I should use lynx to browse the web, but...) Apologies for taking so long to write a post, I have been working hard irl. As all of you, certainly :)
  • 27.Mar.10
    Downloading a file with wget through a specific interface network | rafacas | (0)
    Sometimes I need to download a file from a computer with multiple net interfaces, but only one is connected to the Internet. In these cases I use the bind-address option of the wget command, which binds the connection to the address specified in the local machine. $ wget --bind-address=192.168.213.141 \ > ftp://ftp.icm.edu.pl/vol/rzm1/linux-fedora-secondary/development/source/SRPMS/ppp-2.4.4-11.fc11.src.rpm --2010-03-27 12:25:56-- ftp://ftp.icm.edu.pl/vol/rzm1/linux-fedora-secondary/development/source/SRPM/ppp-2.4.4-11.fc11.src.rpm => `ppp-2.4.4-11.fc11.src.rpm.1' Resolving ftp.icm.edu.pl... 193.219.28.140 Connecting to ftp.icm.edu.pl|193.219.28.140|:21... connected. Logging in as anonymous ... Logged in! ==> SYST ... done. ==> PWD ... done. ==> TYPE I ... done. ==> CWD /vol/rzm1/linux-fedora-secondary/development/source/SRPMS ... done. ==> SIZE ppp-2.4.4-11.fc11.src.rpm ... 724348 ==> ...
  • 09.Sep.09
    IM from the command line network, shell | fernape | (0)
    % cd /usr/ports/net-im/finch; make install clean The above installs finch. It is an ncurses based instant messaging client, part of the pidgin suite. Though it can be a little tough at the beginning, it is a good alternative if you do not have a graphical interface. Below I show two screenshots. Use Alt-w to move between windows. Enjoy!
  • 29.Jun.09
    Measuring network performance network | fernape | (0)
    FreeBSD includes several benchmarking suites in the ports collection. One of these suites is netperf, developed by HP. It allows measuring several network parameters using two programs: the server and the client. First things first: let us install netperf. % cd /usr/ports/benchmarks/netperf && make install clean Once the software has been successfully compiled (it does not take long) we can bring the server up: $ netserver Starting netserver at port 12865 Starting netserver at hostname 0.0.0.0 port 12865 and family AF_UNSPEC Notice that you can launch the server as a regular user. Now, we are ready to run our test: $ netperf -t TCP_STREAM TCP STREAM TEST from ...
  • 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 http://checkip.dyndns.org/ | 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 http://whatismyip.com 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 ...
  • 20.Apr.09
    Monitoring HTTP requests from the command line network | rafacas | (0)
    Some days ago Javisantana sent me a tweet with a link to a one-liner HTTP requests monitor. It goes as follows with some ouput added: $ sudo tcpdump -i en1 -n -s 0 -w - | grep -a -o -E "Host\: .*|GET \/.*" Password: tcpdump: listening on en1, link-type EN10MB (Ethernet), capture size 65535 bytes GET / HTTP/1.1 Host: commandliners.com GET / HTTP/1.1 Host: google.com GET / HTTP/1.1 Host: www.google.com GET / HTTP/1.1 Host: www.google.es GET /intl/en_com/images/logo_plain.png HTTP/1.1 Host: www.google.es [...] Replace en1 with your network interface's name. Usually enX in BSD-like OSes and ethX in Linux. You can create an alias named httpdump and add it to ~/.bash_profile: alias httpdump='sudo tcpdump -i en1 -n -s 0 -w ...
  • 17.Apr.09
    Showing a computer’s open ports cmd, network | rafacas | (0)
    $ netstat -an | grep -i listen Shows the open ports on all the IPs of the computer the command is run on.