Exploit-DB updates

Tuesday, May 10, 2011

iptraf - ncurses lan monitor



The iptraf command is interactive colorful IP LAN monitor. It is an ncurses-based IP LAN monitor that generates various network statistics including TCP info, UDP counts, ICMP and OSPF information, Ethernet load info, node stats, IP checksum errors, and others. It can provide the following info in easy to read format:
  • Network traffic statistics by TCP connection
  • IP traffic statistics by network interface
  • Network traffic statistics by protocol
  • Network traffic statistics by TCP/UDP port and by packet size
  • Network traffic statistics by Layer2 address

Detect MITM attacks with ArpWatch

Well here we will be using the tool "arpwatch" in assistance with the "tail" command to watch for new arp entries and for changes made (I.E a Mitm attack). 


Arpwatch was developed by Lawrence Berkeley National Laboratory, Network Research Group, as open-source software and is released under the BSD license.
Now you should have the "tail" command installed already so you don't have to worry about that, arpwatch probably isn't so you can install that with the "apt-get install arpwatch" command or visit the site it's hosted on for the latest releases -  ftp://ftp.ee.lbl.gov/arpwatch.tar.gz

And if you were wondering what "tail" is, it's a very useful unix command which reads the last few lines of a file or piped data and displays it for us in the terminal. Once you have everything installed, open your terminal/shell of choice - I prefer terminator, it's great - then we will fire up arpwatch on the interface we'd like to monitor and then use the tail command to monitor the syslog file for new entries.


sudo apt-get install arpwatch
arpwatch -i eth0
tail -f /var/log/syslog

Now you will have arpwatch watching for new arp entries and changes within the network which it will then proceed to log in the syslog file located in the /var/log/ directory. The log is then read by tails and displayed in your shell.

Saturday, May 7, 2011

Bash Scripting Basics

Well seeing as I've recently posted my bash friendly java IP parser for use with other tools, I figured I would make a post detailing the basics of bash scripting and one possible way the parser might be used. To start off, open your text editor of choice, mine is nano. Now we will start by creating a file called "b a.sh" and specifying which shell we'd like this script to use by adding "#!/bin/bash" to the top of our script. 

#!/bin/bash

The reason we add this is because we are telling the script to use the "bash" located in the "/bin" directory. 

Moving on to adding something useful. We can use a shell command like so;

#!/bin/bash
echo "Scanning the local network!"
nmap 10.0.0.1/24 -PN -sV -p 23

Now that we have a script that does something we can save it (ctrl-o in nano) and make it executable with the chmod command, then run it.

chmod 755 ba.sh
/ba.sh

Now this is nice and all, but not very useful seeing as we could just enter the command our self. We will string together an nmap scan with my log parser to extract ips from the log and write them in a list format.

#!/bin/bash
logfile="nlog" 
echo "Scanning the local network!"
nmap 10.0.0.1/24 -oG $logfile -PN -sV -p 23 --open
java -jar ips.jar $logfile
cat ips

Now this script is a bit more useful, it scans the local network for pcs with telnet running and writes it to an nmap log which we specify using a variable. That log is then parsed by my ip parser and the ips are written in a list format to a file named "ips" which we then use the "cat" command (which reads a file and displays it in the terminal) to make sure all's well and the script worked. 

If we were on a pentest and wanted to automate a process to scan the network and attempt to crack open telnets we could use a script like this;

#!/bin/bash
logfile="nlog" 
echo "Scanning the local network for hosts running telnet"
nmap 10.0.0.1/24 -oG $logfile -PN -sV -p 23 --open
java -jar ips.jar $logfile
medusa -H /root/ips -U /root/users -P /root/dictionary.txt -e ns -f -v 6 -O telcrack -M telnet

This script will essentially look for hosts running telnet and attempt to crack them with medusa. This is the very basics of bash scripting. There are so many other possibilities. I would also like to mention that when issuing commands in the terminal you can link them together using the ";". So this script could be issued in a shell like this;

clear;logfile="nlog" ;echo "Scanning the local network for hosts running telnet";nmap 10.0.0.1/24 -oG $logfile -PN -sV -p 23 --open;java -jar ips.jar $logfile;medusa -H /root/ips -U /root/users -P /root/dictionary.txt -e ns -f -v 6 -O telcrack -M telnet

Note: You WILL need root to issue that command.


Well that's the basics and shows you how the ip parser could be used to combine tools, I'll likely make more posts on bash scripting in the future so stay tuned. You can find the ip parser here








Friday, May 6, 2011

Viewing intecepted VoIP calls using Wireshark

Okay so I've been playing with wireshark a bit more lately and was trying to find a tool to intercept voip calls when I decided to see what wireshark had in store. Long behold it has some great features in that aspect too. It really is far more power than I once though. Anyhow, on to what I wanted to show you guys. Assuming we continue where we left off on the filter thread, we would want to click on "Telephony" tab and select "VoIP Calls". There you can see the intercepted calls and view the "Graph" or use the "Player" to decode and play the message. The number of codecs it accepts is limited but worth playing with it.