Detection of SQL Injection Using a Genetic Fuzzy Classifier System

SQL Injection (SQLI) is one of the most popular vulnerabilities of web applications. The consequences of SQL injection attack include the possibility of stealing sensitive information or bypassing authentication procedures. SQL injection attacks have different forms and variations. One difficulty in detecting malicious attacks is that such attacks do not have a specific pattern. A new fuzzy rule-based classification system (FBRCS) can tackle the requirements of the current stage of security measures. This paper proposes a genetic fuzzy system for detection of SQLI where not only the accuracy is a priority, but also the learning and the flexibility of the obtained rules. To create the rules having high generalization capabilities, our algorithm builds on initial rules, data-dependent parameters, and an enhancing function that modifies the rule evaluation measures. The enhancing function helps to assess the candidate rules more effectively based on decision subspace. The proposed system has been evaluated using a number of well-known data sets. Results show a significant enhancement in the detection procedure. Keywords—SQL injection; web security; genetic fuzzy system; fuzzy rule learning


INTRODUCTION
Web applications are vulnerable to numerous attacks.SQL injection is a widely common threat, which remains on top of the list of web application attacks as ranked by OWASP (the Open Web Application Security Project) [1].Various techniques of SQL injection are used by hackers to achieve different purposes: bypassing a login system, modifying a table in a database, shutting down SQL server, getting database information from the returned error message, or executing stored procedures [2].
SQL injection attacks are a type of vulnerability that is ultimately caused by insufficient input validation.Such attacks occur when data provided by the user is not properly validated and included directly in an SQL query.By leveraging these vulnerabilities, an attacker can submit SQL commands directly to the database.Web applications are threatened by this kind of vulnerability that uses user input to form SQL queries to access an underlying database [3].Generally, SQL injection attacks are classified into seven types: tautologies, illegal/logically incorrect queries, piggy-backed queries, stored queries, inference and alternate encodings [2] [4] [5].
Attackers continuously develop new ways to bypass controls added by developers.In the recent years, hackers started to use different styles to perform SQLI.Hackers developed techniques to bypass web application firewall (WAF bypassing).The security agents started to use buffer overflow methods and applied new bypassing methods like special characters bypassing.The various types of injections at different levels require a solution that can cope with such changes.
A number of approaches address detection of SQLI attacks.Such approaches include static analysis, dynamic analysis, and combined approach.Researchers developed other approaches like mutation based approach, query tokenization and applying regular expressions.These approaches suffer from a number of problems preventing them from being the optimal solutions [6].Those techniques lack flexibility and scalability; they cannot deal with unknown types or larger ranges of injections [7].Lack of learning capabilities is a vital problem.Most solutions parse user input and confirm match limited to fixed and very small patterns, which are modeled by reference to existing malicious web code.However, there are new malicious web codes which can deliberately be developed to avoid being matched with the registered patterns [8].The available parsing techniques can also cause high computational overhead affecting real-time detection [9].
Recently, machine learning techniques are adapted to overcome previously mentioned problems as they can give leverage for the broader range of malicious web code and can be adapted to variations and changes [8].Machine learning techniques explore the study and construction of algorithms that can learn from and make predictions on data.Such algorithms operate by building a model from example inputs in order to make data-driven predictions or decisions, rather than following strictly static program instructions [10].Some existing machine learning techniques suffer from high computational overhead; the training of classifiers in those techniques is time-consuming and causes computational overhead.Furthermore, a number of existing solutions lack adaptation capability to detect new attacks [9].
Uncertainty and fuzziness are popular phenomena in applications of machine learning.Different types of uncertainty can be observed: (i) Noise, outliers, and errors affect the input data.A machine learning method has to deal with this type of fuzzy information, showing robustness with respect to such disturbances.(ii) Distribution and fuzziness influence representation of information within a machine learning system.According to these different locations and goals of fuzzy information, a variety of different models exist which allow machine learning to deal with uncertain information as www.ijacsa.thesai.orginput, output, or internal representation [11].Fuzzy rule-based systems (FRBSs) are well-known methods within soft computing, based on fuzzy concepts that address complex realworld problems.They are powerful methods to address uncertainty, imprecision, and non-linearity [12].
Fuzzy rule-based classification systems (FRBCSs) are specialized in handling classification tasks.A main characteristic of classification is that the outputs are categorical data.Therefore, in this model type, we preserve the antecedent part of linguistic variables and change the consequent part to be a class C j from a pre-specified class set C = {C 1 ,.......,C M }.FRBCS aim at representing the knowledge of human experts in a set of fuzzy IF-THEN rules.Instead of using crisp sets as in classical rules, fuzzy rules use fuzzy sets.Rules were initially derived from human experts through knowledge engineering processes.However, this approach may not be feasible when facing complex tasks or when human experts are not available.An effective alternative is to generate the FRBCS model automatically from data by using learning methods.FRBCSs have demonstrated their ability to handle control problems, modeling, classification or data mining in a huge number of applications [13].
The automatic definition of FRBCS rules can be seen as an optimization problem.Genetic Algorithms (GAs) are global search techniques with the ability to explore a large search space for suitable solutions only requiring a performance measure.In addition to their ability to find near optimal solutions in complex search spaces, the generic code structure and independent performance features of GAs qualifies them to incorporate a priori knowledge.In the case of FRBCSs, this a priori knowledge may be in the form of linguistic variables, fuzzy membership function parameters, fuzzy rules, number of rules (Genetic rule learning), etc.These capabilities extended the use of GAs in the development of a wide range of approaches for designing FRBSs over the last few years.Therefore, GAs remain today as one of the fewest knowledge schemes available to design and optimize FRBCSs with respect to the design decisions.According to the performance measures, decision makers decide which components are fixed and which need to change [13].
In this work, we investigate the FRBCS technique for detection of SQLI; we suggest a new technique to address the uncertainty, fuzziness and adaptation problems associated with existing machine learning techniques.The rule selection mechanism in FRBCS induces competition among rules by only considering the quality of matching performed by each rule.To increase the generalization power of the classifier, we have proposed a genetic fuzzy approach that creates more cooperative rules in the final population.The proposed system uses genetic algorithm (GA) for optimizing the FRBCS technique to enhance its learning and adaptation capabilities.
The rest of the paper is organized as follows: Section 2 discusses related work reported in the literature.An overview of the proposed fuzzy genetic system is explained in Section 3. The experimental result and evaluation of the proposed system are discussed in Section 4. Finally, in Section 5 the conclusion and future research directions are presented.

