Skip to content
Snippets Groups Projects
Commit 11e97fa9 authored by Recolic Keghart's avatar Recolic Keghart
Browse files

init

parent aa2a8472
No related branches found
No related tags found
No related merge requests found
code 0 → 100644
04372-01470-13019-16116-00021-7
fuck_mcd.fish 100644 → 100755
#!/usr/bin/fish
set tmpFile (mktemp)
curl 'https://www.mcdvoice.com/' -vv -L > $tmpFile 2>&1
set cookie (grep 'Set-Cookie' -i $tmpFile | sed 's/^.*Set-Cookie: //g' | sed 's/path=\// /g' | tr -d '\r\n')
set cookie (grep 'Set-Cookie' -i $tmpFile | sed 's/^.*Set-Cookie: //g' | sed 's/path=\// /g' | sed 's/expires=.*;//g' | tr -d '\r\n')
set firstHop_postfix (grep 'action="Survey.aspx?c=' $tmpFile | sed 's/^.*Survey.aspx//g' | sed 's/".*$//g')
set firstHop "https://www.mcdvoice.com/Survey.aspx$firstHop_postfix"
echo "DEBUG: cookie=|$cookie|, first |$firstHop|"
echo "DEBUG: tmpfile is $tmpFile"
read -P 'Survey Code ? ' surveyCode
set surveyCode $argv[1]
if [ "_$surveyCode" = "_" ]
read -P 'Survey Code ? ' surveyCode
end
function surveyCodeToQueryStr
set arr (string split '-' "$surveyCode")
......@@ -19,13 +23,43 @@ function surveyCodeToQueryStr
echo "JavaScriptEnabled=1&FIP=True&CN1=$arr[1]&CN2=$arr[2]&CN3=$arr[3]&CN4=$arr[4]&CN5=$arr[5]&CN6=$arr[6]&NextButton=Start"
end
surveyCodeToQueryStr "$surveyCode"
####### First query
curl -vv "$firstHop" -H "Cookie: $cookie" --data (surveyCodeToQueryStr "$surveyCode") -L > $tmpFile 2>&1
curl -vv "$firstHop" --cookie "$cookie" --data (surveyCodeToQueryStr "$surveyCode") > $tmpFile 2>&1
set cookieAspId (grep "Set-Cookie" -i $tmpFile | sed 's/^.*Set-Cookie: //g' | sed 's/path=\// /g' | tr -d '\r\n')
set cookie "$cookie ; $cookieAspId"
# try again with asp session id in cookie!
# I must follow its redirection and touch index.aspx once, then try once more
curl -vv "$firstHop" --cookie "$cookie" --data (surveyCodeToQueryStr "$surveyCode") -L > /dev/null 2>&1
curl -vv "$firstHop" --cookie "$cookie" --data (surveyCodeToQueryStr "$surveyCode") > $tmpFile 2>&1
set nextHop_postfix (grep 'action="Survey.aspx?c=' $tmpFile | sed 's/^.*Survey.aspx//g' | sed 's/".*$//g')
set nextHop "https://www.mcdvoice.com/Survey.aspx$nextHop_postfix"
set -g nextHop "https://www.mcdvoice.com/Survey.aspx$nextHop_postfix"
echo "DEBUG: new cookie = |$cookie|, next |$nextHop|"
set TODO_DATA {"R004000=1&IoNF=5&PostedFNS=S000100%7CS000200%7CR004000","R001000=5&IoNF=6&PostedFNS=R001000","R000351=5&R028000=5&R007000=5&R011000=5&R008000=5&R006000=5&IoNF=14&PostedFNS=R000351%7CR028000%7CR007000%7CR011000%7CR008000%7CR006000","R005000=5&R009000=5&R015000=5&IoNF=18&PostedFNS=R005000%7CR009000%7CR015000","R000373=1&R000373Other=&IoNF=44&PostedFNS=R000365%7CR000228%7CR000368%7CR000364%7CR000369%7CR000367%7CR000371%7CR000363%7CR000361%7CR000362%7CR000366%7CR000373","R016000=2&IoNF=49&PostedFNS=R016000","R019000=5&R018000=5&IoNF=62&PostedFNS=R019000%7CR018000","S081000=&IoNF=65&PostedFNS=S081000","R000211=2&IoNF=69&PostedFNS=R000211","R000345=1&IoNF=71&PostedFNS=R000345","R000387=3&R000387Other=&IoNF=85&PostedFNS=R000387"}
for i in (seq (count $TODO_DATA))
echo "DEBUG: Query $nextHop with data $TODO_DATA[$i]"
sleep 1
curl -vv "$nextHop" --cookie "$cookie" --data "$TODO_DATA[$i]" > $tmpFile 2>&1
# last query must return 302, others must return 200
set nextHop_postfix (grep 'action="Survey.aspx?c=' $tmpFile | sed 's/^.*Survey.aspx//g' | sed 's/".*$//g')
set -g nextHop "https://www.mcdvoice.com/Survey.aspx$nextHop_postfix"
if grep '302 Found' $tmpFile > /dev/null
#exit 0
end
end
set finalHop_postfix (grep '"/Finish.aspx' $tmpFile | sed 's/^.*href="//g' | sed 's/".*$//g')
set finalHop "https://www.mcdvoice.com/Survey.aspx?$finalHop_postfix"
echo "DEBUG: Query $finalHop"
set finalCookie (echo "$cookie" | sed 's/HttpOnly//g')
echo -- curl -vv "\"$finalHop\"" --cookie "\"$finalCookie\""
#curl -vv "$finalHop" --cookie "$finalCookie" > $tmpFile 2>&1
......@@ -17,4 +17,6 @@ curl 'https://www.mcdvoice.com/Survey.aspx?c=244822' -H 'Connection: keep-alive'
final!!!
curl 'https://www.mcdvoice.com/Survey.aspx?c=233503' -H 'Connection: keep-alive' -H 'Cache-Control: max-age=0' -H 'Origin: https://www.mcdvoice.com' -H 'Upgrade-Insecure-Requests: 1' -H 'DNT: 1' -H 'Content-Type: application/x-www-form-urlencoded' -H 'User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36' -H 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8' -H 'Referer: https://www.mcdvoice.com/Survey.aspx?c=203503' -H 'Accept-Encoding: gzip, deflate, br' -H 'Accept-Language: en-US,en;q=0.9' -H 'Cookie: AspxAutoDetectCookieSupport=1; BIGipServermcdvoice.com_pool=1530008236.24351.0000; ASP.NET_SessionId=jblbhywoz0hu20fxwnl3xyqx; LID=US; CCID=index.aspx; _ga=GA1.2.667365655.1548909833; _gid=GA1.2.1303960063.1548909833; bhtglocalcooksesstest=1; bhtglocalcookperstest=1; DTC=ID=6e513b33-0873-4f64-93a6-9b2c3ba0f599; DTCExpires=Date=1/30/2020 10:43:52 PM; SN=CH-WEB-WSE04-P; DF_Placed=1; T=SN=CH-WEB-WSE04-P&ST=1/31/2019 4:43:52 AM&FP=/Index.aspx&RA=136.25.169.71&LA=1/31/2019 9:35:23 AM' --data 'R000387=3&R000387Other=&IoNF=85&PostedFNS=R000387' --compressed
curl 'https://www.mcdvoice.com/Finish.aspx?c=263503' -H 'Connection: keep-alive' -H 'Cache-Control: max-age=0' -H 'Upgrade-Insecure-Requests: 1' -H 'DNT: 1' -H 'User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36' -H 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8' -H 'Referer: https://www.mcdvoice.com/Survey.aspx?c=203503' -H 'Accept-Encoding: gzip, deflate, br' -H 'Accept-Language: en-US,en;q=0.9' -H 'Cookie: AspxAutoDetectCookieSupport=1; BIGipServermcdvoice.com_pool=1530008236.24351.0000; ASP.NET_SessionId=jblbhywoz0hu20fxwnl3xyqx; LID=US; CCID=index.aspx; _ga=GA1.2.667365655.1548909833; _gid=GA1.2.1303960063.1548909833; bhtglocalcooksesstest=1; bhtglocalcookperstest=1; DTC=ID=6e513b33-0873-4f64-93a6-9b2c3ba0f599; DTCExpires=Date=1/30/2020 10:43:52 PM; SN=CH-WEB-WSE04-P; DF_Placed=1; T=SN=CH-WEB-WSE04-P&ST=1/31/2019 4:43:52 AM&FP=/Index.aspx&RA=136.25.169.71&LA=1/31/2019 9:35:23 AM' --compressed
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment