Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I can't really see anything in dnet (https://github.com/dugsong/libdnet) that does anything useful with the string "HOST:all|GET:spam"; it appears all you're functionally doing is spraying data (in the form of that string) at your NIC PHY.

Still, that's fun to play with! Here's my go.

My router (a flaky Netgear DG834GU I'm definitely upgrading when I get the chance) does NOT like the following snippet which floods NULs over ICMP (it took a few seconds for Google to become re-pingable):

  yes "$(printf '%16s' $'\0')" | pv | sudo socat stdin ip-sendto:$(route -n | \
   sed -n '/^\(0\.\)\{2\}/{s/[^ ]\+ \+\([^ ]\+\).*/\1/;p;q}'):1
The call to pipeviewer is only to show I/O rate and can be removed, and the subshell call to `route' and `sed' is just to fish out the first listed gateway; you might want to substitute a specific IP address.

IMHO the moral of this post is that it's a testament to socat's power that I got to the above point with only a few minutes' tinkering; I know nothing about networking. :D

(Sidenote: `yes`ing different string widths produces wildly different results; 16 bytes produces 1GB/s+ of data on this old box, everything either side of that is just MB/s. I wonder why?)



This is really cool! I'll re-implement this in C or Python this weekend if I have some time.


If you really want to be evil you could just open TCP sessions to random valid ip addresses. You'll need a custom stack to make it stateless so you can just "forget" about the TCP sessions. You'll fill the NAT table at some point.


I've been meaning to learn more about TCP and IP in general, so that's actually quite an interesting idea.

Not too practical in real-world use - if the link speed is slow, getting the connections successfully ESTABLISHED is going to take a few minutes - but the educational value is certainly noteworthy.


Here's the great thing. You create your own or use some one else's stateless implementation and you can just slam the interface with MBs upon MBs of syn packets to random ips.

Whenever you get to the next step from any of them you just advance. It's beautiful.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: