SiteServer cms 授权破解教程

声明:本文只供研究使用,若产生纠纷,与本文作者无关!请大家积极遵守互联网产权!

 如果是懒人的话,直接移步下载我写好的:http://download.csdn.net/detail/fengruochen966/4274681

 

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证书文件,覆盖原有证书文件即可。

 

 

  • 4
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 4
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 4
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值