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.

Coding Forum


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



Reply
Building SECURE web sites & apps
Old 07-09-2007, 02:23 PM Building SECURE web sites & apps
Learning Newbie's Avatar
Defies a Status

Latest Blog Post:
Astounding Republican Paranoia
Posts: 5,662
Name: John Alexander
Trades: 0
Duh. Run it on linux, then nobody can see it unless they have good intentions. Right? Wrong. Actually that's the problem I want to talk about, we got to the point where computers can do almost magical things to keep secrets, or to break them. It's a Brave New World, such a wonderful, complex, and to a lot of people, incomprehensible issue, that most of us tend to ignore security.

A thread in the general forum hinted at the answer by listing common passwords. That seemed to be about hacking, but it brings up an important issue. You can use MD5 and 3xDES, but if your password is "password" your system isn't secure. The goal of crypto science is for the human to be the weakest point, so the algorithm can't be compromised. As web developers, we can't take that easy out.

I hope we can have a thread where we all share experiences and ideas on how to build secure systems. That involves some talk about hacking, because you have to understand how your enemy will attack to strengthen the right walls. But the goal isn't just to stand up to three particular attacks, it's to make it more difficult to get in, no matter how someone tries.
__________________

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


Please login or register to view this content. Registration is FREE
Learning Newbie is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 07-09-2007, 02:31 PM Re: Building SECURE web sites & apps
Extreme Talker

Posts: 182
Trades: 0
Let's get this thread started! Are we talking about web app security or server security?
bhgchris is offline
Reply With Quote
View Public Profile
 
Old 07-09-2007, 03:07 PM Re: Building SECURE web sites & apps
Learning Newbie's Avatar
Defies a Status

Latest Blog Post:
Astounding Republican Paranoia
Posts: 5,662
Name: John Alexander
Trades: 0
I'm thinking more application security, but that involves a lot of server security. If you write the world's best application and deploy it on a server with holes like swiss cheese, all the work you did to build a robust app is wasted.
__________________

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


Please login or register to view this content. Registration is FREE
Learning Newbie is offline
Reply With Quote
View Public Profile
 
Old 07-09-2007, 03:26 PM Re: Building SECURE web sites & apps
Extreme Talker

Posts: 182
Trades: 0
agreed. These days it seems to be all about xss and sql injection.

As you can see here: http://mybeni.rootzilla.de/mybeNi/category/xss_list/

Even the top 50 sites on the net are nowhere near full-proof. Some different methods are also discussed on that site.

I find it helpful to test my apps with a bunch of these code snippets:
http://ha.ckers.org/xss.html
bhgchris is offline
Reply With Quote
View Public Profile
 
Old 07-10-2007, 11:27 AM Re: Building SECURE web sites & apps
willcode4beer's Avatar
Super Moderator

Posts: 1,533
Name: Paul Davis
Location: San Francisco
Trades: 1
You could add, know your server and programming language well.

For example, Java provides the java.sql.PreparedStatement class t eliminate the threat of SQL injection but, some people still insist on creating SQL with user input directly.

Almost all app servers have a means to provide database connections that are configured on the server. Yet, we still see PHP, ASP, JSP pages that contain database username/passwords and open/close connections within the page.

We can create one-way hashes (MD5/SHA/etc) of passwords (with salt) so that a user's real password is never stored anywhere, yet many apps still store plaintext passwords in a database.

People put crazy security on pages and then forget to secure services called by AJAX within the pages.

The list goes on and on....
__________________

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

willcode4beer is offline
Reply With Quote
View Public Profile
 
Old 07-21-2007, 05:20 PM Re: Building SECURE web sites & apps
phpl33t's Avatar
Average Talker

Posts: 27
Name: Leonard Bachman
Location: Mississippi, Usa
Trades: 0
I could not delete, it double posted.

Last edited by phpl33t; 07-21-2007 at 05:26 PM.. Reason: deleting, it double posted somehow.
phpl33t is offline
Reply With Quote
View Public Profile Visit phpl33t's homepage!
 
Old 07-21-2007, 05:22 PM Re: Building SECURE web sites & apps
phpl33t's Avatar
Average Talker

Posts: 27
Name: Leonard Bachman
Location: Mississippi, Usa
Trades: 0
I love this topic, I will jump on Php security.

1. Use mysql_real_escape_string, NOT addslashes, to validate all user submitted data.

2. upgrade to php5. If you are still on php3, then get a new job.

3. Do not forget to use strip_tags to validate form data.

4. magic quotes, stop using them, in php6 they will be gone anyway.

5. When passing IDs in forms and links, verify the data wil (int) like this:

Quote:
$id = (int)$_POST['id'];
this makes converts the string to an integer... helps against attacks.

6. Use a function like this for validating data:

Quote:
function vdata($value) {
mysql_real_escape_string(htmlspecialchars(strip_ta gs(trim($value)));
return $value;
}
7. turn off indexes in .htaccess

8. Encrypt all passwords saved in files and databases with at least MD5().

9. Try not to chmod 777.

10. The list could never end, but I have to take a leak, so later gator.

Last edited by phpl33t; 07-21-2007 at 05:23 PM..
phpl33t is offline
Reply With Quote
View Public Profile Visit phpl33t's homepage!
 
Old 07-21-2007, 05:23 PM Re: Building SECURE web sites & apps
phpl33t's Avatar
Average Talker

Posts: 27
Name: Leonard Bachman
Location: Mississippi, Usa
Trades: 0
The forum messed up my code, oh poopy! Remove the space between "ta" and "gs". it should be "tags", forum messes that up for some reason.

Last edited by phpl33t; 07-21-2007 at 05:24 PM..
phpl33t is offline
Reply With Quote
View Public Profile Visit phpl33t's homepage!
 
Old 07-21-2007, 06:16 PM Re: Building SECURE web sites & apps
ForrestCroce's Avatar
Half Man, Half Amazing

Posts: 3,023
Name: Forrest Croce
Location: Seattle, WA
Trades: 0
Quote:
Originally Posted by willcode4beer View Post
Almost all app servers have a means to provide database connections that are configured on the server. Yet, we still see PHP, ASP, JSP pages that contain database username/passwords and open/close connections within the page.
Are you talking about SSPI/AD, or basically network level security saying that whatever user the web server runs on has permission to access the database ... trusted connections in Windows?
__________________

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
ForrestCroce is offline
Reply With Quote
View Public Profile Visit ForrestCroce's homepage!
 
Reply     « Reply to Building SECURE web sites & apps
 

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.64251 seconds with 12 queries