II. LITERATURE REVIEW AND RELATED WORK
In general, SQL injection attacks can be divided into the three main categories: in-band, out-of-band and inferential [14].In the in-band attacks, the information is extracted from the same channel that is used for the attack.For example, the list of users will appear in the current page.In out-of-band attack, the extracted information is sent back to the attacker using another channel such as email.For inferential, which is also known as a blind injection, no data is sent back directly to the attacker.However, the attacker can reconstruct the data by trying the different attacks and observing the behavior of the web application.
In the literature, SQLI detection techniques can be classified into the dynamic analysis, static analysis, combined approach, machine learning, and other approaches (e.g.Hash technique, Black Box Testing) [3][15-19].Static analysis checks whether every flow from a source to a sink is subject to an input validation and/or input sanitizing routine [20]; whereas dynamic analysis is based on dynamically mining the programmer's intended query structure on any input and detects attacks by comparing it against the structure of the actual query issued [21].
AMNESIA, as a combined approach, is a model-based technique that combines the static and dynamic analysis for detection and prevention of SQLI attacks [3].In the static phase, to build the models of the SQL queries that are generated at points of access to the database, AMNESIA uses a static analysis.In the dynamic phase, AMNESIA intercepts all the SQL queries before they are sent to the database and checks each query against the statically built models.Queries that violate the model are identified as SQLI attacks.The accuracy of AMNESIA depends on the static analysis stage.Unfortunately, certain types of complicated codes and/or query generation techniques make this step less precise and generate both false positives and negatives [22].
As mentioned above, several approaches for detection of SQL injection were developed.The literature survey emphasizes on the machine learning techniques which are relevant to our proposed system.Valeur et al. [23] proposed an intrusion detection system capable of detecting a variety of SQL injection attacks.Profiles of normal access to the database are built using statistical methods.At runtime, queries that do not match any built model are identified as a possible attack.As with most learning-based anomaly detection techniques, the system requires a training phase prior to detection.The main problem of this technique besides the false positives and negatives is its execution and storage overhead, due to difficulty in training on all the possible normal benign queries with normal behavior [24].
In [9], the authors proposed an SQLI detection technique in adversarial environments by K-centers.They introduced a new online learning technique in which samples are learned one by one, and as a result, number and centers of the clusters are adjusted accordingly.Therefore, the K-centred technique can adapt to different kinds of attacks.The experimental results show that their method has a satisfying result on the SQLI attacks detection in the adversarial environment.The main www.ijacsa.thesai.orgdrawback of their method is that it must receive a true label of each statement after classification [25].The concept of pattern classifiers to detect injection attacks and protect web applications is introduced in [24].HTTP requests are captured and converted into numeric attributes.Numeric attributes include the length and the number of keywords of parameters.Using these attributes, the system classifies the parameters by Bayesian classifier to judge whether the parameters are injection patterns or not.The main drawback is that the system depends on limited types of features.
The major contributions of the work in [26] are the proposal of a novel method based on the genetic algorithm applied to SQLI attack detection task and correlation of a number of detection tools altogether with the novel method.In this work, the authors prove that correlating several sources of information and then performing reasoning on the correlated information can improve the results of attacks detection.The main disadvantage of this algorithm is the overhead in performance and storage caused by the correlation approach.
The implementation of Artificial Neural Networks (ANN) as a biologically inspired computing is investigated in [2] to detect SQLI attacks.Multilayer Feed forward Networks (MLN) was used in the implemented system.It has the ability to learn and store the empirical knowledge, the nonlinearity nature of the neural networks, the ability to generalize the solutions and to adapt when the context changes, and suitable computational performance.The limitations include depending on the appearance of certain SQL keywords along with suspicious characters without considering the relative order between them.For this reason, despite the different order of the keywords, if a normal signature contains many keywords and suspicious characters that often appear together in an SQLI, it is highly likely to be misclassified.Another work, related to ANN-based SQLI detection, is introduced in [27,28].It depends on limited SQL patterns for training so it is susceptible to generate false positives.
TF-IDF has been used in [8] for weight calculation of tokens to evaluate the performance of three machine learning approaches: SVM, Naive-Bayes, and K-NN.This method has low computation time complexity but susceptible to generating false positives [9].Furthermore, Gene Expression Programming (GEP) for detection of SQLI is discussed in [29].At the beginning, chromosomes are generated randomly.Then, in each iteration of GEP, a linear chromosome is expressed in the form of expression tree and executed.The fitness value is calculated and termination condition is checked.The best individual is preserved through the next iteration.Afterward, the populations are subjected to genetic operators with defined probability.New individuals in temporary population constitute the current population.Classification accuracy received from GEP depicts great efficiency for SQL queries constituted from 10 to 15 tokens.For longer statements, the averaged FP and FN is approximately 23%.
Among the approaches, genetic algorithm for detection of SQLI is proposed in [30].In this technique, levels of SQLI are detected using template matching.The ultimate goal of the genetic algorithm is to optimize the matching rules of SQLI queue in the template library.These rules are in the form of IF (condition) THEN (execution); where conditions refer to attack sequence matches.However, the algorithm relies on template sequence to define SQLIA.Therefore, the system fails to detect the attacks of different sequences that are not included in the template library.
The main objective of this paper is to propose a combined approach where FRBS and the genetic algorithm can be used together to improve the accuracy of the system for detection of SQLI, consequently, new SQLI attacks can be processed and detected.To the best of our knowledge, there is no previous work that uses FRBS for detecting SQLI attacks.To enhance the accuracy of learning capability, we extend FRBS with the genetic algorithm to find the most suitable rules for FRBCS.

III. PROPOSED SQL INJECTION DETECTION SYSTEM USING FUZZY GENETIC
This paper introduces a GA based method to generate a fuzzy rule base for SQLI detection.With the specific structure of the chromosome, the GA operations and the adequate fitness function, the proposed method produces a fuzzy rule base (FRB) with proper rules.Designers usually cannot guarantee that the fuzzy control system designed with trial-and-error for building fuzzy rules has a reliable performance.Fig. 1 illustrates the flow diagram of the proposed system.
In this work, the fuzzy rule base is tuned automatically by GA, known as Genetic Fuzzy System (GFS).The fuzzy logic produces controllers that are suitable for dealing with uncertainty and imprecision.Second, fuzzy behaviors can be conveniently synthesized by a set of IF-THEN rules using easy-to-understand linguistic terms to encode expert knowledge.Finally, the interpolative nature of fuzzy systems helps express partial and simultaneous simulations of SQLI features, and the smooth transitions between these features [30].GA starts with a population of randomly generated chromosomes, and advance towards better chromosomes by applying genetic operators inspired by the genetic process occurring in nature.The population undergoes evolution in a form of natural selection.During successive iterations, called generation, chromosomes in the population are evaluated for their adaptation as solutions, and on the basis of this evaluation, a new population of chromosomes is formed using a selection mechanism, crossover, and mutation operators.A fitness function must be devised for each problem to be solved.Each chromosome is evaluated using the fitness function, returning a single numerical value.The probability of selection of a certain chromosome is directly proportional to its fitness function [31].A GA-tuned fuzzy system with seven inputs and one output will be illustrated to explain the SQLI detection process.www.ijacsa.thesai.org

