473,403 Members | 2,354 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,403 software developers and data experts.

Security login box

HI all,

Yesterday i have recived an anomious call. The guy have say me that he can hak my page thou the login box. He have say me that he can wrtie sql code in the login box to hak the page.


??? Anione have an idea if it's true. Any dcumentation??
Jun 26 '07 #1
4 1298
code green
1,726 Expert 1GB
It is very easy if you do not have the correct security checking procedures in the script that processes a submitted form.
Have you checked this script?
it sounds like this hacker is actually trying to warn you!
Jun 26 '07 #2
It is very easy if you do not have the correct security checking procedures in the script that processes a submitted form.
Have you checked this script?
it sounds like this hacker is actually trying to warn you!

No, i don't have this procedures. Can you give me a link or example?
Jun 26 '07 #3
Purple
404 Expert 256MB
Hi Thomas,

I have sent you PM with some info.

Regards Purple
Jun 26 '07 #4
Atli
5,058 Expert 4TB
I'm remaining vague on purpose, as I do not want to give away info as how to hack user accounts.
These are tips, on how to avoid the kind of attack you mentioned.

It is extremely important that you validate your users input, especially the username and password.
Be sure that usernames do not contain single quote marks ('), the string wildcard char (%) or equal signs (=).
A simple way to test this using PHP:

Expand|Select|Wrap|Line Numbers
  1. $invalidStrings = array("'", "%", "=");
  2. foreach($invalidStrings as $str) {
  3.   if(strpos($_POST['Username'], $str) or strpos($_POST['Password'], $str)){
  4.     echo "Invalid character used";
  5.     exit()
  6.   }
  7. }
  8. else {
  9.   echo "Its all good!";
  10. }
  11.  
EDIT: Fixed a couple of errors in the code.

Using hashing algorithms like SHA or MD5 on passwords will in many cases prevent attacks as you mentioned, as the entire string passed from the user will be run through the algorithm and the output will be a string of letters that can't be used to attack your database.
This will also ensure that if by some means a hacker (or anybody) would steal your users information, the passwords will be unusable.

Using hashing algorithms in MySQL is extremely simple. You can simply put your password strings into the sha() function and it will be automaticly converted into a 40 char mess that nobody can read. Then when you want to validate, you simply turn the new string into the same mess and try to match it.
For example:
Expand|Select|Wrap|Line Numbers
  1. /* This will insert a messed up
  2.  * 40 char string into the password field
  3. */
  4. INSERT INTO user(password)
  5. VALUES ( sha('myPassword') );
  6.  
  7. /* This will try to match the password
  8.  * by hashing the input and matching it
  9.  * with the one already scrambled in the database
  10. */
  11. SELECT * FROM user
  12. WHERE password = sha('myPassword');
  13.  
This example is obviously flaved as it is missing the username portion, but it explains what I mean.
Jun 27 '07 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

7
by: PaulThomas | last post by:
I am fighting with XP-Pro and VS.Net trying to allow some of the pages in my application to be accessable by 'all' I am using <authentication mode="Forms" /> and if I Login - everything works...
12
by: Angelos Karantzalis | last post by:
Is there a way to set Permissions based on user roles by using some configuration file for my application ? I'm coming from a Java background, where that could very easily be accomplished but...
2
by: MW | last post by:
Hi, I'm trying to secure my application. I'm using forms authentication and I check passwords against a database. I have a login.aspx page in the root of my application, pages that I want...
1
by: Friends | last post by:
Hi I need to set security for row level but not based on Database user's login. It should be based on the user table login. For the particular user I need to allow only the particular records to...
0
by: RAB | last post by:
I have created a folder which I named 'Security' with the path ....Inetpub/wwwroot/Security Within the 'Security' folder, I have placed three files. Web.config, default.aspx and login.aspx ...
0
by: Sergio E. | last post by:
Hello, I have a problem with masterpages and forms security. I made a new Web site, in which I have my page of login like of beginning, a master page with only a sitemappath object in it, the...
0
by: Sergio E. | last post by:
Hello, I have a problem with masterpages and forms security. I made a new Web site, in which I have my page login.aspx as the homepage , a master page with only a sitemappath object in it, the...
1
by: Matt MacDonald | last post by:
Hi all, I've been debating for a while (basically since asp.net 2.0 came out) on using the built in mebership classes to handle user management in my web apps. I seem to keep coming upon...
3
by: RedHair | last post by:
I use the Form Authentication and Role base security to secure one ASP.NET 3.5 appication. Below are security settings in web.config <location path="testAdmin.aspx"> <system.web>...
5
by: VictorG | last post by:
Hello, I am trying to secure a webservice using WSE 3.0 and the turnkey usernameForCertificateSecurity profile. I am passing a valid username token, and on the server I have overridden the...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.