MCPcopy Index your code
hub / github.com/client9/libinjection

github.com/client9/libinjection @v3.10.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release v3.10.0 ↗ · + Follow
218 symbols 595 edges 41 files 76 documented · 35%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Build Status Coverage Status license

libinjection

SQL / SQLI tokenizer parser analyzer. For

See https://libinjection.client9.com/ for details and presentations.

Simple example:

#include <stdio.h>
#include <strings.h>
#include <errno.h>
#include "libinjection.h"
#include "libinjection_sqli.h"

int main(int argc, const char* argv[])
{
    struct libinjection_sqli_state state;
    int issqli;

    const char* input = argv[1];
    size_t slen = strlen(input);

    /* in real-world, you would url-decode the input, etc */

    libinjection_sqli_init(&state, input, slen, FLAG_NONE);
    issqli = libinjection_is_sqli(&state);
    if (issqli) {
        fprintf(stderr, "sqli detected with fingerprint of '%s'\n", state.fingerprint);
    }
    return issqli;
}
$ gcc -Wall -Wextra examples.c libinjection_sqli.c
$ ./a.out "-1' and 1=1 union/* foo */select load_file('/etc/passwd')--"
sqli detected with fingerprint of 's&1UE'

More advanced samples:

VERSION INFORMATION

See CHANGELOG for details.

Versions are listed as "major.minor.point"

Major are significant changes to the API and/or fingerprint format. Applications will need recompiling and/or refactoring.

Minor are C code changes. These may include * logical change to detect or suppress * optimization changes * code refactoring

Point releases are purely data changes. These may be safely applied.

QUALITY AND DIAGNOSITICS

The continuous integration results at https://travis-ci.org/client9/libinjection tests the following:

LICENSE

Copyright (c) 2012-2016 Nick Galbreath

Licensed under the standard BSD 3-Clause open source license. See COPYING for details.

EMBEDDING

The src directory contains everything, but you only need to copy the following into your source tree:

Core symbols most depended-on inside this repo

insert
called by 40
src/make_parens.py
st_assign
called by 29
src/libinjection_sqli.c
cstrcasecmp
called by 20
src/libinjection_sqli.c
get
called by 13
misc/sqliserver.py
libinjection_sqli_fingerprint
called by 12
src/libinjection_sqli.c
st_copy
called by 11
src/libinjection_sqli.c
st_assign_char
called by 10
src/libinjection_sqli.c
parse_word
called by 9
src/libinjection_sqli.c

Shape

Function 178
Class 15
Method 14
Enum 11

Languages

C62%
Python33%
C++4%
PHP1%
Go1%

Modules by API surface

src/libinjection_sqli.c62 symbols
src/libinjection_html5.c28 symbols
misc/sqliserver.py16 symbols
src/libinjection_xss.c11 symbols
src/testdriver.c9 symbols
python/test_driver.py9 symbols
src/reader.c7 symbols
src/make_parens.py7 symbols
src/html5_cli.c7 symbols
misc/nullserver.py7 symbols
src/sqli_cli.c5 symbols
src/libinjection_sqli.h5 symbols

For agents

$ claude mcp add libinjection \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact