File: example.php

package info (click to toggle)
modsecurity 3.0.9-1%2Bdeb12u1
  • links: PTS
  • area: main
  • in suites: bookworm
  • size: 39,148 kB
  • sloc: cpp: 27,506; ansic: 15,067; sh: 5,355; python: 2,934; yacc: 2,927; makefile: 1,490; lex: 1,359; php: 42; perl: 36
file content (25 lines) | stat: -rw-r--r-- 631 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
<?php

// add to your ini file:
// extension=YOUR DIRECTORY//libinjection.so

echo "Using libinjection " . LIBINJECTION_VERSION . "\n";

// make a state object .. can be reused
$x = new_libinjection_sqli_state();

// pass it in to init
// arg 1 -- state objection above
// arg 2 -- php string of input -- MUST BE URL-DECODED
// arg 3 -- flags -- just pass in '0' for now
$input = "1 union select 1,2,3,4--";
libinjection_sqli_init($x, $input, 0);

// do a test
$sqli = libinjection_is_sqli($x);
if ($sqli == 1) {
  echo "sqli with fingerprint " .  libinjection_sqli_state_fingerprint_get($x) . "\n";
} else {
  echo "not sqli";
}