C
cruxnor
Hello,
I'm trying to code a simple sniffer in perl, but the results I get
from pcap aren't those I had expected!
My process sub looks like this:
sub process_pkt {
my($user_data, $hdr, $pkt) = @_;
print "$pkt\n";
}
And the results is something like this:
@ø7À¨K8À¨KÝngóAÍsPúð^3
@ù7À¨K8À¨KÝngóAÍsPúð^3
âmûôuóÚE6ë@ø$À¨K8À¨KÝngóAÍPúÅBÀUSER XXXX
uóQâmûE6ë@ù$À¨K8À¨KÝngóAÍPúÅBÀUSER XXXX
âmûôuóÚE4ë@ø!À¨K8À¨KÝngó¡AÍÄPú¶?PASS XXXX
uóQâmûE4ë@ù!À¨K8À¨KÝngó¡AÍÄPú¶?PASS XXXX
âmûôuóÚE.ë@ø"À¨K8À¨KÝngóAÍòPúq¼XSTAT
uóQâmûE.ë@ù"À¨K8À¨KÝngóAÍòPúq¼XSTAT
âmûôuóÚE.ë!@øÀ¨K8À¨KÝngó³AÎPúc±]LIST
When I sniff the network with ngrep, the result is much more
readable!
The initialization of pcap is the same as in the documentation.
Does anybody has an idea for this problem?
I'm looking for a sniffer like ngrep output-style.
ciau, cruxnor
I'm trying to code a simple sniffer in perl, but the results I get
from pcap aren't those I had expected!
My process sub looks like this:
sub process_pkt {
my($user_data, $hdr, $pkt) = @_;
print "$pkt\n";
}
And the results is something like this:
@ø7À¨K8À¨KÝngóAÍsPúð^3
@ù7À¨K8À¨KÝngóAÍsPúð^3
âmûôuóÚE6ë@ø$À¨K8À¨KÝngóAÍPúÅBÀUSER XXXX
uóQâmûE6ë@ù$À¨K8À¨KÝngóAÍPúÅBÀUSER XXXX
âmûôuóÚE4ë@ø!À¨K8À¨KÝngó¡AÍÄPú¶?PASS XXXX
uóQâmûE4ë@ù!À¨K8À¨KÝngó¡AÍÄPú¶?PASS XXXX
âmûôuóÚE.ë@ø"À¨K8À¨KÝngóAÍòPúq¼XSTAT
uóQâmûE.ë@ù"À¨K8À¨KÝngóAÍòPúq¼XSTAT
âmûôuóÚE.ë!@øÀ¨K8À¨KÝngó³AÎPúc±]LIST
When I sniff the network with ngrep, the result is much more
readable!
The initialization of pcap is the same as in the documentation.
Does anybody has an idea for this problem?
I'm looking for a sniffer like ngrep output-style.
ciau, cruxnor