Username: Save?
Password:
Home Forum Links Search Login Register*
    News: Welcome to the TechnoWorldInc! Community!
Recent Updates
[Yesterday at 11:48:22 AM]

[Yesterday at 11:48:22 AM]

[Yesterday at 11:48:22 AM]

[Yesterday at 11:48:22 AM]

[April 03, 2024, 06:11:00 PM]

[April 03, 2024, 06:11:00 PM]

[April 03, 2024, 06:11:00 PM]

[April 03, 2024, 06:11:00 PM]

[March 06, 2024, 02:45:27 PM]

[March 06, 2024, 02:45:27 PM]

[March 06, 2024, 02:45:27 PM]

[March 06, 2024, 02:45:27 PM]

[February 14, 2024, 02:00:39 PM]
Subscriptions
Get Latest Tech Updates For Free!
Resources
   Travelikers
   Funistan
   PrettyGalz
   Techlap
   FreeThemes
   Videsta
   Glamistan
   BachatMela
   GlamGalz
   Techzug
   Vidsage
   Funzug
   WorldHostInc
   Funfani
   FilmyMama
   Uploaded.Tech
   MegaPixelShop
   Netens
   Funotic
   FreeJobsInc
   FilesPark
Participate in the fastest growing Technical Encyclopedia! This website is 100% Free. Please register or login using the login box above if you have already registered. You will need to be logged in to reply, make new topics and to access all the areas. Registration is free! Click Here To Register.
+ Techno World Inc - The Best Technical Encyclopedia Online! » Forum » THE TECHNO CLUB [ TECHNOWORLDINC.COM ] » Programming Zone » PHP
  Make More Secure Php Applications
Pages: [1]   Go Down
  Print  
Author Topic: Make More Secure Php Applications  (Read 2977 times)
Daniel Franklin
TWI Hero
**********


Karma: 3
Offline Offline

Posts: 16647


View Profile Email
Make More Secure Php Applications
« Posted: September 26, 2007, 01:19:55 PM »


If you are writing a dynamic web site , you must use a database system like mysql .
Mysql is the most popular one . When you wrote a query like this Select * from adsense where col=1;
As you can see there is no ' , then the attacker can write his query and bypass yours .You can lost your private information and your site can be hacked.
To protect your site , use type casting . If your parameter is an integer use intval() function to protect malicious strings from your website.
If your parameter is a string , you must use addslashes() function .

$query="Select * from computers where os='".addslashes($_GET['os'])."'"; mysql_query($query);

$query="Select * from computers where can_execute_php=".intval($_GET['type']);

2-) xss atacks

Xss means cross site scripting .It depends on session & cookie stealing with javascript codes . if the script writes the parameter to the document without filtering , attacker can enter javascript codes and reach the cookie with document.cookie() function in javascript . To be protected you must use htmlspecialchars() function . it filters special html chars .

3-) Php injections

Eval function in php causes php injections and attacker can execute php code.There is no code to get protected .You must select the string well before you use eval() function.Its not good to give a paramater variable for eval function .

Bugra is a coder & Security tester . He reported a lot of well - known vulnerabilities like hotmail -xss and yahoo - xss . Original article can be found at http://www.getvaluable.info/uncategorized/make-more-secure-php-applications/ or you can visit anything you need for http://www.getvaluable.info

Article Source: http://EzineArticles.com/?expert=Bugra_Bayramoglu

Logged

Pages: [1]   Go Up
  Print  
 
Jump to:  

Copyright © 2006-2023 TechnoWorldInc.com. All Rights Reserved. Privacy Policy | Disclaimer
Page created in 0.098 seconds with 24 queries.