function Preload(path) {
    var image=new Image();
    image.src=path;
}
Preload('images/proj/showright.gif');
Preload('images/proj/showleft.gif');
Preload('images/proj/up.gif');
Preload('images/proj/bottomleft.gif');
Preload('images/proj/bottomright.gif');
var desc=[];
var link=[];
var title=[];
desc["zphp"]="Allows you to easily write PHP scripts which interact with <a href=\"http://www.zimbra.com/\" target=\"_blank\">Zimbra</a> via its <a href=\"http://zimbra.svn.sourceforge.net/viewvc/zimbra/trunk/ZimbraServer/docs/soap.txt?revision=850\" target=\"_blank\">SOAP API</a>. I haven\'t created wrappers for all available functions yet, only some basic ones. Requests and responses are JSON encoded objects sent via HTTP. SSL encryption is optional.";
link["zphp"]="";
title["zphp"]="PHP Connector for Zimbra";
desc["pwstrength"]="A PHP script which uses various methods to measure the strength of a password, as well as suggest how to make it stronger.";
link["pwstrength"]="";
title["pwstrength"]="Password Strength";
desc["captcha"]="PHP script using the GD library, a dictionary, and a bunch of fonts to create a <a href=\"http://en.wikipedia.org/wiki/Captcha\" target=\"_new\"> captcha</a>. If you don\'t know what that is, I\'m sure you\'ve used them before. It creates an image with a distorted word that can probably be read by a human but not a computer. This prevents spammers from creating automated scripts for a website.";
link["captcha"]="";
title["captcha"]="Captcha";
desc["winalert"]="A php script that dynamically alters a Windows binary to create custom error messages. The only real use I could think of is for practical jokes. I had used the same concept to create binaries that compute and compare an MD5 checksum of a user\'s file which was uploaded using <a href=\"http://uber-uploader.sourceforge.net/\" target=\"_new\">Uber Uploader</a>.";
link["winalert"]="";
title["winalert"]="Custom Windows Alerts";
desc["portscan"]="A PHP+AJAX port scanner that checks specified TCP ports for a listening process. Supports 4 concurrent requests, since the script may have to wait 2 seconds for a response to each request. I don\'t think this is a great security tool, since you should already know what listening processes you are using. Any malicious processes that listen for connections would probably use a more obscure port. It can, however, be useful for troubleshooting routers. I only allow the user\'s IP to be scanned, since I don\'t want my script to be used with malicious intent.";
link["portscan"]="";
title["portscan"]="Port Scanner";
desc["regex"]="A simple javascript which builds a <a target=\"_blank\" href=\"http://en.wikipedia.org/wiki/Regular_expression\">regular expression</a> based on the user\'s input.";
link["regex"]="";
title["regex"]="Regular Expression Builder";
desc["files"]="A simple project that creates an index for a directory of files or subdirectories to be shared through a web server. The advantages are that it looks nicer than one created by a web server, and I implemented two methods for preventing external sites from linking directly to files.";
link["files"]="";
title["files"]="Directory Indexer";
desc["ssh_honey"]="I set up an SSH server accessible from the internet. I modified the source code to log the IP, username, and password of all incorrect authentication attempts. This can be useful for building a dictonary of passwords which actual attackers are currently using. This dictionary can be used to identify weak passwords. The same concept can also be used to identify weak usernames. The logs can also be used to identify malicious hosts and other compromised servers.";
link["ssh_honey"]="ssh_honey/";
title["ssh_honey"]="SSH Honeypot";
desc["ftp_honey"]="The same exact web interface as the SSH honeypot, except using the database for the fake FTP server I created. The FTP protocol was simple enough to create a server from scratch which provides enough functionality to trick attackers into attacking it. This data is real-time, unlike the SSH honeypot which is updated every 10 minutes since my OpenSSH patch didn\'t write directly to the database.";
link["ftp_honey"]="ftp_honey/";
title["ftp_honey"]="FTP Honeypot";
desc["binary"]="I created this little script when I was trying to create some binary data to use for my background image. While I was at it, I also added hexadecimal conversion.";
link["binary"]="binary/";
title["binary"]="Text Encoding";
desc["sudo"]="A proof of concept for how sudo timestamps can be re-used in Linux to escalate privileges. This script waits for the user to start sudo, assumes it is the same user the script is running as, waits 10 seconds for the user to enter their password, kills their shell, creates psuedo-terminals until it has the correct tty number to match the sudo session\'s, then finally uses sudo to create the directory /hacked. Attacks like this can be prevented by disabling the use of timestamps by setting the value for \"timestamp_timeout\" to \"0\" in the sudoers file.";
link["sudo"]="sudo/sudo.py";
title["sudo"]="Sudo Vulnerability";
function ShowDesc(proj) {
	var html="<table class=\"nopad\" style=\"width:420px;\"><tr><td class=\"nopad\" style=\"width:18px;height:47px;background-image:url(images/proj/showleft.gif);\"/><td class=\"nopad\"><table class=\"nopad\" style=\"width:384px;margin-left:0px;\"><tr><td class=\"nopad\" style=\"height:2px;background-color:#888888;\"/></tr><tr><td class=\"ptitle\"><a href=\""+link[proj]+"\">"+title[proj]+"</a></td></tr><tr><td class=\"pshow\" style=\"background-image:url(images/proj/showbg.gif);\" onclick=\"HideDesc(\'"+proj+"\');\"><a href=\"javascript:HideDesc(\'"+proj+"\');\" style=\"text-decoration: none;\"><img alt=\"Hide\" src=\"images/proj/up.gif\" class=\"arrow\"/><span style=\"text-decoration: underline;\">hide details</span><img alt=\"Hide\" src=\"images/proj/up.gif\" class=\"arrow\"/></a></td></tr></table></td><td class=\"nopad\" style=\"width:18px;background-image:url(images/proj/showright.gif);\"/></tr><tr><td colspan=\"3\" class=\"nopad\" style=\"background-color:#d0ce95;\"><table class=\"nopad\" style=\"width:420px;height:100%;\"><tr><td class=\"nopad\" style=\"width:2px;background-color:#888888;\" /><td class=\"nopad\"><p style=\"margin-top:4px;\">"+desc[proj]+"</p></td><td class=\"nopad\" style=\"width:2px;background-color:#888888;\" /></tr></table></td></tr><tr><td colspan=\"3\" class=\"nopad\"><table class=\"nopad\" style=\"width:420px;\"><tr><td class=\"nopad\" style=\"width:18px;height:18px;background-image:url(images/proj/bottomleft.gif);\" /><td class=\"phide\" onclick=\"HideDesc(\'"+proj+"\');\"><a href=\"javascript:HideDesc(\'"+proj+"\');\" style=\"text-decoration: none;\"><img alt=\"Hide\" src=\"images/proj/up.gif\" class=\"arrow\"/><span style=\"text-decoration: underline;\">hide details</span><img alt=\"Hide\" src=\"images/proj/up.gif\" class=\"arrow\"/></a></td><td class=\"nopad\" style=\"width:18px;height:18px;background-image:url(images/proj/bottomright.gif);\" /></tr></table></td></tr></table>";
	document.getElementById('desc_'+proj).innerHTML=html;
}
function HideDesc(proj) {
	var html="<table class=\"nopad\" style=\"width:420px;\"><tr><td class=\"nopad\" style=\"width:18px;height:47px;background-image:url(images/proj/hideleft.gif);\"/><td class=\"nopad\"><table class=\"nopad\" style=\"width:384px;margin-left:0px;\"><tr><td class=\"nopad\" style=\"height:2px;background-color:#888888;\"/></tr><tr><td class=\"ptitle\"><a href=\""+link[proj]+"\">"+title[proj]+"</a></td></tr><tr><td class=\"pshow\" style=\"background-image:url(images/proj/hidebg.gif);\" onclick=\"ShowDesc(\'"+proj+"\');\"><a href=\"javascript:ShowDesc(\'"+proj+"\');\" style=\"text-decoration: none;\"><img alt=\"Show\" src=\"images/proj/down.gif\" class=\"arrow\"/><span style=\"text-decoration: underline;\">show details</span><img alt=\"Show\" src=\"images/proj/down.gif\" class=\"arrow\"/></a></td></tr></table></td><td class=\"nopad\" style=\"width:18px;background-image:url(images/proj/hideright.gif);\"/></tr></table>";
	document.getElementById('desc_'+proj).innerHTML=html;
}

function HideAll() {
	for(var n in title) {
		HideDesc(n);
	}
}