A. Extracting SQLI features from dataset
The SQLI attack keywords are the popular keywords in SQL language which are generally used in order to perform operations on the tables inside a given SQL database.This approach extracts tokens (keywords) which consist of specific terms of malicious web code as features.Tokenization is a process of breaking a sentence into a list of words.In other words, a tokenizer parses a sentence into a list of tokens.Based on these tokens, the system extract the features, and represent each query as a sequence of numbers, each number represents one of the features mentioned below      f : Existence of statements that always result in true value, for example or "@=@" or "124=124".
The appropriate selection of these features plays a crucial role in several aspects of the design of robust and feasible SQLI detection systems.The rationale for choosing these types of features is its ability to identify most of SQIA types like tautologies, union, piggybacked, illegal/logically incorrect, alternate encodings and stored procedures which are treated the same as SQL queries.Other features can be included to increase the scalability of the system to detect new malicious code.In addition, by reducing the number of features (by eliminating redundant or irrelevant features), the performance of rule induction system can be improved as well as the classification performance of the rules produced.

B. K-means clustering
To transfer the extracted numerical features (all mentioned above features except the 7 th feature into linguistic terms low (L), medium (M) and high (H); the system utilizes Kmeans clustering algorithm.k-means is one of the simplest unsupervised learning algorithms that solve the well-known clustering problem.The procedure follows a simple and easy way to classify a given data set through a certain number of clusters (assume k clusters) fixed Apriori.Let } ,..., , { be the set of initial centers.Algorithmic steps [32,33] for k-means clustering are: 1) Randomly select k cluster centers, k =3 in our case.
2) Calculate the distance between each data point and cluster centers.
3) Assign the data point to the cluster center whose distance from the cluster center is the minimum of all the cluster centers.
4) Recalculate the new cluster center: , where c i represents the number of data points in cluster.www.ijacsa.thesai.org

5)
Recalculate the distance between each data point and the new obtained cluster centers.If no data point is reassigned then stop, otherwise repeat from step 3.This algorithm aims at minimizing an objective function, in this case, a squared error function.


c i is the number of data points in i th cluster, and k is the number of cluster centers.

