破解已知部分密碼的 zip 文件

破解已知部分密碼的 zip 文件

我有一個壓縮因忘記密碼而無法開啟的檔案。我非常確定此密碼的某些部分,但我不記得添加到其中的變體。我試過破解壓縮包但我不知道如何表明我知道部分密碼。總結一下:

  • 我知道密碼的某些部分,例如“你好“,”世界“ 和 ”糟糕的通行證」。
  • 這些部件可以按任何順序排列,並且不能全部使用。
  • 可能會出現一些額外的小部分,例如 3 到 5 個小寫字母。

你知道有什麼軟體可以做到這一點嗎?

答案1

方法概要:

  1. 使用像這樣的實用程序crunch建立自訂詞典檔案。

  2. fcrackzip使用該自訂字典運行。

問題:

  • 最多 3 個字串與 3-5 個小寫字母混合可構成超過一兆種可能的密碼。僅僅生成該字典就需要一段時間。

  • crunch允許使用基於字元的通配符,但它對自訂字串的處理不太靈活。為了解決這個問題,grep, ,sed似乎sort也需要,其中任何一個都會增加所需的時間,即幾個小時,也許幾天......

像這樣的東西可能會起作用:

crunch 3 9 abcdefghijklmnopqrstuvwxyz123 | \
  grep '[123]' | # at least one number per dict entry
  egrep -v '([123]).*\1' | # remove repeated numbers
  sed 's/1/hello/;s/2/world/;s/3/shittypass/' | # replace numbers with strings
  sort -u | \
  fcrackzip -D -p /dev/stdin foo.zip 

具有較小問題集的測試案例(一個或兩個字串,最多兩個小寫字母,任意順序):

echo foo > bar.txt  # file to archive
zip -P xhellobworld baz bar.txt   # archive with password
time crunch 2 4 abcdefghijklmnopqrstuvwxyz12 | \
     grep '[12]' | egrep -v '([12]).*\1' | \
     sed 's/1/hello/;s/2/world/' | \
     sort -n | fcrackzip -u -D -p /dev/stdin baz.zip 

輸出:

Crunch will now generate the following amount of data: 3163440 bytes
3 MB
0 GB
0 TB
0 PB
Crunch will now generate the following number of lines: 637392 


PASSWORD FOUND!!!!: pw == xhellobworld

real    0m5.942s
user    0m2.240s
sys 0m1.040s

相關內容