1
Hacking and Security / Re: DNS Amplification, please enlighten me
« on: January 25, 2014, 07:47:19 am »
OK so as no one would wipe my ass I done my little research.
UDP is on top of IP.
And NTP should be on TOP of UDP which is on top of IP.
I'll be using raw sockets to forge raw UDP packets with a spoofed address.
So I'll create a struct with all the UDP shit we need to take care, checksum, tos, the lot of it I captured the packet using tcpdump and wireshark.
I've everything figured out concerning this.
Now I understand than when you send a raw UDP packet you're basically sending a string, which is a pointer to an array of chars. and you can send udp packets like "ABC" whatever.
I also understand and read that NTP is protocol on iot's own so I have to create the packet using a struct and here will be the monlist message which is a request message (set the bit) bla bla. Just hsit I have to respect as it's the RFC but don't give a fuck about.
NOW THE QUESTION:
How do I encapsulate the thing to send it in my spoofed UDP raw socket ?
The only way I see is sending it in place of the *buffer, but yeah it seems a bit weird and I actually don't know how I'll do to convert. (just cast the struct to the expected input ?)
Please enlighten me, smartasses. (lawl)
struct iphdr *ip = (struct iphdr *)packet;
06.
struct udphdr *udp = (struct udphdr *)((void *) ip + sizeof(struct iphdr));
07.
This is done to encaspulate UDP in IP.
So I just do something similar ?
Still need to look up what's included for the headers and shit.
Wow, so much work, please tell me if I'm in teh right direction.
UDP is on top of IP.
And NTP should be on TOP of UDP which is on top of IP.
I'll be using raw sockets to forge raw UDP packets with a spoofed address.
So I'll create a struct with all the UDP shit we need to take care, checksum, tos, the lot of it I captured the packet using tcpdump and wireshark.
I've everything figured out concerning this.
Now I understand than when you send a raw UDP packet you're basically sending a string, which is a pointer to an array of chars. and you can send udp packets like "ABC" whatever.
I also understand and read that NTP is protocol on iot's own so I have to create the packet using a struct and here will be the monlist message which is a request message (set the bit) bla bla. Just hsit I have to respect as it's the RFC but don't give a fuck about.
NOW THE QUESTION:
How do I encapsulate the thing to send it in my spoofed UDP raw socket ?
The only way I see is sending it in place of the *buffer, but yeah it seems a bit weird and I actually don't know how I'll do to convert. (just cast the struct to the expected input ?)
Please enlighten me, smartasses. (lawl)
struct iphdr *ip = (struct iphdr *)packet;
06.
struct udphdr *udp = (struct udphdr *)((void *) ip + sizeof(struct iphdr));
07.
This is done to encaspulate UDP in IP.
So I just do something similar ?
Still need to look up what's included for the headers and shit.
Wow, so much work, please tell me if I'm in teh right direction.