
A simple tool wrapper to automate the enumeration, fingerprinting, and PSK extraction of an IPSec VPN gateway.
A simple tool wrapper to automate the enumeration, fingerprinting, and PSK extraction of an IPSec VPN gateway.
Nothing fancy here, just a script I put together to save time during CTFs and while studying for the CPENT. It chains together ike-scan, nmap and hashcat so I don't have to type the same commands over and over.
For authorized testing and educational use only. Only run this against machines you own or have explicit permission to test (your lab, CTF boxes, etc). What you do with it is on you.
The script walks through the usual steps to test an IKE gateway:
If you already know the group ID (maybe you found it somewhere else, like a leaked config), just pass it with -id and the script skips straight to the PSK extraction.
You need these installed:
/usr/share/seclists/Miscellaneous/ike-groupid.txt)./IkeAbuser.sh -t -pw <password_wordlist> -iw <id_wordlist> [options]
Note: -iw is required unless you pass -id with a known group ID, in which case the ID brute force (and its wordlist) are skipped.
-t, --target: target IP (required)-pw, --pwd_wordlist: wordlist for cracking the PSK (required)-iw, --id_wordlist: wordlist for the group IDs (needed if you don't pass -id)-id, --group_id: group ID, if you already know it. Skips the ID brute force-p, --port: custom IKE port, if it's not on 500/4500-vi, --vendor: adds vendor info and fingerprinting to the output-o, : saves a report of the findings to a fileYou already know the ID: ./IkeAbuser.sh -t 10.10.11.87 -id [email protected] -pw /usr/share/wordlists/rockyou.txt (thanks HTB)
You don't, so brute force it: ./IkeAbuser.sh -t 10.10.11.87 -iw /usr/share/seclists/Miscellaneous/ike-groupid.txt -pw /usr/share/wordlists/rockyou.txt
With vendor info and a saved report: ./IkeAbuser.sh -t 10.10.11.87 -id [email protected] -pw /usr/share/wordlists/rockyou.txt -vi -o report.txt
-vi) uses ike-scan's backoff detection, which can take up to a minute. Be patient, it's not stuck.ike_psk.hash so you can resume the crack later with your own rules or wordlists if the first run doesn't find it.--output-h, --help: shows the help