![]() |
|
[Legends] Low Level Win 11 socket POC // AFD.sys method // No Winsock - Printable Version +- Hack Forums (https://hackforums.net) +-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444) +--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151) +---- Forum: Software Development (https://hackforums.net/forumdisplay.php?fid=118) +---- Thread: [Legends] Low Level Win 11 socket POC // AFD.sys method // No Winsock (/showthread.php?tid=6311846) Pages: Pages
1
2
|
Low Level Win 11 socket POC // AFD.sys method // No Winsock - Hackers - Oct 21, 2025 Low Level AFD.sys Socket Creation for Windows 11 I found this write-up about some undocumented functions in Windows. This method uses AFD.sys on Win11, and does not use Winsock to open a socket. Further research with IOCTL can be done to identify how the socket can be used. This guide can help blue teams & cybersecurity researchers defend their machines by teaching them more about the lesser known & undocumented AFD.sys interface! Software developers can write more efficient code, low level, and without relying on a boring library like Winsock. I'll be interested in hearing what people can discover or learn from this. Read the Paper: https://github.com/LNodesL/files/blob/main/random/2025-07-16%20-%20Under%20the%20Hood%20of%20AFD.sys%20-%20Investigating%20Undocumented%20Interfaces.pdf Mirror: https://mega.nz/file/AvUESQLS#6dUV8TN-cOfG9wjRPm-oCPB9nA9JY33ahyw0Pdl36ak Similar articles: https://leftarcode.com/posts/afd-reverse-engineering-part1/ https://leftarcode.com/posts/afd-reverse-engineering-part2/ My Golang example: https://github.com/LNodesL/Golang-AFD.sys-Socket-Creation Here is the example code below that they gave. Keep in mind though that your machine's values may be different, and you shouldn't run this without reading the attached PDF first... Spoiler (Click to View) Read and learn,
Be a legend. RE: No-lib Win 11 socket POC // AFD.sys method // No Winsock - PhillyStyle - Oct 21, 2025 Oh this is very interesting! PDF Downloaded for sure. RE: No-lib Win 11 socket POC // AFD.sys method // No Winsock - Hackers - Oct 21, 2025 (Oct 21, 2025 08:45 PM)PhillyStyle Wrote: Oh this is very interesting! PDF Downloaded for sure. :D happy researching! You will need to do a good amount of work for real connections, but it's possible. Please be very careful... low level work can be messy if you don't undo certain changes, or if you mess with your machine too much! RE: No-lib Win 11 socket POC // AFD.sys method // No Winsock - Phantom_NiNja - Oct 23, 2025 (Oct 21, 2025 08:25 PM)enki Wrote: Thanks for the share. I book marked it. I will look into it later but very interesting. I learned ASM 86-64bit and right now want to make stuff at the lower level. I made my own apps but using the API. I did just just to learn what is commonly done. I am right now slowly trying to learn how to not use the API and try to do my own thing directly with the kernel. I seen this file being used with process monitoring app. Don't you need kernel level assess to use this file? Got any tips for people just starting out new monkeying with low level stuff. (Oct 21, 2025 09:16 PM)enki Wrote: :D happy researching! It's actually good to do this. However, I think there's a lot of ways to BOS the socket stack. It requires driver level kernel access. I think you would have to use an VM if you want to test things because it can damage your computer. However, once you do this you can make your own lib and then use that instead. It's more secure meaning you won't have to rely heavily on Microsoft code. I don't know if this is practical thought. They said online that it's best to use a kernel level version of winsock. The reason they said the AFD.sys depends on the machine you run it on and the windows version it will have different values which could easily brick the system if it's wrong. I will look more into it later in a couple of days. RE: No-lib Win 11 socket POC // AFD.sys method // No Winsock - HiddenEyE - Oct 27, 2025 nice post mate. that code can be extended to be more sophisticated RE: No-lib Win 11 socket POC // AFD.sys method // No Winsock - Hackers - Nov 5, 2025 (Oct 27, 2025 06:46 PM)HiddenEyE Wrote: nice post mate. that code can be extended to be more sophisticated Definitely, I would like to see some people give it a go ttbr0 CL1B are either of you up to the task? You could push this forward for the entire internet, there isn't much public past this starting POC. RE: No-lib Win 11 socket POC // AFD.sys method // No Winsock - CL1B - Nov 5, 2025 Sick, I'll check this out and hopefully follow up. itcorp , check this out. RE: No-lib Win 11 socket POC // AFD.sys method // No Winsock - Hackers - Nov 5, 2025 (Nov 5, 2025 07:29 AM)MarlboroMan Wrote: Sick, I'll check this out and hopefully follow up. Perfect, I figured you'd be interested in this :) RE: No-lib Win 11 socket POC // AFD.sys method // No Winsock - arsium - Nov 7, 2025 Quite nice and interesting post. I will take a look for sure. RE: No-lib Win 11 socket POC // AFD.sys method // No Winsock - Hackers - Nov 7, 2025 (Nov 7, 2025 06:24 AM)arsium Wrote: Quite nice and interesting post. I will take a look for sure. let us know what you find RE: No-lib Win 11 socket POC // AFD.sys method // No Winsock - arsium - Nov 7, 2025 (Nov 7, 2025 06:26 AM)nodes Wrote: let us know what you find Go to mswsock.dll. Inspect WSP*Proc. WSPListen, WSPAccept... And here is : Code 180001e38 Status = NtDeviceIoControlFile(*(uint64_t*)(rax_3 + 8), WSPListen : Code 180001ddd struct IO_STATUS_BLOCK IoStatusBlock;Currently, I did not dynamic analysis while debugging. Remember the article for bind (WSPBind) for example the IOCTL Code (Part2): 0x12003 = #define IOCTL_AFD_BIND _AFD_CONTROL_CODE(AFD_BIND, METHOD_NEITHER) // 0x12003 Code 180004cbc (uint32_t)var_110 = 0x12003;RE: No-lib Win 11 socket POC // AFD.sys method // No Winsock - ttbr0 - Nov 8, 2025 (Nov 5, 2025 07:23 AM)nodes Wrote: ttbr0 CL1B are either of you up to the task? You could push this forward for the entire internet, there isn't much public past this starting POC. ive already seen this make its way around my space before and its first mention was a while back dating back to 2020 with just whispers and then a poc back to 2022. it isnt particularly interesting enough for me to do anything about it but i would follow any development on it. RE: No-lib Win 11 socket POC // AFD.sys method // No Winsock - Hackers - Nov 9, 2025 (Nov 8, 2025 07:38 PM)ttbr0 Wrote: ive already seen this make its way around my space before and its first mention was a while back dating back to 2020 with just whispers and then a poc back to 2022. it isnt particularly interesting enough for me to do anything about it but i would follow any development on it. Fair enough, do you know if they hit a wall or had any technical reasons to not continue? Was surprised to not find much on this topic RE: No-lib Win 11 socket POC // AFD.sys method // No Winsock - ttbr0 - Nov 9, 2025 (Nov 9, 2025 05:51 AM)nodes Wrote: Fair enough, do you know if they hit a wall or had any technical reasons to not continue? Was surprised to not find much on this topic i dont know. personally i dont really see why evasion on socket operations is useful when you can observe and track network data outside of the operating system. it might also be suspicious that a program is directly interacting with the driver. if i saw this in the wild, i would be immediately suspicious than if i saw something just using winsock functions. RE: No-lib Win 11 socket POC // AFD.sys method // No Winsock - Hackers - Nov 10, 2025 (Nov 9, 2025 10:11 PM)ttbr0 Wrote: i dont know. personally i dont really see why evasion on socket operations is useful when you can observe and track network data outside of the operating system. it might also be suspicious that a program is directly interacting with the driver. if i saw this in the wild, i would be immediately suspicious than if i saw something just using winsock functions. Agreed, it would be instantly suspect My thought is maybe red teams could use it with other methods and stay undetected if the blue team is not looking for this. |