{'fraction_non_alphanumeric': 0.02429845904298459, 'fraction_numerical': 0.0033414436334144363, 'mean_word_length': 4.975188990114363, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Encoding a Taxonomy of Web Attacks with Different-Length Vectors

Web attacks, i.e. attacks exclusively using the HTTP protocol, are rapidly becoming one of the fundamental threats for information systems connected to the Internet. When the attacks suffered by web servers through the years are analyzed, it is observed that most of them are very similar, using a reduced number of attacking techniques. It is generally agreed that classification can help designers and programmers to better understand attacks and build more secure applications. As an effort in this direction, a new taxonomy of web attacks is proposed in this paper, with the objective of obtaining a practically useful reference framework for security applications. The use of the taxonomy is illustrated by means of multiplatform real world web attack examples. Along with this taxonomy, important features of each attack category are discussed. A suitable semantic-dependent web attack encoding scheme is defined that uses different-length vectors. Possible applications are described, which might benefit from this taxonomy and encoding scheme, such as intrusion detection systems and application firewalls.


Introduction
With the increasing use of Internet as a commercial channel, there is a growing number of web sites deployed to share information, offer on-line services, sell all sorts of goods, digital or physical, distribute news and articles, etc. On the other hand, the number of attacks is increasing in parallel: theft of private information, defacing of homepages, denial of service, worm spreading, and fraud, are but a few of the most common and frequent attacks in cyberspace [16,21].
When the attacks suffered by web servers through the years are analyzed, it is observed that most of them are recurrent attacks. In fact, they correspond to a limited number of types of attacks. Thus, it is generally agreed that classification can help designers and programmers to better understand attacks and build more secure applications.
In an effort to create a common reference language for security analysts, a number of classifications and taxonomies of computer attacks and vulnerabilities have appeared in recent years [4,10,13,15,20,22,25,32]. However, these taxonomies are general and do not specifically cover web attacks.
In this paper we propose a taxonomy of web attacks, taken into account a number of important features of each attack category. The role of these features as well as their importance for each of the attack categories is discussed. By web attacks, we understand attacks exclusively using the HTTP protocol.
The proposed taxonomy represents an effort to cover known attacks and also some attacks that might appear in the future. Once the taxonomy has been defined and the role and importance of its categories have been explained, we use different-length vectors to encode all relevant information contained in web attacks. These vectors can be useful in a number of applications, such as intrusion detection systems (see Sec. 5.1) or application firewalls (see Sec. 5.2).
The paper is organized as follows. Section 2 proposes the taxonomy of web attacks. Section 3 explains how and why to encode the attacks into differentlength vectors. Section 4 gives some examples of attacks encodings. Section 5 provides some ideas about which applications might benefit from this encoding and Section 6 concludes the paper.

Web attack properties
A taxonomy is a classification scheme that partitions a body of knowledge and defines the relationship of the objects. Classification is the process of using a taxonomy for separating and ordering [10]. According to [2], satisfactory taxonomies have classification categories with the following characteristics: 1. Mutually exclusive: the categories do not overlap.
2. Exhaustive: taken together, the categories include all the possibilities. 3. Unambiguous: clear and precise so that classification is not uncertain, regardless of who is classifying. 4. Repeatable: repeated applications result in the same classification, regardless of who is classifying. 5. Accepted: logical and intuitive so that categories could become generally approved. 6. Useful: could be used to gain insight into the field of inquiry.  Figure 1: Taxonomy of web attacks.
First, we introduce a novel model of web attacks based on the concept of attack life cycle. By attack life cycle we understand a succession of steps followed by an attacker to carry out some malicious activity on the web server, as depicted in Figure 1. The attacker gets through an entry point, searching for a vulnerability in the web server or web application which causes a threat to the web server's assets. The vulnerability is exploited (and the threat realized) by an action, using an HTTP element of certain length, directed against a given target and with a given scope. The attacker might obtain some privileges that depend on the type of attack. Our taxonomy of web attacks is based on the attack life cycle defined in this way.
At every stage of the life cycle we define the following classification criteria or classifiers: In the next subsections each of these criteria are covered in detail and their relevance explained.

Entry point
The fact that a web application is successfully attacked usually means that there is a vulnerability causing a threat that is exploited by the attacker. This vulnerability might be found in the web server software or in the web application code itself. Thus, according to the entry point of the attack, we distinguish between web server software attacks and web application attacks.

Web server software attacks
All web server software, regardless of platform or manufacturer, unintentionally hides a number of vulnerabilities which allow the application to be used in a different way than intended. Many of these vulnerabilities are disclosed to the public, for example publishing in security forums and bulletins. Upon notification of the vulnerability, the manufacturer usually releases a patch or service pack which should correct the error. In the meantime, since the patch is released until all servers are correctly patched, an opportunity window to exploit the current vulnerability might exist.

Web application attacks
Web application-level attacks refer to the vulnerabilities inherent in the code of a web application itself, regardless of the technology in which it is implemented or the security of the web server/back end database on which it is built [23].

Vulnerability
In order to reach the desired result, an attacker must take advantage of a computer or network vulnerability. A vulnerability is a weakness in a system allowing unauthorized action. We define the following vulnerabilities in web applications.

Code Injection
Code injection vulnerabilities allow for injecting arbitrary user-chosen code into a page. The main categories of code injection are: • Script injection: Outside or third-party input data received by a web application result in a client-side script executing within the users web environment, achieving the same level of access and privileges as the hosted domain [32]. Cross-Site Scripting is the most common form of script injection.
• SQL injection: An attacker creates or alters existing SQL commands to gain access to unintended data or even the ability to execute system level commands on the host. See for example [3].
• XPath injection: XPath is a language for addressing parts of an XML document. An attacker can modify search strings to access unauthorized data in XML documents.
These vulnerabilities arise from nonexistent or poorly designed input validation routines on the server-side.

Canonicalization
Canonicalization vulnerabilities occur when an application makes a security decision based on a name (a filename, a folder name, a web address), without having in mind the fact that the name may be expressed in more than one way [11].
The most common way of exploiting canonicalization issues is in the form of path traversal attacks, which allow a malicious user to execute commands or view data outside of the intended target path. Path traversal vulnerabilities arise normally from unchecked URL input parameters, cookies, and HTTP request headers. In most cases, a path traversal attack inherits the permissions of the application being executed which may then access any file allowable using those permissions.

HTML manipulation
HTML manipulation is a vulnerability which allows a malicious user to modify data sent between the client (web browser) and server (web application), to which the user was not intended to have direct access. Parameter manipulation is often accomplished through: Parameter manipulation can be prevented with good input validation techniques on the server side, although it is neglected too often.

Overflows
Buffer overflows have been causing serious security problems for decades [5]. The main cause of buffer overflow problems is that in some programming languages, such as for example C/C++, there are no bounds checks on array and pointer references, meaning a developer has to check the bounds, an activity that is often ignored. When a program writes past the bounds of a buffer, this is called a buffer overflow. Reading or writing past the end of a buffer can cause a number of diverse behaviors: programs can act in strange ways or fail completely.
At best, a buffer overflow can stop a server or service where it happens. At worst, it can allow for arbitrary code execution with the same privileges as the program where it is present.

Misconfiguration
Sometimes, when a web server is started using the default configuration, it runs with a number of potentially dangerous directories, sample applications, user accounts, and other similar elements. Many vulnerabilities have been discovered and exploited in these elements over time. It is highly advisable to uninstall or disable everything which is not explicitly used by the web application.
Moreover, if the platform and web server are not correctly configured (carefully assigning file permissions, using non-default paths, etc.) many other vulnerabilities can arise.

Threat
There is a widely accepted set of services or requisites that all systems must satisfy in order to be considered secure [9,19,25]. These services include authentication, confidentiality, integrity, availability, access control, and auditing.
According to the security property under threat, we distinguish between the following attacks.

Authentication
The goal of authentication is to determine whether someone or something is, in fact, who or what it is declared to be. Authentication is commonly performed through the use of passwords. Knowledge of the password is assumed to guarantee that the user is authentic.
In a Web context, authentication attacks bypass identification controls by using a number of different techniques, such as session hijacking, session replay, identity spoofing, valid credentials theft, authentication module subversion, and brute-forcing. As a consequence, an illegitimate user will be identified as a legitimate one.

Authorization
The goal of authorization is to permit authenticated users to do or have something. In multi-user computer systems, a system administrator defines for the system which users are allowed access to the system and what privileges of use (such as access to which file directories, hours of access, amount of allocated storage space, and so forth).
Most common authorization attacks bypass access control by means of buffer overflows (see Sec. 2.2.4), server platform errors, and SQL injection techniques (see Sec. 2.2.1). Their goal is to execute database or operating system commands and access resources not allowed to the unprivileged user. Eventually, a well-implemented privilege escalation attack will result in the unauthorized increase in the domain of access, even ensuring the attacker administrator or root privileges.

Confidentiality
The goal of confidentiality is to protect the information from being disclosed or revealed to entities not authorized to have that information.
Confidentiality attacks show private information contained in files (source code, other users' information, etc.), or in database tables (credit card numbers, personal information, etc.). Depending on the nature of the information disclosed, the attacker can penetrate further into the attacked system or get private information about the targeted company or its customers.

Integrity
Data integrity services act as safeguards against accidental or malicious tampering or modification of data. Changing the value of a data item includes inserting additional data or deleting, modifying, or reordering parts of the existing data.
Common attacks against data integrity include database records manipulation, cookie poisoning, web page alteration (defacing), and forms field modification.

Availability
The goal of service availability is to ensure that users are not unduly denied access to information and resources.
Denial of service (DoS) is the most frequent attack against availability (see Sec. 2.4.8). DoS attacks can be conducted against the machine hosting the web server or against the web server itself. In the first case, the attack will use techniques equally valid for all machines connected to the Internet. In the second case, the attack will exploit vulnerabilities in the web server or the web application to stop normal service.

Auditing
The auditing services provide the system administrator with the means to record security-relevant information, which can be analyzed to detect potential and actual violations of the system security policy. Auditing, or accountability, has three functions: event detection, information collection, and information processing.
Some attacks manage to pass undetected by preventing their being logged by the auditing system.

Action
Most real-world attacks suffered by web servers are variants or concatenations of a few basic actions or attack classes. In this section we try to reference those primary attack classes which account for mostly all everyday attacks.
We distinguish among actions aimed at three different objectives: server data, user authentication, and web server. Actions directed against data include read, modify, delete, and fabricate. Actions directed against authentication include impersonate, bypass, and search. Actions directed against the web server include interrupt, probe, and unknown.

Read
Read is an action to obtain the content of the data contained within a file, database record, or other data medium stored in the web server. Reading does not alter the integrity of the data read. Examples include viewing source code files, and illicitly copying database tables.

Modify
Modify is an action to alter data. We limit our definition to tampering with data on the server side. Examples include changing a database record, or changing the contents of a file. Modifying data on the client side, such as the value of the URL, a cookie, or a hidden field in a form, does not fall under this category because the vast majority of web attacks imply this manipulation in some way or another. The data continue to be available, but in altered form.

Delete
Delete is an action to remove or render an asset in the server irretrievable by other legitimate users. Examples include deleting database objects and server files.

Fabricate
Fabricate is an action to insert counterfeit objects into the system. Examples include adding hacker toolkits to the server filesystem, creating new user accounts, or inserting records into a database table.

Impersonate
Impersonate is an action to masquerade an illegal user as a legitimate one. Examples include authentication tickets reuse or theft.

Bypass
Bypass is an action to avoid a process by using an alternative method to access a target. Examples include directly accessing protected web resources, such as multimedia files, by simply following a link.

Search
Search is an action to find valid user authentication information. Examples include brute-force attacks which try different combinations of login/password pairs, or repeatedly forging possible authentication tickets or session ID's to simulate an already validated user.

Interrupt
Interrupt is an action to cause networked computers to disconnect from the network or just outright crash. Interruption of service attacks are popularly known as denial of service (DoS) attacks. Their primary goal is to deny the legitimate users access to a particular resource or service.

Probe
Probe is an action used to determine the characteristics of a specific target. Attackers usually begin by gathering information about the target, before stepping into more invasive activities. For instance, the use of uncommon HTTP headers, such as HEAD, or web site mirroring tools, such as Teleport Pro [33] or wget [34], are indicators that an attack might be under way. More aggressive tools, such as Whisker [35] or Nikto [31] are more than probing tools, since they scan the web server in search of vulnerabilities.

Unknown
When an attacker executes code, but it is impossible to ascertain what the command executed is, we consider the action carried as unknown. Examples include a buffer overflow with a command execution payload or .bat or .cmd files executed via URL name. Usually, these unknown actions are considered a threat against authorization, because although the outcome of such execution cannot be known, we assume it is unauthorized.

Length
Buffer overflows are the most common form of security vulnerability today, not only in web applications but also in all Internet applications and services. They are the easiest to exploit with the most devastating consequences, usually resulting in complete takeover of the attacked host.
Buffer overflows often need a very long data input to work. Hence, based on the length of the attack string, we distinguish between common-length and unusually long attacks.

Common length
Attacks which are not based on exploiting a buffer overflow seldom submit arguments of a length greater than a certain threshold that can be experimentally defined for a particular web server. Thus, most attacks fall under this category.

Unusually long
Buffer overflows require passing arguments of sufficient length to fill a memory buffer allocated to a particular input, along with some additional data that are written into memory outside the buffer. When these additional data are missing, the buffer overflow usually results in a Denial of Service (DoS) attack (see Sec. 2.4.8), whereas when it is present and accurately crafted, might result in a system command execution.
Unexpectedly long input arguments very likely imply a buffer overflow attack attempt.

HTTP element
As a prerequisite of our definition of web attacks, the HTTP protocol must be used in order to carry out attacks against web servers. An HTTP request consists of a verb and a group of headers. Different attacks use different verbs and/or headers. It is obvious that this category is not mutually exclusive, but actually is unambiguous and we consider it valid to be included in our global taxonomy, since it provides useful information. Thus, according to the HTTP element used, we distinguish the following attacks.

GET/POST
Most common HTTP requests (and attacks) use the GET or POST verbs.

Host
Most common HTTP requests use the Host header which represents the naming authority of the origin server or gateway given by the original URL.

Cookie
Most web applications use cookies to improve the user experience. When a web browser requests a page from a server, it routinely sends the cookies it received from that domain. These cookies are sent by means of the Cookie header. Cookies can be tampered with manually, changing their value.

Referer
The Referer[sic] header field allows the client to specify the address (URI) of the resource from which the Request URI was obtained. Although the browser must fill this header, manual manipulation of this field cannot be prevented.

Translate
"Translate: f" is a header used by WebDAV. Adding this to HTTP GET signals WebDAV components to really return source code of files and bypass processing. It is used in FrontPage 2000 and any WebDAV compatible client to get files for editing. It has to be accompanied by some other information which should not let anyone access the sources.

SEARCH
As a part of the extra functionality provided by the WebDAV components, Microsoft has introduced the SEARCH request verb to enable searching for files based upon certain criteria.

PROPFIND
The WebDAV PROPFIND verb retrieves properties for a resource identified by the request URI. The PROPFIND method can be used on collection and property resources.

Target
Not all web attacks aim at the same target. Some attackers might be interested in taking control over the web server machine and extending their attack further into the server's network. Others might be interested only in obtaining database records, modifying some pages or misleading other users. Based on the target of the attack, we distinguish between application and platform attacks.

Web application
Web application attacks are directed against the web application running on top of the server platform. If the attack succeeds, only the application data and functionality will be affected, but not the operating system resources. These attacks are typically aimed at web pages (obtaining and/or modifying source code) and database records (viewing, changing and/or deleting information).

Platform
Under this attack, the target is beyond the web application, aimed at the platform. The attacker usually seeks after arbitrary command execution, manipulation of machine accounts, tampering with the host's services, obtaining network information, etc. The web server is used as a mere portal to gain access to the internal network.

Scope
Different attacks affect the web server in different ways. Many attacks only affect one user or a group of users, whereas others have an impact on all users of the service.
Regarding the scope of the attack, we can distinguish between local and universal attacks.

Local
In these attacks, only one user or a small group of users is affected. If the individual attack can be automated and extended to any other user, then it pertains to the category of universal attacks. An example are data harvesting attacks.

Universal
All users will be affected by the attack. Typically, universal attacks include web defacing, database record manipulation, and code injection.

Privileges
When an attacker compromises a web server, the ultimate goal is to gain administrator/root privileges. Most web attacks do not allow the attacker to escalate privileges. They run under a restricted account in the server or database. However, misconfiguration of the operating system access control lists, web server permissions, and database users could enable an attacker to reach administrative privileges. There are three categories of users involved in an attack: • The web application user.
• The database user.
• The operating system level user.
Hence, with regard to the privilege obtained by the attack, we can distinguish between unprivileged and administrative attacks. This category is only applicable when the objective of the attack is obtaining access as a certain user, i.e., authentication attacks (see Sec. 2.3.1).

Unprivileged user
Attacks are run under the identity of a web user, a database user, and/or a system-level user. The attacker can access resources only accessible to that user and thus the impact of the attack is limited.

Administrator/root
If the attacker succeeds in gaining administrative access, the machine is completely compromised. This is the highest level of attack realization.

Encoding of the attacks
Now that we have already characterized attacks by their fundamental properties, we face the problem of how to encode the attack information in a compact and useful way. Provided that the number of attacks suffered by a web site with medium traffic can grow very quickly, it is not advisable to record unnecessary information to prevent running out of storage space prematurely. In fact, the main goal of this taxonomy is to capture the relevant information about attacks, allowing to perform an analysis in order to decide on the severity of the attack.
To reduce the amount of the information recorded on the media, the data can be compressed, using some of the source coding techniques. But the use of general compression techniques and algorithms in this case has serious drawbacks. These drawbacks depend on the class of the method. Here we enumerate some of them.
For static defined word schemes to be implemented (e.g. [1], [6], [8], [12], [24] ) the knowledge of the probabilities of message classes is needed in advance. The problem is that if we treat the descriptions of the attacks as messages, the probability of their appearance varies with time, as new attacks are invented and the remedies are published. Other definitions of messages in this case would be too general and would not lead to a sufficient compression ratio.
To adapt to the changes of the message probabilities, the adaptive Huffman coding can be used (e.g. the FGK algorithm [7] or the Vitter algorithm [27]). But there is no guarantee that the compression ratio achieved by these methods is satisfactory, since these encodings are often outperformed by the static methods [27].
The main drawback of the free-parse methods, such as Ziv-Lempel [28] is that they perform very badly when short messages are encoded. As in the case of the static word schemes, other definitions of messages would not lead to an efficient compression.
Having in mind the specific type of local redundancy in the descriptions of the attacks (i.e. the descriptions of some of the attacks include some of the attack properties, whereas the descriptions of the others do not), we propose a semantic dependent data compression method that makes use of different-length vectors. The vectors have different lengths because only the information significant to the particular attack is retained. Besides its advantage over the general data compression schemes considering the efficiency of the short messages encoding, the use of this type of semantic dependent encoding makes possible the direct use of classification and clustering techniques that are often needed in the implementations, since the classification and clustering can be performed without decompressing [18].
To encode the descriptions of the attacks using the semantic dependent method introduced above, a range of positive integers is assigned to each of the attack properties discussed, in the following way. Each property requires a certain number of bits to encode its information. When only one bit is required, it means that the property can take one of two possible values, but not both. However, when the property can take some different values simultaneously, as many bits as the number of possible values are required.

Encoding examples
Let us consider the following common attacks directed against different types of web servers and platforms. When applicable, all references refer to the Common Vulnerabilities and Exposures (CVE), a list of standardized names for vulnerabilities and other information security exposures [30]. The vectors corresponding to the attacks are encoded in hexadecimal. The web application allows SQL injection. The attacker exploits this vulnerability by executing a SQL Server extended procedure which executes any command passed as argument. In this example, the attacker adds himself to the OS users.

Possible applications
This taxonomy and the corresponding attack encoding vectors are useful in a number of applications, especially in intrusion detection systems and applicationlevel firewalls.

Intrusion Detection Systems (IDS)
An intrusion detection system (IDS) detects and reports attempts to break into or misuse networked computer systems in real time [17]. A traditional, nonheuristically based IDS consists of three functional components: • A monitoring component, such as a packet capturer, which collects traffic data.
• An inference component, which analyzes the captured data to determine whether it corresponds to normal activity or malicious activity.
• An alerting component, which generates a response when an attack has been detected. This response can be passive (such as writing an entry in an event log) or active (such as changing configuration rules in the firewall to block the attacker's IP address).
Coding web attacks into different-length vectors could aid in the postprocessing of IDS alerts, to decide on the severity of the detected attacks.

Application-level firewall
A major problem with IDS is that they are oblivious to SSL traffic. As a consequence, whenever a web site supports SSL encryption, all the attacker has to do in order to evade IDS detection is to submit all attack requests using an SSL channel.
Another approach to web attack detection and prevention consists of using an application-level firewall or, more specifically, web application firewalls [14]. A traditional firewall provides protection only at the network level, with minimal or no application awareness [29]. On the other hand, application-level firewalls are capable of processing data at the application level as well as decrypting SSL connections. An application-layer solution works within the application that it is protecting, inspecting requests as they come in from the network level. If at any point a possible attack is detected, it can take over and prevent unauthorized access and/or damage to the web server.
Encoding web attacks into different-length vectors could help the applicationlevel firewall to decide about the action to be taken when an attack is detected.

Conclusion
In this paper, a taxonomy of web attacks is proposed that intends to represent a forward step towards a more precise reference framework. An attack life cycle is defined as its base, to make it structured and logical. The properties of the most common web attacks are described. A new semantic-dependent encoding scheme for these attacks is defined that uses different-length vectors. The most important advantage of this scheme over general purpose data compression methods is that the decompression is not needed in the applications. Real world examples of attacks against different platforms, web servers, and applications are given to illustrate how this taxonomy can be applied. Finally, possible applications are described, which might benefit from this taxonomy and encoding scheme, such as intrusion detection systems and application firewalls.