Giter Club home page Giter Club logo

hping6's Introduction

This is regular hping2 with a few extra features:

  • -6 - required for ipv6 destinations
  • --pps
  • --bps - set outgoing pps/bps rates. Return packets are not processed in these modes.
  • -flood-send packets as soon as posible.
  • random source ip and dest ip support ipv6

Example:

root@koszik-vps:~# ./hping6 ns1.atw.hu -6 -2 -p 53 -k  -s 1583 --traceroute
HPING ns1.atw.hu (eth0 2a01:270:0:2::11): udp mode set, 48 headers + 0 data bytes
hop=1 TTL 0 during transit from ip=2a00:1f40:2::1 name=2a00-1f40-2--1.pool6.giganet.hu hoprtt=0.9 ms
hop=2 TTL 0 during transit from ip=2a00:1f40:1:bb00::2:1 name=UNKNOWN hoprtt=1005.7 ms
hop=3 TTL 0 during transit from ip=2001:7f8:35::2:9278:2 name=UNKNOWN hoprtt=2011.2 ms
hop=4 TTL 0 during transit from ip=2a02:730:c:b01:b03:0:1:1 name=UNKNOWN hoprtt=3006.7 ms
hop=5 TTL 0 during transit from ip=2a01:270:c:c04:103::1 name=UNKNOWN hoprtt=4007.1 ms
hop=6 TTL 0 during transit from ip=2a01:270:c:c02:c04::1 name=UNKNOWN hoprtt=5007.7 ms
hop=7 TTL 0 during transit from ip=2a01:270:c:106::42 name=UNKNOWN hoprtt=6007.3 ms
^C
--- ns1.atw.hu hping statistic ---
12 packets transmitted, 7 packets received, 42% packet loss
round-trip min/avg/max = 0.9/3006.7/6007.3 ms

TCP flood attack with random source ip with ipv6:

root@testlab:~# ./hping6 2022:1:1:1::2 -6 --rand-source --flood

`2022:1:1:1::2` is the ipv6 address you want to attack

doc: https://github.com/alex-testlab/hping6/wiki

hping6's People

Contributors

alex-testlab avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Forkers

maimang9

hping6's Issues

Not able to use under Debian11

