SHA1_HMAC for unknown text
#5
I dont think so but I could be completely mis-reading this. I have the key (17513529ea04fde116862d745a91afe0e7623ba6) but I dont know the plain text that was hmac'd (192.168.1.61) - its the plain text I want to brute-force

If it helps this is what I used to brute-force it in python (where tkey.txt) contains:

|1|F1E1KeoE/eEWhi10WpGv4OdiO6Y=|3988QV0VE8wmZL7suNrYQLITLCg= ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAAgwCZx9lGaY+Zhz98TdWqZ01mTzOwRnQO0EIBM8Hx8olxMbrQ1Xa+x/7LBoGyJqeYFunZbFCVpAu+2SBkvf75qV8nTlq3WXnLnprsH5Sq/c9f29ZCcMHevI


Python:

import base64
import hmac
from hashlib import sha1

if __name__ == '__main__':
for kh in open("tkey.txt"):
print (kh.strip())
parts = kh.strip().split("|")
if len(parts) < 2:
continue

saltb64 = parts[2]
targetb64 = parts[3].split(" ")[0]

salt = base64.b64decode(saltb64)
target = base64.b64decode(targetb64)

for a in ["192"]:
for b in range(160, 256):
print(b) # For debugging
for c in range(0, 256):
for d in range(0, 256):

message = bytes("%s.%s.%s.%s" % (a,b,c,d), "ascii")
hashed = hmac.new(salt, message, sha1).digest()

if target == hashed:
print("%s|%s -> %s" % (salt.hex(), target.hex(), message))
print("%s|%s -> %s" % (saltb64, targetb64, message))
quit()


Messages In This Thread
SHA1_HMAC for unknown text - by Phil - 03-16-2018, 10:46 AM
RE: SHA1_HMAC for unknown text - by undeath - 03-16-2018, 10:59 AM
RE: SHA1_HMAC for unknown text - by Phil - 03-16-2018, 11:04 AM
RE: SHA1_HMAC for unknown text - by undeath - 03-16-2018, 11:19 AM
RE: SHA1_HMAC for unknown text - by Phil - 03-16-2018, 11:27 AM
RE: SHA1_HMAC for unknown text - by undeath - 03-16-2018, 11:29 AM
RE: SHA1_HMAC for unknown text - by Phil - 03-16-2018, 11:33 AM
RE: SHA1_HMAC for unknown text - by Phil - 03-16-2018, 12:18 PM
RE: SHA1_HMAC for unknown text - by undeath - 03-16-2018, 12:23 PM
RE: SHA1_HMAC for unknown text - by Phil - 03-16-2018, 12:25 PM