Skip to content

Instantly share code, notes, and snippets.

@infusion
Last active July 6, 2016 22:12
Show Gist options
  • Save infusion/89bd715b68f3dfcf49ab to your computer and use it in GitHub Desktop.
Save infusion/89bd715b68f3dfcf49ab to your computer and use it in GitHub Desktop.
Some curl snippets
#!/bin/bash
echo "What have you done today?"
read msg
echo "For how long have wo worked today?"
read hours
user="Robert"
pass="secret"
host="192.168.0.1:1234"
file="/path/to/report.csv"
tmpfile="/Users/robert/.reporting"
time=$(date '+%d/%m/%Y %H:%M:%S')
echo "$hours,\"$time\",\"$msg\"" >> $tmpfile
curl -k -X PUT -T $tmpfile "https://$user:$pass@$host$file"
#!/bin/bash
# Start tor
tor &
pid=$!
# Wait for tor to be up
sleep 6
for i in {1..8000}
do
curl -A "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:29.0) Gecko/20120101 Firefox/29.0" \
--compressed \
-m 15 \
-H "Referer: http://www.xarg.org/" \
-H "Accept: */*" \
-H "X-Requested-With: XMLHttpRequest" \
-H "Content-Type: application/x-www-form-urlencoded; charset=UTF-8" \
-H "Accept-Language: de-DE,de;q=0.8,en-US;q=0.6,en;q=0.4" \
-H "Cookie: language=en" \
--data "test=123&foo=bar" \
--socks5 127.0.0.1:9050 \
http://www.xarg.org/index.asp
sleep 5
# get new IP
kill -HUP $pid
done
kill $pid
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment