# US 2022/0279013 A1 · Flexible deterministic finite automata (dfa) tokenizer for ai-based malicious traffic detection

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 2022/0279013 A1
- Document ID: US20220279013A1
- Status: Published application
- Kind: A1
- Application number: 17/744,463
- Filed: 2022-05-13
- Published: 2022-09-01
- Earliest claimed: 2022-03-30
- Assignees: Intel Corporation
- Applicants: Intel Corporation
- Inventors: Kun QIU; Hao CHANG; Ying WANG; Wenjun ZHU; Xiahui YU; Yingqi LIU; Baoqian LI; Weigang LI
- Web page: https://patentgrep.com/patent/US20220279013A1

## CPC

- H04L 63/1416: {Event detection, e.g. attack signature detection}
- H04L 63/1441: {Countermeasures against malicious traffic (countermeasures against attacks on cryptographic mechanisms H04L9/002)}
- G06F 16/2433: {Query languages}
- G06F 16/90344: {by using string matching techniques}
- H04L 9/0866: {involving user or device identifiers, e.g. serial number, physical or biometrical information, DNA, hand-signature or measurable physical characteristics}
- H04L 9/3213: {using tickets or tokens, e.g. Kerberos (network architectures or network communication protocols for entities authentication using tickets in a packet data network H04L63/0807)}
- H04L 63/02: {for separating internal from external traffic, e.g. firewalls}
- G06N 5/02: Knowledge representation; Symbolic representation
- G06N 20/00: Machine learning
- H04L 63/168: {above the transport layer}
- H04L: TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION (arrangements common to telegraphic and telephonic communication H04M)
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)
- G06N: COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS

## Abstract

Methods and apparatus for a flexible Deterministic Finite Automata (DFA) tokenizer for AI-based malicious traffic detection. A DFA compiler is used to process profiles, such as SQLi, HTML5 and XSS profiles, as well as user-defined profiles, to generate corresponding DFA transition tables. The DFA tokenizer includes a DFA engine that employs the DFA transition table(s) to generate token sequences derived from input strings. The token sequences are converted into feature vectors using a feature extraction engine, and the feature vectors are used for training a machine learning/Artificial Intelligence (AI) model configured to perform binary classification (benign or malicious). During run-time, strings are extracted from input received via a network and tokenized with the DFA tokenizer to generate token sequences that are converted into feature vectors. The feature vectors are then classified using the AI model to determine whether the input is benign or malicious.

## Claims

### Claim 1

A method for determining whether an input received via a network is malicious, comprising:
extracting a string from the input;
converting the string to a token sequence using a Deterministic Finite Automata (DFA) tokenizer;
processing the token sequence to generate a feature vector; and
classifying the feature vector using an artificial intelligence (AI) model to determine whether the input is malicious or benign.

### Claim 2 (depends on 1)

The method of claim 1, wherein the string comprises a Structured Query Language (SQL) string and the method is used for detecting SQL injection (SQLi), further comprising:
generating an SQLi DFA transition table;
employing the SQLi DFA transition table in the DFA tokenizer to convert the string to the token sequence.

### Claim 3 (depends on 2)

The method of claim 2, further comprising:
processing a plurality of strings comprising samples of malicious and benign SQL code with the DFA tokenizer to generate token sequences;
extracting features from the token sequences to generate feature vectors; and
training the AI model with the feature vectors that are generated.

### Claim 4 (depends on 1)

The method of claim 1, wherein the string comprises a Cross-Site Scripting (XSS) string and the method is used for detecting malicious XSS code, further comprising:
generating an XSS DFA transition table;
employing the XSS DFA transition table in the DFA tokenizer to convert the XSS string to the token sequence.

### Claim 5 (depends on 4)

The method of claim 4, further comprising:
processing a plurality of strings comprising samples of malicious and benign XSS code with the DFA tokenizer to generate token sequences;
extracting features from the token sequences to generate feature vectors; and
training the AI model with the feature vectors that are generated.

