


In order to combat this unconstitutional spying, I've been looking for a way to write a spy-proof communication program, and I think that communicating at the Link level of a network might bypass most wiretaps that a hacker (whether a government, or a non-government entity) might install on a network.

This would allow covert communications.Īfter those Snowden leaks, I realized just how much communications are being spied on, by even our own government (which basically sees everybody as a potential suspect) through the use of unconstitutional wiretaps, not just some script kiddie hackers with keyloggers. It would allow stealth communications between 2 computers, while anybody using the network the normal way wouldn't even be aware that the computers using this special technique were on the network (wouldn't show up in the list of computers when checking the DHCP IP address assignment menu in the router's control panel). Such computers would not need the router to assign them an IP address, but could still communicate with each other. It would allow one to communicate with a computer that was physically connected to a network, without actually establishing a higher level connection.
#RAW ETHERNET PACKET SENDER MAC#
I think it would be kind of neat to be able to send and receive messages at the Link level (rather than transport, or application level), using mac addresses, instead of IP addresses. I think there is none, what so ever - on the contrary. If you capture on the outgoing card you won't see the FCS.May i ask, what would be 'possible' legitimate usage of such an functionality. The FCS can be left out(should be handled by hw) so the minimal packet size is 60 bytes, you must send 60 bytes I believe. Memcpy( srcMac, (unsigned char*)req.ifr_hwaddr.sa_data, ETH_ALEN ) Īs you write a raw packet you'll have to put in the mac addresses etc. * store your mac address somewhere you'll need it! in your packet */ If ( ioctl( fd, SIOCGIFHWADDR, &req ) < 0 ) If ( bind( fd, (const struct sockaddr*)&addr, sizeof( addr ) ) < 0 ) If ( ioctl( fd, SIOCGIFINDEX, &req ) < 0 ) Strcpy( (char*)req.ifr_name, (char*)ifname ) Int fd = socket( PF_PACKET, SOCK_RAW, htons( ETH_P_ALL ) ) However it provides the sockaddr which I dont know if I can use for raw ethernet frames? struct sockaddr However OSE does not provide the sockaddr_ll struct. In the examples I have found on the internet uses sockaddr_in when the ip adress is known and sockaddr_ll for raw frames. However the sendto routine also requires a sockaddr struct with information: sendto(int sockfd, const void *buf, size_t len, int flags,Ĭonst struct sockaddr *dest_addr, socklen_t addrlen) What my plan was to do, in order to send data from one card to the other, was to manually fill in a ethernet buffer array with the source and destination MAC adresses. I can then bind the socket to the appropriate device interface using: setsockopt(sock, SOL_SOCKET, SO_BINDTODEVICE, "eth1", 4) I can simply declare a socket using int s = socket(AF_INET, RAW_SOCKET. The "eth1" interface is not assigned any ip-address. I want to send a raw ethernet frame between 2 cards using interface "eth1" which are directly connected to oneanother by an ethernet cable (no switch or anything). I guess many of you are not familiar with this OS but I think you could answer my question anyway. I am working on a project where we use Enea OSE which is a real time embedded operating system.
