Showing posts with label Kali. Show all posts
Showing posts with label Kali. Show all posts

Monday, 20 July 2015

Web Application Testing - Hacking with KALI Linux

Web Application Testing for beginners

I was asked to give a presentation on Web Application Testing, so as well as supporting information as to why and what a test involves, I highlighted why OWASP was important, and showed how easy a simple a SQL injection attack is to carry out.

OWASP

Who or what are OWASP?  Wikipedia gives the definition as: “The Open Web Application Security Project is an online community dedicated to web application security.  The OWASP community includes corporations, education organizations and individuals from around the word”

OWASP gives information on security coding of web applications and following their guidelines will help ensure the development of secure web applications and that the security standards are upheld as part of this process.

KALI Linux

A common penetration testing tool is KALI Linux, which is available here as software or here as a virtual machine.  It’s a suite of testing tools that run on Linux, and includes tools to test web applications.

OWASP ZAP

One of toolsets found in KALI Linux is to a tool called OWASP ZAP, which will test websites for vulnerabilities.  It’s a vulnerability assessment (VA) tool for web applications.


You enter in the website you want to test against.  I have to say ensure you have the permission of the owner of the website, although there are many websites that can be tested against.

SQLMAP

One of the vulnerabilities that OWASP ZAP can test for are SQL injections.  Wikipedia defines SQL Injections as: "SQL injection is a code injection technique, used to attack data-driven applications, in which malicious SQL statements are inserted into an entry field for execution (e.g. to dump the database contents to the attacker)"

Find Database

Once you have a site that is vulnerable to an SQL injection, you can use the SQLMAP tool on KALI via a Terminal session.

To use SQLMAP to check a website for a database, use the following line of code:

sqlmap -u <vulnerable site url> --dbs

This command will show if there are any databases available on the site


Find Tables

Once you have the database information, the next task will be see what tables are available on that database, and that can be done using the following code:

sqlmap -u <vulnerable site> -D <database name> --tables

Once you have the tables, you’ll probably want to have a closer look at any interesting ones.


Find Columns

Once you find an interesting table, it would be useful to see what is available in the columns, which can be done using the following code:

sqlmap -u <vulnerable site> -D <database name> -T <table> --columns


Dump Data

Now you have the column information, it would be useful to dump the data, using the following code:

sqlmap -u <vulnerable site> -D <database name> -T <table> --dump

Once the data has been dumped, you’ll be asked if you want to use external tools to analyse the data, performing an attack using a default dictionary attack and whether you want to ignore common suffixes.


Review Data

Copy and paste the data into Leafpad to view the data, where you’ll see passwords as hashes, and where they are common passwords in the default dictionary, then they will be displayed as clear text.


Conclusion


As you can see, with very little experience, it’s incredibly easy to check for vulnerabilities and use simple commands to perform some very powerful tests against the sites.  The recommendation is to have any web application development team to follow the OWASP Top 10 and ensure regular testing against your web applications.  If you are commissioning an external organisation, ensure they are offering an SLA to delivering a secure application, so they have to pull the stops out to ensure security is built in, rather than it being of additional expense to you and your organisation for not building this into the contract.

Saturday, 30 August 2014

Kali Linux - Installed, what next?

As The X-Factor returns to UK television, I needed to find something else to occupy my time!!

I found a Kali tutorial site called kalitoutorials.net which is great at explaining how and why.  I started with the basic commands, then started to look at how to hack WEP wireless networks.  I used the toolsets to see what they can do and how the results are displayed.  As my wireless network is running WPA2, some of these tools don't work.


My next job is the create a a new wireless network for me to hack.  I have a number of wireless routers and access points I can use. Once I've set one up, I'll write a step-by-step guide with what I've learnt.  I will state now, DO NOT hack any wireless networks that are not yours, or you do not have the expressed permission of the wireless network owner.

Tuesday, 26 August 2014

Kali Linux - Getting Started

Being a newbie to penetration testing, I was introduced to BackTrack a few years ago, but struggled to find time to investigate further.

After a few years, I now look after a team of engineers and penetration testers, so it seems like an opportune time to take a Kali.

Digging through some old hardware, I managed to get a working netbook from a couple of non-working netbooks.  One started life as an MSI Wind U100 and the other an Advent 4211C.  These are relatively low powered machines, with the first generation of Intel Celeron 1.6GHz processor, 1GB RAM and 80GB SATA hard drive.  They are compact with their 10" screens, and the keyboard although a little smaller than most laptops, perfectly usable.

I have made some modifications to the hybrid device, which include an additional 1GB RAM, bringing it up to 2GB RAM.  I've also changed the existing 80GB 5400RPM SATA hard drive for a 40GB Intel SDD, which I hope will extend the battery life of the machine and reduce the amount of heat it generates.  Talking of batteries, the standard 3-cell battery is appalling, so this has been replaced with a 9-cell battery from ebay, so the battery life is now beyond 5 hours, rather than less than an hour!

With the hardware in place, the next step is to get the software installed.  There are some well written instructions to get the Kali Linux installer on to a USB stick here: http://docs.kali.org/installation/kali-linux-live-usb-install

Once the USB stick has been created, I ensured the computer would boot from a USB stick and let it install onto the computer.  If you have some experience with installing Linux, such as Ubuntu, then this will seem very familiar.  If you have a Windows background, you can probably muddle your way through (I did when I first tackled Ubuntu!)


All being well, you will end up with Kali Linux installed on your computer.  The only issue I had was that my hidden wireless network could not be picked up during the installation, so I reverted to using a network cable to complete the installation, then configuring the wireless settings after the installation had completed.

The next step is update the software and then start learning how to use Kali!

There is some great documentation here: http://www.kali.org/official-documentation/