Web Forensic Evidence of SQL Injection Analysis



Similar documents
Preprocessing Web Logs for Web Intrusion Detection

INTRUSION PROTECTION AGAINST SQL INJECTION ATTACKS USING REVERSE PROXY

Check list for web developers

Web Application Security

Yuan Fan Arcsight. Advance SQL Injection Detection by Join Force of Database Auditing and Anomaly Intrusion Detection

CHAPTER 5 INTELLIGENT TECHNIQUES TO PREVENT SQL INJECTION ATTACKS

Detection and mitigation of Web Services Attacks using Markov Model

Mingyu Web Application Firewall (DAS- WAF) All transparent deployment for Web application gateway

How To Prevent An Sql Injection Attack

Guidelines for Web applications protection with dedicated Web Application Firewall

On the Property of the Distribution of Symbols in SQL Injection Attack

WEB APPLICATION FIREWALL

Detection of SQL Injection Attacks by Combining Static Analysis and Runtime Validation

A Review of Anomaly Detection Techniques in Network Intrusion Detection System

Secure Web Application Coding Team Introductory Meeting December 1, :00 2:00PM Bits & Pieces Room, Sansom West Room 306 Agenda

EC-Council CAST CENTER FOR ADVANCED SECURITY TRAINING. CAST 619 Advanced SQLi Attacks and Countermeasures. Make The Difference CAST.

International Journal of Computer Science Trends and Technology (IJCST) Volume 3 Issue 3, May-June 2015

Evaluation of Web Security Mechanisms Using Inline Scenario & Online Scenario

Intrusion detection for web applications

Bisecting K-Means for Clustering Web Log data

Application Security Testing. Generic Test Strategy

STANDARDISATION AND CLASSIFICATION OF ALERTS GENERATED BY INTRUSION DETECTION SYSTEMS

Contemporary Web Application Attacks. Ivan Pang Senior Consultant Edvance Limited

Web Usage Mining: Identification of Trends Followed by the user through Neural Network

Security Assessment of Waratek AppSecurity for Java. Executive Summary

An analysis of suitable parameters for efficiently applying K-means clustering to large TCPdump data set using Hadoop framework

WHITE PAPER. FortiWeb and the OWASP Top 10 Mitigating the most dangerous application security threats

Protecting Websites from Dissociative Identity SQL Injection Attacka Patch for Human Folly

Application and Database Security with F5 BIG-IP ASM and IBM InfoSphere Guardium

A Review on Network Intrusion Detection System Using Open Source Snort

Layered Approach of Intrusion Detection System with Efficient Alert Aggregation for Heterogeneous Networks

Where every interaction matters.

Cross Site Scripting Prevention

Analysis of SQL injection prevention using a proxy server

A Novel Frame Work to Detect Malicious Attacks in Web Applications

Web Application Security

The SQL Injection and Signature Evasion

Web Application Firewall Profiling and Evasion. Michael Ritter Cyber Risk Services Deloitte

Observation and Findings

Web Application Security

A survey on Data Mining based Intrusion Detection Systems

Enhanced Model of SQL Injection Detecting and Prevention

Banking Security using Honeypot

Event-based alert correlation system to detect SQLI activities 1 Faeiz Alserhani

Understanding and Responding to the Five Phases of Web Application Abuse

The purpose of this report is to educate our prospective clients about capabilities of Hackers Locked.

SQL Injection January 23, 2013

A clustering Approach for Web Vulnerabilities Detection

FINAL DoIT v.4 PAYMENT CARD INDUSTRY DATA SECURITY STANDARDS APPLICATION DEVELOPMENT AND MAINTENANCE PROCEDURES

Ensuring Security in Cloud with Multi-Level IDS and Log Management System

Intrusion Detection System using Log Files and Reinforcement Learning

Statistical Validation and Data Analytics in ediscovery. Jesse Kornblum

Application Layer Encryption: Protecting against Application Logic and Session Theft Attacks. Whitepaper

The security of Web applications

A VULNERABILITY AUDIT OF THE U.S. STATE E-GOVERNMENT NETWORK SYSTEMS

