資料庫密碼的破解(以破解MySQL資料庫為例)實驗

來源:互聯網
上載者:User

1、常見的資料庫類型包括 微軟的SQLServer 、MySql、IBM的DB2、Oracle

2、DBPwAudit資料庫密碼破解工具

1) 功能:通過掛載字典對目標資料庫進行密碼暴力猜解,目前支援的資料庫包括SQLServer、MySQL、Oracle、DB2

2) DBPwAudit的安裝:

圖1、上傳實驗用到的軟體包

注釋:#crunch 密碼字典產生工具

#mysql-cennector-java 密碼破解工具需要的驅動(注意:資料庫類型不同,驅動不同)

#dbpwaudit 資料庫密碼破解主程式

 

圖2、解壓dbpwaudit壓縮包

[root@attack ~]# unzip dbpwaudit_0_8.zip

 

3)資料庫密碼dbpwaudit的使用格式

注意:首先將*.jar驅動複製到 /root/DBPwAudit/jdbc 目錄中

DBPwAudit -s <server> -d <db> -D <driver> -U <users> -P <passwords> [options]

-s - Server name or address. #指定資料庫ip地址

-p - Port of database server/instance. #指定資料庫伺服器連接埠

-d - Database/Instancename to audit. #指定資料庫名

-D - Thealiasof the driver to use (-Lforaliases) #指定資料庫類型(Oracle,MySQL,MSSql,DB2)

-U - File containing usernames to guess. #使用者字典檔案

-P - File containing passwords to guess. #密碼字典檔案

-L - List driver aliases. #列出所支援的資料庫驅動別名

-L

Oracle - oracle.jdbc.driver.OracleDriver

MySQL - com.mysql.jdbc.Driver

MSSql - com.microsoft.sqlserver.jdbc.SQLServerDriver

DB2 - com.ibm.db2.jcc.DB2Driver

 

4)使用方法1、破解SQLServer資料庫

#./dbpwaudit.sh -s IP -d master(資料庫名) -D mssql(資料庫類型) -U username(字典) -P password(字典)

使用方法2、破解MySql資料庫

#./dbpwaudit.sh -s IP -d mysql(資料庫名稱) -D MySQL(資料庫類型) -U username(字典) -P password(字典)

注意:驅動是需要手動匯入的。需要建立自己破解字典

 

5)、解壓mysql資料庫驅動軟體包

[root@attack ~]# tar -zxvf mysql-connector-java-5.1.24.tar.gz

 

6)、手動將驅動*.jar複製到 “jdbc”目錄中

[root@attack ~]# cp mysql-connector-java-5.1.24/mysql-connector-java-5.1.24-bin.jar DBPwAudit/jdbc/

 

3、crunch產生密碼字典檔案

 

1)、crunch用途:字典產生工具

 

2)、工具特點:

· 使用排列組合的方式產生字典檔案

· 可以通過行數或檔案的大小中斷產生過程

· 支援產生數字和符號結合的字典檔案

· 支援區分大小寫字母

· 當產生多個檔案時增加一個狀態報表

 

3)、工具更多資訊及下載:http://sourceforge.net/projects/crunch-wordlist/files/

 

4)、crunch工具的安裝

 

圖1、解壓crunch工具的壓縮包

[root@attack ~]# tar -xvf crunch-3.4.tgz

 

圖2、make編譯

[root@attack ~]# cd crunch-3.4

[root@localhost crunch-3.4]# make

Building binary...

/usr/bin/gcc -pthread -Wall -pedantic -std=c99 crunch.c -lm -o crunch

 

圖3、make install安裝

[root@localhost crunch-3.4]# make install

 

5)、crunch使用格式

目錄:/pentest/passwords/crunch/

用法1:#./crunch 密碼最短位元 最大位元 密碼的可能性 -o 產生密碼字典

#./crunch 5 5 1234567890 -o pass1.dic

用法2:#./crunch 最短位元 最大位元 charset.lst(策略集) 使用的策略 -o 產生密碼字典

#./crunch 6 8 charset.lst mixalpha-numeric-all-space -o pass2.dic

  • 1
  • 2
  • 下一頁

相關文章

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.