securing my site

Hello Experts

My first time posting here, and relatively new to EE, so be gentle!

Recently, a friend of mine asked me if I could help him out with his site which is written in classic asp. Being from the VB Programming world, I thought it would be a good challenge and also a good way to build up my web development skills, which are quite limited to say the least!

The first task he gave me was to help secure his site a bit, specifically going through and changing the sql statements over to using the command object and parameterized queries. I did a little research on them, and think I understand the concept and theory behind them, but am having trouble getting the syntax right.

could someone post some code and/or links to a simple example on how they work?

Many thanks!
LVL 2
c lAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Big MontySenior Web Developer / CEO of ExchangeTree.org Commented:
first off, welcome to EE :)

I've answered a few questions here on EE about this very topic, here is one example using parameterized queries:

http://www.experts-exchange.com/Programming/Languages/Visual_Basic/Q_28461391.html#a40152051

Also, make sure you "clean" your data before inserting it into the database. Check for proper values, data types, and even the length of data being inserted (if it's a small field and a huge string is being inserted, it could be someone trying to put in a hijack script.

for understanding the theory behind sql injection, wikipedia has a good article explaining the theory:

http://en.wikipedia.org/wiki/SQL_injection

Welcome to EE!
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Scott Fell, EE MVEDeveloper & EE ModeratorCommented:
Let's see what you are starting with.   Can you post your sample code you have now?
0
c lAuthor Commented:
Monty - Beautiful, exactly what I'm looking for, thank you :)

Scott - I really don't have any code yet with regards to creating parameterized queries, I'm trying to find specific examples that I can understand, I'm going to play around some with the example in the link Monty posted.

I'll probably have lots of more questions as I go along, fair warning!!!
0
Cloud Class® Course: Certified Penetration Testing

This CPTE Certified Penetration Testing Engineer course covers everything you need to know about becoming a Certified Penetration Testing Engineer. Career Path: Professional roles include Ethical Hackers, Security Consultants, System Administrators, and Chief Security Officers.

c lAuthor Commented:
thank you - exactly what I'm looking for!
0
c lAuthor Commented:
crud - I accepted the wrong answer. how do I change it to Monty's answer?
0
c lAuthor Commented:
Thank you Gary!
0
Big MontySenior Web Developer / CEO of ExchangeTree.org Commented:
Glad it was helpful :)

happy programming!
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
ASP

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.