escout

          代碼、心情

          常用鏈接

          統(tǒng)計(jì)

          SOA相關(guān)

          我參與的團(tuán)隊(duì)

          最新評(píng)論

          一步一步破解JIRA3.6

          一步一步破解 JIRA3.6

          上周在springside上看到j(luò)ira這個(gè)團(tuán)隊(duì)軟件,下載下來試用了一番,覺得挺好用得,正好前一段看到了jad這個(gè)反編譯軟件,就想試手一下自己破解這個(gè)jira。下面詳細(xì)敘述了破解的過程,因?yàn)椴惶煜み@個(gè)破解,只是以前大概知道,幾乎沒有用過所以想試手一下。整個(gè)過程花費(fèi)了昨天晚上一晚上,從6點(diǎn)多到11點(diǎn),總算破解好了。

          先說一下我用得工具吧
          eclipse3.2,這個(gè)就不用說了吧,主要是試一下3.2的新特性,用3.1也可以的
          winrar?? 解壓*.jar文件
          然后就是我關(guān)鍵的工具了, Jad 1.5.8e for Windows 9x/NT/2000 on Intel platform
          其實(shí)我最開始使用的不是這個(gè)版本,而是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了一下,發(fā)現(xiàn)原來是jad的版本問題,所以到http://www.kpdus.com/jad.html#download 下載了最新的JAD,就是1.5.8e這個(gè)版本。

          下面說一下我破解的過程吧,首先,我們可以使用評(píng)估版本的license搭建并且跑起來jira,那么可以看到在每一個(gè)具體頁(yè)面底部,都可以看到一個(gè)license信息。既然這個(gè)頁(yè)面可以看到license信息,那么,這個(gè)文件肯定最終是去讀取了license文件信息的,那么具體邏輯是在哪里呢,我就看了一下web.xml,可以知道,jira是使用sitemath來做頁(yè)面布局的,具體查看 sitemath.xml以及相應(yīng)的 decorator.xml,可以知道每個(gè)頁(yè)面底部幾乎都是使用 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. *,那么我們可以猜測(cè),具體的license就應(yīng)該與這個(gè)相關(guān)了


          ?

          footer.jsp 中可以發(fā)現(xiàn)下面這句

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


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

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

          接著,從反編譯出來的

          JiraLicenseUtils.java 可以發(fā)現(xiàn)如下定義

          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 方法的,后面一句是作緩存。

          在繼續(xù)跟蹤 LicenseDecoder

          可以發(fā)現(xiàn)是通過

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

          方法來初始化 License

          繼續(xù)看下去,可以發(fā)現(xiàn)只有這一句具體實(shí)例化了一個(gè) Lisence

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


          classic_search.jpg

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

          implementator.jpg

          這個(gè)兩個(gè)綜合,可以印證一個(gè)思想,就是所有的
          License只有一個(gè)實(shí)現(xiàn),就是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


          可以猜想,修改這個(gè)接口的實(shí)現(xiàn),使其返回我們需要的值,那么就可以繞過License驗(yàn)證了。另外,我們注意到

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

          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解壓開的同名文件處覆蓋,同時(shí)使用下面的命令重新打包

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

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

          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.
          ????埃,本來想用一個(gè)比較有紀(jì)念意義的日期呢,看來不能隨心所欲啊。
          后來又改了一下,最終如下:

          ??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 }



          再次打包放到j(luò)ira/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.
          哈哈,初次破解成功!!
          附記:初次破解,沒有多少經(jīng)驗(yàn),所以更多記錄了一下實(shí)際的步驟。后來我測(cè)試了一下,當(dāng)把系統(tǒng)時(shí)間更改了之后,Support Period在重啟tomcat之后才會(huì)更新,所以大概這個(gè)狀態(tài)在運(yùn)行時(shí)是保存在Application對(duì)象中的吧

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

          評(píng)論

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

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

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

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

          我的意思是有很多atlassian-*.jar,那么如何確定是在具體那個(gè).jar文件啊  回復(fù)  更多評(píng)論   

          # 轉(zhuǎn)自daniel_zhy 2006-05-23 14:44 jirafan

          daniel_zhy 發(fā)表于2006-05-01 8:13 AM IP: 218.1.148.*
          JIRA我們使用快兩年了。 JIRA的確恨容易破解, 但看到JIRA對(duì)開源社區(qū)的巨大貢獻(xiàn), 如果手中還有Money的話,還是付吧,至少?gòu)牧夹纳线^得去。
            回復(fù)  更多評(píng)論   

          # JIRA中文論壇及演示站點(diǎn) 2006-05-23 14:45 jirafan

          JIRA中文論壇:

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

          JIRA中文演示站點(diǎn):
          http://www.czsm.com.cn:8080/jira/  回復(fù)  更多評(píng)論   

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

          恩,謝謝提醒。
          其實(shí)我也只是在學(xué)校實(shí)驗(yàn)室用的,應(yīng)該是license中的academic類型,所以上面只是把方法貼上來,全當(dāng)學(xué)習(xí)了,并沒有把破解的jar貼上來啊  回復(fù)  更多評(píng)論   


          只有注冊(cè)用戶登錄后才能發(fā)表評(píng)論。

          網(wǎng)站導(dǎo)航:
           
          主站蜘蛛池模板: 吴江市| 邛崃市| 太仆寺旗| 通化市| 道真| 烟台市| 同江市| 东光县| 依兰县| 绵竹市| 巢湖市| 枞阳县| 浮山县| 盐池县| 界首市| 天气| 都昌县| 南投县| 延安市| 龙山县| 海晏县| 茶陵县| 台北市| 溆浦县| 荥经县| 潞城市| 长岭县| 桓台县| 邳州市| 海南省| 噶尔县| 长武县| 手机| 澎湖县| 毕节市| 万山特区| 嵊泗县| 陈巴尔虎旗| 天峻县| 新化县| 定襄县|