File: example.php

package info (click to toggle)
modsecurity 3.0.14-1
  • links: PTS
  • area: main
  • in suites: forky, sid, trixie
  • size: 88,920 kB
  • sloc: ansic: 174,512; sh: 43,569; cpp: 26,214; python: 15,734; makefile: 3,864; yacc: 2,947; lex: 1,359; perl: 1,243; php: 42; tcl: 4
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";
}