Open jifox opened 2 years ago
I've tried to use the salt that the switch has stored as a constant and calculated the hash. The has value calculated is the same as the hash in cisco running config.
for _ in range(14):
salt_chars.append(random.choice(cisco_b64chars))
salt = "".join(salt_chars)
salt = "pPsCfoFx0krK.E" # <------------
####################################################
[4] Type 9 (Scrypt)
[5] Exit
Your selection: 4
Enter a Plain Text Password to convert: TestText
Your Cisco Type 9 password hash is: $9$pPsCfoFx0krK.E$yMeHAVYfOMb4yLYg9CkQyKaXkDH01slV9KdvNx7Afg
####################################################
# Switch output from running config
TEST(config)# TEST(config)#do show run | i ....
username .... privilege 15 secret 9 $9$pPsCfoFx0krK.E$yMeHAVYfOMb4yLYg9CkQyKaXkDH01slV9KdvNx7Afg2
It seems that the salt is not a random value for IOS-XE 17.03.04
When using this python script the switch will not accept the calculated hash