The challenge presented to me at the start of this chapter was to be able to create a secure tunnel to transfer our evidence offsite, while making sure we could get around any potential security devices. I also needed a way to get back into the environment from my C&C server without having the company create associated firewall access control rules and NAT rules.
Utilizing stunnel and reverse ssh, I was able to accomplish this. stunnel allowed me to have a SSL tunnel from the internal server to my external C&C server. The SSL tunnel is key since most firewalls will allow outbound SSL and most IPS setups will not decrypt the payload, and therefore it will go through without being inspected. The reverse ssh tunnel allowed the C&C server to piggyback off the already established ssh connection that originated from the inside server. Automating this allowed the...