Double guard: Detecting Interruptions in N- Tier Web Applications

Network Based Intrusion Detection Using Honey pot Deception

Adaptive Framework for Network Traffic Classification using Dimensionality Reduction and Clustering

KEITH LEHNERT AND ERIC FRIEDRICH

Implementation of Botcatch for Identifying Bot Infected Hosts

Distributed Framework for Data Mining As a Service on Private Cloud

SURVEY OF INTRUSION DETECTION SYSTEM

A Multi agent Scanner to Detect Stored XSS Vulnerabilities

SECURING APACHE : THE BASICS - III

The New PCI Requirement: Application Firewall vs. Code Review

ICTN Enterprise Database Security Issues and Solutions

Playing with Web Application Firewalls

Barracuda Web Application Firewall vs. Intrusion Prevention Systems (IPS) Whitepaper

The Cyber Threat Profiler

CSE598i - Web 2.0 Security OWASP Top 10: The Ten Most Critical Web Application Security Vulnerabilities

A Tokenization and Encryption based Multi-Layer Architecture to Detect and Prevent SQL Injection Attack

Text Clustering Using LucidWorks and Apache Mahout

Cyber Security Challenge Australia 2014

Anomaly-based Intrusion Detection in Software as a Service

SQL Injection for newbie

WEB ATTACKS AND COUNTERMEASURES

External Vulnerability Assessment. -Technical Summary- ABC ORGANIZATION

DETECTION AND PREVENTION OF TAUTOLOGY AND UNION QUERY BASED SQL INJECTION ATTACKS

Toward A Taxonomy of Techniques to Detect Cross-site Scripting and SQL Injection Vulnerabilities

Host-based Web Anomaly Intrusion Detection System, an Artificial Immune System Approach

Second-generation (GenII) honeypots

Denial of Service Attack Detection Using Multivariate Correlation Information and Support Vector Machine Classification

Intrusion Detection System in Campus Network: SNORT the most powerful Open Source Network Security Tool

Database security issues PETRA BILIĆ ALEXANDER SPARBER

SQL INJECTION ATTACKS By Zelinski Radu, Technical University of Moldova

Rule 4-004M Payment Card Industry (PCI) Monitoring, Logging and Audit (proposed)

VIDEO intypedia007en LESSON 7: WEB APPLICATION SECURITY - INTRODUCTION TO SQL INJECTION TECHNIQUES. AUTHOR: Chema Alonso

Implementation of Web Application Firewall

Security Model for Multi-Tier Web Application by Using Double Guard

IJMIE Volume 2, Issue 9 ISSN:

Speedy Signature Based Intrusion Detection System Using Finite State Machine and Hashing Techniques

Web Vulnerability Scanner by Using HTTP Method

HOD of Dept. of CSE & IT. Asst. Prof., Dept. Of CSE AIET, Lko, India. AIET, Lko, India

IDS Categories. Sensor Types Host-based (HIDS) sensors collect data from hosts for

IMPLEMENT WEB ATTACK DETECTION ENGINE WITH SNORT BY USING MODSECURITY CORE RULES

Secure Web Development Teaching Modules 1. Threat Assessment

Res. J. Appl. Sci. Eng. Technol., 8(5): , 2014

Application of Data Mining based Malicious Code Detection Techniques for Detecting new Spyware

Using Foundstone CookieDigger to Analyze Web Session Management

Transcription:

International Journal of Science and Engineering Vol.5 No.1(2015):157-162 157 Web Forensic Evidence of SQL Injection Analysis 針 對 SQL Injection 攻 擊 鑑 識 之 分 析 Chinyang Henry Tseng 1 National Taipei University tsengcyt@mail.ntpu.edu.tw 1 Abstract Bernard Chia 2 National Taipei University s710183203@mail.ntpu. edu.tw 2 Tong-Ying Juang 3 National Taipei University juang@mail.ntpu.edu.tw 3 摘 要 In the WEB 2.0 generation, web attack becomes common and widely exploits by the intruders to unauthorized access. According to the survey from OWASP (Open Web Application Security Project s), SQL injection attack (SQLIA) placed the first in the OWASP 2013 s top 10 list of cyber threats that web service facing. SQLIA is a technique of inserting SQL meta-characters and commands into web-based input field to change the original meaning of the SQL queries in order to manipulate the execution of the malicious SQL queries to access the databases unauthorized. It unable be detected by firewall or antivirus due to the SQLIA is just injecting meta-character and do not have any malicious. Hence, forensic analysis to find out the evidence attack play an important role to making conclusion about and incident to prove or disprove intruder s guilt. Methodologies forensic analyses of web application that present previously are only simple statistical analysis, parsing capabilities or simple signature matching. Thus, we proposed a method by analyzing the URL request and decode it before analyzing with the rule set that provided by PHPIDS. After that we, cluster these attacks by calculate the distance with every cluster and cluster it with the nearest centroid point. To find the pattern of the SQL injection to cluster these attacks, we apply a method with extracting the SQL keyword as token set form URL request and analyze these request based on K-mean method to find the standard centroid to cluster these attacks. Keywords: SQL injection, Request decoding, SQL keyword, K-means 在 網 路 2.0, 入 侵 者 以 未 經 授 權 的 方 式 存 取 資 料 庫 內 容 的 網 路 攻 擊 被 廣 泛 使 用 根 據 OWASP 的 調 查 中,SQL 注 入 攻 擊 (SQLIA) 成 為 網 路 攻 擊 排 行 榜 之 冠 SQLIA 是 插 入 的 SQL 元 字 元 和 命 令 以 更 改 原 本 的 SQL 查 詢 的 內 容, 以 執 行 惡 意 的 SQL 查 詢 來 對 資 料 庫 進 行 攻 擊 由 於 SQLIA 的 方 式 並 沒 有 明 顯 的 惡 意 特 徵, 所 以 SQLIA 不 易 被 偵 測 因 此, 網 路 攻 擊 鑑 識 分 析 在 此 扮 演 非 常 重 要 的 角 色, 以 找 出 攻 擊 者 攻 擊 資 料 庫 的 證 據 對 於 過 去 所 提 出 的 Web 攻 擊 分 析 方 法 只 是 一 般 的 統 計 分 析, 僅 僅 只 透 過 語 法 分 析 或 簡 單 的 特 徵 比 對, 效 果 並 不 顯 著 因 此, 我 們 提 出 了 一 種 方 法 來 分 析 與 分 類 SQLIA 首 先, 我 們 會 將 收 集 到 的 URL Request 進 行 Decode 動 作 後, 接 著 利 用 PHPIDS 所 提 供 的 規 則 來 進 行 比 對, 最 後 我 們 透 過 計 算 各 別 SQLIA 與 每 個 攻 擊 的 cluster 中 心 之 距 離 來 對 此 攻 擊 進 行 分 類 為 了 找 出 SQLIA 的 特 徵 模 式, 我 們 利 用 URL Request 內 的 SQL 關 鍵 字 作 為 特 徵 值 並 利 用 K-Mean 方 法 來 分 析 與 分 類 關 鍵 字 : 網 路 攻 擊 鑑 識,Decode, SQLIA, K-Mean * Corresponding author:tsengcyt@mail.ntpu.edu.tw DOI:10.6159/IJSE.2015.(5-1).22

