From 59067683c7c45f45b925314638c83a6ff315861c Mon Sep 17 00:00:00 2001 From: CaptainStabs <40151222+CaptainStabs@users.noreply.github.com> Date: Mon, 21 Oct 2019 17:47:41 -0400 Subject: [PATCH 1/6] Update hashmap_gen.py --- hash2phone/hashmap_gen.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/hash2phone/hashmap_gen.py b/hash2phone/hashmap_gen.py index 45e552b..acce756 100644 --- a/hash2phone/hashmap_gen.py +++ b/hash2phone/hashmap_gen.py @@ -14,7 +14,7 @@ if len(sys.argv)!=2: print("\nUsage:\t",sys.argv[0],"<4-digit phone prefix>") print("\nEx.:Calculate hashmap for range +12130000000 -- +12139999999:") - print(sys.argv[0],"1213") + print(sys.argv[0],"1213") print("\n\n"); sys.exit() @@ -38,12 +38,15 @@ if num % 100000 == 0: print(100-(stop_num-num)/100000,"% complete") connection.commit() - strnum = str(num) + strnum = str(num).encode('utf-8') m = hashlib.sha256() m.update(strnum) - hash= m.digest().encode("hex")[0:6] - - record_to_insert = ("\\x"+hash, strnum) + bhash = m.digest() + strhash = str(bhash).encode() + print(strhash) + print(strnum) + record_to_insert = (strhash, num) + print(record_to_insert) cursor.execute(postgres_insert_query, record_to_insert) @@ -52,4 +55,3 @@ connection.commit() print("last num:\t", strnum) print("done!") - From 4b7881017d8121db77a15adff9bf41f284f6bc28 Mon Sep 17 00:00:00 2001 From: CaptainStabs <40151222+CaptainStabs@users.noreply.github.com> Date: Mon, 28 Oct 2019 09:48:58 -0400 Subject: [PATCH 2/6] Update hashmap_gen.py --- hash2phone/hashmap_gen.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hash2phone/hashmap_gen.py b/hash2phone/hashmap_gen.py index acce756..febcb91 100644 --- a/hash2phone/hashmap_gen.py +++ b/hash2phone/hashmap_gen.py @@ -43,10 +43,10 @@ m.update(strnum) bhash = m.digest() strhash = str(bhash).encode() - print(strhash) - print(strnum) + #print(strhash) #These are optional if you want to see it work + #print(strnum) record_to_insert = (strhash, num) - print(record_to_insert) + #print(record_to_insert) cursor.execute(postgres_insert_query, record_to_insert) From 728c99a2dfea54aff42f0bb99ee4eff81e9409ea Mon Sep 17 00:00:00 2001 From: CaptainStabs <40151222+CaptainStabs@users.noreply.github.com> Date: Wed, 15 Jan 2020 17:40:27 -0500 Subject: [PATCH 3/6] Update README.md --- hash2phone/README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hash2phone/README.md b/hash2phone/README.md index 5082158..bac0873 100644 --- a/hash2phone/README.md +++ b/hash2phone/README.md @@ -25,7 +25,8 @@ sudo -u postgres psql < db_init.sql Place lookup script into webserver directory: ``` -cp map_hash_num.php /var/www/html/ +cp map_hash_num.php /var/www/html/ # postgres version +cp map_hash_num_sqlite.php /var/www/html/ # sqlite version ``` - SQLite @@ -54,6 +55,7 @@ Now you can get mobile phones by 3 bytes of SHA256(phone_number) this way: ``` http://127.0.0.1/map_hash_num.php?hash=112233 +http://127.0.0.1/map_hash_num_sqlite.php?hash=112233 ``` ![ph_candidates](img/hash_api.png) From fad7d498617332d134507a60b71d1480e96045b6 Mon Sep 17 00:00:00 2001 From: CaptainStabs <40151222+CaptainStabs@users.noreply.github.com> Date: Thu, 16 Jan 2020 08:49:01 -0500 Subject: [PATCH 4/6] Update README.md --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 37d12cc..8af38f4 100644 --- a/README.md +++ b/README.md @@ -22,6 +22,8 @@ We have tested these PoCs on **Kali Linux** git clone https://github.com/hexway/apple_bleee.git && cd ./apple_bleee # install dependencies sudo apt update && sudo apt install -y bluez libpcap-dev libev-dev libnl-3-dev libnl-genl-3-dev libnl-route-3-dev cmake libbluetooth-dev +# For the bluetooth scripts, you need to do + ```sudo apt-get install python3-bluez``` sudo pip3 install -r requirements.txt # clone and install owl for AWDL interface git clone https://github.com/seemoo-lab/owl.git && cd ./owl && git submodule update --init && mkdir build && cd build && cmake .. && make && sudo make install && cd ../.. From 16137df996ae5c08e228cdeaada9dbecb918c84e Mon Sep 17 00:00:00 2001 From: CaptainStabs <40151222+CaptainStabs@users.noreply.github.com> Date: Sat, 9 Jan 2021 20:43:15 -0500 Subject: [PATCH 5/6] Update README.md From 8cf6590d53236c4dedf387b81be38682e80e1034 Mon Sep 17 00:00:00 2001 From: CaptainStabs <40151222+CaptainStabs@users.noreply.github.com> Date: Sat, 9 Jan 2021 20:44:14 -0500 Subject: [PATCH 6/6] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 8af38f4..6728987 100644 --- a/README.md +++ b/README.md @@ -192,3 +192,4 @@ Please find details [here](/hash2phone) [https://hexway.io](https://hexway.io)
[@_hexway](https://twitter.com/_hexway) +