Defensive Approaches on SQL Injection and Cross-Site Scripting Attacks

Defensive Approaches on SQL Injection and Cross-Site Scripting Attacks

View metadata, citation and similar papers at core.ac.uk brought to you by CORE provided by Global Journal of Computer Science and Technology (GJCST) Global Journal of Computer Science and Technology: E Network, Web & Security Volume 14 Issue 2 Version 1.0 Year 2014 Type: Double Blind Peer Reviewed International Research Journal Publisher: Global Journals Inc. (USA) Online ISSN: 0975-4172 & Print ISSN: 0975-4350 Defensive Approaches on SQL Injection and Cross-Site Scripting Attacks By Venkatramulu Sunkari & Dr. C. V. Guru Rao Kits Warangal, India Abstract- SQL Injection attacks are the most common attacks on the web applications. Statistical analysis says that so many web sites which interact with the database are prone to SQL Injection/XSS attacks. Different kinds of vulnerability detection system and attack detection systems exist, there is no efficient system for detecting these kinds of attacks. SQL Injection attacks are possible due to the design drawbacks of the websites which interact with back-end databases. Successful attacks may damage more. The state-of-art web application input validation echniques fails to identify the proper SQL/XSS Vulnerabilities accurately because of the systems correctness of sanity checking capability, proper placement of valuators on the applications. The systems fail while processing HTTP Parameter pollution attacks. An extensive survey on the SQL Injection attacks is conducted to present various detection and prevension mechanisms. GJCST-E Classification : H.2.7 DefensiveApproachesonSQLInjectionandCross-SiteScriptingAttacks Strictly as per the compliance and regulations of: © 2014. Venkatramulu Sunkari & Dr. C. V. Guru Rao. This is a research/review paper, distributed under the terms of the Creative Commons Attribution-Noncommercial 3.0 Unported License http://creativecommons.org/licenses/by-nc/3.0/), permitting all non- commercial use, distribution, and reproduction inany medium, provided the original work is properly cited. Defensive Approaches on SQL Injection and Cross-Site Scripting Attacks Venkatramulu Sunkari α & Dr. C. V. Guru Rao σ Abstract - SQL Injection attacks are the most common attacks from SQL Injection attacks. In the most of the website on the web applications. Statistical analysis says that so many home pages we see as the Fig. 1 text and password web sites which interact with the database are prone to SQL boxes to enter into the website. For example if we have Injection/XSS attacks. Different kinds of vulnerability detection login and password to use the web services, and login 2014 system and attack detection systems exist, there is no efficient as admin and password as admin0123. We enter login, system for detecting these kinds of attacks. SQL Injection Year password and then we click on submit. Our browser attacks are possible due to the design drawbacks of the sends the http GET request and these values( login, websites which interact with back-end databases. Successful 77 attacks may damage more. The state-of-art web application password) will be submitted to the appropriate program input validation echniques fails to identify the proper SQL/XSS file, in the above example validate.jsp as an input Vulnerabilities accurately because of the systems correctness parameters. In the middle of the transmission we can of sanity checking capability, proper placement of valuators on observe this request as the applications. The systems fail while processing HTTP ”GET http://www.example.com/validate.jsp? Parameter pollution attacks. An extensive survey on the SQL username=admin&password=admin0123 HTTP/1.1 ”. Injection attacks is conducted to present various detection and Here the validatation process on the server is prevension mechanisms. validate.jsp and it accepts the parameters username I. Introduction and the password. If the above request is received by the www.example.com webserver, then that server QL Injection attack is a web application sends the requested values to the validate.jsp with the vulnerability that occurs because of improper argument values. Validate.jsp validates the username validations at the server side. National Vulnerability and password with its back-end database ( Say S ) Database (NVD) is an International security organization D DDDD DDD ORACLE Server). Before interacting with the database E and is organized by the U.S Government. In this, most validate. Jsp script creates a dynamic SQL Query for ( of the security threats and the vulnerability (flaws) will be validating the user inputs. Let us assume that the code published. Each Vulnerability ( Software Flaws) is for the validate,.jsp is designed as Fig. reffunction. If this identified with CVE-ID. When we see the vulnerabilities validate.jsp takes admin as username and admin0123 (CVE-IDs) published to till date there are total of 60598. as password, then the dynamic query will be created at Among all these vulnerabilities 5922 are sql injection the runtime is var sql = ”select * from users where flaws and 8074 are cross site scripting flaws. Exploit-db username = ’” + username + ”’ and password = ’” + is a security community. The site publishes vulnerability password + ”’”. Dynamic query will be sql=select * details possibly with Proof Of Concept(POC). from users where username=admin and Vulnerability research or response teams and most of password=admin0123. If the user or attacker enters the the hackers or crackers participate for their fame and values for username, and password as ”Username : or name. This site provides a separate category called web 1=1 –” and ”Password : xyz” In the scenario, the apps. In this category we can see the website hacked dynamic query will be created below sql=select * from details. Currently this site is publishing 100 to 200 POC users where username= or 1=1– and password=xyz. for every month. Famous and Open Source Intrusion In the sql statement username= will become one Detection System SNORT is providing detection logics condition which returns false and the condition 1=1 not more than twenty. By these logics we can detect which is tautology condition and returns always true. upto 20-40 sql injection attacks. So many commercial These two conditions here are joined with or. so that IDS/IPS Systems are also providing very few logics. By total result will be true for always. And the Statement (–) this analysis we can conclude that, SQL Injection is used as comment statement in the most of the sql Global Journal of Computer Science and Technology Volume XIV Issue II Version I attacks are more and there is no efficient detection supported database management systems. If this system for detecting and for protecting web applications comment statement statement appears in the middle of the SQL Query, then the rest of the query will be ignored. So that when we execute the above SQL Author α: Associate Proffesor In Cse Kits, Warangal. Query, The result of execute query(sql) will be non-zero Author : Proffessor and Head of Cse Department, SR Engineering σ College, Warangal. e-mails : [email protected], and returns all the records of the users table. And then [email protected] attacker may gain the admin access,.( Because of the ©2014 Global Journals Inc. (US) Defensive Approaches on SQL Injection and Cross-Site Scripting attacks entered user will be treated as the result of the first execute his own queries, instead of the developer record and most of the SQL users Tables first record expected query. And it is possible to insert another SQL may be the admin). Because of no validations are done Querries by at the server-side for the user inputs, an attacker 2014 Year 78 ) D DDD E ( Figure 1 : Sample Login Screen In the Web Applications Global Journal of Computer Science and Technology Volume XIV Issue II Version I Figure 2 : Sample HTML Code To Send Login Data ©2014 Global Journals Inc. (US) Defensive Approaches on SQL Injection and Cross-Site Scripting attacks a) Validate.jsp If this validate.jsp takes admin as username and admin0123 as password, then the dynamic query will be created at the runtime is varsql = ”select _ fromuserswhereusername =0 ” + username+”0andpassword =0 ”+password+”0”; Dynamic query will be sql = select _ fromuserswhereusername = adminandpassword = admin0123; If the user or attacker enters the values for username, and password as below Username : or 1=1 - - Password : xyz 2014 In the above scenario, the dynamic query will be Year created below sql = select _ fromuserswhereusername = or1 = 1 − 79 −andpassword = xyz; in the above sql statement username= will become one condition which returns Figure 3 : Sample Validation Function false and the condition 1=1 which is tautology condition and returns always true. These two conditions combining with UNION Statement. Example: If the here are joined with or. so that total result will be true for attacker enters below values username: or 1=1 union always. And the Statement ( – ) is used as comment insert into users values(sreedevi,sreedevi0123,admin) statement in the most of the sql supported database password: xyz Like this if any vulnerability found on the management systems. If this comment statement website parameter, an attacker can inject his own statement appears in the middle of the SQL Query, then queries for insert,update,etc. the rest of the query will be ignored. So that when we The result of the SQL Injection will be very execute the above SQL Query, The result of execute severe. Like this we can find more number of attack or query(sql)will be non-zero and returns all the records of hacked details in the security websites. the users table. And then attacker may gain the admin ) D DDDD DDD access,.( Because of the entered user will be treated as E II. Sql Injection Attacks ( the result of the first record and most of the SQL users In the most of the website home pages we see Tables first record may be the admin).

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    7 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us