Home page logo

basics logo Security Basics mailing list archives

RE: passwords in asp pages
From: "Tiago Halm" <thalm () netcabo pt>
Date: Wed, 10 Mar 2004 10:05:21 -0000

Hi Ian,

1. The connection to SQL should be done by NT Authentication rather than SQL
Authentication. That way there will be no password involved, only its hash.
When using SQL Authentication the password itself may be viewed by a

2. The DB connection (in terms of efficiency) should use connection pooling
in order to optimize the available connections. Read throught MSDN about

3. The Server (where IIS resides) should be secured enough from prying eyes.
As an example, your ASP pages only need READ access depending of your IIS
authentication. When using:
        a) Integrated Authentication - give ASPs the READ access to
"Authenticated Users"
        b) Anonymous - give ASPs the READ access to IUSR_MACHINENAME (or any
other account you may have configured to anonymous access to IIS)
        c) Basic Authentication - don't use it :p
Other security features need to be taken into account. Microsoft's site has
a lot of details of how to "harden" your IIS Server.

Hope it helps,
Tiago Halm

-----Original Message-----
From: ian () kingcon com [mailto:ian () kingcon com] 
Sent: terça-feira, 9 de Março de 2004 14:00
To: SECURITY-BASICS () securityfocus com
Subject: passwords in asp pages

I am new to security and I have no training in asp 
programming, so I am wondering if I am right in being scared 
of the following instance...

A IIS based website which has asp pages which contain 
plaintext passwords for credentials to an sql database on 
another machine.  The passwords are in between <% %> so I 
assume that means they are only processed on the server and 
the user does not see them, and there do not seem to be any 
.inc files calling these pages.  The server is also up to 
date with patches as far as I know.

This situation really bothers me, but I'm not experienced 
enough too know how it could be exploited or whether it could 
be exploited at all.  I just don't like the fact that 
passwords to a db user are scattered all over the website.  I 
need something to make it easy to say to the people 
responsible... "Here look this is what can be done to the 
website to gather the passwords and destroy your data.  I 
don't think it is wise you do this, it is in your best 
interests to change this pattern."  The programmer seemed to 
just brush it off, when I said that they could be viewed if 
their source was viewed, by telling me that they would be 
only processed by the server itself, which still doesn't make 
me feel good at all.

Shouldn't the password be encrypted?  Seperated in their own file?  

Is it correct to assume that an attacker who elevated their 
priveledges on the web box could view these files and gain 
access too the database that way through some other method?  

What else can be done by an attacker against asp pages that 
would allow this data to be discovered?

Also if I could actually just demonstrate it right before 
their eyes that would be a big help.

Thanks for any advice.


Ethical Hacking at the InfoSec Institute. Mention this ad and get $545 off
any course! All of our class sizes are guaranteed to be 10 students or less
to facilitate one-on-one interaction with one of our expert instructors.
Attend a course taught by an expert instructor with years of in-the-field
pen testing experience in our state of the art hacking lab. Master the skills
of an Ethical Hacker to better assess the security of your organization.
Visit us at:

  By Date           By Thread  

Current thread:
[ Nmap | Sec Tools | Mailing Lists | Site News | About/Contact | Advertising | Privacy ]