Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Nov 6th, 2005, 5:00 PM   #1
paulchwd
Hobbyist Programmer
 
paulchwd's Avatar
 
Join Date: Mar 2005
Posts: 139
Rep Power: 4 paulchwd is on a distinguished road
Exclamation S E C U R I T Y in asp scripts

Hello all,

I'm looking to restrict access to various pages of my website. I have curently an app in place which queries a database for the credientials (user + password) entered and sets a flag to true if a match was found.

I heard about comparing the HTTP_REFERER header to the HTTP_HOST header, but heard it is useless because soem browsers dont support those headers and hackers can mess with them easily,

do you have any sugestions?


Thanks
paulchwd is offline   Reply With Quote
Old Nov 6th, 2005, 6:25 PM   #2
bja888
Hobbyist Programmer
 
bja888's Avatar
 
Join Date: Oct 2005
Location: Central, FL
Posts: 213
Rep Power: 0 bja888 is an unknown quantity at this point
Send a message via AIM to bja888 Send a message via Yahoo to bja888
You don't need to pass session data through the browser. Keep it on the server with the session object. If you really worried about it check browser and IP every time a page is accessed.
bja888 is offline   Reply With Quote
Old Nov 6th, 2005, 11:10 PM   #3
paulchwd
Hobbyist Programmer
 
paulchwd's Avatar
 
Join Date: Mar 2005
Posts: 139
Rep Power: 4 paulchwd is on a distinguished road
Exclamation

Thanks for your reply

What do you mean by " Keep it on the server with the session object"--> could you show me an example pls...thanks

this is what i am doing nowsee attached, it wont let me upload a .asp or .inc file)

Validate is the main validation page that checks u at login

and val1 is the include file i use on each page to check if you logged in

Thanks
Attached Files
File Type: txt validate.txt (1.0 KB, 51 views)
File Type: txt val1.txt (81 Bytes, 47 views)
paulchwd is offline   Reply With Quote
Old Nov 6th, 2005, 11:15 PM   #4
bja888
Hobbyist Programmer
 
bja888's Avatar
 
Join Date: Oct 2005
Location: Central, FL
Posts: 213
Rep Power: 0 bja888 is an unknown quantity at this point
Send a message via AIM to bja888 Send a message via Yahoo to bja888
Your already useing it in your validate.txt file.
session("flag")=true

That is stored on the server is memory recalls. I believe there is no way for anyone to pull that off the server.
bja888 is offline   Reply With Quote
Old Nov 7th, 2005, 8:42 AM   #5
OpenLoop
Expert Programmer
 
OpenLoop's Avatar
 
Join Date: May 2005
Location: East Lansing, MI
Posts: 663
Rep Power: 4 OpenLoop is on a distinguished road
As far as i know, restricting access to parts of a website is the job of the web server. I'm not sure how to do that in IIS but if you're using apache, you can specify the directories that have restricted access.
OpenLoop is offline   Reply With Quote
Old Nov 8th, 2005, 8:00 AM   #6
paulchwd
Hobbyist Programmer
 
paulchwd's Avatar
 
Join Date: Mar 2005
Posts: 139
Rep Power: 4 paulchwd is on a distinguished road
Oh ic, you mentioned checking ip's how would i go about that? And how do I componsate for dynamic (DHCP) ip's
paulchwd is offline   Reply With Quote
Old Nov 8th, 2005, 10:10 AM   #7
InfoGeek
Professional Programmer
 
InfoGeek's Avatar
 
Join Date: Jun 2005
Location: India, The great.
Posts: 435
Rep Power: 4 InfoGeek is on a distinguished road
I checked your Username/password validation script. It can be easily cracked in 1 min(and no thinking) using SQL injection. google SQL injection for more info about the attack.
__________________
PFO - My daily dose of technology.
InfoGeek is offline   Reply With Quote
Old Nov 8th, 2005, 10:48 AM   #8
bja888
Hobbyist Programmer
 
bja888's Avatar
 
Join Date: Oct 2005
Location: Central, FL
Posts: 213
Rep Power: 0 bja888 is an unknown quantity at this point
Send a message via AIM to bja888 Send a message via Yahoo to bja888
Quote:
Originally Posted by paulchwd
Oh ic, you mentioned checking ip's how would i go about that? And how do I componsate for dynamic (DHCP) ip's
Personally, I would use a offline temp folder. Generate a random file name for a text file. Assoiate that file with the session.
Session("File") = "95862983.txt"
Write in that text file the persons IP address then check the file to see if it matches every time you open a page.
bja888 is offline   Reply With Quote
Old Nov 9th, 2005, 10:24 AM   #9
paulchwd
Hobbyist Programmer
 
paulchwd's Avatar
 
Join Date: Mar 2005
Posts: 139
Rep Power: 4 paulchwd is on a distinguished road
Thanks for the reply

1) what do you mean by "offline temp folder." if its not on my server (this will eventually be uploaded to a server other then my IIS which i have limited control over) how will i reference it

2) To info geek: Thanks for the tip, how can i make it more secure ?

3) How can I protect my Access database so that it cannot be downloaded by going for example www.mydomain.com/mydatabase

thanks for all the help
paulchwd is offline   Reply With Quote
Old Nov 10th, 2005, 8:18 AM   #10
InfoGeek
Professional Programmer
 
InfoGeek's Avatar
 
Join Date: Jun 2005
Location: India, The great.
Posts: 435
Rep Power: 4 InfoGeek is on a distinguished road
Quote:
Originally Posted by paulchwd
how can i make it more secure
Read about the attack and find out why your script is vunerable to it. Then modify your script to make it secure.

Quote:
Originally Posted by paulchwd
How can I protect my Access database so that it cannot be downloaded by going for example www.mydomain.com/mydatabase
Don't give read permission to the world.(chmod 700 mydatabase)
__________________
PFO - My daily dose of technology.
InfoGeek is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

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

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




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 2:23 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC