Coder Social home page Coder Social logo

peter-cui1221 / sqlinjection-detect Goto Github PK

View Code? Open in Web Editor NEW
54.0 4.0 14.0 605 KB

SQL injection detection engine built on of SQL tokenizing and syntax analysis written in C

License: The Unlicense

CMake 0.09% Shell 0.10% Awk 0.32% C 90.25% Yacc 9.24%
sqlinjection syntax-analysis sql-tokenizing

sqlinjection-detect's Introduction

sqlinjection-detect

SQL injection detection engine built on of SQL tokenizing and syntax analysis written in C

Simple example:

#include <stdio.h>
#include <string.h>
#include "sqli_detect.h"

int main(int argc, char* argv[]) {
    char *str = "1' or '1'='1";
    int ret = sqli_detect(str, strlen(str));
    if (ret > 0) {
        printf("sqli found\n");
    }
    return ret;
}

vs libinjection

sqlinjection-detect is a kind of sql injection library based on tokenizing and syntax analysis, which can effectively improve the detection rate and reduce false positives. In contrast, libinjection(https://github.com/client9/libinjection). is base on tokenizing. sqlinjection-detect is the same to sqlshop of chaitin (https://github.com/chaitin/sqlchop).

sqlinjection-detect是一款基于语义分析的SQL注册检测库,能够有效的提高检出率,减少误报。相比之下,libinjection(https://github.com/client9/libinjection) 是一款基于词法分析SQL注入检测库。sqlinjection-detect和长亭的SQLChop(https://github.com/chaitin/sqlchop) 从功能的角度来看是一样的。

usage

$ yum install sqlite-devel.x86_64

$ ./build.sh
$ cmake . -DCMAKE_BUILD_TYPE=Release
$ make

$ gcc -I src/include/ sqli_test.c -o sqli_test -L. -lsqli_detect
$ ./test.sh

thanks

this project is base on https://github.com/winkyao/lemon

sqlinjection-detect's People

Contributors

peter-cui1221 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

sqlinjection-detect's Issues

这个检测方案原理不可行

这个检测方案原理不可行,原因是虽然payload拼装前缀得到的sql出现语法错误,但是并不能说明这个payload不是sql注入,因为payload可能出现在sql的任意位置

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.