158 International Journal of Science and Engineering 1. Introduction In the WEB 2.0 generation, web attack becomes common and widely exploits by the intruders to unauthorized access. According to the survey from OWASP (Open Web Application Security Project s), SQL injection attack (SQLIA) placed the first in the OWASP 2013 s top 10 list of cyber threats that web service facing. SQLIA is a technique of inserting SQL meta-characters and commands into web-based input field to change the original meaning of the SQL queries in order to manipulate the execution of the malicious SQL queries to access the databases unauthorized. Since SQL injection is difficult to detected, therefore web forensic analysis based on log files plays an important role to find out the attack evidence. There are many techniques to support web forensic analysis; one of the popular techniques is log analysis. Log analysis [1] is one of the tasks in which forensic analysis rely on. Log files are like the black box on an airplane that recorded the event occurred within an organizations system and networks. It recorded some important information token such as IP address, date, request sent, status and bytes send and each have meaning. In previous research, they are focusing on how to SQL injection but not focus on post-analyzing. Author [2] proposed the improved require/provide model which is established cooperation between statistical and knowledge-based model to detect the SQL injection. Even it is a method that can apply in post forensic analysis, but since it too complicated to apply due to the reason it need collect those different types of log files and correlate it and make this way become complicated. The work of [3] is proposed experiment with Bayesian clustering to detect anomalies log line. It might be have highly false negative since it just a simply statistical analysis. In this paper, we proposed a post forensic methodology to analyze SQL injection attack by analyzing the URL request and decode it before analyzing with the rule set that provided by PHPIDS. After that we, cluster these attacks by calculate the distance with every cluster and cluster it with the nearest centroid point. To find the pattern of the SQL injection to cluster these attacks, we apply a method with extracting the SQL keyword as token set form URL request and analyze these request based on K-mean method to find the standard centroid to cluster these attacks. The rest of the paper is organized as following: Section 2 is introducing these previous techniques. Section 3 is describing the detail of the proposed method. Experimental results are discussed in section 4 and section 5 is conclusion. 2. Related Work Our work is closely related with the following subjects: Detection method and clustering method. Therefore we will introduce previous technique in the following section. The rule-based strategy defines the static rules which have to be defined by the rules before the analysis can be made. Those rules can be like detection of certain characters or more complex like session fixation attacks. Static rules are defined once and stay the same during the detection phase. They have to be defined and specifically crafted for each application. Static rules are pre-know values like certain input characters, a fixed length of a parameter or an upper limit of a transfer. Even Rule based detection is widely use in detection but it will produce high false negative rate when unknown attack has been detected. [4] SQL injection can perform in various ways. Therefore, in the field of research, most works have focus on the other solution. For instance, the T. Naoki [5] proposed techniques of SQL injection attack based on the number of characters (alphabets, symbols, numeric characters, etc.) in the input as feature for analysis. Frank S [6] proposed a technique parsing of the attack strings. The field of log mining is closely related to log file forensics. The work of [7] is proposed experiment with Bayesian clustering to detect anomalies in various kinds of log data. [8], [9] proposed used unsupervised clustering algorithm to find anomalies. The discipline of web log mining and knowledge are discovering as describe in [10]. S. Mukkamala [11] proposed the improved require/provide model which is established cooperation between statistical and knowledge-based model to detect the SQL Injection Attack. P. Ning [12] and [13] proposed the alert correlation model based on pre-requisites and consequences of the individual detected alerts. A knowledge data hyper alert type dictionary contains rules that describe the conditions where prior behaviors prepare for later ones.

International Journal of Science and Engineering 159 3. Web forensic analysis Design The proposed Web forensic analysis system consists of 2 stages: Web attack forensic implementation and k-mean clustering. The flow chat of proposed algorithm is given in figure 1. the evidence to detect attack. To perform the request extraction, we refer the following algorithms [14]. Suppose the log file is that consists millions of records where m is the number of request in the log data. Each query in the log files has structure as figure 2 show. Therefore u i = path i + q i and q i = (a 1, v 1 ) + (a 2, v 2 ) + + (a i, v i ) where path i refer to the resource of the web application and a i is name of parameter and v i is value of parameter. And we will decode those parameter before analyze. Figure 1: Web Forensic analyze methodology A. Web Attack Forensic Implementation This stage is discussed how we process and analyze the server log files to find out the evidence of an attacker. This stage involve is 4 process where is preprocessing, feature extraction, request examination and last is status code analysis. 1. Preprocessing: we collect data that we aim to analysis. In this paper, we choose the log files from the web server with the apache web service. Log files is the history of the user s request that send to the server, therefore, it have many clues about the user, it a resource to find out the attack evidence of the intruders. Log provides some information and through the information that provide by the logs, we can know who the intruders is and what request he/she had send to server. After collecting data, then is cluster of each user. 2. Feature Extraction: For the forensic techniques based on the request, we used the value of the URL-request and status code of the URL to representing 3. Request Examination: Basically, SQL injection is a trick to inject SQL command or query as input mainly in POST and GET method in the webpage. Most of the websites takes parameter from the request and make SQL query to databases. Therefore, parameter of the request is important clue in detect SQL malicious queries. In our approach, we analyze the all the GET request value with the regular expression rule that provided by the PHPIDS. Below show the algorithm that how we compare the request parameter with the rule set. Algorithm Request_Analysis () 1. Input: Log query under test, knowledge base rules set 2. Output: True if query match with the rules 3. Begin 4. { set false otherwise 5. For each log query v i in log data 6. { 7. Compare with Rule set 8. If v i not exists in knowledge base rules set 9. Return false 10. Else 11. Return true 12. } 13. } 14. End