Hi,
If possible, could you help on this issue? When make under Debian 11, lots of warning. IPv4 is ok, but not to be able use for IPv6.
gcc -c -O2 -Wall -g main.c
main.c: In function ‘main’:
main.c:209:3: warning: implicit declaration of function ‘resolve6’; did you mean ‘resolve’? [-Wimplicit-function-declaration]
resolve6((struct sockaddr*)&remote, targetname);
^~~~~~~~
resolve
gcc -c -O2 -Wall -g getifname.c
gcc -c -O2 -Wall -g getlhs.c
gcc -c -O2 -Wall -g linux_sockpacket.c
gcc -c -O2 -Wall -g parseoptions.c
gcc -c -O2 -Wall -g datafiller.c
gcc -c -O2 -Wall -g datahandler.c
gcc -c -O2 -Wall -g gethostname.c
gcc -c -O2 -Wall -g binding.c
gcc -c -O2 -Wall -g getusec.c
gcc -c -O2 -Wall -g opensockraw.c
gcc -c -O2 -Wall -g logicmp.c
gcc -c -O2 -Wall -g waitpacket.c
waitpacket.c: In function ‘handle_ipv6’:
waitpacket.c:194:11: warning: implicit declaration of function ‘recv_icmp6’; did you mean ‘recv_icmp’? [-Wimplicit-function-declaration]
return recv_icmp6(enc_packet, enc_size);
^~~~~~~~~~
recv_icmp
waitpacket.c: In function ‘recv_icmp6’:
waitpacket.c:439:4: warning: implicit declaration of function ‘log_icmp6_unreach’; did you mean ‘log_icmp_unreach’? [-Wimplicit-function-declaration]
log_icmp6_unreach(inet_ntop(opt_af, &src6, tmp, sizeof(tmp)), icmp->code);
^~~~~~~~~~~~~~~~~
log_icmp_unreach
waitpacket.c:444:4: warning: implicit declaration of function ‘log_icmp6_ptb’; did you mean ‘log_icmp_ts’? [-Wimplicit-function-declaration]
log_icmp6_ptb(inet_ntop(opt_af, &src6, tmp, sizeof(tmp)), ntohl(icmp->un.mtu));
^~~~~~~~~~~~~
log_icmp_ts
waitpacket.c: In function ‘recv_tcp’:
waitpacket.c:742:16: warning: ‘tstamp’ may be used uninitialized in this function [-Wmaybe-uninitialized]
sec = tstamp/hz; /* Get the uptime in seconds /
~~~~~~^~~
waitpacket.c:678:8: note: ‘tstamp’ was declared here
__u32 tstamp, echo;
^~~~~~
gcc -c -O2 -Wall -g resolve.c
gcc -c -O2 -Wall -g sendip.c
gcc -c -O2 -Wall -g sendip6.c
gcc -c -O2 -Wall -g sendicmp.c
sendicmp.c: In function ‘send_icmp_other’:
sendicmp.c:258:2: warning: ‘memcpy’ forming offset [21, 28] is out of the bounds [0, 20] of object ‘icmp_ip’ with type ‘struct myiphdr’ [-Warray-bounds]
memcpy(packet+ICMPHDR_SIZE, &icmp_ip, left_space);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
sendicmp.c:199:17: note: ‘icmp_ip’ declared here
struct myiphdr icmp_ip;
^~~~~~~
gcc -c -O2 -Wall -g sendicmp6.c
sendicmp6.c: In function ‘send_icmp_other’:
sendicmp6.c:168:2: warning: ‘memcpy’ forming offset [21, 28] is out of the bounds [0, 20] of object ‘icmp_ip’ with type ‘struct myiphdr’ [-Warray-bounds]
memcpy(packet+ICMPHDR_SIZE, &icmp_ip, left_space);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
sendicmp6.c:112:17: note: ‘icmp_ip’ declared here
struct myiphdr icmp_ip;
^~~~~~~
gcc -c -O2 -Wall -g sendudp.c
gcc -c -O2 -Wall -g sendtcp.c
gcc -c -O2 -Wall -g cksum.c
gcc -c -O2 -Wall -g statistics.c
gcc -c -O2 -Wall -g usage.c
gcc -c -O2 -Wall -g version.c
gcc -c -O2 -Wall -g antigetopt.c
gcc -c -O2 -Wall -g sockopt.c
gcc -c -O2 -Wall -g listen.c
gcc -c -O2 -Wall -g sendhcmp.c
gcc -c -O2 -Wall -g memstr.c
gcc -c -O2 -Wall -g rtt.c
rtt.c: In function ‘rtt’:
rtt.c:41:3: warning: this ‘for’ clause does not guard... [-Wmisleading-indentation]
for (i=0; i<TABLESIZE; i++)
^~~
rtt.c:46:4: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘for’
if (i != TABLESIZE)
^~
gcc -c -O2 -Wall -g relid.c
gcc -c -O2 -Wall -g sendip_handler.c
sendip_handler.c: In function ‘send_ip_handler’:
sendip_handler.c:20:3: warning: implicit declaration of function ‘send_ip6’; did you mean ‘send_ip’? [-Wimplicit-function-declaration]
send_ip6((char
)&ADDR6(&local),
^~~~~~~~
send_ip
gcc -c -O2 -Wall -g libpcap_stuff.c
gcc -c -O2 -Wall -g memlockall.c
gcc -c -O2 -Wall -g memunlockall.c
gcc -c -O2 -Wall -g memlock.c
gcc -c -O2 -Wall -g memunlock.c
gcc -c -O2 -Wall -g ip_opt_build.c
ip_opt_build.c: In function ‘ip_opt_build’:
ip_opt_build.c:26:29: warning: argument to ‘sizeof’ in ‘memset’ call is the same expression as the destination; did you mean to provide an explicit length? [-Wsizeof-pointer-memaccess]
memset(ip_opt, 1, sizeof(ip_opt));
^
gcc -c -O2 -Wall -g display_ipopt.c
gcc -c -O2 -Wall -g sendrawip.c
gcc -c -O2 -Wall -g signal.c
gcc -c -O2 -Wall -g send.c
send.c: In function ‘send_packet’:
send.c:163:37: warning: implicit declaration of function ‘send_icmp6’; did you mean ‘send_icmp’? [-Wimplicit-function-declaration]
else if (opt_icmpmode){if(opt_ipv6)send_icmp6(); else send_icmp();}
^~~~~~~~~~
send_icmp
At top level:
send.c:99:13: warning: ‘select_next_random_ipv6_dest_simple’ defined but not used [-Wunused-function]
static void select_next_random_ipv6_dest_simple(void)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
send.c:90:13: warning: ‘select_next_random_ipv6_source_simple’ defined but not used [-Wunused-function]
static void select_next_random_ipv6_source_simple(void)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
gcc -c -O2 -Wall -g strlcpy.c
gcc -c -O2 -Wall -g arsglue.c
gcc -c -O2 -Wall -g random.c
gcc -c -O2 -Wall -g random6.c
gcc -c -O2 -Wall -g scan.c
scan.c: In function ‘receiver’:
scan.c:455:6: warning: pointer targets in assignment from ‘char *’ to ‘unsigned char *’ differ in signedness [-Wpointer-sign]
p = packet+linkhdr_size+iphdrlen;
^
In function ‘receiver.isra.0’,
inlined from ‘scanmain’ at scan.c:541:3:
scan.c:456:4: warning: ‘memcpy’ forming offset [9, 20] is out of the bounds [0, 8] of object ‘icmp’ with type ‘struct myicmphdr’ [-Warray-bounds]
memcpy(&icmp, p, sizeof(subtcp));
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
scan.c: In function ‘scanmain’:
scan.c:442:21: note: ‘icmp’ declared here
struct myicmphdr icmp;
^~~~
gcc -c -O2 -Wall -g hstring.c
gcc -c -O2 -Wall -g ars.c
ars.c: In function ‘ars_add_icmphdr’:
ars.c:295:22: warning: variable ‘icmp’ set but not used [-Wunused-but-set-variable]
struct ars_icmphdr *icmp;
^~~~
In file included from ars.c:15:
ars.c: In function ‘ars_multi_cksum’:
ars.c:433:46: warning: comparison with string literal results in unspecified behavior [-Waddress]
assert("else reached in ars_multi_cksum()" == "");
^~
ars.c:433:46: warning: comparison with string literal results in unspecified behavior [-Waddress]
assert("else reached in ars_multi_cksum()" == "");
^~
ars.c: In function ‘ars_bsd_fix’:
ars.c:825:20: warning: variable ‘ip’ set but not used [-Wunused-but-set-variable]
struct ars_iphdr *ip;
^~
gcc -c -O2 -Wall -g apd.c
gcc -c -O2 -Wall -g split.c
/usr/bin/ar rc libars.a ars.o apd.o split.o
/usr/bin/ranlib libars.a
gcc -o hping6 -O2 -Wall -g main.o getifname.o getlhs.o linux_sockpacket.o parseoptions.o datafiller.o datahandler.o gethostname.o binding.o getusec.o opensockraw.o logicmp.o waitpacket.o resolve.o sendip.o sendip6.o sendicmp.o sendicmp6.o sendudp.o sendtcp.o cksum.o statistics.o usage.o version.o antigetopt.o sockopt.o listen.o sendhcmp.o memstr.o rtt.o relid.o sendip_handler.o libpcap_stuff.o memlockall.o memunlockall.o memlock.o memunlock.o ip_opt_build.o display_ipopt.o sendrawip.o signal.o send.o strlcpy.o arsglue.o random.o random6.o scan.o hstring.o libars.a

./hping6 -v
hping version 3.0.0-koszik (Sun Apr 16 07:19:17 CEST 2006)
linux sockpacket based binary
use make strip' to strip hping6 binary use make install' to install hping6

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.