{"id":429,"date":"2014-11-03T15:17:31","date_gmt":"2014-11-03T20:17:31","guid":{"rendered":"http:\/\/adsecurity.org\/?p=429"},"modified":"2014-11-24T20:41:23","modified_gmt":"2014-11-25T01:41:23","slug":"powershell-for-pentesters","status":"publish","type":"post","link":"https:\/\/adsecurity.org\/?p=429","title":{"rendered":"PowerShell for Pentesters"},"content":{"rendered":"<p>PowerShell is extremely useful for admins. This power is also extremely useful for attackers.<\/p>\n<p>There are several PowerShell tools specifically for increasing access on a network:<\/p>\n<h3><a href=\"https:\/\/github.com\/mattifestation\/PowerSploit\"><strong>PowerSploit<\/strong><\/a><\/h3>\n<p><a href=\"https:\/\/github.com\/mattifestation\/PowerSploit\">PowerSploit <\/a>&#8211; PowerShell based pentest tool set developed by <a href=\"https:\/\/twitter.com\/mattifestation\">Mattifestation<\/a>.<\/p>\n<blockquote><p>PowerSploit is a collection of Microsoft PowerShell modules that can be used to aid reverse engineers, forensic analysts, and penetration testers during all phases of an assessment.<\/p><\/blockquote>\n<p>PowerSploit is comprised of the following major components:<\/p>\n<p>CodeExecution<br \/>\nScriptModification<br \/>\nPersistence<br \/>\nPETools<br \/>\nCapstone<br \/>\nReverseEngineering<br \/>\nAntivirusBypass<br \/>\nRecon<br \/>\nExfiltration<\/p>\n<p>The last one listed, Exfiltration, includes the following useful PowerShell pentest scripts.<\/p>\n<p>Invoke-TokenManipulation<br \/>\nInvoke-CredentialInjection<br \/>\nInvoke-Mimikatz<br \/>\nGet-GPPPassword<br \/>\nGet-VaultCredential<\/p>\n<p><!--more--><\/p>\n<h3><a href=\"https:\/\/github.com\/darkoperator\/Posh-SecMod\"><strong>Posh-SecModule<\/strong><\/a><\/h3>\n<p>The\u00a0<a href=\"https:\/\/github.com\/darkoperator\/Posh-SecMod\">Posh-SecModule <\/a>by <a href=\"https:\/\/twitter.com\/Carlos_Perez\">DarkOperator <\/a>includes lots of useful pentest PowerShell cmdlets.<\/p>\n<blockquote><p>This module is a PowerShell v3 only module at the moment. The module is a collection of functions that I have found usefull in my day to day work as a security professional. The functions are broken in to functionality:<\/p>\n<p>Discovery: Perform network discovery.<br \/>\nParse: Parsers for Nmap, DNSRecon and other type of output files from security tools.<br \/>\nPostExploitation: Functions to help in performing post exploitation tasks.<br \/>\nRegistry: Collection of functions for manipulating the registry in remote hosts using WMI.<br \/>\nNessus: Collection of assemblies and functions for automating the Nessus Vulnerability Scanner.<br \/>\nUtilities: General purpose functions.<br \/>\nAudit: Functions that may be usful when performing audit of systems.<br \/>\nDatabase: Functions that are useful when interacting with databases.<br \/>\nShodan: Functions for doing discovery using Shodan using a valid API key.<br \/>\nVirusTotal: Functions for Interacting with Virus Total using a valid API key.<br \/>\nMetasploit: Functions for automating Metasploit Framework and the comercial version using the XMLRPC API.<\/p><\/blockquote>\n<h3><a href=\"https:\/\/github.com\/samratashok\/nishang\">Nishang<\/a><\/h3>\n<p><a href=\"https:\/\/github.com\/samratashok\/nishang\">Nishang <\/a>is a suite of PowerShell pentest tools developed by <a href=\"https:\/\/twitter.com\/nikhil_mitt\">Nikhil &#8220;SamratAshok&#8221; Mittal<\/a>. He also blogs at:\u00a0 <a href=\"http:\/\/www.labofapenetrationtester.com\/\">http:\/\/www.labofapenetrationtester.com\/<\/a><\/p>\n<blockquote><p>Nishang is a framework and collection of scripts and payloads which enables usage of PowerShell for offensive security usage and during Penetraion Tests. Nishang is useful during various phases of a penetration test and is most powerful for post exploitation usage.<\/p><\/blockquote>\n<p><a href=\"https:\/\/github.com\/samratashok\/nishang\">Nishang<\/a> includes several very interesting (and useful PowerShell pentest scripts):<\/p>\n<ul>\n<li>HTTP-Backdoor<br \/>\nA backdoor which is capable to recieve instructions from third party websites and could execute powershell scripts in memory.<\/li>\n<li>DNS_TXT_Pwnage<br \/>\nA Backdoor which could recieve commands and powershell scripts from DNS TXT queries and execute those on target and could be controlled remotely using the queries.<\/li>\n<li>Execute-OnTime<br \/>\nA Backdoor which could execute powershell scripts on a given time on a target.<\/li>\n<li>Remove-Update<br \/>\nIntroduce vulnerabilites by removing patches.<\/li>\n<li>Download-Execute-PS<br \/>\nDownload and execute a powershell script in memory.<\/li>\n<li>Copy-VSS<br \/>\nCopy the SAM file using Volume Shadow Service.<\/li>\n<li>FireBuster FireListener<br \/>\nA pair of scripts for Egress Testing<\/li>\n<li>Get-LSASecret<br \/>\nGet LSA Secret from a target.<\/li>\n<li>Get-PassHashes<br \/>\nGet password hashes from a target.<\/li>\n<li>Get-WLAN-Keys<br \/>\nGet WLAN keys in plain from a target.<\/li>\n<li>Keylogger<br \/>\nLog keys from a target.<\/li>\n<li>Brute-Force<br \/>\nBrute force FTP, Active Directory, MS SQL Server and Sharepoint.<\/li>\n<li>Port-Scan<br \/>\nA handy port scanner.<\/li>\n<li>Add-Exfiltration<br \/>\nAdd data exfiltration capability to gmail,pastebin, webserver and DNS to any script.<\/li>\n<li>Add-Persistence<br \/>\nAdd Reboot persistence capability to a script.<\/li>\n<li>Remove-Persistence<br \/>\nRemoce persistence added by the Add-Persistence script.<\/li>\n<li>Do-Exfiltration<br \/>\nPipe (|) this to any script to exfiltrate the output.<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>PowerShell is extremely useful for admins. This power is also extremely useful for attackers. There are several PowerShell tools specifically for increasing access on a network: PowerSploit PowerSploit &#8211; PowerShell based pentest tool set developed by Mattifestation. PowerSploit is a collection of Microsoft PowerShell modules that can be used to aid reverse engineers, forensic analysts, &hellip; <\/p>\n<p><a class=\"more-link btn\" href=\"https:\/\/adsecurity.org\/?p=429\">Continue reading<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[11,7],"tags":[218,68],"class_list":["post-429","post","type-post","status-publish","format-standard","hentry","category-microsoft-security","category-powershell","tag-powershellforpentesters","tag-powershellhacking","item-wrap"],"_links":{"self":[{"href":"https:\/\/adsecurity.org\/index.php?rest_route=\/wp\/v2\/posts\/429","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/adsecurity.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/adsecurity.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/adsecurity.org\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/adsecurity.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=429"}],"version-history":[{"count":2,"href":"https:\/\/adsecurity.org\/index.php?rest_route=\/wp\/v2\/posts\/429\/revisions"}],"predecessor-version":[{"id":636,"href":"https:\/\/adsecurity.org\/index.php?rest_route=\/wp\/v2\/posts\/429\/revisions\/636"}],"wp:attachment":[{"href":"https:\/\/adsecurity.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=429"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/adsecurity.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=429"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/adsecurity.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=429"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}