<?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>TAZ: TheTAZZone Network &#187; honeypots</title>
	<atom:link href="http://www.thetazzone.com/category/security-tutorials/honeypots/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.thetazzone.com</link>
	<description>Welcome to Internet Chaos: 960+ Games; Security, Networking, and General Tutorials; IRC Chat; and an Active Forum Community</description>
	<lastBuildDate>Sun, 22 Nov 2009 02:06:42 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Tutorial &#8211; SMTP Relay Honeypot</title>
		<link>http://www.thetazzone.com/tutorial-smtp-relay-honeypot/</link>
		<comments>http://www.thetazzone.com/tutorial-smtp-relay-honeypot/#comments</comments>
		<pubDate>Mon, 23 Mar 2009 21:51:22 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[honeypots]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[tutorials]]></category>

		<guid isPermaLink="false">http://www.thetazzone.com/?p=685</guid>
		<description><![CDATA[ORIGINALLY POSTED BY NOKIA FOR THETAZZONE/TAZFORUM HERE
Do not use, republish, in whole or in part, without the consent of the Author. TheTAZZone policy is that Authors retain the rights to the work they submit and/or post…we do not sell, publish, transmit, or have the right to give permission for such…TheTAZZone merely retains the right to [...]]]></description>
			<content:encoded><![CDATA[<p>ORIGINALLY POSTED BY NOKIA FOR THETAZZONE/TAZFORUM <a href="http://tazforum.thetazzone.com/viewtopic.php?f=28&amp;t=719">HERE</a></p>
<p>Do not use, republish, in whole or in part, without the consent of the Author. TheTAZZone policy is that Authors retain the rights to the work they submit and/or post…we do not sell, publish, transmit, or have the right to give permission for such…TheTAZZone merely retains the right to use, retain, and publish submitted work within it’s Network</p>
<dl class="codebox">
<dt>Code: <a onclick="selectCode(this); return false;" href="http://tazforum.thetazzone.com/viewtopic.php?f=28&amp;t=719#">Select all</a></dt>
<dd><code>Soda_Popinsky has very kindly allowed this tutorial of his to be hosted on the TAZ.</code></p>
</dd>
</dl>
<p><span style="text-decoration: underline;"><span style="font-weight: bold;">SMTP Relay Honeypot Tutorial</span></span><br />
By Soda_Popinsky</p>
<p>Overview:</p>
<p>This tutorial details the use of the Jackpot Mailswerver located here:<br />
<a class="postlink" href="http://jackpot.uk.net/">http://jackpot.uk.net/</a></p>
<p>A honeypot is, to quote Lance Spitzner founder of the Honeynet Project:</p>
<p>“Information system resource whose value lies in unauthorized or illicit use of that resource.”</p>
<p>Simply put, a honeypot is something that appears to be vulnerable, but in reality is recording illicit use by malicious attackers. I believe that most of the lure in honeypot technology lies in the sense of control it provides the owner. Network security is about avoidance, prevention, and mitigation, except where honeypots are involved. My interest in honeypots comes from a honeypots aggressive nature. A honeypot enables you to push back.</p>
<p>Jackpot is a “ready-to-run SMTP relay honeypot, written in pure Java”. With a tool like Jackpot, one can fight back against spammers with accurately logged complaints. The Jackpot website lists organizations you can go to with these complaints:</p>
<p><a class="postlink" href="http://www.abuse.net/">http://www.abuse.net/</a><br />
<a class="postlink" href="http://www.spamhaus.org/index.lasso">http://www.spamhaus.org/index.lasso</a><br />
<a class="postlink" href="http://www.euro.cauce.org/en/">http://www.euro.cauce.org/en/</a><br />
<a class="postlink" href="http://www.cauce.org/">http://www.cauce.org/</a><br />
<a class="postlink" href="http://spam.abuse.net/">http://spam.abuse.net/</a><br />
<a class="postlink" href="http://www.spamhelp.org/">http://www.spamhelp.org/</a></p>
<p>Installation:</p>
<p>Find the download link here:<br />
<a class="postlink" href="http://jackpot.uk.net/">http://jackpot.uk.net</a></p>
<p>Unzip the file, and open the folder. Configuration is our first priority. Open jackpot.properties in a text editor. These fields are the most important:</p>
<p>ServerHeader: Change this to a fake server header (Jackpot by default is a dead giveaway, we’ll discuss later)<br />
SmtpAddress: Specify the IP that jackpot will “serve” on.<br />
HtmlPath: Change this to a folder name that you will remember<br />
RoleAccountAlias: Specify the email address that postmaster email will go to<br />
AdminUser: User ID for web admin<br />
AdminPassword: User Pass for web admin<br />
HttpPort: Change this to a port number you will access the web interface from. If left default, it could be a giveaway.<br />
ServerName: Change this so your machine name isn’t revealed to a HELO command.</p>
<p>Review the other fields, you may need to tweak depending on your situation or configuration.</p>
<p>Here is the configuration file I am using:</p>
<blockquote class="uncited">
<div>#This entry specifies the value retuned in the &#8220;Server: &#8221; HTTP header returned<br />
#by Jackpot. By default, Jackpot claims to be &#8220;Jackpot&#8221; (with the current version number).<br />
ServerHeader= Current Industries v 1.3</p>
<p>#IP Address where SMTP will be served, if your host is multi-homed. If the host is<br />
#multi-homed, and this entry is missing or blank, SMTP will be served on all addresses.<br />
SmtpAddress=</p>
<p>#Specifies a virtual path for HTML. This defaults to &#8220;html&#8221;, i.e.<br />
#the root hosts page is <!-- m --><a class="postlink" href="http:///">http://</a><!-- m -->&lt;jackpot&gt;:&lt;port&gt;/html/hosts.html.<br />
#If you set this value to &#8220;xyzzy&#8221;, then HTTP requests must be of the<br />
#form <!-- m --><a class="postlink" href="http:///">http://</a><!-- m -->&lt;jackpot&gt;:&lt;port&gt;/xyzzy/something.html, otherwise they<br />
#will elicit a 404. This is supposed to make it easier for Jackpot to be<br />
#stealthy.<br />
HtmlPath=jacklog</p>
<p>#Specifies an email address to which all mail to postmaster@[jackpot] or<br />
#abuse@[jackpot] is to be forwarded.<br />
RoleAccountAlias=SodaP@yahoo.com</p>
<p>#UserID for access to web-admin.<br />
AdminUser=honeypot</p>
<p>#Password for access to Web-admin<br />
AdminPassword=jackpotpassword</p>
<p>##################################################<br />
##############<br />
#The next section contains stuff you might customise to make<br />
#this Jackpot look different from other Jackpots. If you want to<br />
#customise these entries, telnet to a real mailserver and<br />
#see how *it* behaves.<br />
##################################################<br />
##############</p>
<p>#Port for serving HTTP; it would be a good idea to change this, because the<br />
#Jackpot server could be fingerprinted by finding it&#8217;s HTTP server.<br />
HttpPort=8081</p>
<p>#This entry specifies the response sent to (all) VRFY requests.<br />
VrfyResponse=250 User not recognized</p>
<p>#This entry specifies the response to (all) EXPN requests.<br />
ExpnResponse=502 Command is disabled</p>
<p>#This entry specifies the response to (all) TURN requests.<br />
TurnResponse=502 Command not implemented</p>
<p>#Specifies the 503 message<br />
BadSequenceResponse=Bad sequence of commands</p>
<p>#This entry specifies the response to a DATA request.<br />
DataResponse=Enter mail, end with \&#8221;.\&#8221; on a line by itself</p>
<p>#This entry specifies the response to a connection request when no threads are<br />
#available in ther SMTP pool.<br />
DiskFullResponse=Disk full</p>
<p>#Controls whether Jackpot adds a Received: header. Defaults to yes. If it doesn&#8217;t,<br />
#it&#8217;s a badly-broken relay.<br />
AddReceivedHeader=yes</p>
<p>#Controls whether any Received: header should show the sending host and address.<br />
#If not, then the received header will show only the return path from the HELO (which<br />
#a spammer would normally be forge). If this is No, Jackpot acts as a blind relay.<br />
ShowReceivedHost=no</p>
<p>#This entry specifies the name of the mail server, as output in the banner.<br />
#There are some (commented out) examples below from real mail-servers.<br />
#MTADescription=Jackpot MailSwerver Version 1.0.0<br />
MTADescription=ESMTP Sendmail V8</p>
<p>#This entry specifies the name of this machine, used in the response to HELO/EHLO,<br />
#in any Received: header added by Jackpot to relayed messages,<br />
#and to construct a postmaster address. Defaults to the name of your localhost<br />
#(best setting).<br />
ServerName=EVER-12E5oP</p>
<p>##################################################<br />
##############<br />
#This section contains stuff related to logging and so on -<br />
#general system control.<br />
##################################################<br />
##############</p>
<p>#If set to Yes, bounce-messages will be sent for unaliased addresses in this<br />
#(Jackpot&#8217;s) domain, and whenever a recipient&#8217;s mailhosts cannot be contacted.<br />
#Default is no.<br />
SendBounceMessages=no</p>
<p>#This entry specifies the maximum number of recipients in a message-envelope before it is<br />
#rejected as spam. If you find you are getting relay-requests with multiple recipients,<br />
#consider raising it.<br />
MaxRecipients=1</p>
<p>#Extra time taken to respond to commands when in a spamrun.<br />
#This is applied to every line entered in a HELO dioalog; the default is 1s. This<br />
#is enough to make a HTML message from Outlook Express take almost a minute to enter.<br />
TarpitDelay=3000</p>
<p>#The amount of time considered &#8216;too soon&#8217; for the purposes of determining if a<br />
#message should be relayed. Messages submitted via SMTP may also be subject to<br />
#tarpitting if they arrive &#8216;too soon&#8217;. Default is 20s.<br />
MinSpamInterval=20000</p>
<p>#This entry specifies the location for log output.<br />
logfile=jackpot.log</p>
<p>#This entry controls the size of the ThreadPool. Jackpot will<br />
#politely decline protocol activities on ports 25 and [HTTP-port]<br />
#once the number of free threads falls below 5.<br />
MaxThreads = 50</p>
<p>#Specifies the nameserver to use. If not provided, uses the system default.<br />
#Doesn&#8217;t seem to affect anything much.<br />
#NameServer=</p>
<p>#Specifies the (comma-delimited)names:ports of the HTTP servers to be updated<br />
when SMTP traffic is captured.<br />
LogServers=127.0.0.1</p>
<p>#Determines whether an Ident service should be offered to abuse.net<br />
#(speeds up enquiries).<br />
IdentForAbuse=yes</p>
<p>#Specifies what kinds of message get output to the system logs. This is a<br />
#bit-set, the values are as follows:<br />
# SMTP = 1;<br />
# HTTP = 2;<br />
# RELAY = 4;<br />
# STATUS = 8;<br />
# PROXY = 16;<br />
# ENVE = 32;<br />
# CONFIG = 64;<br />
# DEBUG = 128;<br />
FileLogging=255<br />
ConsoleLogging=31</p>
<p>#Specifies a limit on the number of spams that should be stored for<br />
#each spam-source.<br />
MaxStoragePerSource=100</p>
<p>##################################################<br />
##############<br />
#This section specifies timouts for socket-connections used for<br />
#several different purposes. Times are in milliseconds.<br />
##################################################<br />
##############<br />
#How long to wait for proxy-test results<br />
ProxyCheckTimeout=3000</p>
<p>#How long to wait for abuse.net lookups<br />
AbuseLookupTimeout=3000</p>
<p>#How long to wait for SBL lookups<br />
SBLLookupTimeout=2000</p>
<p>##################################################<br />
##############<br />
#This section controls what is running, and how, at system<br />
#startup.<br />
##################################################<br />
##############</p>
<p>#Whether to start the HTTP service.<br />
StartupHttp=yes</p>
<p>#Whether to start the SMTP service<br />
StartupSmtp=yes</p>
<p>#Whether to start up with relaying enabled<br />
StartupRelay=no</p>
<p>#Whether to start up with tarpitting enabled<br />
StartupTarpit=yes</p>
<p>#Whether to start up with POSTing to storage enabled<br />
StartupStorage=yes</p>
<p>#Whether to start up with the SOCKSV4 Proxy Server running<br />
StartupProxy=no</p>
<p>##################################################<br />
##############<br />
#The last section contains stuff you are unlikely to need to<br />
#change, at least for now.<br />
##################################################<br />
##############</p>
<p>#Port for serving SMTP; if you change this, you&#8217;ll probably be the only<br />
#person who ever sends mail to your Jackpot server.<br />
SmtpPort=25</p>
<p>#This entry restricts the maximum number of messages that can be queued at any one time.<br />
#The queue is in memory, and Spammy will have to send relay-requests on multiple<br />
#connections simultaneously to have a chance of filling it up.<br />
MaxQueueSize=100</p></div>
</blockquote>
<p>To start the honeypot, run jackpot.bat in the console. You will see it begin the “Mailswerver” daemon, as well as it’s web services.</p>
<blockquote class="uncited">
<div>C:\Documents and Settings\Soda\Desktop\jackpot-1.2.2&gt;jackpot.bat<br />
C:\Documents and Settings\Soda\Desktop\jackpot-1.2.2&gt;java -Xss32k -Xmx24M -classpath ./classes;dnsjava-1.2.4.jar;jackpot.jar net.jackpot.Jackpot<br />
05/02/04 19:25:06 GMT STATUS Jackpot Mailswerver version 1.2.2<br />
05/02/04 19:25:15 GMT STATUS Started SMTP for your.ip.address<br />
05/02/04 19:25:15 GMT STATUS Serving SMTP on port 25 for your.ip.address<br />
05/02/04 19:25:15 GMT STATUS Serving HTTP on port 8081<br />
05/02/04 19:25:15 GMT STATUS Jackpot version 1.2.1 is available at jackpot.uk.net<br />
05/02/04 19:25:34 GMT SMTP attack.ip.address your.ip.address HELO<br />
05/02/04 19:25:59 GMT SMTP attack.ip.address your.ip.address HELO</div>
</blockquote>
<p>You&#8217;ll notice the last 2 lines in the console, they don&#8217;t appear when you start jackpot. Those are captured attacks, and will appear as they arrive.</p>
<p>Logging:</p>
<p>Logging is done in the file jackpot.log. The second column containing ENVE will contain communication with your honeypot.</p>
<p>Sample snippet from my log (notice the telnet-ish behavior of the attacker)</p>
<blockquote class="uncited">
<div>05/02/04 08:02:32 GMT ENVE AttackerIP MyIP 250 none-e8alt64jnu<br />
05/02/04 08:02:56 GMT ENVE AttackerIP MyIP MAIL FROM: <!-- e --><a href="mailto:asdf@ASDF.com">asdf@ASDF.com</a><!-- e --><br />
05/02/04 08:02:59 GMT ENVE AttackerIP MyIP 250 Sender <!-- e --><a href="mailto:asdf@ASDF.com">asdf@ASDF.com</a><!-- e --> OK<br />
05/02/04 08:03:16 GMT ENVE AttackerIP MyIP RCPT TP O: M&lt;AIL@OTHER&gt;COM<br />
05/02/04 08:03:19 GMT ENVE AttackerIP MyIP 500 Command garbled<br />
05/02/04 08:03:38 GMT ENVE AttackerIP MyIP RCPT TPOL: MAIL @ OTHER&gt;COM.<br />
05/02/04 08:03:41 GMT ENVE AttackerIP MyIP 500 Command garbled<br />
05/02/04 08:03:53 GMT ENVE AttackerIP MyIP RCPT TO: <!-- e --><a href="mailto:MAIL@other.com">MAIL@other.com</a><!-- e --><br />
05/02/04 08:03:56 GMT ENVE AttackerIP MyIP 250 Recipient <!-- e --><a href="mailto:MAIL@other.com">MAIL@other.com</a><!-- e --> OK<br />
05/02/04 08:04:06 GMT ENVE AttackerIP MyIP DATA</div>
</blockquote>
<p>Jackpot also has a web interface, which we configured earlier. Visit</p>
<p><!-- m --><a class="postlink" href="http://localhost/">http://localhost</a></p>
<p><!-- m -->:[HttpPort]/[HtmlPath]/home.html for your interface. Fill in the fields with the ones defined in your config file.</p>
<p>The logging interface is very simple, you just click on a host and view the spam attempts they made on your server, including the data that was attempted to be sent, and other useful info for a complaint.</p>
<p>Admin:</p>
<p>Your username and password were defined in the config file earlier. Very simple interface for a very simple honeypot. It’s very self explanatory, except for the tarpit feature. That number forces a delay between commands, slowing the spammer down.</p>
<p>Conclusion:</p>
<p>Jackpot is hardly an industrial strength honeypot, but it’s good enough to be very useful. I don’t expect anyone will use this tutorial on a production environment, but just be aware that Honeypots introduce a security risk into an environment. So if you know what you are doing, go for it.<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-</p>
<p>I have no idea how old the Jackpot software is because it isn&#8217;t shown anywhere on the site. I was able to use it just fine.</p>
<p>I will have another tutorial coming out on Valentines Day, hopefully. It’s describes new breed of honeypot that you should all enjoy</p>


<!-- Begin TwitThis script (http://twitthis.com/) -->
<div style="text-align:left;">
<script type="text/javascript" src="http://s3.chuug.com/chuug.twitthis.scripts/twitthis.js"></script>
<script type="text/javascript">
<!--
document.write('<a href="javascript:;" onclick="TwitThis.pop();"><img src="http://s3.chuug.com/chuug.twitthis.resources/twitthis_grey_72x22.gif" alt="TwitThis" style="border:none;" /></a>');
//-->
</script>
</div>
<!-- /End -->

]]></content:encoded>
			<wfw:commentRss>http://www.thetazzone.com/tutorial-smtp-relay-honeypot/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tutorial &#8211; Custom Web Based Honeypots with GHH</title>
		<link>http://www.thetazzone.com/tutorial-custom-web-based-honeypots-with-ghh/</link>
		<comments>http://www.thetazzone.com/tutorial-custom-web-based-honeypots-with-ghh/#comments</comments>
		<pubDate>Sun, 15 Mar 2009 21:42:21 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[honeypots]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[tutorials]]></category>

		<guid isPermaLink="false">http://www.thetazzone.com/?p=679</guid>
		<description><![CDATA[ORIGINALLY POSTED BY NOKIA FOR THETAZZONE/TAZFORUM HERE
Do not use, republish, in whole or in part, without the consent of the Author. TheTAZZone policy is that Authors retain the rights to the work they submit and/or post…we do not sell, publish, transmit, or have the right to give permission for such…TheTAZZone merely retains the right to [...]]]></description>
			<content:encoded><![CDATA[<p>ORIGINALLY POSTED BY NOKIA FOR THETAZZONE/TAZFORUM <a href="http://tazforum.thetazzone.com/viewtopic.php?f=28&amp;t=714">HERE</a></p>
<p>Do not use, republish, in whole or in part, without the consent of the Author. TheTAZZone policy is that Authors retain the rights to the work they submit and/or post…we do not sell, publish, transmit, or have the right to give permission for such…TheTAZZone merely retains the right to use, retain, and publish submitted work within it’s Network</p>
<dl class="codebox">
<dt>Code: <a onclick="selectCode(this); return false;" href="http://tazforum.thetazzone.com/viewtopic.php?f=28&amp;t=714#">Select all</a></dt>
<dd><code>Soda_Popinsky has very kindly allowed this tutorial of his to be hosted on the TAZ.</code></p>
</dd>
</dl>
<p><span style="text-decoration: underline;"><span style="font-weight: bold;">Custom Web Based Honeypots with GHH</span></span><br />
by Soda_Popinsky</p>
<p>Links<br />
<a class="postlink" href="http://ghh.sourceforge.net/">http://ghh.sourceforge.net</a><br />
<a class="postlink" href="https://sourceforge.net/projects/ghh/">https://sourceforge.net/projects/ghh/</a></p>
<p>GHDB operated by johnny.ihackstuff.com</p>
<p>Overview</p>
<p>What is GHH?<br />
GHH is the reaction to a new type of malicious web traffic: search engine hackers. GHH is a “Google Hack” honeypot. It is designed to provide reconaissance against attackers that use search engines as a hacking tool against your resources. GHH implements honeypot theory to provide additional security to your web presence.</p>
<p>What is a honeypot?<br />
A honeypot is, to quote Lance Spitzner founder of the Honeynet Project:</p>
<p>“An information system resource whose value lies in unauthorized or illicit use of that resource.”</p>
<p>Simply put a honeypot is something that appears to be vulnerable, but in reality is recording illicit use by malicious attackers.</p>
<p>GHH allows administrators to track malicious hosts, observe who is perpetrating the attack and how it is being executed via the log. The data generated by this, or any other honeypot can be used to deny future access to attackers, notify service providers of attacks originating from their networks or act as an input for statistical analysis.</p>
<p>What are search engine hackers and why should I care?<br />
Google has developed a powerful tool. The search engine that Google has implemented allows for searching on an immense amount of information. The Google index has swelled past 8 billion pages [February 2005] and continues to grow daily. Mirroring the growth of the Google index, the spread of web-based applications such as message boards and remote administrative tools has resulted in an increase in the number of misconfigured and vulnerable web apps available on the Internet.</p>
<p>These insecure tools, when combined with the power of a search engine and index which Google provides, results in a convenient attack vector for malicious users. It is in your best interest to be knowledgable of, and protect yourself from this threat.</p>
<p>This threat is amplified by tools like Foundstone&#8217;s Sitedigger, and Wikto, which automate this technique.</p>
<p>Building the Honeypot</p>
<p>(it&#8217;s recommended you have used or are familiar with how the pre-built honeypots work, as well as an existing knowledge of PHP)</p>
<p>At the GHH project page, you will find several pre-built honeypots. They may contain a certain file structure, but basically, they all have at least this minimum:</p>
<p>3 files</p>
<p>-The Honeypot<br />
-The Config File<br />
-The Log file</p>
<p>And a README.txt, which isn&#8217;t required to function but contains instructions for other users.</p>
<p>At the GHH project page, download the &#8220;Custom GHH Template&#8221;. Extract the contents and view config.php in a text editor. Each section is clearly marked with a header and footer, with small detail on what the section does. Find the configuration section, and change the $Filename variable to contain the filename or path to a text file (which you will have to make) that isn&#8217;t in the document root of your webserver. There is no default filename or default logfile to prevent predictable file locations. Your logs for your custom honeypot will go into this filepath, as well as any new honeypots that use this configuration file.</p>
<p>View template.php in a text editor and find the configuration section. Enter the filepath or filename for your configuration file (config.php doesn&#8217;t have to be in your document root).</p>
<p>Scroll down to where it says &#8220;Begin Custom Honeypot Section&#8221;.</p>
<p>PHP:</p>
<dl class="codebox">
<dt>Code: <a onclick="selectCode(this); return false;" href="http://tazforum.thetazzone.com/viewtopic.php?f=28&amp;t=714#">Select all</a></dt>
<dd><code>////////////////////////////////////////////////////////<br />
//Begin Custom Honeypot Section<br />
//GHH Honeypot by Ryan McGeehan for GHDB Signature #365 (intitle:"PHP Shell *" "Enable stderr" filetype&lt;img src="http://images.antionline.com/images/smilies/tongue.gif" border="0" alt=""&gt;hp)<br />
////////////////////////////////////////////////////////<br />
$HoneypotName = "PHPSHELL";</code></p>
<p>//Trick PHP Shell page<br />
echo &#8220;&lt;html&gt;\n&lt;head&gt;\n&lt;title&gt;PHP Shell 1.7&lt;/title&gt;\n&lt;/head&gt;\n&lt;body&gt;\n&lt;h1&gt;PHP Shell 1.7&lt;/h1&gt;\n\n\n&lt;form name=\&#8221;myform\&#8221; action=\&#8221;/mysidia/main/mid/uploaded/p-s.mid.php\&#8221; method=\&#8221;post\&#8221;&gt;\n&lt;p&gt;Current working directory: &lt;b&gt;\n&lt;a href=\&#8221;/mysidia/main/mid/uploaded/p-s.mid.php?work_dir=/\&#8221;&gt;Root&lt;/a&gt;/&lt;/b&gt;&lt;/p&gt;\n\n&lt;p&gt;Choose new working directory:\n&lt;select name=\&#8221;work_dir\&#8221; onChange=\&#8221;this.form.submit()\&#8221;&gt;\n&lt;br /&gt;\n&lt;br /&gt;&lt;html&gt;\n&lt;head&gt;\n&lt;title&gt;PHP Shell 1.7&lt;/title&gt;\n&lt;/head&gt;\n&lt;body&gt;\n&lt;h1&gt;PHP Shell 1.7&lt;/h1&gt;\n\n\n&lt;form name=\&#8221;myform\&#8221; action=\&#8221;/mysidia/main/mid/uploaded/p-s.mid.php\&#8221; method=\&#8221;post\&#8221;&gt;\n&lt;p&gt;Current working directory: &lt;b&gt;\n&lt;a href=\&#8221;/mysidia/main/mid/uploaded/p-s.mid.php?work_dir=/\&#8221;&gt;Root&lt;/a&gt;/&lt;/b&gt;&lt;/p&gt;\n\n&lt;p&gt;Choose new working directory:\n&lt;select name=\&#8221;work_dir\&#8221; onChange=\&#8221;this.form.submit()\&#8221;&gt;\n&lt;br /&gt;\n&lt;br /&gt;\n&lt;br /&gt;\n&lt;br /&gt;\n\n&lt;/select&gt;&lt;/p&gt;\n\n&lt;p&gt;Command: &lt;input type=\&#8221;text\&#8221; name=\&#8221;command\&#8221; size=\&#8221;60\&#8221;&gt;\n&lt;input name=\&#8221;submit_btn\&#8221; type=\&#8221;submit\&#8221; value=\&#8221;Execute Command\&#8221;&gt;&lt;/p&gt;\n\n&lt;p&gt;Enable &lt;code&gt;stderr&lt;/code&gt;-trapping? &lt;input type=\&#8221;checkbox\&#8221; name=\&#8221;stderr\&#8221;&gt;&lt;/p&gt;\n&lt;textarea cols=\&#8221;80\&#8221; rows=\&#8221;20\&#8221; readonly&gt;\n\n\n&lt;/textarea&gt;\n&lt;/form&gt;\n\n&lt;script language=\&#8221;JavaScript\&#8221; type=\&#8221;text/javascript\&#8221;&gt;\ndocument.forms[0].command.focus();\n&lt;/script&gt;\n\n&lt;hr&gt;\n&lt;i&gt;Copyright &amp;copy; 2000&amp;ndash;2002, &lt;a\nhref=\&#8221;mailto:gimpster@gimpster.com\&#8221;&gt;Martin Geisler&lt;/a&gt;. Get the latest\nversion at &lt;a href=\&#8221;http://www.gimpster.com\&#8221;&gt;www.gimpster.com&lt;/a&gt;.&lt;/i&gt;\n&lt;/body&gt;\n&lt;/html&gt;\n&#8221;;</p>
<p>//Find our PHP shell target in the referer site<br />
if (strstr($Attack['referer'], &#8220;Shell&#8221;)){<br />
$Signature[] = &#8220;Target in URL&#8221;;<br />
}</p>
<p>//Finds if exact GHDB signature was used<br />
if (strstr ($Attack['referer'], &#8221; intitle%3A%22PHP+Shell+*%22+%22Enable+stderr%22+fi<br />
letype%3Aphp&#8221;)){<br />
$Signature[] = &#8220;GHDB Signature!&#8221;;<br />
}</p>
<p>////////////////////////////////////////////////////////<br />
//End Custom Honeypot Section<br />
////////////////////////////////////////////////////////</p>
</dd>
</dl>
<p>The header shows that this template is using the honeypot code for the Google Hacking Database (GHDB) #365, which is a PHP Shell honeypot. PHP Shell is a vulnerability on a misconfigured webserver, and GHH is emulating it in this example.</p>
<p>Change $HoneypotName to a string that will describe the honeypot in the logs. GHH honeypots use quick and dirty names here as a standard.</p>
<p>The echo statement that appears is what imitates the vulnerable page. You will need the HTML output of the vulnerable website to place into this line. You can find HTML to use from the GHDB at the link provided above, maintained by johnny.ihackstuff.com. This brings up an important point called fingerprinting, which will be covered later.</p>
<p>The next line is a signature. It is a quick statement that searches for &#8220;Shell&#8221; in the referred URL. Many search engines have a referral included in their links, so it&#8217;s possible to determine which search engine and what query an attacker used to reach the honeypot. In this case, &#8220;Shell&#8221; is being searched for, and if found it will put &#8220;Target in URL&#8221; in the logs to do some of the investigation for us.</p>
<p>The next signature searches the referral for the exact GHDB Signature, this will tell us that the attacker either<br />
A) Used a hacking tool<br />
B) Used the GHDB database or<br />
C) got lucky and crafted the same search as GHDB.</p>
<p>That&#8217;s how this section operates. Here are your tools to work with.</p>
<p>The $Attacker array contains these indexes:</p>
<p>PHP:</p>
<dl class="codebox">
<dt>Code: <a onclick="selectCode(this); return false;" href="http://tazforum.thetazzone.com/viewtopic.php?f=28&amp;t=714#">Select all</a></dt>
<dd><code>$Attacker['IP'] //Contains the Hosts IP<br />
$Attacker['request'] //Contains the Hosts request to get to the honeypot<br />
$Attacker['referer'] //Contains the referrer if exists<br />
$Attacker['agent'] //Contains the hosts user agent<br />
$Attacker['accept'] //The rest describe the browser and connection between host and server<br />
$Attacker['charset']<br />
$Attacker['encoding']<br />
$Attacker['language']<br />
$Attacker['connection']<br />
$Attacker['keep_alive']</code></dd>
</dl>
<p>You can use these indexes along with some logic written in PHP similar (or exact logic, searching for different strings) to the sample given above. When your code decides it has found something malicious in the $Attacker array, append it to the end of the $Signature array:</p>
<p>PHP:</p>
<dl class="codebox">
<dt>Code: <a onclick="selectCode(this); return false;" href="http://tazforum.thetazzone.com/viewtopic.php?f=28&amp;t=714#">Select all</a></dt>
<dd><code>if (strstr($Attack['referer'], "Shell")){<br />
$Signature[] = "Target in URL"; //Append it like this, $array[]= "whatever"; will go to the end of the array<br />
}</code></dd>
</dl>
<p>and it will appear in the logfile along with any other signatures found.</p>
<p>The Logs</p>
<p>Here&#8217;s an example log from testing:</p>
<p>The logs are done in the CSV format. (Comma Separated Values) Each field is separated by a comma. The fields in the document include:</p>
<p>Tripped: The honeypot was accessed / tripped. (If you have multiple honeypots, this will tell you which one was accessed)<br />
Time of Attack: The time the honeypot was viewed<br />
Host: The IP address of the attacker<br />
Requested URI: The Uniform Resource Identifier made to reach your site<br />
Referrer: This will have the query used in the search engine in most cases, alarming you to what the attacker attempted to find, and how they tried to find it. The most important detail of the log.<br />
Accepts: Contents of the Accept: header if there is one.<br />
Accepts Charset: Contents of the Accepts_Charset header if there is one.<br />
Accept Language: Contents of the Accept-Language<br />
Connection: Contents of the Connection: header from the current request<br />
User Agent: The user agent of the attacker<br />
Signatures: The signature of attack the honeypot was able to determine from a combination of browsers headers.</p>
<p>Making Sense of It All</p>
<p>Don&#8217;t panic if your log file ($Filename) has a large number of requests in it. Honeypots are meant to be accessed. This log is a potent source of information to see how attackers are reaching your site. By looking at the referrer field in the log, you will be able to determine where the attacker came from, the query they used, or if your honeypot has been discovered and linked.</p>
<p>Fingerprinting and Policy</p>
<p>Fingerprinting</p>
<p>Fingerprinting is an issue with all honeypots. Fingerprinting is the process of identifying a honeypot from a legit application or host. In GHH&#8217;s case, the HTML has to be nearly identical in most cases to the vulnerable application&#8217;s HTML. This way Google indexes the honeypots and vulnerable applications the same way and they cannot be fingerprinting without browsing the server or viewing the page. There are some cases when the HTML is different from honeypot to honeypot, which would require you to break up the string with randomized codes, numbers, or strings.</p>
<p>Policy</p>
<p>Be extremely careful when creating any policies around a GHH logfile. There can be false positives and it can become a potential risk if logs are actively involved with policies.</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;</p>
<p>If anyone needs help trying out ghh, or has any suggestions for it, shoot me a pm. But seeing how I am &#8220;Under Investigation&#8221; now, I don&#8217;t know how long that offer will stand</p>
<p>So give it a roll and let me know how it goes.</p>


<!-- Begin TwitThis script (http://twitthis.com/) -->
<div style="text-align:left;">
<script type="text/javascript" src="http://s3.chuug.com/chuug.twitthis.scripts/twitthis.js"></script>
<script type="text/javascript">
<!--
document.write('<a href="javascript:;" onclick="TwitThis.pop();"><img src="http://s3.chuug.com/chuug.twitthis.resources/twitthis_grey_72x22.gif" alt="TwitThis" style="border:none;" /></a>');
//-->
</script>
</div>
<!-- /End -->

]]></content:encoded>
			<wfw:commentRss>http://www.thetazzone.com/tutorial-custom-web-based-honeypots-with-ghh/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tutorial &#8211; Advanced Web Based Honeypot Techniques</title>
		<link>http://www.thetazzone.com/tutorial-advanced-web-based-honeypot-techniques/</link>
		<comments>http://www.thetazzone.com/tutorial-advanced-web-based-honeypot-techniques/#comments</comments>
		<pubDate>Fri, 13 Mar 2009 21:40:15 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[honeypots]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[tutorials]]></category>

		<guid isPermaLink="false">http://www.thetazzone.com/?p=677</guid>
		<description><![CDATA[ORIGINALLY POSTED BY NOKIA FOR THETAZZONE/TAZFORUM HERE
Do not use, republish, in whole or in part, without the consent of the Author. TheTAZZone policy is that Authors retain the rights to the work they submit and/or post…we do not sell, publish, transmit, or have the right to give permission for such…TheTAZZone merely retains the right to [...]]]></description>
			<content:encoded><![CDATA[<p>ORIGINALLY POSTED BY NOKIA FOR THETAZZONE/TAZFORUM <a href="http://tazforum.thetazzone.com/viewtopic.php?f=28&amp;t=713">HERE</a></p>
<p>Do not use, republish, in whole or in part, without the consent of the Author. TheTAZZone policy is that Authors retain the rights to the work they submit and/or post…we do not sell, publish, transmit, or have the right to give permission for such…TheTAZZone merely retains the right to use, retain, and publish submitted work within it’s Network</p>
<dl class="codebox">
<dt>Code: <a onclick="selectCode(this); return false;" href="http://tazforum.thetazzone.com/viewtopic.php?f=28&amp;t=713#">Select all</a></dt>
<dd><code>Soda_Popinsky has very kindly allowed this tutorial of his to be hosted on the TAZ.</p>
<p>You can find the original post here:<br />
http://www.antionline.com/showthread.php?s=&amp;threadid=269669<br />
</code></dd>
</dl>
<p><span style="font-weight: bold;">Advanced Web Based Honeypot Techniques</span><br />
by Soda_Popinsky</p>
<p>Links<br />
<a class="postlink" href="http://ghh.sourceforge.net/">http://ghh.sourceforge.net</a><br />
<a class="postlink" href="https://sourceforge.net/projects/ghh/">https://sourceforge.net/projects/ghh/</a></p>
<p>GHDB operated by johnny.ihackstuff.com</p>
<p>Background</p>
<p>The GHH project develops web based honeypots designed to lure &#8220;Google Hackers&#8221; using malicious search engine tactics, along with tools and documentation to allow others to develop customized honeypots, decreasing the exposure of vulnerable applications in the Google index.</p>
<p>Recommended Reading:</p>
<p><!-- m --><a class="postlink" href="http://tazforum.thetazzone.com/viewtopic.php?p=6084#6084">http://tazforum.thetazzone.com/viewtopi &#8230; =6084#6084</a></p>
<p><!-- m --></p>
<p>Overview</p>
<p>This tutorial will expand upon extension spoofing and transparent linking, and how to apply it in the creation of customized web based honeypots. The v1.1 honeypots and documentation released by GHH will be used as a reference for this tutorial.</p>
<p>Spoofed file extensions</p>
<p>While browsing through the Google Hacking Database (GHDB), you should notice that not all of the signatures target server side scripts (.php for example). This hack, for example:</p>
<p>inurl:passwd.txt</p>
<p>That hack searches for the file extension .txt. The contents of these files are usually interesting, and their exposure could introduce vulnerability on the server they are hosted on. There is usually more of a risk being introduced to the enviroment than a typical web application vulnerability in cases like these.</p>
<p>Or perhaps these:</p>
<p>inurl:admin.mdb<br />
inurl:customer.mdb<br />
inurl:users.mdb</p>
<p>Depending on their contents, a database file such as this could cause extreme losses. In order to emulate filetypes like these, GHH depends on apache htaccess files to spoof its file extension. We can then take advantage of server side scripting to log and handle the attack any way we want, and if we&#8217;re using GHH as an engine, this means log remotely and apply signatures to the attack.</p>
<p>So following the previous tutorial on GHH v1.0 (Should still be compatible) we can leverage htaccess and Apache to allow our honeypot to spoof another file extension. By placing a htaccess file in the same directory as our honeypot with the following lines:</p>
<dl class="codebox">
<dt>Code: <a onclick="selectCode(this); return false;" href="http://tazforum.thetazzone.com/viewtopic.php?f=28&amp;t=713#">Select all</a></dt>
<dd><code>AddHandler application/x-httpd-php .mdb #Change .mdb to your filetype<br />
AddType application/x-httpd-php .mdb #Change .mdb to your filetype</code></dd>
</dl>
<p>Apache &amp; PHP will interpret the .xyz file as a PHP script . The only problem is that browsers won&#8217;t behave normally when viewing some extensions (.mdb, .txt for example) To handle this, we can place the following PHP code at the beginning of our honeypot:</p>
<p>PHP:</p>
<dl class="codebox">
<dt>Code: <a onclick="selectCode(this); return false;" href="http://tazforum.thetazzone.com/viewtopic.php?f=28&amp;t=713#">Select all</a></dt>
<dd><code> &lt;?php<br />
header('Content-Type: text/plain'); //This line must change<br />
//Rest of code...<br />
?&gt; </code></dd>
</dl>
<p>This will tell the browser to handle a file as a certain type of content. The previous code would be acceptable for a .sql, .txt, .log, .dat file or something similar. When the content reaches the attacker, the browser will behave like it should (we already have them captured, but it&#8217;s best not to tip them off anyhow). If you had a database file, you&#8217;d want it to open in access for example. This would require &#8216;Content-Type: application/msaccess&#8217; to be sent to the browser.</p>
<p>Content types available @:<br />
<a class="postlink" href="http://www.iana.org/assignments/media-types/">http://www.iana.org/assignments/media-types/</a></p>
<p>Transparent Linking</p>
<p>Transparent linking is the process of advertising your honeypot to search engines, but not the casual users of your website. There are a few ways to do this, some better than others. The better your transparent link, the less false positives you&#8217;ll have in your logs. The goal is to have visitors to your honeypot that are referred from a search engine, and not from the site it&#8217;s hosted on. This forces them to find the honeypot through the engine, and by that vector you can retrieve the search query they used against your site (intention and motive!)</p>
<p>Direct link<br />
Simply making an obvious hyperlink with some text in your top level website:</p>
<p>PHP:</p>
<dl class="codebox">
<dt>Code: <a onclick="selectCode(this); return false;" href="http://tazforum.thetazzone.com/viewtopic.php?f=28&amp;t=713#">Select all</a></dt>
<dd><code>&lt;a href="http://yourwebsite.com/honeypot.php"&gt;blah&lt;/a&gt;</code></dd>
</dl>
<p>Obvious problems include users clicking on the link, and filling your logs with false positive. Don&#8217;t use this type of link.</p>
<p>Camo Link<br />
The following CSS style will make the link the same color as your background. You should change black to match your background.</p>
<p>PHP:</p>
<dl class="codebox">
<dt>Code: <a onclick="selectCode(this); return false;" href="http://tazforum.thetazzone.com/viewtopic.php?f=28&amp;t=713#">Select all</a></dt>
<dd><code>&lt;style type="text/css"&gt;<br />
&lt;!--<br />
.camo{<br />
color:black;<br />
}<br />
--!&gt;<br />
&lt;/style&gt;</code></dd>
</dl>
<p>Then apply your style to the link.</p>
<p>PHP:</p>
<dl class="codebox">
<dt>Code: <a onclick="selectCode(this); return false;" href="http://tazforum.thetazzone.com/viewtopic.php?f=28&amp;t=713#">Select all</a></dt>
<dd><code>&lt;a href="http://yourwebsite.com/honeypot.php" class="camo"&gt;.&lt;/a&gt;</code></dd>
</dl>
<p>This has it&#8217;s problems as well. It&#8217;s cumbersome, because you might not know what the background will be behind the link. This makes a literally transparent link desireable, however I haven&#8217;t found any options other than CSS Alpha() function, which doesn&#8217;t seem to work well with text.</p>
<p>Disappearing link<br />
The following CSS will prevent the link from being shown to the user at all, as long as their browser renders CSS.</p>
<p>PHP:</p>
<dl class="codebox">
<dt>Code: <a onclick="selectCode(this); return false;" href="http://tazforum.thetazzone.com/viewtopic.php?f=28&amp;t=713#">Select all</a></dt>
<dd><code>&lt;style type="text/css"&gt;<br />
&lt;!--<br />
.cya{<br />
display:none;<br />
}<br />
--!&gt;<br />
&lt;/style&gt;</code></dd>
</dl>
<p>The link is now completely nonexistent, except in the source. The thought was that being completely invisible would be the best option, however the GHH project learned the hard way that display:none is completely ignored by Google because it can be abused. Against what seems to be the popular belief, Google does not index links with a CSS style of display:none (such a smart spider!) It will however, be indexed by less powerful crawlers.</p>
<p>Shy Link<br />
In order to leverage a disappearing link, you&#8217;ll need to plug in some PHP to detect when the Googlebot comes around (You have to cater to Googlebot <img title="Smile" src="http://tazforum.thetazzone.com/images/smilies/icon_smile.gif" alt=":)" />)</p>
<p>PHP:</p>
<dl class="codebox">
<dt>Code: <a onclick="selectCode(this); return false;" href="http://tazforum.thetazzone.com/viewtopic.php?f=28&amp;t=713#">Select all</a></dt>
<dd><code> &lt;a href="http://yourwebsite.com/honeypot.php"<br />
&lt;?php<br />
if(!strstr($_SERVER['HTTP_USER_AGENT'], 'Googlebot'))<br />
echo 'class="cya"';<br />
?&gt;<br />
&gt;.&lt;/a&gt; </code></dd>
</dl>
<p>This is also a pain, but it does the job. Other spiders aren&#8217;t as smart as Googlebot, and freely crawl links with the display:none style, so this technique will compeletly cover the link from casual browsers and still let it be discovered by Google.</p>
<p>Map Link<br />
The use of image maps can be a quick way to link multiple honeypots. Create nearly untouchable links in an image.</p>
<p>PHP:</p>
<dl class="codebox">
<dt>Code: <a onclick="selectCode(this); return false;" href="http://tazforum.thetazzone.com/viewtopic.php?f=28&amp;t=713#">Select all</a></dt>
<dd><code>&lt;img src="image.gif" border="0" usemap="#Map"&gt;<br />
&lt;map name="Map"&gt;<br />
&lt;area shape="rect" coords="0,0,0,0" href="http://yourdomain.com/honeypot"&gt;<br />
&lt;/map&gt;</code></dd>
</dl>
<p>Buddy Link<br />
Buddy linking is as simple as having other domains link to your honeypot. When they are crawled, spiders will hopefully follow up to your site. Casual users of your site are not likely to cause false positives, however users of your buddies site may cause them, making it a good idea to stick to the tactics described here.</p>
<p>&#8220;Tattletale&#8221; Link<br />
TELL the search engine where you are, and forget about linking. Most engines have a suggest feature, Google has sitemaps. If you don&#8217;t feel like using the python tool or writing XML, there&#8217;s the option to submit a textfile with URL&#8217;s separated by CRLF&#8217;s. Check it out here:<br />
<a class="postlink" href="http://www.google.com/webmasters/si...bid=us-et-about">http://www.google.com/webmasters/si&#8230;bid=us-et-about</a></p>
<p>GHH Theory</p>
<p>The nature of GHH is to be known but not seen. This is why working with GHH is challenging. The concept of Google Hacking and Honeypots are simple, however the design of the web and the design of a honeypot in tandem present the challenge of &#8220;hiding in plain sight&#8221; on the web. GHH is developed under that concept, which is useful in the creation of new tools related to the relevant attacks.</p>
<p>Benefits of GHH include very early warning of a potential attack, by catching an attacker in their reconnaisance phase and learning their possible motives. GHH also improves other vulnerable targets chances of survival on the web. By saturating a search engine index with specific false positives, it makes what was once an foolproof vector a more unreliable source of victims. So in short, it also benefits others.</p>


<!-- Begin TwitThis script (http://twitthis.com/) -->
<div style="text-align:left;">
<script type="text/javascript" src="http://s3.chuug.com/chuug.twitthis.scripts/twitthis.js"></script>
<script type="text/javascript">
<!--
document.write('<a href="javascript:;" onclick="TwitThis.pop();"><img src="http://s3.chuug.com/chuug.twitthis.resources/twitthis_grey_72x22.gif" alt="TwitThis" style="border:none;" /></a>');
//-->
</script>
</div>
<!-- /End -->

]]></content:encoded>
			<wfw:commentRss>http://www.thetazzone.com/tutorial-advanced-web-based-honeypot-techniques/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
