CashTanker
Happy Investing, With Happy Christian Community
 
our advertising disclaimer | Disclaimer - Must be read before using forum or clicking any links
imoneyreserve.com
ptvpartner.com
TheHYIPForum.com
ALL NEW! HYIP, Autosurf, Cycler, MLM Forum! Check it out today and earn money!
YOUR AD HERE!
For only $17/day, $99/week or $379/month on the most Popular HYIP related site online!
Put your banner or text ad in the rotation above!ONLY $17/day, $99/week, or $379/month!


Your Ad Here
Your Ad Here

above banners and links are advertisements only. We do not endorse or vouch for any advertisers.Put Your 728X90 Banner Here NOW!

Go Back   Talkgold HYIP, Investment & Money Forum > Caution : Risky High Yield Investing Programs > HYIP - AutoSurf Program Admin Talk
User Name
Password
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 06-15-2006, 11:21 PM
Test33's Avatar
Test33 Test33 is offline
Senior Investor
Join Date: Jan 2006
Location: Biggest Little City in the World
Posts: 609
Send a message via AIM to Test33 Send a message via MSN to Test33 Send a message via Yahoo to Test33
Default SQL Injection - A simple way to prevent

Alright, I've made a post on another thread with this way.

By turning ON magic quotes this should stop most SQL injections. I haven't done a lot of testing, but I have not be able to inject anything into my MySQL database.

Here is how you would do an SQL injection.

Code:
"a'; DROP TABLE users; SELECT * FROM data WHERE name LIKE '%"
in the place of username/password etc fields. Now, with magic quotes off, this is the full sql query

Code:
SELECT * FROM users WHERE name = 'a'; DROP TABLE users; SELECT * FROM data WHERE name LIKE '%';
This would stop the sql code from being executed.

Now, this is what it would look like with magic quotes on

Code:
SELECT * FROM users WHERE name = 'a\'; DROP TABLE users; SELECT * FROM data WHERE name LIKE \'%';
Remember, that this will not stop all sql injections, but it should stop most of them.

Since, I do not have a reputation here, at least I don't think I do. I'll give you the tutorial on how to do it, right here, free. Then you can contact me if you still need help.

Since most people today just run shared hosting, you do not have access to your php.ini, but I also found out, that it is possible to do it from your .htaccess file, however, it doesn't always work. So instead all you need to use is the "addslashes" function.
  1. Open the file that you want to add the function to.
  2. Find the variable that you want to add slashs to. I'll call it $a;
  3. Below it, add $a = addslashes($a);

Make sure your names for the variables are correct. You should have basic knowledge of PHP before attempting this.

If you have access to your php.ini just do this:
  1. Open php.ini
  2. Find magic_quotes_gpc off
  3. change off to on

This will affect ALL your scripts, and might not be good, but it's the easy way out.


Now, I haven't looked too much at GC HYIP script, since the code is messy =P. But I'll try to add a function to make it easier for all of you. Or unless, naversay wants to, or if he already has.

I want other people to list their ways of 'patching' this problem up. I'm sure their are better ways then using addslashes function. So post it. Also, tell me if this will work or wont work. I've only tested it on my projects, 'cause I can read the code =)
Reply With Quote
-- Sponsored Links --
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


TALKGOLD
SIDEBAR ADS

ADVERTISE HERE. Must read: Advertising Terms & Disclaimer
PUT YOUR 120X120 AD HERE FOR ONLY $550/WEEK!
Click Here for details.
Your ad here! Cost of Ad - $540
Your ad here! Cost of Ad - $530
Your ad here! Cost of Ad - $520
Your ad here! Cost of Ad - $510
Your ad here! Cost of Ad - $310
Your ad here! Cost of Ad - $230
Cost of Ad - $200
Your ad here! Cost of Ad - $190
Your Ad Here Cost of Ad - $120
Your Ad Here Cost of Ad - $120
Your Ad Here Cost of Ad - $110
Your Ad Here Cost of Ad - $105
Your ad here Cost of Ad - $105
Your ad here Cost of Ad - $105
Your ad here Cost of Ad - $105
Cost of Ad - $100
Your Ad Here Cost of Ad - $100
Instaforex Cost of Ad - $95
Your ad here! Cost of Ad - $80
Cost of Ad - $75
Your ad here Cost of Ad - $75
Your ad here Cost of Ad - $75
Your ad here Cost of Ad - $75
YOUR AD HERE

PUT YOUR NON-ROTATING AD HERE NOW!
ONLY $75/Week


click here
click here
YOUR AD HERE!
YOUR AD HERE!
Well Profit

1500% - 2000% After 1 Day, 3200% - 4200% After 2 Days

Only $39/week or $135/month - Advertise Now!
GENIUS PROFIT

250% After 10 Minutes (Instant Withdrawal)
800% After 3 Hour (Instant Withdrawal)
1400% After 10 Hour (Instant Withdrawal)
2500% After 24 Hour (Instant Withdrawal)
Www.Genius-Profit.Com
Only $39/week or $135/month - Advertise Now!
Check our Advertising Rates!

All times are GMT. The time now is 06:23 PM.

Add to Google

Protected by BlockDOS.net - DDOS Protection
Powered by: vBulletin - Copyright ©2000 - 2005, Jelsoft Enterprises Ltd.