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
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
"I don't suffer from insanity but enjoy every minute of it" - Edgar Allen Poe
http://www.Bloodware.net - Developing free software for the community.
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.
-Jack C
jack {at} crepinc.com
http://www.crepinc.com
i'll take it as a no
no lib no nothing? damn.
oh well, thanks.
"I don't suffer from insanity but enjoy every minute of it" - Edgar Allen Poe
http://www.Bloodware.net - Developing free software for the community.
"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,
-Jack C
jack {at} crepinc.com
http://www.crepinc.com
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().
Last edited by Sang-drax : Tomorrow at 02:21 AM. Reason: Time travelling
but is it possible to read frame as well?
"I don't suffer from insanity but enjoy every minute of it" - Edgar Allen Poe
http://www.Bloodware.net - Developing free software for the community.
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.
-Jack C
jack {at} crepinc.com
http://www.crepinc.com
i don't follow... how did he do arp request then?
Last edited by Devil Panther; 08-06-2004 at 02:39 PM.
"I don't suffer from insanity but enjoy every minute of it" - Edgar Allen Poe
http://www.Bloodware.net - Developing free software for the community.
Oh, that's what I'm sending?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.
Last edited by Sang-drax : Tomorrow at 02:21 AM. Reason: Time travelling
With that particular driver, use ReadFile() to read a frame from the adapter.Originally Posted by Devil Panther
Last edited by Sang-drax : Tomorrow at 02:21 AM. Reason: Time travelling
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.
-Jack C
jack {at} crepinc.com
http://www.crepinc.com
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.Originally Posted by Sang-drax
-Jack C
jack {at} crepinc.com
http://www.crepinc.com
Sang-drax, I can't run it on win9x?
"I don't suffer from insanity but enjoy every minute of it" - Edgar Allen Poe
http://www.Bloodware.net - Developing free software for the community.
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.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 !?
"I don't suffer from insanity but enjoy every minute of it" - Edgar Allen Poe
http://www.Bloodware.net - Developing free software for the community.
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.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.
Last edited by Sang-drax : Tomorrow at 02:21 AM. Reason: Time travelling