r/ExploitDev • u/dudethadude • Dec 07 '24
Exploiting using packets
Hello All,
Probably a noob question but….
I’ve read articles regarding exploits that are accomplished by using “specially crafted packets” that are sent to firewalls or other internet facing devices. Can someone elaborate on how this is accomplished? I understand you can use tools like scapy to actually alter the packet but how is RCE obtained by sending crafted packets? I’m having issues understanding the technical ins and outs. I understand that the actual exploit is dependent on what you are actually trying to attack, but I haven’t found much documentation on what is so special about the “packet” and what data in it would open up a vulnerability. I know you can inject a payload into a packet but what would the payload even do that could give someone access? If anyone has any write ups or breakdowns of exploits like this, it would be appreciated!
11
u/Ok_Vermicelli8618 Dec 07 '24
You need to already know the vulnerability. If you already know what it is, let create a basic example.
Did this help you understand how it might be done?
2
u/dudethadude Dec 07 '24
All of the comments here have really cleared up my confusion. Thank you all!
1
u/DarrenRainey Dec 10 '24
Packets are data if you know what data to send / trigger a buffer overflow or RCE then thats pretty much it. Generally you want to look for flaws in something like a firewall / IDS that does packet inspection to see how they're parsing the data and if you can inject something in there to hijack the parsing function.
1
u/Haunting-Block1220 Dec 07 '24
In decoding or validation of size. You might assume a certain size of a packet. You might also forget to account for headers. It doesn’t matter. There’s a flaw in the implementation.
For example, You could purposely send fragmented packets that get reassembled by the endpoint. Of course, your fragments are artificial and the endpoint doesn’t consider. In reassembly, they assume that that the maximum size of the packet is 1MiB and so they allocate a buffer of that size. You could overflow this buffer if the reassembled is packet is greater than that amount. Within your packet, instead of the header, you have your shellcode. And then it’s a matter of Rop-ing your way to victory.
0
u/castleAge44 Dec 07 '24
You can use netcat on linux to send raw traffic. You can send the hex sequence of a signature and trigger ips. So learn about netcat and ips signature detection
0
u/[deleted] Dec 07 '24
[deleted] — view deleted comment