C. Fuzzy Logic System
Owing to low computational requirement and capability of modeling human perception, fuzzy Logic (FL) is an efficient and flexible method for managing degrees of uncertainty in attack detection.Problems can be described in natural descriptions, linguistic terms, rather than the numerical values.The FL system consists of (i) fuzzifier that takes input values and determines the degree to which they belong to each of the fuzzy sets via membership functions (MFs); (ii) fuzzy inference system that defines a non-linear mapping of the input data vector into a scalar output, using fuzzy rules and (3) defuzzifier that maps output fuzzy sets into a crisp number [34].A fuzzy set [35] is defined as [2]: ) where X represents the universal set, x is an element of X, D is a fuzzy subset in X and μ D (x) is the membership function of fuzzy set D. A membership function is a curve that defines how each point in the input space is mapped to a membership value (or degree of membership) between 0 and 1 [35].
Next we will fuzzify the input (features of SQLI) and the output (probability of injection), i.e. input and output are mapped into a set of fuzzy partitions.Here, a seven-input single-output fuzzy system is used, which is given by , where is the input space and Z is the output space.Three fuzzy variables including 'low', 'medium' and 'high' (L, M, H) are used to describe the features.Their respective MFs (µ A ) [36] are triangular function calculated as: ) where a, b and c are the outputs of the k-mean clustering that represent lower, center and upper limits of a cluster respectively.To achieve overlap between the membership functions (overlapped fuzzy-sets) of each feature, the system makes an intersection with 15% -20% between the consecutive MFs.
Once the system acquires the fuzzy descriptions of the features distance, the Mamdani rule base (fuzzy reasoning) can be built to make an inference of detection of SQLI.Fuzzy reasoning, which is formulated by the group of fuzzy IF-THEN rules, presents a degree of presence or absence of association or interaction between the elements of two or more sets.In the proposed system, reasoning is carried out through the following rules:  If more than half input variables are 'H', the output variable is set to 'H'.
 If both 7 f and 2 f are 'H', the output variable is set to 'H'.

 If both 7
f and 1 f are 'H', the output variable is set to 'H'.
 If both 1 f and 2 f are 'H', the output variable is set to 'H'.
f , 2 f and 1 f are 'H', the output variable is set to 'H'.
 If any of 7 f , 2 f and 1 f is 'H', the output variable is set to 'M'.
f and 2 f are 'M', the output variable is set to 'M'.
Other rules are obtained using the Cartesian product method of the seven features; which is to consider all the combinations of antecedent linguistic values and generate a fuzzy rule for each combination.The output variable of each case depends on the nature of dataset.The rules altogether deal with the weight assignments impliedly in the same way that humans think.The fuzzy inference processes all of the cases in a parallel manner, which makes the decision more reasonable.
The output of the fuzzy system is the probability of SQLI (PSQLI) and it is also described by three fuzzy variables, including 'high', 'medium' and 'low' with triangular MFs.The outputs of fuzzy values are then defuzzified to generate a crisp value for the variable.The most popular defuzzification method is the centroid, which calculates and returns the center of gravity of the aggregated fuzzy set [36] and is given by where ) (r  is the center of the suggested output at rule r, n is the number of rules and ) (r  is the MF at rule r.The obtained crisp value is then mapped to its range (low, medium, high) to indicate the potential of SQLI attack.

D. Rule Induction using Genetic Algorithm
In general, a rule base can be constructed by human experts or by machine learning techniques from datasets.The machine learning approach is useful where it is desired to extract rules from the analysis that can be related to conceivable human behavior.The essential feature of a GA is that a population of proposed solutions (coded using a "chromosome") is modified using biologically inspired operators (especially crossover and mutation), and incorporating a random component, to explore a solution space [37].Formally, let P(g) and S(g) be parents and offspring in generation g; the GA is working as follows: www.ijacsa.thesai.orgRecombine P(g) to yield S(g) Evaluate S(g) Select P(g+1) from P(g) and S(g) g ← g +1 END In general, the methods that combine the genetic and fuzzy approaches for generation of knowledge bases (KBs) can be divided into two main groups: genetic tuning and genetic learning [13].If there exists a KB, we apply a genetic tuning process for improving the FRBS performance while preserving the existing RB.That is, to adjust FRBS parameters for improving its performance, maintaining the same RB.The second possibility is to learn KB components (an adaptive inference engine can be included).That is, to involve the learning of KB components among other FRBS components.Our system employs the genetic learning to learn the flexible inference engine.
The first step in applying GAs to the problem of rule learning is to map the initial rules (initial RB) into a suitable representation for genetic operations.The system that has been used is Michigan GA [13].In Michigan GA, the population consists of multiple individuals, each individual codifies single rule, and the whole rule set is provided by combining several individuals in a population.For this problem, the variables (genes) are the linguistic values of each feature (low, medium, high).Many trials of different values of GA parameters were performed.Finally, the best-evaluated values of parameters were chosen as mentioned in Table I.The codification scheme and the fitness calculation are described below.

1) Chromosome Codification
The pre-selection of candidate rules (initial RB) used here allows each rule to be uniquely identified.The identification induces a simple binary codification of each rule in each chromosome and, consequently, the use of simple processes to create and handle the chromosomes.Fig. 2 illustrates a chromosome with 15 bits, represented in binary system, where each consecutive two bits from the position 1 to position 12 indicate a feature i f (i=1 to 6) with "00" for low, "01" for medium and "11" for high linguistic term; whereas the bit at position 13 identifies a feature 7 f with values "0" to non- existing and "1" for existing and finally the last two bits represents PSQLI with "00" for low, "01" for medium and "11" for high linguistic term.

