escout

          代碼、心情

          常用鏈接

          統計

          SOA相關

          我參與的團隊

          最新評論

          一步一步破解JIRA3.6

          一步一步破解 JIRA3.6

          上周在springside上看到jira這個團隊軟件,下載下來試用了一番,覺得挺好用得,正好前一段看到了jad這個反編譯軟件,就想試手一下自己破解這個jira。下面詳細敘述了破解的過程,因為不太熟悉這個破解,只是以前大概知道,幾乎沒有用過所以想試手一下。整個過程花費了昨天晚上一晚上,從6點多到11點,總算破解好了。

          先說一下我用得工具吧
          eclipse3.2,這個就不用說了吧,主要是試一下3.2的新特性,用3.1也可以的
          winrar?? 解壓*.jar文件
          然后就是我關鍵的工具了, Jad 1.5.8e for Windows 9x/NT/2000 on Intel platform
          其實我最開始使用的不是這個版本,而是1.5.7然后再破解的過程中,反編譯java文件總是有問題,說

          JavaClassFileParseException: Class file version mismatch

          Parsing atlassian-extras-0.7.19/com\atlassian\license\applications\perforceplugi

          n/PeforcePluginLicenseTypeStore.class...The class file version is 47.0 (only 45.

          3 and 46.0 are supported)

          然后就去google了一下,發現原來是jad的版本問題,所以到http://www.kpdus.com/jad.html#download 下載了最新的JAD,就是1.5.8e這個版本。

          下面說一下我破解的過程吧,首先,我們可以使用評估版本的license搭建并且跑起來jira,那么可以看到在每一個具體頁面底部,都可以看到一個license信息。既然這個頁面可以看到license信息,那么,這個文件肯定最終是去讀取了license文件信息的,那么具體邏輯是在哪里呢,我就看了一下web.xml,可以知道,jira是使用sitemath來做頁面布局的,具體查看 sitemath.xml以及相應的 decorator.xml,可以知道每個頁面底部幾乎都是使用 footer.jsp來顯示的
          打開footer.jsp,可以看到最初幾句

          1?<%@?page?import="com.atlassian.jira.config.properties.APKeys,
          2??????????????????com.atlassian.jira.util.BuildUtils,
          3??????????????????com.atlassian.jira.ManagerFactory,
          4??????????????????com.atlassian.license.*,
          5??????????????????com.atlassian.license.applications.jira.JiraLicenseTypeStore,
          6??????????????????com.atlassian.jira.web.action.util.JiraLicenseUtils"%>
          7?
          看到其中com.atlassian.license. *,那么我們可以猜測,具體的license就應該與這個相關了


          ?

          footer.jsp 中可以發現下面這句

          License?curLicense? = ? null ;
          if ?(JiraLicenseUtils.isLicenseSetup())
          ????curLicense?
          = ?LicenseManager.getInstance().getLicense(JiraLicenseUtils.JIRA_LICENSE_KEY);


          使用如下命令行,反編譯atlassian-extras-0.7.19.jar包(注:這個包JIRA 3.6破解

          http://www.aygfsteel.com/martinx/archive/2006/05/07/44914.html 這篇文章也提到了,但是沒有給出如何確定這個包的,其實可以通過eclipse的工程,把整個工程加載,包括類庫,然后就可以看到類層次結構了,然后就可以知道具體在那個包了)
          jad -o -r -sjava -dsrc atlassian-extras-0.7.19/**/*.class
          這樣可以把整個atlassian-extras-0.7.19.jar包下的文件都反編譯,然后我把反編譯的結果java文件導入到了eclipse,新建了一個工程,這樣方便后續的處理和查找以及編譯等等。

          接著,從反編譯出來的

          JiraLicenseUtils.java 可以發現如下定義

          public ? static ? final ?String?JIRA_LICENSE_KEY? = ? " JIRA " ;

          分析這一句

          curLicense? = ?LicenseManager.getInstance().getLicense(JiraLicenseUtils.JIRA_LICENSE_KEY);

          主要是 LicenseManager getLicense 方法

          License?license? = ?LicenseDecoder.getLicense(pair,?applicationName);
          licenseList.put(applicationName,?license);

          可以看出,是通過 LicenseDecoder 類得到 License 方法的,后面一句是作緩存。

          在繼續跟蹤 LicenseDecoder

          可以發現是通過

          License?loadLicense(LicensePair?pair,?PublicKey?publicKey,?String?applicationName)

          方法來初始化 License

          繼續看下去,可以發現只有這一句具體實例化了一個 Lisence

          return ? new ?DefaultLicense(dateCreated,?datePurchased,?organisation,?licenseType,?users,?partnerName,?licenseId);
          到現在,就已經定位到具體的License類了,但是具體是不是這個類呢,這時候就是使用eclipse強大的功能的時候了
          使用classic search,如下,可以發現聲明中有License的,大約有7、8個類,具體看一下,可以發現僅有剛才的DefaultLIcense是繼承了License接口的,那么可以基本確定就是這個類了。


          classic_search.jpg

          但是,又不是很放心,所以又在License接口上如下查看了一下

          implementator.jpg

          這個兩個綜合,可以印證一個思想,就是所有的
          License只有一個實現,就是DefaultLicense,那么,問題就好辦了,只要修改DefaultLicense類文件就可以了

          看看反編譯的文件,知道License接口如下,在具體看一下License接口:

          ?1public?interface?License
          ?2?2{
          ?3?3
          ?4?4????public?abstract?Date?getDateCreated();
          ?5?5
          ?6?6????public?abstract?Date?getDatePurchased();
          ?7?7
          ?8?8????public?abstract?String?getOrganisation();
          ?9?9
          1010????public?abstract?LicenseType?getLicenseType();
          1111
          1212????public?abstract?boolean?isExpired();
          1313
          1414????public?abstract?Date?getExpiryDate();
          1515
          1616????public?abstract?String?toString();
          1717
          1818????public?abstract?boolean?isLicenseLevel(Collection?collection);
          1919
          2020????public?abstract?int?getUsers();
          2121
          2222????public?abstract?String?getPartnerName();
          2323
          2424????public?abstract?String?getLicenseId();
          2525}

          26


          可以猜想,修改這個接口的實現,使其返回我們需要的值,那么就可以繞過License驗證了。另外,我們注意到

          public ? abstract ?LicenseType?getLicenseType();
          這個方法,返回值是LicenseType,大概就是我們不同的License類型的一個區別吧,突然想到,其實把這些LicenseType都改成JIRA_ENTERPRISE_FULL_LICENSE幾乎類似的,那么也可以繞過這個,不過這個沒有具體試過,有興趣的可以一試。

          public ??? class ??JiraLicenseTypeStore?? extends ??LicenseTypeStore
          ?
          2 ???? {
          ?
          3 ??
          ?
          4 ?????? public ??JiraLicenseTypeStore()
          ?
          5 ???????? {
          ?
          6 ?????????applicationLicenseTypes.add(JIRA_STANDARD_ACADEMIC);
          ?
          7 ?????????applicationLicenseTypes.add(JIRA_STANDARD_EVALUATION);
          ?
          8 ?????????applicationLicenseTypes.add(JIRA_STANDARD_NON_PROFIT);
          ?
          9 ?????????applicationLicenseTypes.add(JIRA_STANDARD_FULL_LICENSE);
          10 ?????????applicationLicenseTypes.add(JIRA_PROFESSIONAL_ACADEMIC);
          11 ?????????applicationLicenseTypes.add(JIRA_PROFESSIONAL_EVALUATION);
          12 ?????????applicationLicenseTypes.add(JIRA_PROFESSIONAL_NON_PROFIT);
          13 ?????????applicationLicenseTypes.add(JIRA_PROFESSIONAL_FULL_LICENSE);
          14 ?????????applicationLicenseTypes.add(JIRA_ENTERPRISE_ACADEMIC);
          15 ?????????applicationLicenseTypes.add(JIRA_ENTERPRISE_EVALUATION);
          16 ?????????applicationLicenseTypes.add(JIRA_ENTERPRISE_NON_PROFIT);
          17 ?????????applicationLicenseTypes.add(JIRA_ENTERPRISE_FULL_LICENSE);
          18 ?????}
          ?
          19 ??
          20 ?????? public ??Collection?getAllLicenses()
          21 ???????? {
          22 ?????????? return ??applicationLicenseTypes;
          23 ?????}
          ?
          24 ??
          25 ?????? public ??String?getPublicKeyFileName()
          26 ???????? {
          27 ?????????? return ??publicKeyFileName;
          28 ?????}
          ?
          29 ??
          30 ?????? public ??String?getPrivateKeyFileName()
          31 ???????? {
          32 ?????????? return ??privateKeyFileName;
          33 ?????}
          ?
          34 ??
          35 ?????? public ??? static ??LicenseType?JIRA_STANDARD_ACADEMIC?? = ??? new ??DefaultLicenseType(? 197 ?,?? " ?JIRA?Standard:?Academic? " ?,?? false ?,?? false ?);
          36 ?????? public ??? static ??LicenseType?JIRA_STANDARD_EVALUATION?? = ??? new ??DefaultLicenseType(? 109 ?,?? " ?JIRA?Standard:?Evaluation? " ?,?? true ?,?? false ?);
          37 ?????? public ??? static ??LicenseType?JIRA_STANDARD_NON_PROFIT?? = ??? new ??DefaultLicenseType(? 157 ?,?? " ?JIRA?Standard:?Non-Profit?/?Open?Source? " ?,?? false ?,?? false ?);
          38 ?????? public ??? static ??LicenseType?JIRA_STANDARD_FULL_LICENSE?? = ??? new ??DefaultLicenseType(? 179 ?,?? " ?JIRA?Standard:?Commercial?Server? " ?,?? false ?,?? false ?);
          39 ?????? public ??? static ??LicenseType?JIRA_PROFESSIONAL_ACADEMIC?? = ??? new ??DefaultLicenseType(? 91 ?,?? " ?JIRA?Professional:?Academic? " ?,?? false ?,?? false ?);
          40 ?????? public ??? static ??LicenseType?JIRA_PROFESSIONAL_EVALUATION?? = ??? new ??DefaultLicenseType(? 47 ?,?? " ?JIRA?Professional:?Evaluation? " ?,?? true ?,?? false ?);
          41 ?????? public ??? static ??LicenseType?JIRA_PROFESSIONAL_NON_PROFIT?? = ??? new ??DefaultLicenseType(? 76 ?,?? " ?JIRA?Professional:?Non-Profit?/?Open?Source? " ?,?? false ?,?? false ?);
          42 ?????? public ??? static ??LicenseType?JIRA_PROFESSIONAL_FULL_LICENSE?? = ??? new ??DefaultLicenseType(? 87 ?,?? " ?JIRA?Professional:?Commercial?Server? " ?,?? false ?,?? false ?);
          43 ?????? public ??? static ??LicenseType?JIRA_ENTERPRISE_ACADEMIC?? = ??? new ??DefaultLicenseType(? 269 ?,?? " ?JIRA?Enterprise:?Academic? " ?,?? false ?,?? false ?);
          44 ?????? public ??? static ??LicenseType?JIRA_ENTERPRISE_EVALUATION?? = ??? new ??DefaultLicenseType(? 201 ?,?? " ?JIRA?Enterprise:?Evaluation? " ?,?? true ?,?? false ?);
          45 ?????? public ??? static ??LicenseType?JIRA_ENTERPRISE_NON_PROFIT?? = ??? new ??DefaultLicenseType(? 213 ?,?? " ?JIRA?Enterprise:?Non-Profit?/?Open?Source? " ?,?? false ?,?? false ?);
          46 ?????? public ??? static ??LicenseType?JIRA_ENTERPRISE_FULL_LICENSE?? = ??? new ??DefaultLicenseType(? 267 ?,?? " ?JIRA?Enterprise:?Commercial?Server? " ?,?? false ?,?? false ?);
          47 ?????? public ??? static ??String?publicKeyFileName?? = ??? " ?com/atlassian/jira/issue/Bug.class? " ?;
          48 ?????? public ??? static ??String?privateKeyFileName?? = ??? " ?jira/jira.byte? " ?;
          49 ??
          50 ?}
          ?


          那么,分析了上述的類,那么,就來修改一下DefaultLicense了,首先把初始化修改一下,如下:

          ?1 public ?DefaultLicense(Date?dateCreated,?Date?datePurchased,?String?organisation,?LicenseType?licenseType,? int ?users,?String?partnerName,?String?licenseId)
          ?2 ? 2 ???? {????????
          ?3 ? 3 ????????????Calendar?calendar = Calendar.getInstance();
          ?4 ? 4 ????????????calendar.set( 1982 , 4 , 21 );
          ?5 ? 5 ???????????? this .dateCreated? = ?calendar.getTime();
          ?6 ? 6 ???????????? this .datePurchased? = calendar.getTime();?
          ?7 ? 7 ???????????? this .organisation? = ? " escout@sjtu " ;
          ?8 ? 8 ???????????? this .licenseType? = JiraLicenseTypeStore.JIRA_ENTERPRISE_ACADEMIC;
          ?9 ? 9 ???????????? this .users? = ? 10000 ;
          10 10 ???????????? this .partnerName? = ?partnerName;
          11 11 ???????????? this .licenseId? = ?licenseId;
          12 12 ????}


          接著,把修改的DefaultLicense文件,覆蓋到atlassian-extras-0.7.19.jar解壓開的同名文件處覆蓋,同時使用下面的命令重新打包

          D:\develope\jadnt157\atlassian-extras-0.7.19>jar cvf atlassianextras-0.7.19.jar

          ?./
          然后把修改后的jar放到web-inf/lib目錄下覆蓋同名文件。重啟tomcat,這時候,我本來想應該就可以了,誰知打開瀏覽器,白屏!沒有任何頁面顯示,ft。
          ??? 想了想,打開tomcat的log文件,發現如下幾行。

          2006-05-12 21:26:08,421 ERROR [web.action.util.JiraLicenseUtils] The current license is too old (Mon Jun 14 21:26:05 CST 1982) to run this version (3.6 - Tue Apr 11 00:00:00 CST 2006) of JIRA.
          ????埃,本來想用一個比較有紀念意義的日期呢,看來不能隨心所欲啊。
          后來又改了一下,最終如下:

          ??1 public ? class ?DefaultLicense
          ??2 ???? implements ?License
          ??3 {
          ??4
          ??5 ???? public ?DefaultLicense(Date?dateCreated,?Date?datePurchased,?String?organisation,?LicenseType?licenseType,? int ?users,?String?partnerName)
          ??6 ???? {
          ??7 ????????Calendar?calendar = Calendar.getInstance();
          ??8 ????????calendar.add(Calendar.DAY_OF_MONTH,? - 5 );
          ??9 ???????? this .dateCreated? = ?calendar.getTime();
          ?10 ???????? this .datePurchased? = calendar.getTime();?
          ?11 ???????? this .organisation? = ? " escout@sjtu " ;
          ?12 ???????? this .licenseType? = JiraLicenseTypeStore.JIRA_ENTERPRISE_ACADEMIC;
          ?13 ???????? this .users? = ? 10000 ;
          ?14 ???????? this .partnerName? = ?partnerName;
          ?15 ???????? this .licenseId? = ? "" ;
          ?16 ????}

          ?17
          ?18 ???? public ?DefaultLicense(Date?dateCreated,?Date?datePurchased,?String?organisation,?LicenseType?licenseType,? int ?users,?String?partnerName,?String?licenseId)
          ?19 ???? {????????
          ?20 ????????????Calendar?calendar = Calendar.getInstance();
          ?21 ????????????calendar.add(Calendar.DAY_OF_MONTH,? - 1 );
          ?22 ???????????? this .dateCreated? = ?calendar.getTime();
          ?23 ???????????? this .datePurchased? = calendar.getTime();?
          ?24 ???????????? this .organisation? = ? " escout@sjtu " ;
          ?25 ???????????? this .licenseType? = JiraLicenseTypeStore.JIRA_ENTERPRISE_ACADEMIC;
          ?26 ???????????? this .users? = ? 10000 ;
          ?27 ???????????? this .partnerName? = ?partnerName;
          ?28 ???????????? this .licenseId? = ?licenseId;
          ?29 ????}

          ?30
          ?31 ???? public ?Date?getDateCreated()
          ?32 ???? {
          ?33 ???????? return ?dateCreated;
          ?34 ????}

          ?35
          ?36 ???? public ?Date?getDatePurchased()
          ?37 ???? {
          ?38 ???????? return ?datePurchased;
          ?39 ????}

          ?40
          ?41 ???? public ?String?getOrganisation()
          ?42 ???? {
          ?43 ???????? return ?organisation;
          ?44 ????}

          ?45
          ?46 ???? public ?LicenseType?getLicenseType()
          ?47 ???? {
          ?48 ???????? return ?licenseType;
          ?49 ????}

          ?50
          ?51 ???? public ?String?toString()
          ?52 ???? {
          ?53 ???????? return ?licenseType.getNiceName()? + ? " ?licensed?to? " ? + ?organisation;
          ?54 ????}

          ?55
          ?56 ???? public ? boolean ?isExpired()
          ?57 ???? {
          ?58 ??????? return ? false ;
          ?59 ????}

          ?60
          ?61 ???? public ?Date?getExpiryDate()
          ?62 ???? {
          ?63 ???????? return ? null ;
          ?64 ????}

          ?65
          ?66 ???? public ?String?getPartnerName()
          ?67 ???? {
          ?68 ???????? return ?partnerName;
          ?69 ????}

          ?70
          ?71 ???? public ? boolean ?isLicenseLevel(Collection?levels)
          ?72 ???? {
          ?73 ???????? for (Iterator?iterator? = ?levels.iterator();?iterator.hasNext();)
          ?74 ???????? {
          ?75 ????????????String?level? = ?(String)iterator.next();
          ?76 ???????????? if (getLicenseType().getDescription().toLowerCase().indexOf(level.toLowerCase())? != ? - 1 )
          ?77 ???????????????? return ? true ;
          ?78 ????????}

          ?79
          ?80 ???????? return ? false ;
          ?81 ????}

          ?82
          ?83 ???? public ? int ?getUsers()
          ?84 ???? {
          ?85 ???????? return ? - 1 ;
          ?86 ????}

          ?87
          ?88 ???? public ?String?getLicenseId()
          ?89 ???? {
          ?90 ???????? return ?licenseId;
          ?91 ????}

          ?92
          ?93 ???? public ? static ? long ?EVALUATION_PERIOD? = ? 0x9fa52400L ;
          ?94 ???? protected ?Date?dateCreated;
          ?95 ???? protected ?Date?datePurchased;
          ?96 ???? protected ?String?organisation;
          ?97 ???? protected ?LicenseType?licenseType;
          ?98 ???? private ? int ?users;
          ?99 ???? private ?String?partnerName;
          100 ???? private ?String?licenseId;
          101
          102 }



          再次打包放到jira/web-inf/lib/目錄下,重啟,這下好了,jira license detail顯示:

          escout@sjtu
          08/五月/06
          JIRA Enterprise: Commercial Server
          R5AM<<8X9R
          Your commercial JIRA support and updates are available until 09/五月/07.
          哈哈,初次破解成功!!
          附記:初次破解,沒有多少經驗,所以更多記錄了一下實際的步驟。后來我測試了一下,當把系統時間更改了之后,Support Period在重啟tomcat之后才會更新,所以大概這個狀態在運行時是保存在Application對象中的吧

          posted on 2006-05-13 21:54 綠色使者、綠色心情 閱讀(4639) 評論(5)  編輯  收藏 所屬分類: java 安全eclipse 相關

          評論

          # re: 一步一步破解JIRA3.6 2006-05-14 12:00 martin xus

          呵呵,那個 atlassian-extras-0.7.19 就在web-inf/lib下面,怎么會無法找到呢:)

          Support Period 的修改在LicenseUtils里面:
          public static long getSupportPeriodEnd(License license)   回復  更多評論   

          # re: 一步一步破解JIRA3.6 2006-05-14 14:50 綠色使者、綠色心情

          我的意思是有很多atlassian-*.jar,那么如何確定是在具體那個.jar文件啊  回復  更多評論   

          # 轉自daniel_zhy 2006-05-23 14:44 jirafan

          daniel_zhy 發表于2006-05-01 8:13 AM IP: 218.1.148.*
          JIRA我們使用快兩年了。 JIRA的確恨容易破解, 但看到JIRA對開源社區的巨大貢獻, 如果手中還有Money的話,還是付吧,至少從良心上過得去。
            回復  更多評論   

          # JIRA中文論壇及演示站點 2006-05-23 14:45 jirafan

          JIRA中文論壇:

          http://www.czsm.com.cn/bbs/

          JIRA中文演示站點:
          http://www.czsm.com.cn:8080/jira/  回復  更多評論   

          # re: 一步一步破解JIRA3.6 2006-05-23 14:58 綠色使者、綠色心情

          恩,謝謝提醒。
          其實我也只是在學校實驗室用的,應該是license中的academic類型,所以上面只是把方法貼上來,全當學習了,并沒有把破解的jar貼上來啊  回復  更多評論   


          只有注冊用戶登錄后才能發表評論。

          網站導航:
           
          主站蜘蛛池模板: 龙泉市| 万载县| 嵩明县| 石柱| 新乡县| 泸州市| 二连浩特市| 梁山县| 时尚| 莱西市| 高清| 萨迦县| 屏山县| 扎囊县| 微山县| 沁水县| 新蔡县| 台中县| 鲁甸县| 临湘市| 阿城市| 类乌齐县| 德清县| 山阳县| 淮北市| 白河县| 保定市| 淅川县| 梁河县| 紫阳县| 新宾| 石柱| 保定市| 六枝特区| 北票市| 万全县| 卢龙县| 松潘县| 涡阳县| 星座| 玉门市|