160 International Journal of Science and Engineering Figure 2: URL log line Request 4. Status Code Analysis: In the forensic analysis, we not just consider the request parameter detection, but the HTTP status code is be consider in evidence detection analyze. This is because HTTP is the statuses that refer to the request that send to server. In our approach, we just consider the HTTP status code as 2xx. This is because the request with HTTP status code 2xx is mean that the request is success communicating with the web serve. B. K-mean Clustering To clustering these SQL injections that found in log files, we apply k-mean to cluster these attacks. We extract the SQL keyword in logline as feature to cluster these attacks. Example below show we extract SQL keyword to analyze. http: exapmle. php? id2 union, username() Step 6: Recalculate the centroid of cluster. Step 7: Repeat step 5 and 6 until the centroid of cluster be constant. Step 8: The centroid will become the standard centroid of cluster to classify attack. Keyword Token Type Token ID SELECT keyword S UNION keyword U INSERT keyword I DELETE keyword D CREATE keyword C DROP keyword D r ALTER keyword A UPDATE keyword U p SQL Token Since all the SQL injection attack requests most probably have involve SQL keyword, thus, we extract these keywords from the request. Figure 3 show the SQL keyword that we consider. The clustering job is done via k-mean function. We apply k-mean clustering to determine the center as standard pattern to cluster these attacks. Our method is as follow: Step 1: Set value of T = {t 1, t 2, t 3 t i, t i 1 } where T= training set token set Step 2: Set the value of k=number of cluster in T Step 3: D i is the cluster that divide from T based on value of k Step 4: Assign initial centroid of every dataset D i.. Step 5: Take the sample of data D i and calculate the Euclidean distance between the sample data and the centroid of each cluster and assign the sample to the cluster with the nearest centroid. AND keyword A n OR keyword O NOT keyword N -- syntax S 1 1=1 syntax S 2 Figure 3: SQL Token Table 4. Evaluation 4.1 URL Request Examination Result By applying 5-fold cross validation analyze URL request and produce a confusion matrix as show in figure 4. From result, it shows that we detect 4288 out of 4297 from blacklist

