hping: physical layer header size unknown
I can't use hping for some reason.
Code:
$ hping 127.0.0.1 |
I have the exact same problem:
SUSE 10 alpha hping 127.0.0.1 HPING 127.0.0.1 (lo 127.0.0.1): NO FLAGS are set, 40 headers + 0 data bytes len=40 ip=127.0.0.1 ttl=64 DF id=0 sport=0 flags=RA seq=0 win=0 rtt=0.3 ms len=40 ip=127.0.0.1 ttl=64 DF id=0 sport=0 flags=RA seq=1 win=0 rtt=0.2 ms len=40 ip=127.0.0.1 ttl=64 DF id=0 sport=0 flags=RA seq=2 win=0 rtt=0.2 ms 1: len=40 ip=127.0.0.1 ttl=64 DF id=0 sport=1 flags=RA seq=3 win=0 rtt=0.2 ms len=40 ip=127.0.0.1 ttl=64 DF id=0 sport=1 flags=RA seq=4 win=0 rtt=0.2 ms but trying a remote host results in: hping www.google.com [main] physical layer header size unknown and even with remote ip addresses hping2 72.14.203.104 [main] physical layer header size unknown anyone find a solution? seems like it's making a call to this function.. if ( get_linkhdrsize(ifname) == -1 ) { printf("[main] physical layer header size unknown\n"); exit(1); } |
I had no luck trying to hping my bridge interface. Works fine with the eth0 interface which is part of it, though.
# hping2 -I br0 -S 123.456.789.123 -c 3 -p 22 [main] physical layer header size unknown # hping2 -I eth0 -S 123.456.789.123 -c 3 -p 22 HPING 123.456.789.123 (lo 123.456.789.123): S set, 40 headers + 0 data bytes len=44 ip=123.456.789.123 ttl=64 DF id=0 sport=22 flags=SA seq=0 win=32792 rtt=0.2 ms len=44 ip=123.456.789.123 ttl=64 DF id=0 sport=22 flags=SA seq=1 win=32792 rtt=0.1 ms len=44 ip=123.456.789.123 ttl=64 DF id=0 sport=22 flags=SA seq=2 win=32792 rtt=0.1 ms I investigated further and found this: /* header size of some physical layer type */ #define PPPHDR_SIZE 0 #define ETHHDR_SIZE sizeof(struct ethhdr) #define LOHDR_SIZE sizeof(struct ethhdr) #define UNKNOWNHDR_SIZE 0 int get_linkhdrsize(char *ifname) { if ( strstr(ifname, "ppp") ) { linkhdr_size = PPPHDR_SIZE; return 0; } else if ( strstr(ifname, "eth") ) { linkhdr_size = ETHHDR_SIZE; return 0; } else if ( strstr(ifname, "lo") ) { linkhdr_size = LOHDR_SIZE; return 0; } else return 1; } |
I had the same problem using hping2 over a wireless interface but hping3 worked fine.
|
Fix is simple, just modify getlhs.c and return ETHHDR_SIZE
Like this:
... } else if ( strstr(ifname, "eth") ) { linkhdr_size = ETHHDR_SIZE; return 0; } else if ( strstr(ifname, "br") ) { // << ADD THIS FOR YOUR BRIDGE DEVICES like br0 linkhdr_size = ETHHDR_SIZE; return 0; } else if (strstr(ifname, "ets")) { ... Recompile, and you should be golden. |
All times are GMT -5. The time now is 01:44 PM. |