How to run or install .bin files in Ubuntu (Unix)

Being a beginner with Unix OS is a painful but interesting experience. I guess I learn almost everyday few things which might be very basic but definitely challenging for a newbie like me. Few days back I wanted to install Adobe Reader on my Ubuntu 10.10. Most of the ready to install packages for Ubntu are in .deb format which can be installed like an executable file in Windows. But this package was in .deb format. Interesting! I thought. This one is not click and install package but it requires no extra terrestrial effort for sure. Following steps should be taken:

  • Open the terminal and go in the directory where the /deb package is saved
  • Change the access rights / permission for the .deb file/package. Most easy way is to give all rights (read, write and execute) to all users by following command: chmod a+x name_of_file.bin
  • Now run the file with the following command: sudo ./name_of_file.bin

How to measure the throughput of a network with ipmt Unix command

ipmt, for IP measurement tools, is a set of tools able to carry out performance measurements on IP networks at the transport layer. tcpmt and udpmt are network performance measurement tools at the transport layer (respectively TCP and UDP). Every second, they generate a throughput report.
By default, they transmit on the discard port of the destination station. This means that, for UDP, the measured throughput at the sender cannot be the effective transmitted throughput since UDP is not reliable.

How to use them :
# tcpmt [-p port] [-s pktsz] [-n pktnb] host
# udpmt [-p port] [-s pktsz] [-n pktnb] host

Where :
port is the destination port number (discard, by default).
pktsz is the size of sent packets (1024 bytes by default) This parameter is only significant in the UDP context.
pktnb is the packet number to send (by default, press Control-C to stop the transmission).
host is the destination address.
A report is generated every second

  • transmission time (in ms since 0h),
  • the number of sent packets during the time interval,
  • the total number of sent packets,
  • the measured throughput during the time interval in kbit/s,
  • the average throughput on the last ten seconds,
  • the average throughput since the beginning.

tcptarget and udptarget are two programs which measure the trhoughput at the destination. Thay can be launched with no argument and they display the port number on which they are listening. We must use the -p option of tcpmt/udpmt in order to specify a port. As soon as tcptarget/udptarget start to receive packets, they display a report every second. This report is easier to understand than the sender report but it is less detailed. It displays the reception time in seconds with a precision around the millisecond and the throughput in kbit/s.

If you want to measure the behavior of concurrent flows sent on the same target station, Tcp/udptarget are the perfect tools since the arrival times are computed on the same station. Thus you can easily compare the packet arrival times of the different flows without having to synchronize the sending stations.

How to manipulate the routing table in Unix

The routing table of a station can be modified or seen thanks to the route command. It may be used to add or remove entries in the table. The routing table can be displayed by “netstat -r” command (For more information on netstat command please follow: http://computerandu.wordpress.com/2011/03/03/how-to-use-netstat-a-unix-networking-command/).

1. Route command presentation:

route add|delete [-net|-host] []

command keywords signification :
add|delete : add will add an entry in the routing table , delete will remove one ;
-net|-host : -net allows to specify an entry towards a network, -host allows to specify an entry towards a host ;
destination : The destination can be a host station address or a network address followed by the subnet mask length, /20 ; The destination may also be the keyword default. In this case, the packet will be sent to the matching router if the destination network address is not specified in the routing table ;
gateway : the router address which relays the packets from one network to another;
netmask : the subnet mask of the destination network.

2. Add a path in a routing table: Use the add option, and specify in the following order : the -net option if you need to enter a network route or -host if it is a host route, the destination IP address (network or station) and the destination internet address (network or station) and the IP address of the router that will relay the traffic. For instance :
# route add -net 192.168.0 192.168.1.2
add net 192.168.0: gateway 192.168.1.2
will add a path in the routing table : to reach the network 192.168.0/24, you must go through the 192.168.1.2 router.

3. Remove an entry in the routing table: Use the delete option and specify host or network options like in the addition process. For instance :
# route delete -net 192.168.0/24
will remove the previous entry added in the routing table.

4. Delete all the routing table entries: The flush command will remove all the entries added with the add command. If you use this command remotely, it may suspend all your current communications with this router and make this station unreachable.

Remark : do not remove the loopback entry, 127.0.0.1 or localhost, which enables the application to communicate localy.

How to install and run Nessus on Ubuntu, Linux or other Unix like OS

installation on UbuntuNessus is a great network security tool but installing it correctly can be a real pain some time even for advance user. I faced few problems and that is why I noted down all the necessary and sufficient steps. The steps below are explained for Ubuntu but I think similar steps can be used for other Unix like OS.

Step1: Download the ubuntu package from the website:http://tenable.com/products/nessus/nessus-download-agreement
and Run it.
Step2: To start nessus, type this command in super user mode: sudo /etc/init.d/nessusd start
Output of this command will result in:

$Starting Nessus : .
takshak@takshak-NB:~$ Missing plugins. Attempting a plugin update…
Your installation is missing plugins. Please register and try again.
To register, please visit http://www.nessus.org/register

Step3. Go on the given link and resgister on the home version, check ur mail get the license and use the command specified in ur mail as super user. It will register the Nessus and will also downlaod the missing plugins.

Step4. Run the nessus by using command: sudo /etc/init.d/nessusd start
Running Nessus command nasl gives an error “nasl : command not found”

(i) Try this command: whereis nessus
output will look something like: nessus: /opt/nessus/bin/nessus

(ii) Check the path see if the mentioned directory is added in the path or not by using command: echo $PATH
If the output of the command is: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games
then the command is not added to the path

(iii) Add the dirctory to the path by using the command: export PATH=$PATH:/opt/nessus/bin

Step5: Then start nessus by using command: sudo /etc/init.d/nessusd start

Step6: To run a nasl file use: nasl -t target_ip filename.nasl