2) Fitness Function
In order to use genetic algorithms as the search procedure, it is necessary to define a fitness function which properly assesses the rules.The fitness function must be able to discriminate between the legal and illegal classification of queries.Finding an appropriate function is not a trivial task, due to the variations associated with the SQLI types.In general, the quality of rules in an FRBS is one of the parameters that favor accuracy, while the number of rules is the parameter that favors transparency, an FRBS with a small number of rules can make the model easily understood by the user.Several approaches in the field of FRBS reduce the FRB size at the expense of accuracy [38].In this work, the primary objective is to enhance the accuracy; therefore, the numbers of rules are left as they are.
In this work, the method suggested by the authors in [39] is refined to improve the evaluation step performed by the GA in order to optimize the rules in the final FRB during the search process.The fitness value is calculated using the Correct Classification Rate (CCR) represented by each chromosome.
where A is the total number of attack records, B is the total number of normal records,  is a total number of attack records correctly identified as attack and  is the total number of normal records incorrectly classified as attack (False positive).

IV. EXPERIMENTAL RESULTS
To evaluate the performance of the proposed system, a desktop application that integrates Java and MATLAB has

Rule antecedent part
Consequent part www.ijacsa.thesai.orgbeen implemented.The dataset is downloaded from testbed [40] which is used to evaluate Amnesia approach in [3].The test bed has two sets of inputs: "legit" set, which consists of legitimate inputs for the application, and "attack" set, which consists of attempted SQLIAs.All types of attacks were represented in this set except for multi-phase attacks.The multi-phase attacks include inference attacks and illegal/logically incorrect queries, such attacks require human intervention and interpretation.The testbed includes seven folders, three of them are used for training and the rest for testing.The result is analyzed using: (1) True negative (TN), which means the label of the SQL statement is normal and the classifier has classified it as normal.
(2) True positive (TP) means that the classified label is the same as the true label which is abnormal.(3) False negative (FN) means that the classifier has made a classification mistake concerning the abnormal SQL statements.(4) False positive (FP), which means that a normal statement is misclassified to be an abnormal statement [9].The tests are conducted according to Table I, and the fuzzy parameters are set as membership function type is triangular with 20% overlap.
The first experiment was conducted on the three different training sets to investigate the performance of the proposed system under both original Cartesian rules and enhanced version.The original Cartesian rules were the initial rules of the GA formed by all combinations of the seven features that have been previously mentioned in Section 3. Whereas the enhanced version contains the Cartesian version plus seven rules that contain only three features (f 1 , f 2 , and f 7 ), which have the higher impact on SQLI detection.Each other individual rule in the original Cartesian set contains all the seven features together.Table II indicates that the system can achieve high accuracy using the enhanced Cartesian rule with 96.8% TP for the attack set and 1.2% FP for the legit set of the Checkers dataset.The enhanced Cartesian rules improve the detection accuracy of attacks with a slightly increased false positive rate for the legit set.One reason for this increase is the fact that using the enhanced version activates some rules concerned with f1 which exists with high frequency in normal URLs.For example, the frequency of a character like '=' can be high in normal URLs.
When compared to the results in Table III, the enhanced Cartesian rules achieve higher accuracy in detection of SQLI in the three folders of the testing set with average increase of 3% TP and average decrease of 1% TN.One explanation of such result is that there are some attack URLs like "Password='&ret_page='''''&querystring='" resulted after preprocessing stage in the training set.Such URLs do not consider most of SQLI features; thus they are not matched with any rule resulting in false negative (wrong classification).Regarding the Office Talk testing set, it has been noticed that the obtained results have the same range as the results of the training set due to the similarity of the URLs structure.
From the obtained results in table IV, it is confirmed that the proposed system provides good accuracy on the subject of increasing population size (number of initial rules).In general, increasing the population size leads to increasing the diversity of chromosomes.This diversity results in new offspring's in each generation that gives rise to increasing accuracy.However, increasing the number of rules increases the overhead.Furthermore, the experiments reveal that the system's accuracy can be improved as the level of fuzzification increases inside the membership function (intersection area).In the case of increasing the intersection by 5%, the accuracy changed by 2-4%.One explanation for this result is that the system's ability to deal with uncertainty is directly proportional with increasing the fuzzification level.Increasing the intersection level between membership functions for each feature will increase the ability of the fuzzy logic system to infer the result from the activated rules through fuzzy logic operation (min, and max).www.ijacsa.thesai.orgCOMPARATIVE STUDY

Correct Responses
The proposed system 98.4% Neural Network system [28] 96.8% In the last experiment, the accuracy (correct responses) of the proposed system that employs genetic fuzzy algorithm to detect SQLI and the comparative algorithm suggested by N. Sheykhkanloo [28] is given in Table V.The comparative system utilizes an effective pattern recognition Neural Network (NN) model for detection and classification of the SQLI attacks.From the illustrated results, our system outperforms the other one by 1.5%.In general, the correct responses of the neural network system depend mainly on the number of hidden layers that is commonly determined by the user.On contrast, the accuracy of our system depends on the number of utilized features and consequently the constructed rules, which characterize the flexibility factor for our system.Furthermore, the initialization parameters of GA can affect the performance of our system.These parameters are configured in the learning phase (offline processing), which consumes more time.In the testing phase (online processing), the computation time for detection is reasonable and acceptable.The duration is about 217 sec for 13079 attacks, i.e. 16.6 ms for one attack.

V. CONCLUSION
In this article, we proposed a genetic-fuzzy rule-based classification system for the SQLI attack detection.In the proposed system, the SQL statement is treated as a feature vector that characterizes the SQLI attack keywords.The genetic algorithm is adapted for FRBCS to improve the quality of matching implemented by each rule by means of adjusting FRBS parameters to increase the generalization power of the classifier.The quality of the proposed system depends mainly on the selection of the attributes used to build the feature vector.It has the potential to give a higher accuracy when comparing to other solutions that use SQL keywords separately for the problem of SQL injection.For new patterns that the proposed system cannot recognize, the system can be retrained so that it can detect the new patterns without a significant increase in processing time.The solution can be used in combination with positive logic based filtering as in the prototype implementation.We have presented the evaluation methodology and reported the results that prove that: (i) The proposed method outperforms other state-of-the art NN method.(ii) Enhanced Cartesian of GA population type improves detection results.Future work includes investigating more features to enhance the performance of the detection, and the ability to automatically reduce the number of rules in the rule base to improve the detection.

 5 f 6 f
: Length of SQL statement.: Frequency of spaces within the parameter of the query, which leads to the possibility of attacks.

TABLE II .
RESULTS OF SQLI DETECTION OF TRAINING SET

TABLE IV .
RESULTS OF SQLI DETECTION OF TESTING SET (TOTAL OF 13079 ATTACKS, 3016 LEGIT URLS OF THE FOUR TESTING FOLDERS)