Java开发网 |
注册 |
登录 |
帮助 |
搜索 |
排行榜 |
发帖统计
|
您没有登录 |
» Java开发网 » Java Security
打印话题 寄给朋友 订阅主题 |
作者 | 【转贴】手把手教你如何破解Jive的 License (ZT) |
Biubiu
Pure Java 总版主 发贴: 471 积分: 50 |
于 2002-07-25 20:15
2.1 分析 jive.license文件的内容是经过了base64编码的。 把它反编过来内容如下: <license> <licenseID>3</licenseID> <product>Jive Forums Professional</product> <licenseType>Evaluation</licenseType> <name /> <company /> <version>2.5</version> <numCopies>1</numCopies> <url /> <expiresDate>2002/06/26</expiresDate> <creationDate>2002/05/26</creationDate> <signature>302c02144645c9e37dc97f7baa3d3049ba783ce79b58b3780214167f1c81ea83beacd56c63d15b1c708b47d79487</signature> </license> 其中各元素含义如下: licenseID:1-->Basic, 2-->Professional, 3-->Enterprise product:Jive Forums Basic, Jive Forums Professional, Jive Forums Enterprise licenseType: Non-Commercial, Commercial, Evaluation 其中expiresDate和creationDate元素限定了使用期限。 修改expiresDate可以延长时间...... , 去掉该两项,则expiresDate为无限期,creationDate为系统时间 但大家要注意的是后面有一个signature元素是签名信息。如果你修改了上面那些内容,在jive中会无法通过验证。 弄不到他的私钥,无法伪造签名。 所以你的破解可以有两种方式,一种是在程序里crack license validate, 另一种是自己生成一对加密匙,用生成的私匙签名替代掉加密程序中的签名,这样你就可以变一个Keygen小程序,生成任意的满足你需求的License,很酷吧,象网上发布的Weblogic的破解便是采用了这种方法,具体操作就留给大家自己练习吧,在此只介绍第一种方法。 2.2 破解 使用jad反编译,修改相应的文件 ------------------------------------------------------------------------- 2.2.1 破解签名 解开jive.jar文件,找到com.jivesoftware.forum.LicenseManager类。 ------------------------------------------------------------------------- static boolean validate(License license) throws Exception { String publicKey = "308201b73082012c06072a8648ce3804013082011f02818100fd7f53811d75122952df4a9c2eece4e7f611b7523cef4400c31e3f80b6512669455d402251fb593d8d58fabfc5f5ba30f6cb9b556cd7813b801d346ff26660b76b9950a5a49f9fe8047b1022c24fbba9d7feb7c61bf83b57e7c6a8a6150f04fb83f6d3c51ec3023554135a169132f675f3ae2b61d72aeff22203199dd14801c70215009760508f15230bccb292b982a2eb840bf0581cf502818100f7e1a085d69b3ddecbbcab5c36b857b97994afbbfa3aea82f9574c0b3d0782675159578ebad4594fe67107108180b449167123e84c281613b7cf09328cc8a6e13c167a8b547c8d28e0a3ae1e2bb3a675916ea37f0bfa213562f1fb627a01243bcca4f1bea8519089a883dfe15ae59f06928b665e807b552564014c3bfecf492a038184000281800e12e8c79cffbadb747fa05f83e8ad7ce339c670c2b672e80a1f4dab0b0ea2696856212367d0371a8f56c6262ef0e54c8b954ab207e6bfb98cf0faa43a3b73c2a7ddd36c6b45a9fdbf2346124700a9bcb1b65b16a381e5f72368162e2861e2722c1682157055050b1582b8c9a338e44f4296cd225ee267a1bc2faaf71713e176"; byte pub[] = StringUtils.decodeHex(publicKey); X509EncodedKeySpec pubKeySpec = new X509EncodedKeySpec(pub); KeyFactory keyFactory = KeyFactory.getInstance("DSA"); java.security.PublicKey pubKey = keyFactory.generatePublic(pubKeySpec); Signature sig = Signature.getInstance("DSA"); sig.initVerify(pubKey); sig.update(license.getFingerprint()); return sig.verify(StringUtils.decodeHex(license.getSignature())); // here ---------------〉 return true; } ------------------------------------------------------------------------- 2.2.2 生成自己的License 解开jive.jar文件,找到com.jivesoftware.forum.License类。 ------------------------------------------------------------------------- 将main改为: public static void main(String args[]) throws Exception { License license = new License(3L, "Jive Forums Enterprise", "2.5", LicenseType.COMMERCIAL); license.setName("Warezman"); //anyname maybe yours license.setNumCopies(999); //any you want license.setNumClusterMembers(999); //any you want license.setCompany("warezman"); //any you want LicenseFactory.sign(license); System.out.println("Validating..."); System.out.println(LicenseManager.validate(license)); System.out.println(license.getExpiresDate()); String xml = toXML(license); String x = StringUtils.encodeBase64(xml); for(int i = 0; i < x.length(); i += 80) System.out.println(x.substring(i, x.length() - i <= 80 ? i + (x.length() - i) : i + 80)); } 执行以下命令即可获得Commerce/Enterprise/...无限期的License *** 为了生成license,必须将privkey文件放在d:\下 set JAVA_HOME=d:\bea\jdk131 :setEnv set CLASSPATH=%JAVA_HOME%\lib\tools.jar; jive_jar_dir\jive.jar; %CLASSPATH% java -classpath %CLASSPATH% com.jivesoftware.forum.License -----Result like-----> PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4NCjxsaWNlbnNlPjxsaWNlbnNlSUQ+MzwvbGljZW5zZUlEPjxwcm9kdWN0PkppdmUgRm9ydW1zIEVudGVycHJpc2U8L3Byb2R1Y3Q+PGxpY2Vuc2VUeXBlPkNvbW1lcmNpYWw8L2xpY2Vuc2VUeXBlPjxuYW1lPkZpUkVTVGFSPC9uYW1lPjxjb21wYW55Pjg4NDhDbHViPC9jb21wYW55Pjx2ZXJzaW9uPjIuNTwvdmVyc2lvbj48bnVtQ29waWVzPjk5OTwvbnVtQ29waWVzPjxudW1DbHVzdGVyTWVtYmVycz45OTk8L251bUNsdXN0ZXJNZW1iZXJzPjx1cmwgLz48ZXhwaXJlc0RhdGUgLz48Y3JlYXRpb25EYXRlPjIwMDIvMDcvMTg8L2NyZWF0aW9uRGF0ZT48c2lnbmF0dXJlPjMwMmMwMjE0M2NkNGRlOTZkNTY2ZGJlOWYwODM2ZjcwN2M4MDgwNTJjZDhhMmU3YTAyMTQ3ODdjNWI4YzFiYTJhZWZhM2U4NGQ4YzZlYmNlOTYzMDY4ODYxMGRlPC9zaWduYXR1cmU+PC9saWNlbnNlPg0K This is what you need. ------------------------------------------------------------------------- 2.2.3 修改版本由Professional-->Enterprise为 解开jive.jar文件,找到com.jivesoftware.forum.JiveGlobals类。 ------------------------------------------------------------------------- public static int getJiveEdition() { //by FiRESTaR Convert to Enterprise Edition //return 101; return 102; } 2.3 重新打包 2.3.1. Now compile source files and then make new jive.jar set CLASSPATH=%JAVA_HOME%\lib\tools.jar; jive_jar_dir\jive.jar; %CLASSPATH% javac -classpath %CLASSPATH% *.java 2.3.2 将新的 Licnese.class, LicenseManager, JiveGlobals.class等替换掉jive.jar中的相应文件 That's all. 【Author: wyuanzheng@DL KING】 In theory, there is no difference between theory and practice; in practice, however, there is. If the only tool you have is a hammer, you tend to see every problem as a nail. 25了才开始学JAVA晚吗? |
话题树型展开 |
人气 | 标题 | 作者 | 字数 | 发贴时间 |
19518 | 【转贴】手把手教你如何破解Jive的 License (ZT) | Biubiu | 5980 | 2002-07-25 20:15 |
已读帖子 新的帖子 被删除的帖子 |
Powered by Jute Powerful Forum® Version Jute 1.5.6 Ent Copyright © 2002-2021 Cjsdn Team. All Righits Reserved. 闽ICP备05005120号-1 客服电话 18559299278 客服信箱 714923@qq.com 客服QQ 714923 |