{"id":451,"date":"2018-01-18T15:46:27","date_gmt":"2018-01-18T15:46:27","guid":{"rendered":"https:\/\/www.attackdebris.com\/?p=451"},"modified":"2020-11-14T12:09:12","modified_gmt":"2020-11-14T12:09:12","slug":"451","status":"publish","type":"post","link":"https:\/\/www.attackdebris.com\/?p=451","title":{"rendered":"Cracking Cisco ASA SHA-512 Hashes with Hashcat"},"content":{"rendered":"<p>I&nbsp;haven&#8217;t&nbsp;seen too much detail around about how to crack Cisco ASA PBKDF2 (Password-Based Key Derivation Function 2) SHA-512 hashes, which I believe have been supported in some ASA versions&nbsp;from as early as March 2016.<\/p>\n<div>&nbsp;<\/div>\n<p>As always the hashes can be recovered from the&nbsp;appropriate Cisco ASA config file.<\/p>\n<div>&nbsp;<\/div>\n<p>Here are some examples of how the hashes can appear in the ASA config files. In the examples below all 3 sample hashes can be easily cracked using any respectable word-list:<\/p>\n<pre>enable password $sha512$5000$vlCP+V07DGEJ9TcSV\/GpuA==$2S8SLoECmbtb\/o17ZhXuKg== pbkdf2\n\nusername admin password $sha512$5000$SvZkzlRDO115YrLXsZuWCg==$Yu0w7sFjhLnbtZQJ\/nyp+A== pbkdf2 privilege 15\n\nusername admin password $sha512$5000$OZ45Ro7002bnyFGXlIghqg==$T9oP1zKSTmv74Nizd8ku3A== pbkdf2 privilege 15<\/pre>\n<div>&nbsp;<\/div>\n<p>Some modification of the hashes is required before they can be imported into hashcat. Basically the first $ needs to be removed and all subsequent $&#8217;s need to be replaced with colons.<\/p>\n<div>&nbsp;<\/div>\n<p>For example:<\/p>\n<pre>$sha512$5000$SvZkzlRDO115YrLXsZuWCg==$Yu0w7sFjhLnbtZQJ\/nyp+A==<\/pre>\n<div>&nbsp;<\/div>\n<p>Becomes:<\/p>\n<pre>sha512:5000:SvZkzlRDO115YrLXsZuWCg==:Yu0w7sFjhLnbtZQJ\/nyp+A==<\/pre>\n<div>&nbsp;<\/div>\n<p>This hash can now be fed into hashcat as a single:<\/p>\n<pre>hashcat64.exe -m 12100 sha512:5000:SvZkzlRDO115YrLXsZuWCg==:Yu0w7sFjhLnbtZQJ\/nyp+A==&nbsp;c:\\Tools\\wordlists\\pw_topten.txt<\/pre>\n<div>&nbsp;<\/div>\n<div><a href=\"https:\/\/www.attackdebris.com\/wp-content\/uploads\/2018\/01\/hashcat_1.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-452\" src=\"https:\/\/www.attackdebris.com\/wp-content\/uploads\/2018\/01\/hashcat_1.png\" alt=\"\" width=\"661\" height=\"286\" srcset=\"https:\/\/www.attackdebris.com\/wp-content\/uploads\/2018\/01\/hashcat_1.png 661w, https:\/\/www.attackdebris.com\/wp-content\/uploads\/2018\/01\/hashcat_1-300x130.png 300w\" sizes=\"auto, (max-width: 661px) 100vw, 661px\" \/><\/a><\/div>\n<p>&nbsp;<\/p>\n<p style=\"text-align: left;\">Or via a file:<\/p>\n<pre>hashcat64.exe -m 12100 sha512.txt c:\\Tools\\wordlists\\pw_topten.txt<\/pre>\n<div>&nbsp;<\/div>\n<div><a href=\"https:\/\/www.attackdebris.com\/wp-content\/uploads\/2018\/01\/hashcat_2.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-453\" src=\"https:\/\/www.attackdebris.com\/wp-content\/uploads\/2018\/01\/hashcat_2.png\" alt=\"\" width=\"610\" height=\"301\" srcset=\"https:\/\/www.attackdebris.com\/wp-content\/uploads\/2018\/01\/hashcat_2.png 610w, https:\/\/www.attackdebris.com\/wp-content\/uploads\/2018\/01\/hashcat_2-300x148.png 300w\" sizes=\"auto, (max-width: 610px) 100vw, 610px\" \/><\/a><\/div>\n<p>&nbsp;<\/p>\n<p>Cracked hashes:<\/p>\n<pre>sha512:5000:vlCP+V07DGEJ9TcSV\/GpuA==:2S8SLoECmbtb\/o17ZhXuKg==: (i.e. blank)\n\nsha512:5000:SvZkzlRDO115YrLXsZuWCg==:Yu0w7sFjhLnbtZQJ\/nyp+A==:cisco<\/pre>\n<div>&nbsp;<\/div>\n<p>I leave the final hash (below) to be cracked as a challenge for the reader (it can be cracked with any&nbsp;respectable&nbsp;word-list):<\/p>\n<pre>&nbsp;$sha512$5000$OZ45Ro7002bnyFGXlIghqg==$T9oP1zKSTmv74Nizd8ku3A==<\/pre>\n<p>Thanks to my colleague Marius for the initial pointer on the hash type.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I&nbsp;haven&#8217;t&nbsp;seen too much detail around about how to crack Cisco ASA PBKDF2 (Password-Based Key Derivation Function 2) SHA-512 hashes, which I believe have been supported in some ASA versions&nbsp;from as early as March 2016. &nbsp; As always the hashes can be recovered from the&nbsp;appropriate Cisco ASA config file. &nbsp; Here are some examples of how &hellip; <\/p>\n<p><a class=\"more-link btn\" href=\"https:\/\/www.attackdebris.com\/?p=451\">Continue reading<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","enabled":false},"version":2}},"categories":[13],"tags":[],"class_list":["post-451","post","type-post","status-publish","format-standard","hentry","category-passwords","item-wrap"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/s3MDvd-451","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.attackdebris.com\/index.php?rest_route=\/wp\/v2\/posts\/451","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.attackdebris.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.attackdebris.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.attackdebris.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.attackdebris.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=451"}],"version-history":[{"count":35,"href":"https:\/\/www.attackdebris.com\/index.php?rest_route=\/wp\/v2\/posts\/451\/revisions"}],"predecessor-version":[{"id":589,"href":"https:\/\/www.attackdebris.com\/index.php?rest_route=\/wp\/v2\/posts\/451\/revisions\/589"}],"wp:attachment":[{"href":"https:\/\/www.attackdebris.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=451"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.attackdebris.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=451"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.attackdebris.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=451"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}