I know that with raw sockets I can go low as creatining my own ip packets, but what it i want to construct my own ethernet frames?
thanks
Printable View
I know that with raw sockets I can go low as creatining my own ip packets, but what it i want to construct my own ethernet frames?
thanks
while you're at it, you might as well physically turn on and off the little pins in the NIC.
Sure, you could hack the kernal to allow you to do that, but unless you're seeking knowedge, it's pointless. If you want a challenge, use raw sockets to create a spoofed telnet, with arp spoofing to get the response. That'll keep you busy.
i'll take it as a no :)
no lib no nothing? damn.
oh well, thanks.
"no"
That's not entirly true. After I posted yesterday, I was working on a script I'm writing that spoofs connections with raw packets. While looking around, I actually did come across an API for writing to raw frames... it might have been in libnet???
If I find it, I will let you know, but check libnet and The Oracle (google).
Later,
It is indeed possible:
http://cboard.cprogramming.com/showthread.php?t=55430
I used the following driver, whose C# interface I converted to C++:
http://www.thecodeproject.com/csharp/SendRawPacket.asp
It then possible to send any Ethernet frame by constructing a char[] buffer and passing it to the driver using WriteFile().
but is it possible to read frame as well?
actually, thats not raw frames you're sending, Sang-drax . It's just raw packets. I looked ast your code.
What he would like to do is send that actually tiny IP peices, not, for instance, and ARP Packet. It's even lower level than that.
i don't follow... how did he do arp request then?
Oh, that's what I'm sending? :rolleyes:Quote:
Originally Posted by crepincdotcom
I'm sending Ethernet frames, nothing else. The Ethernet packages/frames contain ARP, IP, IPX or something else. If you'd read sendARPResponse() in PacketLoop.cpp you'd have seen that I'm filling in the destination and source MAC address in the Ethernet frame.
No reason for giving me bad reputation for that post. I know what I'm sending.
With that particular driver, use ReadFile() to read a frame from the adapter.Quote:
Originally Posted by Devil Panther
lol i'm sorry for the bad reps
I still stand by the packets though. Frames are different: you actually send individual peices, perhaps even individual fragments. You are making a packet: you simply fill in the struct regarding srcaddr, dst, checksum, type, all that. I'm saying, it's more low level.
Not to be dissing anyone, but just remember that it's windows code, a little different than *nix. But I don't know what OS you use.Quote:
Originally Posted by Sang-drax
Sang-drax, I can't run it on win9x?
but packets contain ethernet, but when you build a raw socket you only have control of ethernet's payload. And if you build a packet with full controll of the ethernet part, you have full control over the frame.Quote:
I still stand by the packets though. Frames are different: you actually send individual peices, perhaps even individual fragments. You are making a packet: you simply fill in the struct regarding srcaddr, dst, checksum, type, all that. I'm saying, it's more low level.
Sang-drax, I don't see any CRC !?
The Ethernet CRC is filled in automatically by the hardware. I don't know if NDIS-compatible network adapters support sending frames with custom CRCs.Quote:
Originally Posted by Devil Panther
crepinc: What do you mean is the difference between packets and frames? Units of level one and two in the OSI stack are called frames, and level three and four are called packets.
I'm not sure exactly what we're disagreeing on... :)
I'd really like to see an example on how to send frames with custom CRC. I'm sure it is possible with some ethernet cards at least, but not with the driver I use.