{"id":13839882,"url":"https://github.com/Viralmaniar/HiveJack","last_synced_at":"2025-07-11T07:31:14.955Z","repository":{"id":54823403,"uuid":"256955517","full_name":"Viralmaniar/HiveJack","owner":"Viralmaniar","description":"This tool can be used during internal penetration testing to dump Windows credentials from an already-compromised host. It allows one to dump SYSTEM, SECURITY and SAM hives and once copied to the attacker machines provides option to delete these files to clear the trace.","archived":false,"fork":false,"pushed_at":"2020-04-24T12:12:05.000Z","size":2334,"stargazers_count":107,"open_issues_count":1,"forks_count":33,"subscribers_count":9,"default_branch":"master","last_synced_at":"2024-11-19T11:08:51.500Z","etag":null,"topics":["infrastructure-pentest","intenalpentest","internal-pentest","lateral-movement","pentest-tool","pentesting","reghives","samdump","secretdump","system-hives"],"latest_commit_sha":null,"homepage":null,"language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Viralmaniar.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-04-19T08:59:00.000Z","updated_at":"2024-11-06T11:55:08.000Z","dependencies_parsed_at":"2022-08-14T04:00:18.958Z","dependency_job_id":null,"html_url":"https://github.com/Viralmaniar/HiveJack","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Viralmaniar%2FHiveJack","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Viralmaniar%2FHiveJack/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Viralmaniar%2FHiveJack/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Viralmaniar%2FHiveJack/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Viralmaniar","download_url":"https://codeload.github.com/Viralmaniar/HiveJack/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225705046,"owners_count":17511214,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["infrastructure-pentest","intenalpentest","internal-pentest","lateral-movement","pentest-tool","pentesting","reghives","samdump","secretdump","system-hives"],"created_at":"2024-08-04T17:00:37.219Z","updated_at":"2024-11-21T09:30:32.914Z","avatar_url":"https://github.com/Viralmaniar.png","language":"C#","funding_links":[],"categories":["C# #","C# (212)"],"sub_categories":[],"readme":"# HiveJack\nThis tool can be used during internal penetration testing to dump Windows credentials from an already-compromised host. It allows one to dump SYSTEM, SECURITY and SAM registry hives and once copied to the attacker machines provides an option to delete these files to clear the trace.\n\nOften, this is a repetitive process, once an attacker gets system-level access on the compromised host dumping hives values is the next step. Time is very valuable when it comes to internal penetration testing. **HiveJack** will save you plenty of time when it comes to dumping and deleting the files. You'll never have to remember the command to perform the actions. ;)\n\n![image](https://user-images.githubusercontent.com/3501170/79689138-2d9a1780-8296-11ea-9d7f-35a02ad7e41d.png)\n\nFiles dumped in the *c:\\\\temp\\\\* folder of the compromised host:\n\n![image](https://user-images.githubusercontent.com/3501170/80096475-f769da00-85ac-11ea-99e1-e47dff224b4a.png)\n\nFiles are successfully deleted from the compromised host upon clicking on the **Delete Hives** button:\n\n![image](https://user-images.githubusercontent.com/3501170/80096814-8aa30f80-85ad-11ea-9c1a-1559348c9f69.png)\n\nAny suggestions or ideas for this tool are welcome - just tweet me on [@ManiarViral](https://twitter.com/maniarviral)\n\nA hive is a logical group of keys, subkeys, and values in the registry that has a set of supporting files loaded into memory when the operating system is started or a user logs in.\n\nRegistry files have the following two formats:\n  - Standard format: Supported from Windows 2000, also supported in the later versions of the Windows for backward compatibility\n  - Latest format: Supported starting with Windows XP\n  \n**HKEY_CURRENT_USER, HKEY_LOCAL_MACHINE\\SAM, HKEY_LOCAL_MACHINE\\Security, and HKEY_USERS\\.DEFAULT;** all other hives use the latest format.\n\nDuring an internal penetration test, the attacker often wants to perform a lateral movement from one host to the other. To move from one host to the other attacker often requires account credentials. Using **HiveJack** attacker would be able to gather credentials via system hives.\n\n**HiveJack** is useful once the attacker has successfully gained local admin or system privileges on one of the compromised hosts. To further gain access within the network attacker can use registry hives. Dumping these hives would allow an attacker to capture system users' password hashes. \n\nUpon dumping the registry hives and pulling it on the attacking box one can use a tool such as **secretsdump** available here: https://github.com/SecureAuthCorp/impacket/blob/master/examples/secretsdump.py\n\n![image](https://user-images.githubusercontent.com/3501170/80098042-9394e080-85af-11ea-8a73-16a28cdff124.png)\n\nOnce the password hashes are obtained it opens the doors to a variety of attacks such as pass-the-hash, spraying or password cracking to perform a lateral movement within the network.\n\nWhen hive files are copied to the attacking machine it is a good practice to delete the files from the *temp* folder to avoid leaking of sensitive files or cleaning the traces.\n\n# Quick Tip\n\nIt is a good practice to check the *C:\\\\Windows\\\\repair\\\\* location to obtain the SAM and SYSTEM files to avoid detection from EDR solutions. However, this directory contains outdated copies of the original *C:\\\\Windows\\\\System32\\\\config\\\\* files so it might not reflect the current users' credentials. However, if the passwords are cracked it may be useful to know any password patterns such as **Winter2020** or **Summer2020**\n\n# How do I use this?\n\n**Method 1:** \u003cbr\u003e\nUse a HiveJack.exe file from the release section (https://github.com/Viralmaniar/HiveJack/releases/download/v1.0/HiveJack.exe) and run it on the compromised host. The hives will get stored at the *c:\\\\temp\\\\* folder.\n\n**Method 2:** \u003cbr\u003e\nOpen the solution using **Visual Studio** and look at the code to build the solution.\n\n\n**Note:** Please make sure you have a *temp* folder in the 'C:' Drive of the compromised host before dumping the registry hives.\n\n# Questions?\n\nTwitter: https://twitter.com/maniarviral \u003cbr\u003e\nLinkedIn: https://au.linkedin.com/in/viralmaniar\n\n# Contribution \u0026 License\n\nMIT License\n\nCopyright (c) 2020 Viral Maniar\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n\nAny suggestions or ideas for this tool are welcome - just tweet me on [@ManiarViral](https://twitter.com/maniarviral) [@PreemptiveCyber](https://twitter.com/PreemptiveCyber)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FViralmaniar%2FHiveJack","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FViralmaniar%2FHiveJack","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FViralmaniar%2FHiveJack/lists"}