背景
以前加密了一個壓縮文件,里面全是回憶的照片,結果密碼搞忘記了,我勒個去,然后就在網上下載了個軟件暴力破解,結果很明顯,沒有破解出來。然后自己就思索怎么破解。
一開始是加QQ群,讓別人幫忙破解,仍然沒有破解出來,別個還幫我跑了100g的字典,還是挺感謝他的,再說一聲 謝謝了哈,沒有收我錢,全憑熱心。
然后自己就尋思着,看怎么破解,暴力破解估計沒戲,除非搭建雲,用N多電腦協同破解,這方法對我而言不可取。
接着就想,還是字典破解吧,然后字典就很重要了撒,聰明的黑客,不可能什么都暴力破解,肯定會根據用戶信息,生成特定的密碼,這樣破解的概率是最大的。這壓縮文件的密碼又是我自己設定的,那么根據我的習慣得出自己的密碼應該還是不難,就在網上找生成密碼的算法,其實就是個數學里面的排列組合,用C#實現。然后就是把密碼給搞出來,把常用密碼拆分一下就可以了,根據自己的習慣來。比如,我喜歡用guxingyue這個密碼,然后我就拆分為gu、xing、yue,還有喜歡用guxingy這個密碼,這密碼是一個整體
下面是我的原始字典
經過排序組合,變成這個樣子:
解釋一下哈,有1個密碼的組合,有2個密碼的組合,有3個密碼的組合,有4個密碼的組合排列。總共就只有4個最基本的密碼。
生成的密碼數量就是這樣多。
這樣生成后的密碼,就可以做為字典用於暴力破解了。
排列組合的原文鏈接:https://www.cnblogs.com/kissdodog/p/5419981.html
用到的代碼:
1、排列組合:

