I need to write a Linux packet sniffer that detects an HTTPS packet that is sent and saves the URL from the request. I found the code for this in security-freak and ran it. This code works and only sniffs the received packet, but I need to get the sent packet to the sniffer. How to receive the sent packet in this code?
I cannot use any library like libcap (forbidden). Code: sniffer.c
You should use ETH_P_ALL instead of ETH_P_IP as a protocol. ETH_P_IP only listens for incoming IP packets.
Why can't you use any library? Homework?
It is difficult to answer without having examples from your code, for example, how you installed sll_pkttype.
sll_pkttype
The urlsnarf tool in the dnsiff Suite may be worth a look.
libpcap DNET ( - 5) ( ). .
.