DNSStager icon indicating copy to clipboard operation
DNSStager copied to clipboard

Large files fail to complete

Open blockanz opened this issue 4 years ago • 1 comments

Create a DNSStager with ~3000 records using IPV6, but when run the downloader gets to around 500 records and then stops working. Tried with Golang client and TXT records and gets to around 300 before running out of memory.

blockanz avatar Jun 01 '21 21:06 blockanz

Hello @blockanz,

In general, DNSStager is not designed to handle such large files.

If you first used the IPv6 C client, this issue could be happening because of the following line:

https://github.com/mhaskar/DNSStager/blob/e2940ef19be0854687a9cfb8fa6871ab27671924/templates/client-ipv6-generic.c#L36

  LPVOID allbuffer2 = VirtualAlloc(NULL, 0x1500, MEM_COMMIT | MEM_RESERVE, PAGE_EXECUTE_READWRITE);

This line will allocate 0x1500 bytes for you and I think when you try to pull more records the client will not be able to do that.

This is a good point, I can make the agent automatically allocate space based on the original payload size.

Will try to bring this with the next stable release.

Thank you for reporting!

mhaskar avatar Jun 02 '21 23:06 mhaskar