International Journal of Science and Engineering 161 data and detect 1 out of 2114 from whitelist data. Experiment result show that the detection rate (TP) of actual SQL injection is 99% and the detection rate (FN) of actual SQL injection just 1%. The experiment also shows that the detection rate (TN) of actual benign is 99.95% and the detection rate (FP) of actual benign is 0.05. Actual (SQL Injection) Actual (benign) (SQL Injection ) 4288 (0.99) 1 (0.05) (benign) 9 (0.01) 2113 (99.95) Figure 4: URL request with decoding confusion matrix By applying same dataset above but the difference is analyzing the URL request without decoding. From dataset, we detect 3690 out of 4297 from blacklist and 1 out of 2114 from whitelist. Figure 5 shows the confusion matrix of the experiment. From the table, we noticed that the detection rate (TP) of actual SQL injection is 85.8% and the detection rate (FN) of actual SQL injection is 14.2%. At the same time, the detection rate (TN) of actual benign is 99.95% and the detection rate (TP) of actual benign is 0.05. Actual (SQL Injection) (SQL Injection ) (benign) 3690 (0.8586) 607 (0.1414) Actual (benign) 1(0.05) 2113 (99.95) Figure 5: URL request without decoding confusion matrix From the confusion matrix above, we notice that the detection rate (TP) of actual SQL injection with decoding is higher than the URL request without decoding. This is because some intruders will encode their malicious code during injection for the purpose to evade the signature detection of Intrusion Detection System (IDS), hence it will affect the effectiveness of detection. This experiment show that URL request with/without decoding will affect the detection. 4.2 K-mean Clustering We apply four type of SQL injection attack to our testing environment. Figure 6 show the clustering result of 4 type attack. From 1000 sample of request, we success cluster the DE- LETE request with zero false negative rate. Besides that, the INSERT and UPDATE request also be cluster into proper cluster with zero false negative. For the UNION request, the true positive rate is 98% and the false negative is 2%. Actual Predict Figure 6: clustering Result of 4 type SQL injection attack 5. Conclusion We using a rule set that provided by PHPIDS to analyze the URL request to find out the attack evidence by the intruders. We decode every URL request before we analyzing the request to avoid the misdetection of the request. Besides that, we also apply the technique K-mean based on the ratio of SQL keyword in the URL request to find out the standard centroid for clustering purpose. At the end of experiment, it show that out proposed is effectiveness in detection and clustering every attack References DELETE INSERT UNION UPDATE DELETE 1000 0 0 0 INSERT 0 1000 0 0 UNION 2 0 980 18 UPDATE 0 0 0 1000 [1] S. Allen, Importance of understanding logs from an information security standpoint, Tech. rep., SANS Institute, 2001, Tech. Rep. [2] Alserhani, Faeiz, et al, "Event-based Alert Correlation System to Detect SQLI Activities," Advanced Information Networking and Applications (AINA), 2011 IEEE International Conference on IEEE, pp.175-182, 2011. [3] P. Ma, Log Analysis-based Intrusion Detection via Unsupervised Learning, Master of Science, School of Informatics,

162 International Journal of Science and Engineering University of Edinburgh, 2003 [4] I. Koral, Richard A. Kemmerer, and P.A. Porras, "State transition analysis: A rule-based intrusion detection approach," Software Engineering, IEEE Transactions on Vol.21 No.3, pp.181-199, March 1995 [5] T. Naoki, Y. Hiroyuki, and M. Minoru, Detection for SQL Injection with Anomaly Detection Method, The 71th National Convention of ISPJ collection of papers, Vol.3, pp.379 380, 2009 [6] Rietta, Frank S, "Application Layer Intrusion Detection for SQL Injection," Proceedings of the 44th annual Southeast regional conference ACM, pp.531-536, 2006. [7] P. Ma, Log Analysis-based Intrusion Detection via Unsupervised Learning, Master of Science, School of Informatics, University of Edinburgh, 2003 [8] J. Stearley, Towards Informatic Analysis of Syslogs, In Cluster Computing, 2004 IEEE International Conference on, pp. 309 318, 2004. [9] A.J.Oliner, A.Aiken and J.Stearley, Alert detection in system logs, In Data Mining, 2008.ICDM 08. Eighth IEEE International Conference on, pp.959 964, 2008. [10] S. Mukkamala and A.H. Sung, Identifying Significant Features for Network Forensic Analysis Using Artificial Intelligent Techniques, In Ternational Journal of Digital Evidence, Vol.1 Isu.4, pp.1 17, 2003. [11] Alserhani, Faeiz, et al. "Event-based Alert Correlation System to Detect SQLI Activities," Advanced Information Networking and Applications (AINA), 2011 IEEE International Conference on IEEE, pp.175-182, 2011. [14] Kruegel, Christopher, and G. Vigna, "Anomaly detection of web-based attacks," Proceedings of the 10th ACM conference on Computer and communications security, pp.251-261, 2003. [12] P. Ning, Y. Cui, D.Reeves, and D.X. Xu, Tools and Techniques for Analyzing Intrusion Alerts, in ACM Transactions on Information and System Security, pp.273--318, May 2004 [13] P. Ning, Y. Cui, D. Reeves, Constructing Attack Scenarios through Correlation of Intrusion Alerts, in Proceedings of the 9th ACM Conference on Computer & Communications Security, Washington D.C., pp245--254, November 2002