diff options
author | Johannes Löthberg <johannes@kyriasis.com> | 2015-05-16 01:10:03 +0200 |
---|---|---|
committer | Johannes Löthberg <johannes@kyriasis.com> | 2015-05-16 01:10:03 +0200 |
commit | 946f03bb0e69f9de042aedab5362278227b88b93 (patch) | |
tree | 7d36de93fedb623b2a5a325afc16e6e9e325bac8 | |
parent | 43943e26128724aaf5516a596772a16afdae06ea (diff) | |
download | bin-946f03bb0e69f9de042aedab5362278227b88b93.tar.xz |
add sprunc, netcat sprunge client
Written in POSIX sh
-rwxr-xr-x | sprunc | 15 |
1 files changed, 15 insertions, 0 deletions
@@ -0,0 +1,15 @@ +#!/usr/bin/busybox sh + +stdin=$(cat /dev/stdin) +uuenc=$(perl -MURI::Escape -e 'print uri_escape($ARGV[0]);' "$stdin") + +content_length=$(( ${#uuenc} + $(expr length "sprunge=") )) + +/usr/bin/nc sprunge.us 80 <<EOF | awk '/17/{getline; print}' +POST / HTTP/1.1 +Host:sprunge.us +Content-Type:application/x-www-form-urlencoded +Content-Length:$content_length + +sprunge=$uuenc +EOF |