| View previous topic :: View next topic |
| Author |
Message |
Stylo Grandmaster Cheater Supreme
Reputation: 3
Joined: 16 May 2007 Posts: 1073 Location: Israel
|
Posted: Tue Sep 07, 2010 2:25 pm Post subject: ARP Sending in C++ |
|
|
I was wondering how would i send an arp request that i have built in c++?
so far i got here:
| Code: |
typedef struct arp {
unsigned short htype;
unsigned short ptype;
unsigned char hlen;
unsigned char plen;
unsigned short operation;
unsigned int source_mac;
unsigned short source_mac_con;
unsigned int source_ip;
unsigned short dest_mac;
unsigned int dest_mac_con;
unsigned int dest_ip;
} *ARP;
void SendARPRequest( void ) {
ARP arp_packet;
arp_packet = (ARP) malloc( sizeof arp );
arp_packet->htype = 1;
arp_packet->ptype = 0x0800;
arp_packet->hlen = 48;
arp_packet->plen = 32;
arp_packet->operation = 1;
arp_packet->source_mac = 0x000129d5;
arp_packet->source_mac_con = 0x98ef;
arp_packet->source_ip = 0x0a000001;
arp_packet->dest_mac = 0x00000000;
arp_packet->dest_mac_con = 0x0000;
arp_packet->dest_ip = 0x0a000007;
}
|
I created the arp structure as far as i guess it is.
but now where do i go?
how do i turn it into my network card to move on to the network?
i'm guessing there is no use in sockets in that level of frames / packets
any help would be great
_________________
Stylo |
|
| Back to top |
|
 |
Deltron Z Expert Cheater
Reputation: 1
Joined: 14 Jun 2009 Posts: 164
|
Posted: Tue Sep 07, 2010 4:52 pm Post subject: |
|
|
Why are you using C-style code in C++ code?
Anyways, I think you can do this with raw sockets, but you should know that sending raw sockets on Windows is disabled.
You could write a driver or use one, I belive that the library WinPCap should help you.
|
|
| Back to top |
|
 |
Stylo Grandmaster Cheater Supreme
Reputation: 3
Joined: 16 May 2007 Posts: 1073 Location: Israel
|
Posted: Tue Sep 07, 2010 10:57 pm Post subject: |
|
|
Yea, I know winpcap and wondered if i could just write one in myself,
but i don't really know how to accomplish that.
by saying driver do you mean kmd?
_________________
Stylo |
|
| Back to top |
|
 |
justa_dude Grandmaster Cheater
Reputation: 23
Joined: 29 Jun 2010 Posts: 893
|
Posted: Wed Sep 08, 2010 3:36 am Post subject: |
|
|
| Yeah, kernel-level.
|
|
| Back to top |
|
 |
tombana Master Cheater
Reputation: 2
Joined: 14 Jun 2007 Posts: 456 Location: The Netherlands
|
Posted: Wed Sep 08, 2010 2:32 pm Post subject: |
|
|
Windows sockets do not allow ARP packets from usermode. So yes you need a kernelmode driver. The easiest would be to use WinPCap, though I'm not sure if it can send packets instead of only 'sniffing'.
It's probably quite difficult to make such a driver yourself if you've never made a driver before.
|
|
| Back to top |
|
 |
Stylo Grandmaster Cheater Supreme
Reputation: 3
Joined: 16 May 2007 Posts: 1073 Location: Israel
|
Posted: Wed Sep 08, 2010 4:08 pm Post subject: |
|
|
| tombana wrote: | Windows sockets do not allow ARP packets from usermode. So yes you need a kernelmode driver. The easiest would be to use WinPCap, though I'm not sure if it can send packets instead of only 'sniffing'.
It's probably quite difficult to make such a driver yourself if you've never made a driver before. |
Yea, that's pretty much what i want to get into right now.
I'd like to step into the KMD subject not only for that goal, but for knowing it properly.
got any good tutorials for beginners?
_________________
Stylo |
|
| Back to top |
|
 |
deffi How do I cheat?
Reputation: 0
Joined: 17 Nov 2010 Posts: 2
|
Posted: Wed Nov 17, 2010 4:14 pm Post subject: |
|
|
| How about using SendARP winapi?
|
|
| Back to top |
|
 |
|