Skip to content

Instantly share code, notes, and snippets.

@evo42
Last active April 25, 2023 22:31
Show Gist options
  • Select an option

  • Save evo42/e40e7af57d4f013e32c6956aed315d4c to your computer and use it in GitHub Desktop.

Select an option

Save evo42/e40e7af57d4f013e32c6956aed315d4c to your computer and use it in GitHub Desktop.
BitATM -- cardless cash withdrawal at 1.427 ATMs in Austria -- https://SEPA.digital
#!/bin/bash
# smartcash.sh
# API for BAWAG PSK smartCash service
user=''
pin=''
account='0'
amount='10'
mobileTan=''
url='https://ebanking.bawagpsk.com/InternetBanking/InternetBanking?d=login&svc=BAWAG&ui=html&lang=de'
rm ./curl-cookies;
# auth
login=$(curl -is --verbose -c ./curl-cookies "$url");
action=$(echo "$login" | (grep -o 'action="/InternetBanking/InternetBanking/[0-9\$]\{5,15\}">' | grep -o '[0-9\$]\{5,15\}'));
grr=$(echo "$login" | (grep -o 'id="grr" value="[0-9a-zA-Z-]\{10,50\}" />' | grep -o '[0-9a-zA-Z-]\{20,50\}'));
url="https://ebanking.bawagpsk.com/InternetBanking/InternetBanking/$action"
auth=$(curl -is -b ./curl-cookies -c ./curl-cookies --verbose -d "svc=BAWAG&submitflag=true&d=login&grr=$grr&lang=de&dn=$user&pin=$pin&rd=" -X POST "$url")
action=$(echo "$auth" | grep -o '[0-9\$]\{5,15\}' | head -n 1);
url="https://ebanking.bawagpsk.com/InternetBanking/InternetBanking/$action";
start=$(curl -is -b ./curl-cookies -c ./curl-cookies --verbose -d "svc=PSK&d=transactions&submitflag=false&print=false&submitfieldname=&submitfieldval=&lastviewed=&activeaccount=$account&id=&type=" -X POST "$url")
mtan=$(curl -is -b ./curl-cookies -c ./curl-cookies --verbose -d "svc=PSK&d=cashplus&submitflag=true&action=sign&id=&toGeolocate=&accountNumber=0&amountRange=firstRange&amountFieldFirst=$amount&address=&lat=&lon=&hAccount=$account&legalText=on&itanRadio=mtan_anfordern" -X POST "$url")
read -p "Enter the mobile TAN: " mobileTan
while true
do
case $mobileTan in
[nN]* ) exit;;
* ) sign=$(curl -is -b ./curl-cookies -c ./curl-cookies --verbose -d "svc=PSK&d=cashplus&submitflag=true&action=request&id=&toGeolocate=&amountRange=firstRange&lat=&lon=&legalText=true&amountFieldFirst=$amount&hAmountFirst=$amount&amountFieldSecond=&hAmountSecond=&hAddress=&address=&accountNumber=$account&hAccount=$account&xn9praq9uk=$mobileTan&itanRadio=mtan" -X POST "$url")
break ;;
esac
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment