Skip to content

Instantly share code, notes, and snippets.

@net1
Forked from Porrapat/login_scb.sh
Created October 4, 2021 13:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save net1/c82beec77e66ead09e85f2fa1b439faf to your computer and use it in GitHub Desktop.
Save net1/c82beec77e66ead09e85f2fa1b439faf to your computer and use it in GitHub Desktop.
# ============ Login SCB ========================
# To Use provide your username and password
# chmod -R 777 login_scb.sh
# ./login_scb.sh
# Please provide your username and password on https://www.scbeasy.com/
username=
password=
# Please Specify Your cookie file (Any blank text file is OK.)
cookie_file=login-scb-cookie.txt
# Link on bank website
form_page=https://www.scbeasy.com/v1.4/site/presignon/index.asp
login_page_url=https://www.scbeasy.com/online/easynet/page/lgn/login.aspx
first_page_url=https://www.scbeasy.com/online/easynet/page/firstpage.aspx
statement_url=https://www.scbeasy.com/online/easynet/page/acc/acc_mpg.aspx
# Login and get SESSIONEASY variable and Cookie file
curl -s -L -b $cookie_file -c $cookie_file "$form_page" > /dev/null
SESSIONEASY=$(curl -X POST -d "LANG=T&LOGIN=$username&PASSWD=$password" -s -L -b $cookie_file -c $cookie_file "$login_page_url" | grep -oP '(?<=NAME="SESSIONEASY"\s{1}VALUE=")[^"]*(?=")')
echo "SESSIONEASY IS : $SESSIONEASY"
echo "COOKIE FILE IS : $cookie_file"
# Show your money on bank protected page.
echo "======= YOU HAVE MONEY IN scbeasy.net (THB) ====="
curl -X POST -s -b $cookie_file -d "SESSIONEASY=$SESSIONEASY" "$statement_url" | grep -oP "([0-9.,]+)(?=<\/strong><\/td><td style=\"width: 230px;\">)"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment