Debian Codegraph @

others/libinjection/php/example.php

raw
1 <?php
2
3 // add to your ini file:
4 // extension=YOUR DIRECTORY//libinjection.so
5
6 echo "Using libinjection " . LIBINJECTION_VERSION . "\n";
7
8 // make a state object .. can be reused
9 $x = new_libinjection_sqli_state();
10
11 // pass it in to init
12 // arg 1 -- state objection above
13 // arg 2 -- php string of input -- MUST BE URL-DECODED
14 // arg 3 -- flags -- just pass in '0' for now
15 $input = "1 union select 1,2,3,4--";
16 libinjection_sqli_init($x, $input, 0);
17
18 // do a test
19 $sqli = libinjection_is_sqli($x);
20 if ($sqli == 1) {
21 echo "sqli with fingerprint " . libinjection_sqli_state_fingerprint_get($x) . "\n";
22 } else {
23 echo "not sqli";
24 }
25