### Claim 6 (depends on 1)

The method of claim 1, wherein processing the token sequence to generate a feature vector employs execution of multiple Single Instruction Multiple Data (SIMD) instructions.

### Claim 7 (depends on 1)

The method of claim 1, further comprising:
generating a DFA transition table by processing a user-defined profile comprising a plurality of strings with a DFA compiler;
employing the DFA transition table in the DFA tokenizer;
processing at least a portion of the plurality of strings in the user-defined profile with the DFA tokenizer to generate token sequences;
extracting features from the token sequences to generate feature vectors; and
training the AI model with the feature vectors that are generated.

### Claim 8 (depends on 7)

The method of claim 7, wherein the plurality of strings in the user-defined profile employ lexical encoding.

### Claim 9 (depends on 1)

The method of claim 1, further comprising implementing the method in a firewall.

### Claim 10

A non-transitory machine-readable medium having instructions comprising software modules stored thereon configured to be executed by one or more processors in one or more computer system, the software modules including:
a DFA compiler, configured to process a profile comprising a plurality of strings and associated rules and generate a DFA transition table;
a DFA engine, configured to receive an input string and generate a token sequence using the DFA transition table; and
a feature extraction engine, configured to extract features from the token sequences generated by the DFA engine and convert the extracted features into feature vectors.

### Claim 11 (depends on 10)

The non-transitory machine-readable medium of claim 10, wherein the profile is a user-defined profile comprising alphanumeric strings corresponding to a natural language.

### Claim 12 (depends on 10)

The non-transitory machine-readable medium of claim 10, wherein the profile is a user-defined profile comprising alphanumeric strings having a lexical coding.

### Claim 13 (depends on 10)

The non-transitory machine-readable medium of claim 10, wherein the profile is a Structured Query Language injection (SQLi) profile, and wherein the DFA compiler generates an SQLi DFA transition table that is used by the DFA engine to generate token sequences.

### Claim 14 (depends on 10)

The non-transitory machine-readable medium of claim 10, wherein the profile is a Cross-Site Scripting (XSS) profile, and wherein the DFA compiler generates an XSS DFA transition table that is used by the DFA engine to generate token sequences.

### Claim 15 (depends on 10)

The non-transitory machine-readable medium of claim 10, wherein the feature extraction engine employs a plurality of Single Input Multiple Data (SIMD) instructions to covert a token sequence into a feature vector.

### Claim 16

A Web Application Fire (WAF) comprising:
one or more processors;
memory, operatively coupled to the one or more processors;
at least one network interface having one or more ports, operatively coupled to the processor; and
software instructions comprising a Deterministic Finite Automata (DFA) tokenizer, a feature extraction engine, and a machine learning model configured to perform binary classification,
where the WAF is enabled, via execution of the software instructions to:
extract strings from inputs received at least one of the one or more ports of the network interface;
convert the strings to token sequences using the (DFA) tokenizer;
process the token sequences with the feature extraction engine to generate feature vectors; and
classify the feature vectors using the machine learning model to determine whether inputs are malicious or benign.

### Claim 17 (depends on 16)

The WAF of claim 16, further comprising one or more DFA transition tables stored in the memory, wherein the DFA tokenizer uses the one or more DFA transition tables to convert extracted strings into token sequences.

### Claim 18 (depends on 16)

The WAF of claim 16, wherein the one or more DFA transition tables include one or more of a Structured Query Language injection (SQLi) DFA transition table, a Hypertext Markup Language (HTML)5 DFA transition table, and a Cross-Site Scripting (XSS) DFA transition table.

### Claim 19 (depends on 16)

The WAF of claim 16, wherein the one or more processors comprising a plurality of processors implemented in multiple computer systems, and wherein the software instructions comprise a plurality of modules that are configured to be distributed across the multiple computer systems.

### Claim 20 (depends on 1)

The method of claim 1, wherein the feature extraction engine employs execution of multiple Single Instruction Multiple Data (SIMD) instructions to process the token sequence to generate a feature vector.
