SiteServer cms 授權破解教程
阿新 • • 發佈:2019-01-07
宣告:本文只供研究使用,若產生糾紛,與本文作者無關!請大家積極遵守網際網路產權!
SiteServer cms採用的是des加密授權,本人已破解授權DLL和授權檔案。本文教程主要教大家使用des加密來實現自主授權
首先新建DESEncrypt.cs des加密檔案。
using System; using System.Text; using System.Security; using System.Security.Cryptography; using System.IO; /**/ /// <summary> /// 此處定義的是DES加密,為了便於今後的管理和維護 /// 請不要隨便改動密碼,或者改變了密碼後請一定要 /// 牢記先前的密碼,否則將會照成不可預料的損失 /// </summary> public class DESEncrypt { #region "member fields" private byte[] ivb = new byte[] { 0x12, 0x34, 0x56, 120, 0x90, 0xab, 0xcd, 0xef }; private string key = "kesgf4zb"; private Encoding encoding = new UnicodeEncoding(); private DES des; #endregion /**/ /// <summary> /// 建構函式 /// </summary> public DESEncrypt() { des = new DESCryptoServiceProvider(); } #region "propertys" /**/ /// <summary> /// 設定加密金鑰 /// </summary> public string EncryptKey { get { return "kesgf4zb"; } set { this.key = value; } } /**/ /// <summary> /// 要加密字元的編碼模式 /// </summary> public Encoding EncodingMode { get { return this.encoding; } set { this.encoding = value; } } #endregion /**/ /// <summary> /// 加密指定的檔案,如果成功返回True,否則false /// </summary> /// <param name="filePath">要加密的檔案路徑</param> /// <param name="outPath">加密後的檔案輸出路徑</param> public void EncryptFile2(string filePath, string outPath) { byte[] rgbKey = null; byte[] rgbIV = new byte[] { 0x12, 0x44, 0x16, 0xee, 0x88, 0x15, 0xdd, 0x41 }; try { FileStream stream; DES des = new DESCryptoServiceProvider(); ; rgbKey = Encoding.UTF8.GetBytes((this.key.Length > 8) ? this.key.Substring(0, 8) : this.key); stream = new FileStream(filePath, FileMode.Open, FileAccess.Read); StreamReader reader = new StreamReader(stream, this.EncodingMode); // string dataStr = reader.ReadToEnd(); // byte[] toEncrypt = this.EncodingMode.GetBytes(dataStr); byte[] buffer3 = new byte[600]; int num3 = stream.Read(buffer3, 0, buffer3.Length); stream.Close(); FileStream stream2 = new FileStream(outPath, FileMode.OpenOrCreate, FileAccess.Write); CryptoStream stream3 = new CryptoStream(stream2, des.CreateEncryptor(rgbKey, rgbIV), CryptoStreamMode.Write); //stream3.Write(toEncrypt, 0, toEncrypt.Length); stream3.Write(buffer3, 0, num3); stream3.FlushFinalBlock(); stream3.Close(); stream2.Close(); } catch (Exception exception) { throw new FileNotFoundException("沒有找到指定的檔案"); } } }
新建並且配置license.xml檔案位於根目錄,內容如下:
<!--test--> <registration productID="CMS"> <computer> <domain>www.baidu.com</domain> <macAddress></macAddress> <processorID></processorID> <columnSerialNumber></columnSerialNumber> </computer> <company> <isOEM>false</isOEM> <companyName></companyName> <companyUrl></companyUrl> <productName></productName> <productUrl></productUrl> </company> <product> <owner></owner> <productUser>All</productUser> <modules></modules> <maxSiteNumber>0</maxSiteNumber> <expirationDate>2009-3-10</expirationDate> </product> </registration>
說明:
domain 授權域名或IP
macAddress 網絡卡地址
然後執行生成:
protected void Button1_Click(object sender, EventArgs e) { string path = HttpContext.Current.Server.MapPath("~/") + "license.xml"; string outpath = HttpContext.Current.Server.MapPath("~/") + "license.lic"; DESEncrypt dese = new DESEncrypt(); dese.EncryptFile2(path, outpath); Response.Write("<a href='license.lic'>證書生成成功!</a>"); }
會生成license.lic證書檔案,覆蓋原有證書檔案即可。