[原创]smartgit18.2 软件验证过程分析
0x00准备条件
jd-gui.exe :反编译工具 eclipse + "Enhanced Class Decompiler" :IDE + 反编译插件。 JByteMod :字节码编辑器
0x01 先找切入点:
在界面上,通过“Register”操作,随便提供了一个文件作为输入,界面提示:"The specified file is invalid.",
到软件的安装目录的lib中找到smartgit.jar文件,基本可以认定它是核心功能包,所以对它进行逆向分析。
./smartgit/aqU.java:/* 120 */ return "Please enter or choose a valid license file.";
./smartgit/aqU.java:/* 124 */ return "The specified file is invalid.";
public static String u()
{
return "Please enter or choose a valid license file.";
}
public static String v()
{
return "The specified file is invalid.";
}
从上面的提示找到的信息,基本上都是一个通用aqU字符返回类,里面有比较多的信息,但是提供不了处理逻辑,但是
返回字符中有关于版本的信息,通过对反编译的工程进行call调用查找,定位到aqT类(说明:windows不区分文件大小
写很坑,混淆过的文件中,很多不区分大小写就是重名的,通过luyten.exe导出可以解决)
C2582aqT(C2340alT c2340alT, boolean z) {
this(c2340alT.a(C2583aqU.f()), // Type
c2340alT.a(C2583aqU.g()), // Subscription
c2340alT.b(C2583aqU.i()), // Name
c2340alT.a(C2583aqU.j()), // Address
c2340alT.a(C2583aqU.l()), // Email
c2340alT.a(C2583aqU.o()), // ProgramVersion
c2340alT.b(C2583aqU.m(), true), // FreeUpdatesUntil
c2340alT.b(C2583aqU.n(), true), // ValidUntil
c2340alT.b(C2583aqU.k(), true), // DemoUntil
c2340alT.b(C2583aqU.s(), true), // SupportUntil
c2340alT.b(C2583aqU.h(), true), // SubscriptionTo
c2340alT.a(C2583aqU.p(), // LicenseCount
c2340alT.a(C2583aqU.r(), null)), // MaxUsers
c2340alT.a(C2583aqU.q(), false), z, c2340alT); // Enterprise
}
虽然没有定位到关键处理点,但是上面的信息基本提供了证书文件的字段内容,仔细分析这个类后,可以基本确定证书文件格式:
Type=professional Name=asdf Address=asdf.cn BLE Str. Email=asdf@qq.com ProgramVersion=18.2 FreeUpdatesUntil=2999-12-30 ValidUntil=2999-12-30 DemoUntil=2999-12-30 SupportUntil=2999-12-30 LifeLongUpdates=true MaxUsers=1000
当然上面的还不是证书文件的全部信息,需要继续分析,再次查找aqT类的创建点:
public abstract class C2576aqV {
@NotNull
protected final QX a(ake ake, String str, String str2, boolean z, boolean z2) {
QX a = new C2342alV(C2229ajA.a(str), C2229ajA.a(str2), z).a(ake); // 分析证书信息。
QX qx = new QX(new C2582aqT((C2340alT) a.a(), z2), a.b()); // ===> License info record .
if (qx != null) {
return qx;
}
throw new IllegalStateException(String.format("@NotNull method must not return null", new Object[0]));
}
}
这儿基本是证书文件的关键处理入口,不过现在因为是混淆的,啥也看不出来。
0x02构建可调试工程
因为代码进行了混淆,看起来还是非常的低效,所 以想着能构建一个可调试工程,但是这个程序是从smartgit.exe进行运行的,它
是用的自己的加载器进行jar的加载,所以转到分析smartgit.exe,程序并没有加壳,直接找smartgit.jar字符串相关的信息,结果
什么也没有找到。但是在查看数据目录(C:\Users\<username>\AppData\Roaming\syntevo\SmartGit\18.2)时,有个logger.properties
配置文件,看着像可以配置日志级别,以为能收集数据,就改了下配置,结果启动程序的时候,直接出错了,而且提示有完整DUMP文件,
从文件中看到比较有意思的信息:
com.exe4j.runtime.WinLauncher.main() smartgit.exe
+-> com.syntevo.QBootLoader.main() (SourceFile:102)
+-> com.syntevo.smartgit.SmartGit.main() (SourceFile:11)
+-> smartgit.apB.a() (SourceFile:245)
基本理清楚加载的过程:
smartgit.exe ---> (bootloader.jar + bootloader-config.jar) ---> smartgit.jar
注意:上传附件及图片大小不得大于30M。
⚠️ 版权声明:
本博客所有内容(含教程、源码、工具)仅供个人技术学习与研究交流使用,严禁商用、倒卖、二次分发及非法用途。
未经作者书面授权,任何组织或个人不得转载、复制或用于其他平台,违者将追究相关责任。
