-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsession_timeout.sh
44 lines (29 loc) · 932 Bytes
/
session_timeout.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#!/bin/bash
# Felipe Cerqueira - [email protected]
# Cauan Guimaraes - [email protected]
# Dec 2016
# Proxy connections to burp
export http_proxy=http://localhost:8080
export https_proxy=http://localhost:8080
EXPECTED_RESULT="200 OK"
LOGNAME=session_$$.log
for delay_minute in 0 1 6 12 22 30; do
delay_second=$(( delay_minute * 60 ));
echo "`date` - sleeping for $delay_second second(s) or $delay_minute minute(s)";
sleep $delay_second
echo "`date` - sending request";
exec 2>&1 > $LOGNAME
# Curl command goes here. Using an authenticated request,
# right-click and select "Copy as curl command"
# End
exec 1>&0
exec 2>&0
grep "$EXPECTED_RESULT" $LOGNAME > /dev/null
if [ "$?" != "0" ]; then
echo "`date` - session expired!!!"
break
else
echo "`date` - session still alive"
fi
done
rm $LOGNAME