JP6876307B2 - Independent SQL injection defense analysis notification method based on php and its system - Google Patents

Independent SQL injection defense analysis notification method based on php and its system Download PDF

Info

Publication number
JP6876307B2
JP6876307B2 JP2020008081A JP2020008081A JP6876307B2 JP 6876307 B2 JP6876307 B2 JP 6876307B2 JP 2020008081 A JP2020008081 A JP 2020008081A JP 2020008081 A JP2020008081 A JP 2020008081A JP 6876307 B2 JP6876307 B2 JP 6876307B2
Authority
JP
Japan
Prior art keywords
blacklist
sql
sql statement
request
injection
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
JP2020008081A
Other languages
Japanese (ja)
Other versions
JP2021022358A (en
Inventor
ケンソウ カク
ケンソウ カク
ビニン チン
ビニン チン
イ シ
イ シ
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangdong Eflycloud Computing Co Ltd
Original Assignee
Guangdong Eflycloud Computing Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guangdong Eflycloud Computing Co Ltd filed Critical Guangdong Eflycloud Computing Co Ltd
Publication of JP2021022358A publication Critical patent/JP2021022358A/en
Application granted granted Critical
Publication of JP6876307B2 publication Critical patent/JP6876307B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/14Network architectures or network communication protocols for network security for detecting or protecting against malicious traffic
    • H04L63/1408Network architectures or network communication protocols for network security for detecting or protecting against malicious traffic by monitoring network traffic
    • H04L63/1416Event detection, e.g. attack signature detection
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/14Network architectures or network communication protocols for network security for detecting or protecting against malicious traffic
    • H04L63/1441Countermeasures against malicious traffic
    • H04L63/1466Active attacks involving interception, injection, modification, spoofing of data unit addresses, e.g. hijacking, packet injection or TCP sequence number attacks

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Hardware Design (AREA)
  • Computing Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer And Data Communications (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Description

本発明は、SQLインジェクション攻撃の技術分野に関し、特に、phpに基づく独立型sqlインジェクション防御分析通知方法及びそのシステムに関する。 The present invention relates to the technical field of SQL injection attack, and more particularly to a php-based stand-alone skl injection defense analysis notification method and its system.

インターネット技術の急速な発展に伴って、Web技術及びデータベース技術は、現代化情報システムを構成する重要な技術となっており、Webサーバ及びデータベースに基づく情報セキュリティは、現在のインターネットセキュリティの中心的な問題の1つである。Webサーバ及びデータベースは、ハッカーの攻撃を受けやすい。その中でも、SQLインジェクション攻撃は、現在、Webサーバが直面する一般的な攻撃であり、攻撃者は、アプリケーションプログラムのWebフォームの入力フィールド又はページ要求におけるクエリ文字列などを変更して、一連のSQLコマンドを挿入することにより、データベースのクエリ文字列を変更し、それにより、データベースサーバに悪意のあるSQLコマンドを実行させ、さらに、バックグラウンドデータベースを不正にアクセスして、データベースにおける価値のあるデータを盗む。SQLインジェクション攻撃は、ハッカーがWebサーバを攻撃するための最も一般的な攻撃方式であり、インターネットセキュリティに深刻な脅威をもたらす。 With the rapid development of Internet technology, Web technology and database technology have become important technologies that make up modern information systems, and information security based on Web servers and databases is a central issue of current Internet security. It is one of. Web servers and databases are vulnerable to hacker attacks. Among them, the SQL injection attack is a general attack currently faced by a Web server, and an attacker modifies an input field of a Web form of an application program or a query string in a page request to change a series of SQL. By inserting a command, you change the query string in the database, which causes the database server to execute malicious SQL commands, and also gains unauthorized access to the background database to capture valuable data in the database. steal. SQL injection attacks are the most common attack method for hackers to attack web servers and pose a serious threat to Internet security.

従来技術では、SQLインジェクション攻撃防御方法は、ほとんど、ルール、すなわち、正常なSQL文及びSQLインジェクション攻撃を区分するための、事前に作成された判断ルールをベースとするものであり、攻撃手段の継続的な開発や進化に加えて、インターネットにおける過大のデータ量及び多様性のため、正常なSQL文とSQLインジェクション攻撃を正確に区別できる完全なルールライブラリの作成が困難であり、従って、このような方法は、誤報率と欠報率が高く、ルールライブラリを絶えずに更新しなければならず、それにしても、効果的な保護を提供できない。 In the prior art, SQL injection attack defense methods are mostly based on rules, i.e., pre-made judgment rules for distinguishing between normal SQL statements and SQL injection attacks, and continuation of the means of attack. Due to the excessive amount of data and diversity on the Internet, in addition to the development and evolution of the system, it is difficult to create a complete rule library that can accurately distinguish between normal SQL statements and SQL injection attacks. The method has a high rate of false and missed reports and requires constant updates to the rules library, yet it cannot provide effective protection.

中国特許出願公開第107682373A号明細書Chinese Patent Application Publication No. 107682373A

本発明は、SQL異種化に基づくSQLインジェクション攻撃防御方法を開示し、コンピュータアプリケーションプログラムがデータベースにアクセスする過程で、対話型SQL命令に対して異種化処理を実行することにより、SQLインジェクション攻撃を識別して阻止する方法に関する The present invention discloses a SQL injection attack defense method based on SQL heterogeneity, and identifies SQL injection attacks by executing heterogeneous processing for interactive SQL instructions in the process of accessing a database by a computer application program. And how to stop

本発明が解決しようとする技術的課題は、sqlインジェクション問題に対して全方位的な対策を取り、予防(攻撃コストの増加)、対処(フィルタリング、階層化処理及びIP制限を行う)、監視(アラーム通知)、及び記録(ログ追跡)のそれぞれの点で対応する対策を講じ、データセキュリティをさらに確保する、phpに基づく独立型sqlインジェクション防御分析通知方法及びそのシステムを提供することである。 The technical problem to be solved by the present invention is to take omnidirectional measures against the SQL injection problem, prevent (increase attack cost), deal with (filter, stratify, and limit IP), and monitor (perform IP restriction). It is to provide a php-based stand-alone SQL injection defense analysis notification method and its system by taking corresponding measures in each of the alarm notification) and the recording (log tracking) to further secure the data security.

上記技術的課題を解決するために、本発明は、以下の技術案を提供する。phpに基づく独立型sqlインジェクション防御分析通知方法であって、
sqlインジェクションの要求IPを照合して、IP制限ブラックリストに登録されているか否かを検出し、そうである場合、要求を終了し、そうでない場合、次のステップに進むステップS1と、
sqlインジェクションのパラメータを取得して、パラメータにブラックリスト記号が含まれているか否かを判断し、含まれている場合、このsqlインジェクションをnoticeレベルに設定し、パラメータにブラックリスト記号が含まれているか否かに関わらず、次のステップに進むステップS2と、
sqlインジェクションのパラメータにブラックリストキーワードが含まれているか否かを判断し、含まれている場合、このsqlインジェクションをwarningレベルに設定し、パラメータにブラックリストキーワードが含まれているか否かに関わらず、次のステップに進むステップS3と、
sqlインジェクションのパラメータをスペースで分割して、パラメータにブラックリストキーワードが含まれているか否かを判断し、含まれている場合、このsqlインジェクションをerrorレベルに設定し、パラメータにブラックリストキーワードが含まれているか否かに関わらず、次のステップに進むステップS4と、
正常、noticeレベル、及びwarningレベルのsqlインジェクションの場合、データベースを要求し続け、errorレベルのsqlインジェクションの場合、該sqlインジェクションの要求ipが一定時間内に所定回数のインジェクション攻撃を行ったか否かを検出し、そうである場合、この要求ipを禁止してIP制限ブラックリストに追加し、そうでない場合、そのインジェクション攻撃回数に1を加算するステップS5と、を含む。
好ましくは、前記ステップS1のIP制限ブラックリストは、IP制限を予め収集してデータベースに保存したものであり、且つ前記IP制限ブラックリストは、ステップS5のIP制限ブラックリストに追加された要求ipを追加することにより、更新される。
In order to solve the above technical problems, the present invention provides the following technical proposals. It is a stand-alone SQL injection defense analysis notification method based on php.
The request IP of SQL injection is collated to detect whether or not it is registered in the IP restriction blacklist. If so, the request is terminated, and if not, step S1 to proceed to the next step and
Get the parameters of the SQL injection to determine if the parameter contains a blacklist symbol, and if so, set this skl injection to the note level and the parameter contains the blacklist symbol Step S2 to proceed to the next step regardless of whether or not
Determine if the skl injection parameter contains a blacklist keyword, and if so, set this skl injection to the warning level, regardless of whether the parameter contains a blacklist keyword. , Step S3 to proceed to the next step,
Divide the skl injection parameter with a space to determine if the parameter contains a blacklist keyword, and if so, set this skl injection to the error level and the parameter contains the blacklist keyword Step S4 to proceed to the next step regardless of whether or not it is
In the case of normal, notice level, and warning level SQL injection, it keeps requesting the database, and in the case of error level SQL injection, whether or not the request ip of the skl injection has performed a predetermined number of injection attacks within a certain period of time. Includes step S5, which detects and, if so, prohibits this request ip and adds it to the IP restriction blacklist, otherwise adds 1 to its number of injection attacks.
Preferably, the IP restriction blacklist in step S1 is a collection of IP restrictions in advance and stored in a database, and the IP restriction blacklist is a request ip added to the IP restriction blacklist in step S5. It will be updated by adding it.

好ましくは、前記ステップS2のブラックリスト記号は、攻撃的な記号を予め収集されてデータベースに保存したものである。 Preferably, the blacklist symbol in step S2 is an offensive symbol collected in advance and stored in a database.

好ましくは、前記ステップS3のブラックリストキーワードは、攻撃的なキーワードを予め収集してデータベースに保存したものである。 Preferably, the blacklist keyword in step S3 is an offensive keyword collected in advance and stored in a database.

好ましくは、前記ステップS4は、noticeレベル、warningレベル、及びerrorレベルのsqlインジェクションの場合、その要求ip、要求パラメータ、要求時間、及び要求urlの情報をすべて記録してデータベースに記憶するステップをさらに含む。 Preferably, step S4 further records, in the case of note-level, warning-level, and errror-level SQL injections, all information about the request ip, request parameters, request time, and request url and stores it in the database. Including.

好ましくは、前記ステップS4は、errorレベルのsqlインジェクションの場合、運用保守スタッフに通知するようにメールを送信して、且つクライアントのsqlインジェクション要求を直ちに終止するステップをさらに含む。 Preferably, said step S4 further comprises sending an email to notify the operations and maintenance staff in the case of error level SQL injection and immediately terminating the client's SQL injection request.

好ましくは、前記ステップS4では、前記一定時間が24時間であり、前記所定回数が3回である。 Preferably, in step S4, the fixed time is 24 hours, and the predetermined number of times is three times.

好ましくは、前記ステップS1の前に、sqlインジェクションの要求パラメータrandomNumについて、存在し且つフォーマットが正確であるか否かを検出するステップS0をさらに含む。 Preferably, prior to step S1, step S0 is further included to detect whether the required parameter randomNum for SQL injection is present and the format is accurate.

本発明の別の目的は、phpに基づく独立型sqlインジェクション防御分析通知システムを提供することであり、該システムは、
sqlインジェクションのIP制限を収集するIP制限ブラックリスト収集ユニットと、
収集されたsqlインジェクションのIP制限を記憶するIP制限ブラックリスト記憶ユニットと、
sqlインジェクションの要求IPについて、前記IP制限ブラックリスト記憶ユニットにおけるIP制限であるか否かを判断するIP制限ブラックリスト判断ユニットと、
sqlインジェクションのブラックリスト記号を収集するブラックリスト記号収集ユニットと、
収集されたsqlインジェクションのブラックリスト記号を記憶するブラックリスト記号記憶ユニットと、
sqlインジェクションのパラメータについて、前記ブラックリスト記号記憶ユニットのブラックリスト記号が含まれているか否かを判断し、且つ、ブラックリスト記号が含まれているsqlインジェクションをnoticeレベルに設定するブラックリスト記号判断ユニットと、
sqlインジェクションのブラックリストキーワードを収集するブラックリストキーワード収集ユニットと、
収集されたsqlインジェクションのブラックリストキーワードを記憶するブラックリストキーワード記憶ユニットと、
sqlインジェクションのパラメータには、前記ブラックリストキーワード記憶ユニットにおけるブラックリストキーワードが含まれているか否かを判断し、且つ、このブラックリストキーワードが含まれているsqlインジェクションをwarningレベルに設定し、さらに、sqlインジェクションのパラメータをスペースで分割し、パラメータには、前記ブラックリストキーワード記憶ユニットにおけるブラックリストキーワードが含まれているか否かを判断し、且つ、このブラックリストキーワードが含まれているsqlインジェクションをerrorレベルに設定するブラックリストキーワード判断ユニットと、
正常、noticeレベル、及びwarningレベルのsqlインジェクションの場合、データベースを要求し続け、errorレベルのsqlインジェクションの場合、一定時間内に所定回数に達したインジェクション攻撃をIP制限ブラックリストに追加する処理結果ユニットと、を備える。
Another object of the present invention is to provide a php-based stand-alone SQL injection defense analysis notification system.
An IP restriction blacklist collection unit that collects IP restrictions for SQL injection, and
An IP restriction blacklist storage unit that stores the IP restrictions of collected SQL injections,
With respect to the request IP of SQL injection, the IP restriction blacklist determination unit that determines whether or not the IP restriction is the IP restriction in the IP restriction blacklist storage unit, and the IP restriction blacklist determination unit.
A blacklist symbol collection unit that collects skl injection blacklist symbols,
A blacklist symbol storage unit that stores the collected SQL injection blacklist symbols,
A blacklist symbol determination unit that determines whether or not the blacklist symbol of the blacklist symbol storage unit is included in the SQL injection parameter and sets the skl injection containing the blacklist symbol to the note level. When,
A blacklist keyword collection unit that collects skl injection blacklist keywords,
A blacklist keyword storage unit that stores the collected SQL injection blacklist keywords,
It is determined whether or not the skl injection parameter includes the blacklist keyword in the blacklist keyword storage unit, and the skl injection containing this blacklist keyword is set to the warning level. The parameter of skl injection is divided by a space, it is determined whether or not the parameter contains the blacklist keyword in the blacklist keyword storage unit, and the skl injection containing this blacklist keyword is eraser. The blacklist keyword judgment unit to be set to the level, and
A processing result unit that keeps requesting the database for normal, notice-level, and warning-level SQL injections, and adds a specified number of injection attacks to the IP-restricted blacklist within a certain period of time for errror-level SQL injections. And.

好ましくは、前記独立型sqlインジェクション防御分析通知システムは、errorレベルのsqlインジェクションをメールで運用保守スタッフに送信して、且つクライアントのsqlインジェクション要求を直ちに終止するメールフィードバック処理ユニットをさらに備える。 Preferably, the stand-alone SQL injection defense analysis notification system further comprises an email feedback processing unit that emails error level SQL injections to operations and maintenance staff and immediately terminates the client's SQL injection request.

上記技術案を用いると、本発明は、少なくとも以下の有益な効果を有する。本発明の方法は、sqlインジェクション問題に対して全方位的な対策を取り、予防(攻撃コストの増加)、対処(フィルタリング、階層化処理及びIP制限を行う)、監視(アラーム通知)、及び記録(ログ追跡)のそれぞれの点で対応する対策を講じ、データセキュリティをさらに確保し、本発明のシステムは、プラグインのように使用するときに接続し、使用しないときに取り外せばよく、このため、使用しやすく、柔軟的で便利であり、本発明は、攻撃を分析してランク付けし、後で各レベルの攻撃に対して対応する対策を講じるために拡張性を提供し、また、攻撃者のコストを増加することができ、本発明は、独立して柔軟的に使用でき、複数のレベルで複数の点からデータを保護することができる。 Using the above technical proposal, the present invention has at least the following beneficial effects. The method of the present invention takes omnidirectional measures against the SQL injection problem, preventing (increasing attack cost), dealing with (filtering, layering processing and IP restriction), monitoring (alarm notification), and recording. Corresponding measures should be taken at each point of (log tracking) to further secure data security, and the system of the present invention should be connected when used like a plug-in and disconnected when not in use. Easy to use, flexible and convenient, the present invention provides scalability to analyze and rank attacks and later take action to respond to each level of attack, and also attacks. The invention can be used independently and flexibly, and data can be protected from multiple points at multiple levels.

本発明の実施例1に係るphpに基づく独立型sqlインジェクション防御分析通知方法のステップフローチャートである。It is a step flowchart of the stand-alone SQL injection defense analysis notification method based on php which concerns on Example 1 of this invention. 本発明の実施例2に係るphpに基づく独立型sqlインジェクション防御分析通知システムの構造ブロック図である。It is a structural block diagram of the stand-alone SQL injection defense analysis notification system based on php which concerns on Example 2 of this invention.

ただし、矛盾しない限り、本願における実施例及び実施例における特徴を互いに組み合わせることができ、以下、図面及び具体的な実施例を参照しながら本願をさらに詳細に説明する。 However, as long as there is no contradiction, the examples in the present application and the features in the examples can be combined with each other, and the present application will be described in more detail below with reference to the drawings and specific examples.

実施例1
本発明の対象となる課題は、4つであり、第一は、sqlインジェクション防御の課題であり、第二は、sqlインジェクション攻撃の分析処理の課題であり、第三は、サーバが攻撃されたことを最後の時点で知ることを回避するために、攻撃に対するリアルタイムなフィードバックを行う課題であり、第四は、sqlインジェクションのコストが低く、攻撃が頻繁に発生することを解決する課題である。
Example 1
There are four issues that are the subject of the present invention, the first is the issue of SQL injection defense, the second is the issue of analysis processing of SQL injection attack, and the third is the issue of server attack. In order to avoid knowing this at the last point, it is a task to give real-time feedback to the attack, and a fourth is to solve the problem that the cost of SQL injection is low and the attack occurs frequently.

本発明の技術案は、上記4つの課題に対して設計されたphpに基づく独立型防止システムである。 The technical proposal of the present invention is a php-based stand-alone prevention system designed for the above four problems.

第一の課題を解決するために、本技術案は、第1層には、ブラックリストのようにget、post、cookieのパラメータの判断及びフィルタリングを行い、主に通常のインジェクション句読点をフィルタリングし、第2層には、sqlインジェクションキーワードの監視を行い、第3層には、パラメータの分割分析を行い、誤判断を回避する。 In order to solve the first problem, in the first layer, the parameters of get, post, and cookie are judged and filtered like a blacklist, and the normal injection punctuation marks are mainly filtered. The second layer monitors the SQL injection keyword, and the third layer performs the parameter division analysis to avoid erroneous judgment.

第二の課題に関して、パラメータを判断した結果、第一層に問題があり、残りに問題がないと、noticeとしてランク付けし、第1層、第2層にインジェクションキーワードがあり、第3層にないと、warningとしてランク付けし、3層ともに問題があると、errorとしてランク付けし、要求を終止する。 Regarding the second issue, as a result of judging the parameters, if there is a problem in the first layer and there is no problem in the rest, it is ranked as noteice, there are injection keywords in the first and second layers, and the third layer has an injection keyword. If not, it is ranked as warning, and if there is a problem in all three layers, it is ranked as parameter and the request is terminated.

第三の課題に関して、3つのレベルの要求時間、要求データ、ipアドレスをデータベースに記録し、errorエラーの場合、メールで運用保守スタッフに直ちに通知し、且つipアドレスを変更し、変更されるipが合計3回sql攻撃を行うと、ipを1日間禁止する。 Regarding the third issue, three levels of request time, request data, and IP address are recorded in the database, and in the case of an error error, the operation and maintenance staff is immediately notified by e-mail, and the IP address is changed and the IP is changed. Will ban ip for a day if it makes a total of 3 skl attacks.

第4の課題に関して、最後の技術案は、sqlインジェクションの操作コストを増加し、それぞれの要求に固定形式のランダムパラメータを追加し、攻撃者は、攻撃を行うには、パケットをキャプチャしてパラメータを変更し要求を再送信しなければならない。さらに、各要求が1回しか使用できないため、攻撃者は、繰り返し変更する必要があり、時間コスト及び操作コストを増加する。 Regarding the fourth issue, the final proposal increases the operating cost of SQL injection, adds a fixed form of random parameters to each request, and the attacker captures the packet and parameters to carry out the attack. Must be changed and the request resubmitted. In addition, since each request can only be used once, the attacker would have to make repeated changes, increasing time and operating costs.

図1に示されるように、上記4つの課題に対して、本実施例は、phpに基づく独立型sqlインジェクション防御分析通知方法を提供し、該方法は、ステップS101〜ステップS106を含む。
S101、sqlインジェクションの要求パラメータrandomNumについて、存在し且つフォーマットが正確であるか否かを検出する。
S102、sqlインジェクションの要求IPを照合して、IP制限ブラックリストに登録されているか否かを検出し、そうである場合、要求を終了し、そうでない場合、次のステップに進み、前記IP制限ブラックリストは、IP制限を予め収集してデータベースに保存したものであり、且つ前記IP制限ブラックリストは、ステップS106のIP制限ブラックリストに追加された要求ipを追加することにより、更新される。
S103、sqlインジェクションのパラメータを取得して、パラメータにブラックリスト記号が含まれているか否かを判断し、含まれている場合、このsqlインジェクションをnoticeレベルに設定し、パラメータにブラックリスト記号が含まれているか否かに関わらず、次のステップに進み、前記のブラックリスト記号は、攻撃的な記号を予め収集してデータベースに保存したものであり、前記ブラックリスト記号は、ファイル1『sqlインジェクション記号ブラックリスト』に記憶される。
S104、sqlインジェクションのパラメータにブラックリストキーワードが含まれているか否かを判断し、含まれている場合、このsqlインジェクションをwarningレベルに設定し、パラメータにブラックリストキーワードが含まれているか否かに関わらず、次のステップに進み、前記のブラックリストキーワードは、攻撃的なキーワードを予め収集してデータベースに保存したものであり、前記ブラックリストキーワードは、ファイル2『sqlインジェクションキーワードブラックリスト』に記憶される。
S105、sqlインジェクションのパラメータをスペースで分割して、パラメータにブラックリストキーワードが含まれているか否かを判断し、含まれている場合、このsqlインジェクションをerrorレベルに設定し、パラメータにブラックリストキーワードが含まれているか否かに関わらず、次のステップに進み、noticeレベル、warningレベル、及びerrorレベルのsqlインジェクションの場合、その要求ip、要求パラメータ、要求時間、及び要求urlの情報をすべて記録してデータベースに記憶し、errorレベルのsqlインジェクションの場合、運用保守スタッフに通知するようにメールを送信して、且つクライアントのsqlインジェクション要求を直ちに終止する。
S106、正常、noticeレベル、及びwarningレベルのsqlインジェクションの場合、データベースを要求し続け、errorレベルのsqlインジェクションの場合、該sqlインジェクションの要求ipが一定時間内に所定回数のインジェクション攻撃を行ったか否かを検出し、そうである場合、この要求ipを禁止してIP制限ブラックリストに追加し、そうでない場合、そのインジェクション攻撃回数に1を加算し、好ましくは、前記一定時間が24時間であり、前記所定回数が3回であり、ここで、一定時間は、必ずしも24時間である必要がなく、所定回数も必ずしも3回である必要がなく、実際の状況のニーズに応じて、開発者によって定義できる。
As shown in FIG. 1, for the above four issues, the present embodiment provides a php-based stand-alone SQL injection defense analysis notification method, which method comprises steps S101 to S106.
For the required parameter randomNum of S101, SQL injection, it is detected whether or not it exists and the format is accurate.
S102, the request IP of skl injection is collated to detect whether or not it is registered in the IP restriction blacklist. If so, the request is terminated, and if not, the process proceeds to the next step and the IP restriction is performed. The blacklist is a collection of IP restrictions in advance and stored in a database, and the IP restriction blacklist is updated by adding a request ip added to the IP restriction blacklist in step S106.
Obtain the parameters of S103 and SQL injection, determine whether the parameter contains the blacklist symbol, and if so, set this SQL injection to the note level and the parameter contains the blacklist symbol. Regardless of whether or not it is, proceed to the next step, the blacklist symbol is a collection of offensive symbols in advance and saved in the database, and the blacklist symbol is the file 1 "SQL injection". It is stored in the symbol black list.
S104, It is determined whether or not the parameter of SQL injection contains a blacklist keyword, and if it is included, this SQL injection is set to the warning level and whether or not the parameter contains a blacklist keyword. Regardless, the next step is taken, and the blacklist keyword is a collection of offensive keywords in advance and saved in the database, and the blacklist keyword is stored in the file 2 “SQL injection keyword blacklist”. Will be done.
S105, SQL injection parameters are divided by spaces to determine if the parameters include a blacklist keyword, and if so, this SQL injection is set to the error level and the parameters are blacklist keywords. Proceed to the next step, whether or not it is included, and in the case of note-level, warning-level, and error-level SQL injections, record all information about the request ip, request parameters, request time, and request url. Then, it is stored in the database, and in the case of error level SQL injection, an email is sent to notify the operation and maintenance staff, and the client's SQL injection request is immediately terminated.
In the case of S106, normal, notice level, and warning level SQL injection, the database is continuously requested, and in the case of error level SQL injection, whether or not the request ip of the skl injection has performed a predetermined number of injection attacks within a certain period of time. If so, this request ip is prohibited and added to the IP restriction blacklist, otherwise 1 is added to the number of injection attacks, preferably the fixed time is 24 hours. , The predetermined number of times is three times, and here, the fixed time does not necessarily have to be 24 hours, and the predetermined number of times does not necessarily have to be three times, depending on the needs of the actual situation, depending on the developer. Can be defined.

実施例2
図2に示されるように、本実施例は、phpに基づく独立型sqlインジェクション防御分析通知システムを提供し、該システムは、
sqlインジェクションのIP制限を収集するIP制限ブラックリスト収集ユニットと、
収集されたsqlインジェクションのIP制限を記憶するIP制限ブラックリスト記憶ユニットと、
sqlインジェクションの要求IPについて、前記IP制限ブラックリスト記憶ユニットにおけるIP制限であるか否かを判断するIP制限ブラックリスト判断ユニットと、
sqlインジェクションのブラックリスト記号を収集するブラックリスト記号収集ユニットと、
収集されたsqlインジェクションのブラックリスト記号を記憶するブラックリスト記号記憶ユニットと、
sqlインジェクションのパラメータについて、前記ブラックリスト記号記憶ユニットのブラックリスト記号が含まれているか否かを判断し、且つ、ブラックリスト記号が含まれているsqlインジェクションをnoticeレベルに設定するブラックリスト記号判断ユニットと、
sqlインジェクションのブラックリストキーワードを収集するブラックリストキーワード収集ユニットと、
収集されたsqlインジェクションのブラックリストキーワードを記憶するブラックリストキーワード記憶ユニットと、
sqlインジェクションのパラメータには、前記ブラックリストキーワード記憶ユニットにおけるブラックリストキーワードが含まれているか否かを判断し、且つ、このブラックリストキーワードが含まれているsqlインジェクションをwarningレベルに設定し、さらに、sqlインジェクションのパラメータをスペースで分割し、パラメータには、前記ブラックリストキーワード記憶ユニットにおけるブラックリストキーワードが含まれているか否かを判断し、且つ、このブラックリストキーワードが含まれているsqlインジェクションをerrorレベルに設定するブラックリストキーワード判断ユニットと、
正常、noticeレベル、及びwarningレベルのsqlインジェクションの場合、データベースを要求し続け、errorレベルのsqlインジェクションの場合、一定時間内に所定回数に達したインジェクション攻撃をIP制限ブラックリストに追加する処理結果ユニットと、
errorレベルのsqlインジェクションをメールで運用保守スタッフに送信して、且つクライアントのsqlインジェクション要求を直ちに終止するメールフィードバック処理ユニットと、を備える。
Example 2
As shown in FIG. 2, the present embodiment provides a php-based stand-alone SQL injection defense analysis notification system, which is a system.
An IP restriction blacklist collection unit that collects IP restrictions for SQL injection, and
An IP restriction blacklist storage unit that stores the IP restrictions of collected SQL injections,
With respect to the request IP of SQL injection, the IP restriction blacklist determination unit that determines whether or not the IP restriction is the IP restriction in the IP restriction blacklist storage unit, and the IP restriction blacklist determination unit.
A blacklist symbol collection unit that collects skl injection blacklist symbols,
A blacklist symbol storage unit that stores the collected SQL injection blacklist symbols,
A blacklist symbol determination unit that determines whether or not the blacklist symbol of the blacklist symbol storage unit is included in the SQL injection parameter and sets the skl injection containing the blacklist symbol to the note level. When,
A blacklist keyword collection unit that collects skl injection blacklist keywords,
A blacklist keyword storage unit that stores the collected SQL injection blacklist keywords,
It is determined whether or not the skl injection parameter includes the blacklist keyword in the blacklist keyword storage unit, and the skl injection containing this blacklist keyword is set to the warning level. The parameter of skl injection is divided by a space, it is determined whether or not the parameter contains the blacklist keyword in the blacklist keyword storage unit, and the skl injection containing this blacklist keyword is eraser. The blacklist keyword judgment unit to be set to the level, and
A processing result unit that keeps requesting the database for normal, notice-level, and warning-level SQL injections, and adds a specified number of injection attacks to the IP-restricted blacklist within a certain period of time for errror-level SQL injections. When,
It is provided with an email feedback processing unit that sends errr level SQL injection to operation and maintenance staff by email and immediately terminates the client's SQL injection request.

本発明の実施例を示して説明したが、当業者であれば、本発明の原理及び精神から逸脱せずに、これらの実施例に対して様々な同等の変化、修正、置換や変形を行うことができ、本発明の範囲が添付の特許請求の範囲及びその同等範囲によって限定されることを理解できる。 Although examples of the present invention have been shown and described, those skilled in the art will make various equivalent changes, modifications, substitutions and modifications to these examples without departing from the principles and spirit of the invention. It can be understood that the scope of the present invention is limited by the appended claims and their equivalents.

Claims (10)

Webサーバは、データベースへアクセスを要求する要求IPから、正常なsql文及びsqlインジェクション攻撃を含むsql文を、インターネットを介して受け取ったときに、sqlインジェクション攻撃を区分して排除するphpに基づく独立型sqlインジェクション防御分析通知方法であって、
前記sql文前記要求IPを照合して、IP制限ブラックリストに登録されているか否かを検出し、登録されている場合、要求を終了し、そうでない場合、次のステップに進むステップS1と、
前記sql文のパラメータを取得して、パラメータにブラックリスト記号が含まれているか否かを判断し、含まれている場合、前記sql文をnoticeレベルに設定し、パラメータにブラックリスト記号が含まれているか否かに関わらず、次のステップに進むステップS2と、
前記sql文のパラメータにブラックリストキーワードが含まれているか否かを判断し、含まれている場合、前記sql文をwarningレベルに設定し、パラメータにブラックリストキーワードが含まれているか否かに関わらず、次のステップに進むステップS3と、
前記sql文のパラメータをスペースで分割して、パラメータにブラックリストキーワードが含まれているか否かを判断し、含まれている場合、前記sql文をerrorレベルに設定し、パラメータにブラックリストキーワードが含まれているか否かに関わらず、次のステップに進むステップS4と、
正常、noticeレベル、及びwarningレベルの前記sql文の場合、前記要求IPのデータベースへのアクセスを要求し続け、errorレベルの前記sql文の場合、前記sql文の要求ipが一定時間内に所定回数のインジェクション攻撃を行ったか否かを検出し、そうである場合、この要求ipを禁止してIP制限ブラックリストに追加し、そうでない場合、そのインジェクション攻撃回数に1を加算するステップS5と、を含む、
ことを特徴とするphpに基づく独立型sqlインジェクション防御分析通知方法。
The Web server is independent based on php that classifies and eliminates skl injection attacks when it receives skl statements including normal skl statements and skl injection attacks from the request IP requesting access to the database via the Internet. Type SQL injection defense analysis notification method,
By matching the request IP of the sql statement, to detect whether or not it is registered in the IP restrictions blacklist, if it is registered, and terminates the request, if not, the step S1 proceeds to the next step ,
The parameter of the SQL statement is acquired to determine whether or not the parameter contains a blacklist symbol, and if so, the SQL statement is set to the note level and the parameter contains the blacklist symbol. Step S2 to proceed to the next step regardless of whether or not
Determine if the parameter of the SQL statement contains a blacklist keyword, and if so , set the SQL statement to the warning level, regardless of whether the parameter contains a blacklist keyword. Step S3 to proceed to the next step without
The parameter of the SQL statement is divided by a space to determine whether the parameter contains a blacklist keyword, and if so, the SQL statement is set to the error level and the parameter contains the blacklist keyword. Step S4 to proceed to the next step regardless of whether it is included or not,
Normal, if the sql statement level notice, and warning levels, continue to request access to the requested IP database, if the sql statement error level, a predetermined number of times within a predetermined time is required ip of the sql statement If this is the case, this request ip is prohibited and added to the IP restriction blacklist, and if not, 1 is added to the number of injection attacks in step S5. Including,
A php-based stand-alone SQL injection defense analysis notification method.
前記ステップS1のIP制限ブラックリストは、IP制限を予め収集してデータベースに保存したものであり、且つ前記IP制限ブラックリストは、ステップS5のIP制限ブラックリストに追加された要求ipを追加することにより、更新される、
ことを特徴とする請求項1に記載のphpに基づく独立型sqlインジェクション防御分析通知方法。
The IP restriction blacklist in step S1 is a collection of IP restrictions in advance and stored in a database, and the IP restriction blacklist adds a request ip added to the IP restriction blacklist in step S5. Updated by,
The php-based stand-alone SQL injection defense analysis notification method according to claim 1.
前記ステップS2のブラックリスト記号は、攻撃的な記号を予め収集されてデータベースに保存したものである、
ことを特徴とする請求項1に記載のphpに基づく独立型sqlインジェクション防御分析通知方法。
The blacklist symbol in step S2 is an offensive symbol collected in advance and stored in a database.
The php-based stand-alone SQL injection defense analysis notification method according to claim 1.
前記ステップS3のブラックリストキーワードは、攻撃的なキーワードを予め収集してデータベースに保存したものである、
ことを特徴とする請求項1に記載のphpに基づく独立型sqlインジェクション防御分析通知方法。
The blacklist keywords in step S3 are those in which offensive keywords are collected in advance and stored in a database.
The php-based stand-alone SQL injection defense analysis notification method according to claim 1.
前記ステップS4は、noticeレベル、warningレベル、及びerrorレベルの前記sql文の場合、その要求ip、要求パラメータ、要求時間、及び要求urlの情報をすべて記録してデータベースに記憶するステップをさらに含む、
ことを特徴とする請求項1に記載のphpに基づく独立型sqlインジェクション防御分析通知方法。
The step S4 further includes a step of recording all the information of the request ip, the request parameter, the request time, and the request url in the case of the SQL statement of the note level, the warning level, and the error level and storing it in the database.
The php-based stand-alone SQL injection defense analysis notification method according to claim 1.
前記ステップS4は、errorレベルの前記sql文の場合、運用保守スタッフに通知するようにメールを送信して、且つクライアントの前記sql文の要求を直ちに終止するステップをさらに含む、
ことを特徴とする請求項1に記載のphpに基づく独立型sqlインジェクション防御分析通知方法。
The step S4 further includes, in the case of the error level SQL statement , a step of sending an email to notify the operation and maintenance staff and immediately terminating the client's request for the SQL statement.
The php-based stand-alone SQL injection defense analysis notification method according to claim 1.
前記ステップS4では、前記一定時間が24時間であり、前記所定回数が3回である、
ことを特徴とする請求項1に記載のphpに基づく独立型sqlインジェクション防御分析通知方法。
In step S4, the fixed time is 24 hours, and the predetermined number of times is three times.
The php-based stand-alone SQL injection defense analysis notification method according to claim 1.
前記ステップS1の前に、
前記sql文の要求パラメータrandomNumについて、存在し且つフォーマットが正確であるか否かを検出するステップS0をさらに含む、
ことを特徴とする請求項1−7のいずれか1項に記載のphpに基づく独立型sqlインジェクション防御分析通知方法。
Before step S1,
Further comprising step S0 to detect whether the required parameter randomNum of the SQL statement exists and is in the correct format.
The php-based stand-alone SQL injection defense analysis notification method according to any one of claims 1-7.
Webサーバは、データベースへアクセスを要求する要求IPから、正常なsql文及びsqlインジェクション攻撃を含むsql文を、インターネットを介して受け取ったときに、sqlインジェクション攻撃を区分して排除するphpに基づく独立型sqlインジェクション防御分析通知システムであって、
前記sql文のIP制限を収集するIP制限ブラックリスト収集ユニットと、
収集された前記sql文のIP制限を記憶するIP制限ブラックリスト記憶ユニットと、
前記sql文前記要求IPについて、前記IP制限ブラックリスト記憶ユニットにおけるIP制限であるか否かを判断するIP制限ブラックリスト判断ユニットと、
前記sql文のブラックリスト記号を収集するブラックリスト記号収集ユニットと、
収集された前記sql文のブラックリスト記号を記憶するブラックリスト記号記憶ユニットと、
前記sql文のパラメータについて、前記ブラックリスト記号記憶ユニットのブラックリスト記号が含まれているか否かを判断し、且つ、ブラックリスト記号が含まれているsql文をnoticeレベルに設定するブラックリスト記号判断ユニットと、
前記sql文のブラックリストキーワードを収集するブラックリストキーワード収集ユニットと、
収集された前記sql文のブラックリストキーワードを記憶するブラックリストキーワード記憶ユニットと、
前記sql文のパラメータには、前記ブラックリストキーワード記憶ユニットにおけるブラックリストキーワードが含まれているか否かを判断し、且つ、このブラックリストキーワードが含まれている前記sql文をwarningレベルに設定し、さらに、前記sql文のパラメータをスペースで分割し、パラメータには、前記ブラックリストキーワード記憶ユニットにおけるブラックリストキーワードが含まれているか否かを判断し、且つ、このブラックリストキーワードが含まれている前記sql文をerrorレベルに設定するブラックリストキーワード判断ユニットと、
正常、noticeレベル、及びwarningレベルの前記sql文の場合、前記要求IPのデータベースへのアクセスを要求し続け、errorレベルの前記sql文の場合、一定時間内に所定回数に達したインジェクション攻撃をIP制限ブラックリストに追加する処理結果ユニットと、を備える、
ことを特徴とするphpに基づく独立型sqlインジェクション防御分析通知システム。
The Web server is independent based on php that classifies and eliminates skl injection attacks when it receives skl statements including normal skl statements and skl injection attacks from the request IP requesting access to the database via the Internet. SQL injection defense analysis notification system
An IP restriction blacklist collection unit that collects the IP restrictions of the SQL statement, and
An IP restriction blacklist storage unit that stores the collected IP restrictions of the SQL statement, and
For the request IP of the sql statement, and IP restrictions blacklist determination unit that determines whether the IP limited in the IP restriction blacklist storage unit,
A blacklist symbol collection unit that collects the blacklist symbols of the SQL statement, and
A blacklist symbol storage unit that stores the collected blacklist symbols of the SQL statement, and
For the parameters of the SQL statement , it is determined whether or not the blacklist symbol of the blacklist symbol storage unit is included, and the blacklist symbol determination which sets the skl statement including the blacklist symbol to the note level. With the unit
A blacklist keyword collection unit that collects blacklist keywords in the SQL statement,
A blacklist keyword storage unit that stores the collected blacklist keywords of the SQL statement,
It is determined whether or not the parameter of the SQL statement includes the blacklist keyword in the blacklist keyword storage unit, and the SQL statement including the blacklist keyword is set to the warning level. Furthermore, the dividing parameters of sql statement space, the parameters, determines whether contains blacklist keywords in the blacklist keyword storage unit, and said containing this blacklist keyword A blacklist keyword judgment unit that sets the skl statement to the argument level,
In the case of the normal, notice level, and warning level SQL statements , the request for access to the database of the request IP is continued, and in the case of the error level SQL statement , the injection attacks that reach a predetermined number of times within a certain period of time are IPd. It has a processing result unit to be added to the restricted blacklist,
A php-based stand-alone SQL injection defense analysis notification system.
errorレベルの前記sql文をメールで運用保守スタッフに送信して、且つクライアントの前記sql文の要求を直ちに終止するメールフィードバック処理ユニットをさらに備える、
ことを特徴とする請求項9に記載のphpに基づく独立型sqlインジェクション防御分析通知システム。
Further provided is a mail feedback processing unit that sends the error level SQL statement to the operation and maintenance staff by email and immediately terminates the client's request for the SQL statement.
The php-based stand-alone SQL injection defense analysis notification system according to claim 9.
JP2020008081A 2019-07-26 2020-01-22 Independent SQL injection defense analysis notification method based on php and its system Active JP6876307B2 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201910681283.3A CN110474888A (en) 2019-07-26 2019-07-26 A kind of free-standing sql injection defence analysis alarm method and its system based on php
CN2019106812833 2019-07-26

Publications (2)

Publication Number Publication Date
JP2021022358A JP2021022358A (en) 2021-02-18
JP6876307B2 true JP6876307B2 (en) 2021-05-26

Family

ID=68508938

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2020008081A Active JP6876307B2 (en) 2019-07-26 2020-01-22 Independent SQL injection defense analysis notification method based on php and its system

Country Status (2)

Country Link
JP (1) JP6876307B2 (en)
CN (1) CN110474888A (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111832023B (en) * 2020-07-10 2021-04-27 厦门靠谱云股份有限公司 SQL injection detection method and device based on C/S architecture
CN112966507A (en) * 2021-03-29 2021-06-15 北京金山云网络技术有限公司 Method, device, equipment and storage medium for constructing recognition model and identifying attack

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP5145967B2 (en) * 2008-01-18 2013-02-20 富士通株式会社 Command statement construction program, processing method, and processing device
JP5656266B2 (en) * 2012-01-24 2015-01-21 Necソリューションイノベータ株式会社 Blacklist extraction apparatus, extraction method and extraction program
CN105144216A (en) * 2013-03-15 2015-12-09 维萨国际服务协会 Snap mobile security apparatuses, methods and systems
JP6364255B2 (en) * 2014-06-17 2018-07-25 株式会社エヌ・ティ・ティ・データ Communication control device, attack defense system, attack defense method, and program

Also Published As

Publication number Publication date
JP2021022358A (en) 2021-02-18
CN110474888A (en) 2019-11-19

Similar Documents

Publication Publication Date Title
Hofmeyr et al. Intrusion detection using sequences of system calls
US10984010B2 (en) Query summary generation using row-column data storage
EP2566130B1 (en) Automatic analysis of security related incidents in computer networks
EP3457661B1 (en) Malicious software detection in a computing system
US7730531B2 (en) System and method for detection of artificially generated system load
US8719942B2 (en) System and method for prioritizing computers based on anti-malware events
CN108268354A (en) Data safety monitoring method, background server, terminal and system
RU2523112C1 (en) System and method of selecting optimum type of antiviral verification when accessing file
CN1773417A (en) System and method of aggregating the knowledge base of antivirus software applications
CN103701793A (en) Method and device for identifying server broiler chicken
JP6876307B2 (en) Independent SQL injection defense analysis notification method based on php and its system
JP7311350B2 (en) MONITORING DEVICE, MONITORING METHOD, AND MONITORING PROGRAM
RU2757597C1 (en) Systems and methods for reporting computer security incidents
US8392998B1 (en) Uniquely identifying attacked assets
US20170318037A1 (en) Distributed anomaly management
RU2481633C2 (en) System and method for automatic investigation of safety incidents
US11457034B2 (en) Distribution-based detection of abusive requests
CN111159702B (en) Process list generation method and device
CN113055362B (en) Method, device, equipment and storage medium for preventing abnormal behaviors
US10068094B2 (en) System and method for tracing data access and detecting abnormality in the same
KR102348357B1 (en) Apparatus and methods for endpoint detection and reponse using dynamic analysis plans
KR102311997B1 (en) Apparatus and method for endpoint detection and response terminal based on artificial intelligence behavior analysis
CN115134106A (en) Method and computer program product for detecting hacker attacks
CN106649458A (en) Method and system for detecting file update amount
RU2800739C1 (en) System and method for determining the level of danger of information security events

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20200125

A871 Explanation of circumstances concerning accelerated examination

Free format text: JAPANESE INTERMEDIATE CODE: A871

Effective date: 20200618

A975 Report on accelerated examination

Free format text: JAPANESE INTERMEDIATE CODE: A971005

Effective date: 20200915

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20200917

RD02 Notification of acceptance of power of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7422

Effective date: 20201023

A601 Written request for extension of time

Free format text: JAPANESE INTERMEDIATE CODE: A601

Effective date: 20201214

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20210122

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20210413

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20210416

R150 Certificate of patent or registration of utility model

Ref document number: 6876307

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE

Ref document number: 6876307

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150