public class PermutationAndCombination<T> { /// <summary> /// 交換兩個變量 /// </summary> /// <param name="a">變量1</param> /// <param name="b">變量2</param> public static void Swap(ref T a, ref T b) { T temp = a; a = b; b = temp; } /// <summary> /// 遞歸算法求數組的組合(私有成員) /// </summary> /// <param name="list">返回的范型</param> /// <param name="t">所求數組</param> /// <param name="n">輔助變量</param> /// <param name="m">輔助變量</param> /// <param name="b">輔助數組</param> /// <param name="M">輔助變量M</param> private static void GetCombination(ref List<T[]> list, T[] t, int n, int m, int[] b, int M) { for (int i = n; i >= m; i--) { b[m - 1] = i - 1; if (m > 1) { GetCombination(ref list, t, i - 1, m - 1, b, M); } else { if (list == null) { list = new List<T[]>(); } T[] temp = new T[M]; for (int j = 0; j < b.Length; j++) { temp[j] = t[b[j]]; } list.Add(temp); } } } /// <summary> /// 遞歸算法求排列(私有成員) /// </summary> /// <param name="list">返回的列表</param> /// <param name="t">所求數組</param> /// <param name="startIndex">起始標號</param> /// <param name="endIndex">結束標號</param> private static void GetPermutation(ref List<T[]> list, T[] t, int startIndex, int endIndex) { if (startIndex == endIndex) { if (list == null) { list = new List<T[]>(); } T[] temp = new T[t.Length]; t.CopyTo(temp, 0); list.Add(temp); } else { for (int i = startIndex; i <= endIndex; i++) { Swap(ref t[startIndex], ref t[i]); GetPermutation(ref list, t, startIndex + 1, endIndex); Swap(ref t[startIndex], ref t[i]); } } } /// <summary> /// 求從起始標號到結束標號的排列,其余元素不變 /// </summary> /// <param name="t">所求數組</param> /// <param name="startIndex">起始標號</param> /// <param name="endIndex">結束標號</param> /// <returns>從起始標號到結束標號排列的范型</returns> public static List<T[]> GetPermutation(T[] t, int startIndex, int endIndex) { if (startIndex < 0 || endIndex > t.Length - 1) { return null; } List<T[]> list = new List<T[]>(); GetPermutation(ref list, t, startIndex, endIndex); return list; } /// <summary> /// 返回數組所有元素的全排列 /// </summary> /// <param name="t">所求數組</param> /// <returns>全排列的范型</returns> public static List<T[]> GetPermutation(T[] t) { return GetPermutation(t, 0, t.Length - 1); } /// <summary> /// 求數組中n個元素的排列 /// </summary> /// <param name="t">所求數組</param> /// <param name="n">元素個數</param> /// <returns>數組中n個元素的排列</returns> public static List<T[]> GetPermutation(T[] t, int n) { if (n > t.Length) { return null; } List<T[]> list = new List<T[]>(); List<T[]> c = GetCombination(t, n); for (int i = 0; i < c.Count; i++) { List<T[]> l = new List<T[]>(); GetPermutation(ref l, c[i], 0, n - 1); list.AddRange(l); } return list; } /// <summary> /// 求數組中n個元素的組合 /// </summary> /// <param name="t">所求數組</param> /// <param name="n">元素個數</param> /// <returns>數組中n個元素的組合的范型</returns> public static List<T[]> GetCombination(T[] t, int n) { if (t.Length < n) { return null; } int[] temp = new int[n]; List<T[]> list = new List<T[]>(); GetCombination(ref list, t, t.Length, n, temp, n); return list; } }
2、生成密碼:

public void test4() { //排列組合 生成密碼 StringBuilder sb = new StringBuilder(); var strContent = System.IO.File.ReadAllText("02 pwd.txt"); List<string> list = Regex.Split(strContent, "\r\n").ToList();//一個sheet包含的所有行,行與行之間用回車分隔 //這里的1234,就是組合的個數 new List<int> { 1, 2, 3, 4 }.ForEach(num => { List<string[]> ListCombination = PermutationAndCombination<string>.GetPermutation(list.ToArray(), num); //求全部的3-3組合 foreach (var arr in ListCombination) { string pwd = "";//排列組合后的密碼 foreach (var item in arr) { pwd += item; } sb.Append(pwd + "\r\n"); } Console.WriteLine($"num:{num} count:{ListCombination.Count}"); }); System.IO.File.WriteAllText("222.txt", sb.ToString()); }
文件解釋:
02 pwd.txt 里面存的是最基本的密碼,就是用於組合排列的那幾個基本元素,數學里面叫什么忘記了,突然感覺高中就像白學了一樣,這都能忘!!還是沒有經常用到的緣故吧
222.txt 里面存的是排序組合后的密碼
用到的破解工具:
都是百度搜索的,這里鄙視一下百度,搜索經常是廣告一連串,真是無聊。簡直跟谷歌無法比,谷歌游覽器裝個插件一樣能用谷歌搜索,這個插件叫:谷歌訪問助手,不是打廣告,好用的東西要分享,我也是我們公司的跟我講才知道的,一直都以為需要掛vpn才能翻牆,游覽器裝個插件就可以了,關鍵是還免費。
ARPR_gr(我用的是這個哈 在電腦上找到的 都不知道什么時候下載的 破解類型 選擇字典破解,不要選暴力破解哈)
補充:Advanced RAR Password Recovery(ARPR)
Advanced Office Password Recovery (這個之前下來是准備破解Excel密碼的,我哥哥的Excel密碼忘記了,找我,然后下的)
hashcat (這個是之前 那個群里的好人 幫我破解用的軟件,他因為幫我免費破解,估計是搶了群主的生意,群主還把他踢了,唉 不想說什么 挺感謝的 哥們)

最后再說一下哈,我不是教別個破解。只是自己遇到了忘記密碼,把自己的破解過程記錄一下。還有就是現在很多破解的群好坑,其它的不想多說
具體的操作步驟:
之前公司的電腦硬盤壞了,就當重新復習一下吧
壓縮文件地址:https://files-cdn.cnblogs.com/files/guxingy/%E7%94%A8%E7%BB%84%E5%90%88%E6%8E%92%E5%88%97%E7%9A%84%E6%96%B9%E5%BC%8F%E9%87%8D%E6%96%B0%E6%9E%84%E5%BB%BA%E5%AF%86%E7%A0%81.rar
復制到迅雷里面下載就可以了,或者直接點擊“壓縮文件地址”這幾個字就可以了
下載之后解壓一下,看下圖的說明:
一、生成字典的步驟:
1、下載壓縮文件
2、解壓文件
3、打開文件“02 pwd.txt”,編寫自己的密碼元素,每個密碼元素以“回車”隔開
4、執行文件“ConsoleApplication1.exe”
5、文件“222.txt”就是生成的密碼字典了
二、使用密碼字典的步驟:
1、軟件下載:https://pan.baidu.com/share/link?shareid=3379506451&uk=1076102322
百度網盤里面的 直接就可以下 也是百度搜的 可惜是英文版 下次找到中文版了 就把鏈接補上
怕百度網盤的鏈接失效,在補上一個,https://files-cdn.cnblogs.com/files/guxingy/ARPR_4.53.rar
2、准備一個需要解密的壓縮文件,用於測試
3、解壓文件“ARPR_4.53.rar”,找到文件“archpr.exe”,雙擊打開
在選擇過程中,如果就執行了破解了,你就點一下“Stop”就可以了,
等全部選擇好后,再點一下“Start”就可以了。
5、破解成功后會出現這個界面:
這種方式破解的關鍵在於字典的精准程度,你需要把自己的基礎密碼整理好,程序僅僅只是幫你組合排列密碼給。
6、最后附上程序的源碼,代碼其實都貼出來的,用vs2015+就可以打開了:
https://files-cdn.cnblogs.com/files/guxingy/%E7%94%A8%E7%BB%84%E5%90%88%E6%8E%92%E5%88%97%E7%9A%84%E6%96%B9%E5%BC%8F%E9%87%8D%E6%96%B0%E6%9E%84%E5%BB%BA%E5%AF%86%E7%A0%81-%E6%BA%90%E7%A0%81.rar
如果還是不知道怎么操作的,可以加我微信:17726605564,加的時候備注一下哈