Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>One clever solution to this that I've seen is to include a "honeypot" input box and set its CSS display value to none. If there is anything in that box, you know it's a script. Also, use something really obscure for the real name of the field, and pass in a token you can validate upon submission. For example:</p> <pre><code>&lt;input type="text" name="zsdifhs" value="&lt;?= $q ?&gt;" id="zsdifhs" /&gt; &lt;input type="text" name="q" value="&lt;?= $tok ?&gt;" id="query" style="display:none;" /&gt; </code></pre> <p>Or possibly set it to the background color of your page; if that's white, something like:</p> <pre><code>&lt;input type="text" name="zsdifhs" value="&lt;?= $q ?&gt;" id="zsdifhs" /&gt; &lt;input type="text" name="q" value="&lt;?= $tok ?&gt;" id="query" style="font-size: 1pt; color: white;" /&gt; </code></pre> <p>Or set it to some non-visible margin, like:</p> <pre><code>&lt;input type="text" name="zsdifhs" value="&lt;?= $q ?&gt;" id="zsdifhs" /&gt; &lt;input type="text" name="q" value="&lt;?= $tok ?&gt;" id="query" style="margin-left: 9000px;" /&gt; </code></pre> <p>In the processing script, if <code>$_POST['q']</code> is set to anything except the token you passed in, you know it's almost certainly been modified by a script. To avoid detection, you can also use javascript to change the CSS display status, and if you're feeling really clever, you can even do something fancy like return a static page with bogus results (which is pretty efficient) instead of actually processing the query instead of returning an error or access denied page, which the script would probably detect, allowing the attacker to check to see what's wrong and tweak their script.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload