{"id":210,"date":"2025-07-05T18:49:00","date_gmt":"2025-07-05T18:49:00","guid":{"rendered":"https:\/\/thecyberstaff.com\/?p=210"},"modified":"2025-12-28T19:42:57","modified_gmt":"2025-12-28T19:42:57","slug":"escape-hackthebox-lab","status":"publish","type":"post","link":"https:\/\/thecyberstaff.com\/?p=210","title":{"rendered":"Escape- Hackthebox lab"},"content":{"rendered":"\n<p class=\"has-text-align-center\">To start the assessment, I start with my nmap scans to check for open TCP and UDP ports.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"989\" height=\"899\" src=\"https:\/\/thecyberstaff.com\/wp-content\/uploads\/2025\/07\/Pasted-image-20250702111236.png\" alt=\"\" class=\"wp-image-453\" srcset=\"https:\/\/thecyberstaff.com\/wp-content\/uploads\/2025\/07\/Pasted-image-20250702111236.png 989w, https:\/\/thecyberstaff.com\/wp-content\/uploads\/2025\/07\/Pasted-image-20250702111236-300x273.png 300w, https:\/\/thecyberstaff.com\/wp-content\/uploads\/2025\/07\/Pasted-image-20250702111236-768x698.png 768w\" sizes=\"auto, (max-width: 989px) 100vw, 989px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"528\" height=\"218\" src=\"https:\/\/thecyberstaff.com\/wp-content\/uploads\/2025\/07\/Pasted-image-20250702111502.png\" alt=\"\" class=\"wp-image-454\" srcset=\"https:\/\/thecyberstaff.com\/wp-content\/uploads\/2025\/07\/Pasted-image-20250702111502.png 528w, https:\/\/thecyberstaff.com\/wp-content\/uploads\/2025\/07\/Pasted-image-20250702111502-300x124.png 300w\" sizes=\"auto, (max-width: 528px) 100vw, 528px\" \/><\/figure>\n\n\n\n<p class=\"has-text-align-center\">Looks like a domain controller with a SQL service. I use the tool smbclient to check for any smb share that look interesting.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"718\" height=\"250\" src=\"https:\/\/thecyberstaff.com\/wp-content\/uploads\/2025\/07\/Pasted-image-20250702111847.png\" alt=\"\" class=\"wp-image-455\" srcset=\"https:\/\/thecyberstaff.com\/wp-content\/uploads\/2025\/07\/Pasted-image-20250702111847.png 718w, https:\/\/thecyberstaff.com\/wp-content\/uploads\/2025\/07\/Pasted-image-20250702111847-300x104.png 300w\" sizes=\"auto, (max-width: 718px) 100vw, 718px\" \/><\/figure>\n\n\n\n<p class=\"has-text-align-center\">The share &#8220;Public&#8221; looks good so I connect to the share. There is a file called Procedures.pdf so I pull that down to my local attack box.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"261\" src=\"https:\/\/thecyberstaff.com\/wp-content\/uploads\/2025\/07\/Pasted-image-20250702112213-1024x261.png\" alt=\"\" class=\"wp-image-456\" srcset=\"https:\/\/thecyberstaff.com\/wp-content\/uploads\/2025\/07\/Pasted-image-20250702112213-1024x261.png 1024w, https:\/\/thecyberstaff.com\/wp-content\/uploads\/2025\/07\/Pasted-image-20250702112213-300x76.png 300w, https:\/\/thecyberstaff.com\/wp-content\/uploads\/2025\/07\/Pasted-image-20250702112213-768x196.png 768w, https:\/\/thecyberstaff.com\/wp-content\/uploads\/2025\/07\/Pasted-image-20250702112213.png 1092w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p class=\"has-text-align-center\">The file contains employee instructions for connecting to the SQL server and it also has a cleartext password for the &#8220;PublicUser&#8221; account.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"561\" src=\"https:\/\/thecyberstaff.com\/wp-content\/uploads\/2025\/07\/Pasted-image-20250702113019-1024x561.png\" alt=\"\" class=\"wp-image-458\" srcset=\"https:\/\/thecyberstaff.com\/wp-content\/uploads\/2025\/07\/Pasted-image-20250702113019-1024x561.png 1024w, https:\/\/thecyberstaff.com\/wp-content\/uploads\/2025\/07\/Pasted-image-20250702113019-300x164.png 300w, https:\/\/thecyberstaff.com\/wp-content\/uploads\/2025\/07\/Pasted-image-20250702113019-768x421.png 768w, https:\/\/thecyberstaff.com\/wp-content\/uploads\/2025\/07\/Pasted-image-20250702113019.png 1186w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p class=\"has-text-align-center\">I connect to the SQL server with the discovered account. It looks like the databases are all default with nothing interesting. <\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"616\" height=\"218\" src=\"https:\/\/thecyberstaff.com\/wp-content\/uploads\/2025\/07\/Pasted-image-20250705124355.png\" alt=\"\" class=\"wp-image-459\" srcset=\"https:\/\/thecyberstaff.com\/wp-content\/uploads\/2025\/07\/Pasted-image-20250705124355.png 616w, https:\/\/thecyberstaff.com\/wp-content\/uploads\/2025\/07\/Pasted-image-20250705124355-300x106.png 300w\" sizes=\"auto, (max-width: 616px) 100vw, 616px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"352\" height=\"170\" src=\"https:\/\/thecyberstaff.com\/wp-content\/uploads\/2025\/07\/Pasted-image-20250705130132.png\" alt=\"\" class=\"wp-image-460\" srcset=\"https:\/\/thecyberstaff.com\/wp-content\/uploads\/2025\/07\/Pasted-image-20250705130132.png 352w, https:\/\/thecyberstaff.com\/wp-content\/uploads\/2025\/07\/Pasted-image-20250705130132-300x145.png 300w\" sizes=\"auto, (max-width: 352px) 100vw, 352px\" \/><\/figure>\n\n\n\n<p class=\"has-text-align-center\">I decided to use the xp_dirtree function to read a fake share on my attack box. With this functionality, I can run Responder to see if I can capture a password hash. I successfully collect a NTLMv2 hash for the sql_svc user.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"577\" height=\"87\" src=\"https:\/\/thecyberstaff.com\/wp-content\/uploads\/2025\/07\/Pasted-image-20250705130358.png\" alt=\"\" class=\"wp-image-461\" srcset=\"https:\/\/thecyberstaff.com\/wp-content\/uploads\/2025\/07\/Pasted-image-20250705130358.png 577w, https:\/\/thecyberstaff.com\/wp-content\/uploads\/2025\/07\/Pasted-image-20250705130358-300x45.png 300w\" sizes=\"auto, (max-width: 577px) 100vw, 577px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"736\" height=\"152\" src=\"https:\/\/thecyberstaff.com\/wp-content\/uploads\/2025\/07\/Pasted-image-20250705130431.png\" alt=\"\" class=\"wp-image-462\" srcset=\"https:\/\/thecyberstaff.com\/wp-content\/uploads\/2025\/07\/Pasted-image-20250705130431.png 736w, https:\/\/thecyberstaff.com\/wp-content\/uploads\/2025\/07\/Pasted-image-20250705130431-300x62.png 300w\" sizes=\"auto, (max-width: 736px) 100vw, 736px\" \/><\/figure>\n\n\n\n<p class=\"has-text-align-center\">I take the password hash offline and crack it with the Hashcat tool reveling the plaintext password.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"504\" src=\"https:\/\/thecyberstaff.com\/wp-content\/uploads\/2025\/07\/Pasted-image-20250705131023-1024x504.png\" alt=\"\" class=\"wp-image-463\" srcset=\"https:\/\/thecyberstaff.com\/wp-content\/uploads\/2025\/07\/Pasted-image-20250705131023-1024x504.png 1024w, https:\/\/thecyberstaff.com\/wp-content\/uploads\/2025\/07\/Pasted-image-20250705131023-300x148.png 300w, https:\/\/thecyberstaff.com\/wp-content\/uploads\/2025\/07\/Pasted-image-20250705131023-768x378.png 768w, https:\/\/thecyberstaff.com\/wp-content\/uploads\/2025\/07\/Pasted-image-20250705131023.png 1084w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p class=\"has-text-align-center\">I am then able to log into the target machine with WinRM.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"208\" src=\"https:\/\/thecyberstaff.com\/wp-content\/uploads\/2025\/07\/Pasted-image-20250705131426-1024x208.png\" alt=\"\" class=\"wp-image-464\" srcset=\"https:\/\/thecyberstaff.com\/wp-content\/uploads\/2025\/07\/Pasted-image-20250705131426-1024x208.png 1024w, https:\/\/thecyberstaff.com\/wp-content\/uploads\/2025\/07\/Pasted-image-20250705131426-300x61.png 300w, https:\/\/thecyberstaff.com\/wp-content\/uploads\/2025\/07\/Pasted-image-20250705131426-768x156.png 768w, https:\/\/thecyberstaff.com\/wp-content\/uploads\/2025\/07\/Pasted-image-20250705131426.png 1042w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p class=\"has-text-align-center\">I found an interesting file in the C:\\SQLServer\\Logs directory and download it to my local attack box.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"521\" height=\"84\" src=\"https:\/\/thecyberstaff.com\/wp-content\/uploads\/2025\/07\/Pasted-image-20250705131618.png\" alt=\"\" class=\"wp-image-465\" srcset=\"https:\/\/thecyberstaff.com\/wp-content\/uploads\/2025\/07\/Pasted-image-20250705131618.png 521w, https:\/\/thecyberstaff.com\/wp-content\/uploads\/2025\/07\/Pasted-image-20250705131618-300x48.png 300w\" sizes=\"auto, (max-width: 521px) 100vw, 521px\" \/><\/figure>\n\n\n\n<p class=\"has-text-align-center\">The file hash a plaintext password for the user &#8220;ryan.cooper&#8221;, it looks like they entered the password in the username field on accident.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"896\" height=\"110\" src=\"https:\/\/thecyberstaff.com\/wp-content\/uploads\/2025\/07\/Pasted-image-20250705131932.png\" alt=\"\" class=\"wp-image-466\" srcset=\"https:\/\/thecyberstaff.com\/wp-content\/uploads\/2025\/07\/Pasted-image-20250705131932.png 896w, https:\/\/thecyberstaff.com\/wp-content\/uploads\/2025\/07\/Pasted-image-20250705131932-300x37.png 300w, https:\/\/thecyberstaff.com\/wp-content\/uploads\/2025\/07\/Pasted-image-20250705131932-768x94.png 768w\" sizes=\"auto, (max-width: 896px) 100vw, 896px\" \/><\/figure>\n\n\n\n<p class=\"has-text-align-center\">While enumerating Active Directory, I found an Active Directory Certificate Services vulnerability ESC1 on the certificate template &#8220;UserAuthentication&#8221;.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"902\" height=\"736\" src=\"https:\/\/thecyberstaff.com\/wp-content\/uploads\/2025\/07\/Pasted-image-20250705132434.png\" alt=\"\" class=\"wp-image-467\" srcset=\"https:\/\/thecyberstaff.com\/wp-content\/uploads\/2025\/07\/Pasted-image-20250705132434.png 902w, https:\/\/thecyberstaff.com\/wp-content\/uploads\/2025\/07\/Pasted-image-20250705132434-300x245.png 300w, https:\/\/thecyberstaff.com\/wp-content\/uploads\/2025\/07\/Pasted-image-20250705132434-768x627.png 768w\" sizes=\"auto, (max-width: 902px) 100vw, 902px\" \/><\/figure>\n\n\n\n<p class=\"has-text-align-center\">I use the tool certipy-ad to request a certificate and obtain a .pfx file to use to authenticate to the certificate server with.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"175\" src=\"https:\/\/thecyberstaff.com\/wp-content\/uploads\/2025\/07\/Pasted-image-20250705133249-1024x175.png\" alt=\"\" class=\"wp-image-468\" srcset=\"https:\/\/thecyberstaff.com\/wp-content\/uploads\/2025\/07\/Pasted-image-20250705133249-1024x175.png 1024w, https:\/\/thecyberstaff.com\/wp-content\/uploads\/2025\/07\/Pasted-image-20250705133249-300x51.png 300w, https:\/\/thecyberstaff.com\/wp-content\/uploads\/2025\/07\/Pasted-image-20250705133249-768x131.png 768w, https:\/\/thecyberstaff.com\/wp-content\/uploads\/2025\/07\/Pasted-image-20250705133249.png 1390w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p class=\"has-text-align-center\">I ran into an issue where the clock on my local attack box was too far off from the clock on the target machine.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"885\" height=\"189\" src=\"https:\/\/thecyberstaff.com\/wp-content\/uploads\/2025\/07\/Pasted-image-20250705133547.png\" alt=\"\" class=\"wp-image-472\" srcset=\"https:\/\/thecyberstaff.com\/wp-content\/uploads\/2025\/07\/Pasted-image-20250705133547.png 885w, https:\/\/thecyberstaff.com\/wp-content\/uploads\/2025\/07\/Pasted-image-20250705133547-300x64.png 300w, https:\/\/thecyberstaff.com\/wp-content\/uploads\/2025\/07\/Pasted-image-20250705133547-768x164.png 768w\" sizes=\"auto, (max-width: 885px) 100vw, 885px\" \/><\/figure>\n\n\n\n<p class=\"has-text-align-center\">I used the &#8220;ntpdate&#8221; tool to resolve this.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"699\" height=\"83\" src=\"https:\/\/thecyberstaff.com\/wp-content\/uploads\/2025\/07\/Pasted-image-20250705133614-1.png\" alt=\"\" class=\"wp-image-471\" srcset=\"https:\/\/thecyberstaff.com\/wp-content\/uploads\/2025\/07\/Pasted-image-20250705133614-1.png 699w, https:\/\/thecyberstaff.com\/wp-content\/uploads\/2025\/07\/Pasted-image-20250705133614-1-300x36.png 300w\" sizes=\"auto, (max-width: 699px) 100vw, 699px\" \/><\/figure>\n\n\n\n<p class=\"has-text-align-center\">Then I was able to authenticate and grab the password hash for the &#8220;Administrator&#8221; account.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"896\" height=\"223\" src=\"https:\/\/thecyberstaff.com\/wp-content\/uploads\/2025\/07\/Pasted-image-20250705133632.png\" alt=\"\" class=\"wp-image-473\" srcset=\"https:\/\/thecyberstaff.com\/wp-content\/uploads\/2025\/07\/Pasted-image-20250705133632.png 896w, https:\/\/thecyberstaff.com\/wp-content\/uploads\/2025\/07\/Pasted-image-20250705133632-300x75.png 300w, https:\/\/thecyberstaff.com\/wp-content\/uploads\/2025\/07\/Pasted-image-20250705133632-768x191.png 768w\" sizes=\"auto, (max-width: 896px) 100vw, 896px\" \/><\/figure>\n\n\n\n<p class=\"has-text-align-center\">I passed the hash with WinRM and was able to log in as &#8220;Administrator&#8221; fully compromising the box.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"208\" src=\"https:\/\/thecyberstaff.com\/wp-content\/uploads\/2025\/07\/Pasted-image-20250705133841-1024x208.png\" alt=\"\" class=\"wp-image-474\" srcset=\"https:\/\/thecyberstaff.com\/wp-content\/uploads\/2025\/07\/Pasted-image-20250705133841-1024x208.png 1024w, https:\/\/thecyberstaff.com\/wp-content\/uploads\/2025\/07\/Pasted-image-20250705133841-300x61.png 300w, https:\/\/thecyberstaff.com\/wp-content\/uploads\/2025\/07\/Pasted-image-20250705133841-768x156.png 768w, https:\/\/thecyberstaff.com\/wp-content\/uploads\/2025\/07\/Pasted-image-20250705133841.png 1061w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p class=\"has-text-align-center\">This box shows the importance of keeping passwords protected and making sure services like Active Directory Certificate Services are properly implemented and hardened to protect against cyber threats.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>To start the assessment, I start with my nmap scans to check for open TCP and UDP ports. Looks like a domain controller with a SQL service. I use the tool smbclient to check for any smb share that look interesting. The share &#8220;Public&#8221; looks good so I connect to [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":212,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3,4],"tags":[],"class_list":["post-210","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-cybersecurity","category-pentesting"],"brizy_media":[],"_links":{"self":[{"href":"https:\/\/thecyberstaff.com\/index.php?rest_route=\/wp\/v2\/posts\/210","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/thecyberstaff.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/thecyberstaff.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/thecyberstaff.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/thecyberstaff.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=210"}],"version-history":[{"count":2,"href":"https:\/\/thecyberstaff.com\/index.php?rest_route=\/wp\/v2\/posts\/210\/revisions"}],"predecessor-version":[{"id":475,"href":"https:\/\/thecyberstaff.com\/index.php?rest_route=\/wp\/v2\/posts\/210\/revisions\/475"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/thecyberstaff.com\/index.php?rest_route=\/wp\/v2\/media\/212"}],"wp:attachment":[{"href":"https:\/\/thecyberstaff.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=210"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/thecyberstaff.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=210"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/thecyberstaff.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=210"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}