diff --git a/bml-bash/bml.sh b/bml-bash/bml.sh deleted file mode 100755 index bfd2802..0000000 --- a/bml-bash/bml.sh +++ /dev/null @@ -1,93 +0,0 @@ -#!/bin/bash - -source .env - -BML_URL='https://www.bankofmaldives.com.mv/internetbanking/api' -COOKIE=/tmp/bmlcookie -red=`tput setaf 1` -green=`tput setaf 2` -reset=`tput sgr0` - -LOGIN=$(curl -s -c $COOKIE $BML_URL/login \ - --data-raw username=$BML_USERNAME \ - --data-raw password=$BML_PASSWORD \ - --compressed \ - | jq -r .success) - -if [ "$LOGIN" = "true" ] - then - NAME=$(curl -s -b $COOKIE $BML_URL/profile \ - | awk -F 'fullname":"' '{print $2}' \ - | cut -f1 -d '"') - echo "" - echo ${green}Welcome ${reset}$NAME -# curl -s -b $COOKIE $BML_URL/userinfo - echo "" -else - echo "${red}An error occured, Please check Username and Password" 1>&2 - rm $COOKIE 2> /dev/null - exit -fi - -echo "Menu" -echo "" -echo "1 - Accounts" -echo "2 - Contacts" -echo "3 - Activities" -echo "4 - Services" -echo "5 - Settings" -echo "" -printf 'Please Input: ' -read -r MENU - -if [ "$MENU" = "1" ] - then - curl -s -b $COOKIE $BML_URL/dashboard | jq -elif [ "$MENU" = "2" ] - then - echo "" - echo "Contacts" - echo "" - echo "1 - Transfer" - echo "2 - Add Contact" - echo "3 - Delete Conact" - echo "" - printf 'Please Input: ' - read -r CONTACS - - if [ "$CONTACS" = "1" ] - then - curl -s -b $COOKIE $BML_URL/contacts | jq -r '["Account Number","Currency","Account Name","Contact Name"], ["==================================================================="], (.["payload"] | .[] | [.account, .currency, .name, .alias]) | @tsv' - elif [ "$CONTACS" = "2" ] - then - printf 'Account Number: ' - read -r ACCOUNT_NUMBER - VALID_NUMBER=$(curl -s -b $COOKIE $BML_URL/validate/account/$ACCOUNT_NUMBER \ - | jq -r .success) - if [ "$VALID_NUMBER" = "true" ] - then - printf 'Name: ' - read -r ACCOUNT_NAME - curl -s -b $COOKIE $BML_URL | jq - else - echo "${red}Invalid Account" 1>&2 - fi - elif [ "$CONTACS" = "3" ] - then - echo "" - else - exit - fi -elif [ "$MENU" = "3" ] - then - curl -s -b $COOKIE $BML_URL/activities | jq -elif [ "$MENU" = "4" ] - then - curl -s -b $COOKIE $BML_URL/services/applications/context | jq -elif [ "$MENU" = "5" ] - then - curl -s -b $COOKIE $BML_URL/settings | jq -else - echo "${red}There was an error" -fi - diff --git a/bml-bash/pasrjsontest.sh b/bml-bash/pasrjsontest.sh deleted file mode 100755 index 1ca67cf..0000000 --- a/bml-bash/pasrjsontest.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/bash - -source .env - -BML_URL='https://www.bankofmaldives.com.mv/internetbanking/api' -COOKIE=/tmp/bmlcookie -curl -s -c $COOKIE $BML_URL/login \ - --data-raw username=$BML_USERNAME \ - --data-raw password=$BML_PASSWORD \ - --compressed > /dev/null -curl -s -b $COOKIE $BML_URL/profile > /dev/null -#curl -s -b $COOKIE $BML_URL/contacts -curl -s -b $COOKIE $BML_URL/validate/account/7704265806101 diff --git a/bml-tg-notify/bml-tg-notify.sh b/bml-tg-notify/bml-tg-notify.sh index 9b9d75b..3ae7aea 100755 --- a/bml-tg-notify/bml-tg-notify.sh +++ b/bml-tg-notify/bml-tg-notify.sh @@ -10,19 +10,17 @@ TG_BOTAPI='https://api.telegram.org/bot' BML_URL='https://www.bankofmaldives.com.mv/internetbanking/api' mkdir -p ~/.cache/bml-cli/ COOKIE=~/.cache/bml-cli/cookie -LOGIN=$(curl -s -c $COOKIE $BML_URL/login \ - --data-raw username=$BML_USERNAME \ - --data-raw password=${BML_PASSWORD} \ - --compressed \ - | jq -r .code) + +LOGIN=$(curl -s -c $COOKIE $BML_URL/login --data-raw username=$BML_USERNAME --data-raw password=${BML_PASSWORD} | jq -r .code) if [ "$LOGIN" = "0" ] then - : + PROFILE=$(curl -s -b $COOKIE $BML_URL/profile | jq -r '.payload | .profile | .[] | .profile' | head -n 1) + curl -s -b $COOKIE $BML_URL/profile --data-raw profile=$PROFILE > /dev/null else echo Something went wrong exit fi -curl -s -b $COOKIE $BML_URL/profile > /dev/null + while true; do CHECKDIFF1=$(echo $HISTORY | wc -c) HISTORY=$(curl -s -b $COOKIE $BML_URL/account/$BML_ACCOUNTID/history/today | jq -r '.payload | .history | .[]') diff --git a/dhiraagu-ddns/dipcf.sh b/dhiraagu-ddns/dipcf.sh index 277f232..f98b359 100755 --- a/dhiraagu-ddns/dipcf.sh +++ b/dhiraagu-ddns/dipcf.sh @@ -31,7 +31,7 @@ else fi #Set DHIRAAGU_IP, login with generated cookie and some regex to extract Dhiraagu IP address -DHRAAGU_IP=$(curl -s -b /tmp/dcookies \ +DIHRAAGU_IP=$(curl -s -b /tmp/dcookies \ $DHIRAAGU_HOME_URL \ | grep 'IP Address' -A1 \ | tail -n1 \ diff --git a/encryipt-variable-bash/bruh b/encryipt-variable-bash/bruh new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/encryipt-variable-bash/bruh @@ -0,0 +1 @@ + diff --git a/encryipt-variable-bash/openssh.sh b/encryipt-variable-bash/openssh.sh new file mode 100644 index 0000000..806dc2d --- /dev/null +++ b/encryipt-variable-bash/openssh.sh @@ -0,0 +1,11 @@ +read -p 'Username: ' BML_USERNAME +read -s -p 'Enter Pin: ' PIN +read -s -p 'Repeat Pin: ' REPEAT_PIN + +if [ "$PIN" = "$REPEAT_PIN" ] + then + echo $BML_USERNAME | PASS=$(openssl aes-256-cbc -a -salt -pass pass:$PIN) + echo $PASS > bruh +else + echo "Pin do not match" +fi