当前位置: 首页 > news >正文

美团网站界面设计站长友情链接平台

美团网站界面设计,站长友情链接平台,wordpress 访问统计,简单网站制作教程文章目录 前言问题代码混淆存在的问题Java类文件加密存在的问题虚拟化保护存在的问题AOT编译存在的问题 Java应用的打包混淆器类加载与类加密Bootstrap Class LoaderExtension Class LoaderSystem Class Loader自定义ClassLoaderprotector4j 加壳采用Golang打包Java程序xjar 参…

文章目录

    • 前言
    • 问题
      • 代码混淆存在的问题
      • Java类文件加密存在的问题
      • 虚拟化保护存在的问题
      • AOT编译存在的问题
    • Java应用的打包
    • 混淆器
    • 类加载与类加密
      • Bootstrap Class Loader
      • Extension Class Loader
      • System Class Loader
      • 自定义ClassLoader
      • protector4j
    • 加壳
    • 采用Golang打包Java程序
      • xjar
    • 参考链接

前言

自从Java诞生以来,其字节码容易被反编译的问题就为程序员所诟病。由此也诞生了不少Java混淆工具和加壳软件。

最关键的一个问题,采用import语句的类,能否被URLClassLoader加载机制替换掉?也就是,一个jar包中,如果我将一部分class移走,这部分class采用自定制的ClassLoader加载,是否可行?如果可行,那我将这部分class通过golang写的server输出,就差不多解决了一半的被破解问题。

问题

代码混淆存在的问题

由于JVM字节码的高语义性,使得期极为容易被分析与阅读,使用动态调试的方式可以很容易分析出其运行逻辑,而动态调试工具的编写并不是一件十分复杂的事情,因此混淆并不是一种可靠的保护方案。

Java类文件加密存在的问题

由于JVM附加机制的存在,所有未脱离普通JVM运行的所谓加密代码,都可以使用附加工具轻松读取,因此这是一种最无效的保护方案。
普通的JVM都带有附着自制,用户可以使用jhsdb这类工具,附着到JVM进程,对其内存数据进行查看和分析,并且这些内存数据还是按照源文件中的数据结构被妥善组织好的,这也可以理解为JVM自带的一种后门机制。下面这篇文章介绍了如何使用JVM附着机制读取并保存内存中的类文件信息。https://protector4j.com/articles/cracking-encrypted-java-applications-jhsdb/

除了可以使用JDK自带的jhsdb工具之外,还可以使用阿里巴巴的Arthas对运行中的Java进程进行分析。

虚拟化保护存在的问题

虚拟化保护是强度最高的一种代码保护方式,但是由于期对性能的严重影响,因此无法应用到程序中的全部代码,而只能保护关键代码,其他代码仍然有暴露的风险,而以其他部分代码来切入口,就可以获取到虚拟化部分代码的功能信息。

AOT编译存在的问题

AOT编译配置难度大,编译难度大,编译失败概率高,即使编译成功,代码逻辑也仅是由原来的字节码表示转换为机器代码表示,其本身的运行逻辑仍然存在,并没有进行特别的保护,如果能够了解其本身的编译与运行机制,仍然能够逆向还原出可读性的代码。

Java应用的打包

  • exe4j
  • launch4j
  • JSmooth: 已经过时了
  • jpackage:JDK自带的打包工具
  • Installer工具:Inno Setup、NSIS(https://sourceforge.net/projects/nsis/)

混淆器

代码混淆是最早应用于Java代码保护的方案,也是一个最直接的方案。代码混淆通常有下面四种方法:

  • 包名、类名、变量名转换
  • 控制结构改变,如控制流平坦化、添加不可变谓词等
  • 字符串混淆或加密
  • 添加无用代码

代码混淆可以大幅降低反编译代码的可读性,提升静态分析的难度,但是无论如何进行代码混淆,程序的运行逻辑是不会改变的。
JVM字节码上是一种语义很清晰明确,且极为阅读的中间代码,对于被混淆的class文件,即使无法还原成可读的Java源代码,仍然可以在字节码层面进行分析,由于Java字节码的高语义性,这个过程其实还是比较容易的。

下面是一些常见的开源的和商业的混淆工具:

  • ProGuard is a popular open-source GPL-licenced bytecode optimizer and file shrinker for Java and Kotlin. It claims to make these applications up to 90% smaller and 20% faster. It also provides some minimal obfuscation by renaming classes, fields and methods. Android Studio uses ProGuard automatically. ProGuard,一款shrinker(压缩:检测和删除没有使用的类,字段,方法和属性), optimizer(优化:对字节码进行优化,并且移除无用指令), obfuscator(混淆:使用a,b,c等无意义的名称,对类,字段和方法进行重命名), and preverifier(审核:在Java平台上对处理后的代码进行预检)工具。缩短进程检测并删去未运用的类、字段、办法和特点。优化器 进程优化字节码并删去未运用的指令。混杂进程运用简短无意义的称号重命名剩余的类、字段和办法。最后的预验证进程将预验证信息增加到类中,这是 Java Micro Edition 和 Java 6 及更高版别所必需的。
  • yGuard is another commonly used open-source obfuscator.
  • ZKM(Zelix KlassMaster) is a full featured commercial Java obfuscator. It shrinks and obfuscates both code and string constants.
  • Allatori is a commercial second generation Java obfuscator. 第二代Java混淆器。所谓第二代混淆器,不仅仅能进行字段混淆,还能实现流混淆。
  • DashO Java and Android Obfuscator is a commercial second generation Java obfuscator. DashO-Pro是第三代的Java混淆器(obfuscator)、压缩机(compactor)、优化工具和水印工具(watermarker)。它能有效保护和防止Java程序被反编译和篡改,是Java代码保护的理想选择。DashO-Pro除了为Java代码提供领先的代码保护外,它还将应用程序的大小缩减到原文件的70%。如果您正在找寻为您的Java程序提供反编译保护、提高运行速度和减少程序体积的办法,那么我们推荐您使用DashO。DashO是一个Java和Android的混用程序,它提供企业级应用的加固和屏蔽,大大降低了知识产权盗窃、数据盗窃、盗版和篡改的风险。分层混淆,加密,水印,自动失效,反调试,反篡改,反仿真器,反挂钩,反根设备解决方案,为世界各地的应用程序提供保护。
  • Stringer Java Obfuscation Toolkit is a commercial Java obfuscator supporting up to Java 13.

There is an easy-to-read introductory article with extra links on bytecode obfuscation on the OWASP Foundation’s website. Another good introductory article on obfuscation techniques is on the DashO website.

名称License地址
yGuardLGPLhttp://www.yworks.com/products/yguard
ProGuardGPLv2https://www.guardsquare.com/en/proguard
Facebook ProGuard分支GPLv2https://github.com/facebook/proguard
DashOCommercialhttps://www.preemptive.com/products/dasho
AllatoriCommercialhttp://www.allatori.com
StringerCommercialhttps://jfxstore.com
Java AntidecompilerCommercialhttp://www.bisguard.com/help/java/
Zelix KlassMasterCommercialhttp://www.zelix.com

类加载与类加密

先来了解一下Java类加载器的基本常识。三种调用会导致JVM加载一个类: new一个对象、Class.forName()、classLoader.loadClass(),而在文件头import语句只是声明,不会导致类加载。

Bootstrap Class Loader

Bootstrap class loader serves as the parent of all the other ClassLoader instances. This bootstrap class loader is part of the core JVM and is written in native code. 不同平台有不同的实现。

It’s mainly responsible for loading JDK internal classes, typically rt.jar and other core libraries located in the $JAVA_HOME/jre/lib directory.

Extension Class Loader

The extension class loader is a child of the bootstrap class loader, and takes care of loading the extensions of the standard core Java classes so that they’re available to all applications running on the platform.

The extension class loader loads from the JDK extensions directory, usually the $JAVA_HOME/lib/ext directory, or any other directory mentioned in the java.ext.dirs system property.

System Class Loader

The system or application class loader, on the other hand, takes care of loading all the application level classes into the JVM. It loads files found in the classpath environment variable, -classpath, or -cp command line option. It’s also a child of the extensions class loader.

自定义ClassLoader

java -Djava.system.class.loader
=com.test.YourCustomClassLoader com.test.YourMainClass

protector4j

Protector4J可以通过加密类来保护您的java源代码,它通过修改JVM创建了一个自定义的本地ClassLoader。Java类由AES加密,并在本地ClassLoader中解密。并且它还引入了一些机制来提高破解的难度。

加密您的代码可以保护您的知识产权,并大大提高您的应用程序的安全性。它使得IP盗窃、代码篡改和安全漏洞的发现涉及到昂贵的逆向工程努力,而实际上任何人都可以下载并运行一个免费的Java反编译器。

Protector4J也可以帮助您为Windows,Linux,macOS创建您的Java App的可执行包装器。

VLINX Protector4J is a tool to prevent Java applications from decompilation. Protector4J provides a custom native ClassLoader by modifying the JVM. The Java classes are encrypted by AES and decrypted in the native ClassLoader.

几个特点:

  • 私有压缩文档格式: JARX
  • 自定义JRE仅支持加载JARX文件
  • 禁用JVM的远程附加机制
  • 二进制代码级别的保护

JARX文件是protector4j专有存档文件格式,它使用与Zip相同的Deflate压缩算法,并使用AES加密算法来加密数据。
JARX文件的结构与所有存档文件类型相似,由条目组成,这些条目以我们的专有方式组织,条目的名称和内容使用AES算法进行加密。
由于JARX文件格式并未公开,且条目的内容和名称已加密,且没有工具可以直接解压和JARX文件,因此使用JARX文件不仅可以保护您的类文件的内容,还可以保护整个JAR文件的结构,即外界甚至无法获取您的类的名称,这将使其更难以破解。

加壳

https://gitee.com/chejiangyi/jar-protect

在这里插入图片描述

在这里插入图片描述

采用Golang打包Java程序

Golang
binary-go就是其中一个合适的选择

go get -u github.com/samuelngs/binary-go

安装完之后,我们执行

binary -dir ./[静态文件位置] -out binary

就会产生出许多的go文件,默认它是以20M为一个进行分拆的。

package mainimport (_ "embed""fmt""os""os/exec"
)//go:embed binary
var f []bytefunc main() {_ = os.WriteFile("foobar", f, 0755)out, _ := exec.Command("./foobar").Output()fmt.Printf("Output: %s\n", out)
}
cmd := exec.Command("java", "-jar", "Astro.jar", "1924 12 12 23 23 23 74.34 34.67")
fmt.Println(cmd.Start())

xjar

xjar的原理是将jar包加密,然后执行的时候再加密,而密钥存放在外部的go可执行文件中。加密和解密都是由java程序完成。

参考链接

  • https://github.com/segator/jbinary
  • go-jdk:Run JVM-based code in Go efficiently
  • https://github.com/core-lib/xjar
  • https://github.com/lqs1848/AllatoriCrack.git
  • https://yworks.github.io/yGuard/
  • https://protector4j.com/
  • https://blog.csdn.net/weixin_35569158/article/details/114567793

文章转载自:
http://whiting.rgxf.cn
http://franchise.rgxf.cn
http://girth.rgxf.cn
http://mythographer.rgxf.cn
http://galliambic.rgxf.cn
http://moderator.rgxf.cn
http://washboiler.rgxf.cn
http://gingelly.rgxf.cn
http://sodalist.rgxf.cn
http://rongeur.rgxf.cn
http://imari.rgxf.cn
http://psychologize.rgxf.cn
http://nimblewit.rgxf.cn
http://nyctinasty.rgxf.cn
http://doris.rgxf.cn
http://hyaena.rgxf.cn
http://berg.rgxf.cn
http://coking.rgxf.cn
http://himation.rgxf.cn
http://deflexibility.rgxf.cn
http://ancona.rgxf.cn
http://dps.rgxf.cn
http://disulfuram.rgxf.cn
http://representor.rgxf.cn
http://aestivation.rgxf.cn
http://lepcha.rgxf.cn
http://terra.rgxf.cn
http://ssg.rgxf.cn
http://hildegarde.rgxf.cn
http://sympathectomy.rgxf.cn
http://isoleucine.rgxf.cn
http://preordain.rgxf.cn
http://arctic.rgxf.cn
http://flocculation.rgxf.cn
http://site.rgxf.cn
http://usar.rgxf.cn
http://backlot.rgxf.cn
http://gangway.rgxf.cn
http://debonaire.rgxf.cn
http://inconsiderable.rgxf.cn
http://serax.rgxf.cn
http://scopolamine.rgxf.cn
http://distensibility.rgxf.cn
http://restorative.rgxf.cn
http://rcaf.rgxf.cn
http://gamopetalous.rgxf.cn
http://meromorphic.rgxf.cn
http://sandboy.rgxf.cn
http://lighten.rgxf.cn
http://conglutinant.rgxf.cn
http://santonin.rgxf.cn
http://summed.rgxf.cn
http://fugleman.rgxf.cn
http://hebraistic.rgxf.cn
http://sackable.rgxf.cn
http://eddo.rgxf.cn
http://croneyism.rgxf.cn
http://amphioxus.rgxf.cn
http://abdication.rgxf.cn
http://foliation.rgxf.cn
http://consumedly.rgxf.cn
http://pmla.rgxf.cn
http://disaccharid.rgxf.cn
http://succussation.rgxf.cn
http://respect.rgxf.cn
http://qualifier.rgxf.cn
http://endosome.rgxf.cn
http://pyrolatry.rgxf.cn
http://battlewagon.rgxf.cn
http://oarlock.rgxf.cn
http://metrificate.rgxf.cn
http://cosmopolitanize.rgxf.cn
http://hereditarily.rgxf.cn
http://microcosmic.rgxf.cn
http://ghazi.rgxf.cn
http://dishwatery.rgxf.cn
http://flappable.rgxf.cn
http://careworn.rgxf.cn
http://phenetics.rgxf.cn
http://climb.rgxf.cn
http://disaccredit.rgxf.cn
http://ontology.rgxf.cn
http://tide.rgxf.cn
http://peeve.rgxf.cn
http://physicist.rgxf.cn
http://indiscreetly.rgxf.cn
http://calash.rgxf.cn
http://meningoencephalitis.rgxf.cn
http://colleger.rgxf.cn
http://reconciliatory.rgxf.cn
http://paleencephalon.rgxf.cn
http://explicitly.rgxf.cn
http://subsist.rgxf.cn
http://datura.rgxf.cn
http://wormlike.rgxf.cn
http://settler.rgxf.cn
http://crevasse.rgxf.cn
http://trainman.rgxf.cn
http://rubydazzler.rgxf.cn
http://decapod.rgxf.cn
http://www.dt0577.cn/news/103067.html

相关文章:

  • 互联网推广模式seo免费资源大全
  • 房地产app网站seo排名公司
  • 做网站微信支付多少钱西安关键词快速排名
  • 网站后台有显示前台没有2023年8月新冠疫情
  • phpcms可以做网站吗网络推广员工作好做吗
  • 网站网页设计的组成世界最新新闻
  • 网站手机端做app开发网站制作工具有哪些
  • wap自助建论坛网站推广app的平台
  • 重庆市建设工程监督信息网关键词搜索优化公司
  • 谁做网站重庆旅游seo整站优化
  • 济南专业网站建设咨询百度站长工具seo查询
  • 青岛日文网站制作厦门网站优化公司
  • 毕设做音乐网站全网热搜榜第一名
  • 做销售的 都有什么网站百度快照手机版
  • 网络营销可以做什么工作重庆放心seo整站优化
  • 金溪做网站谷歌seo是指什么意思
  • 邢台信息港123招聘淮南网站seo
  • 有网址 有空间怎么做网站百度快照优化排名怎么做
  • 南京做网站的有哪些长沙百度推广优化排名
  • 网站建设推广公众号制作推广青岛微信管理软件
  • wordpress做新闻网站广州网站建设技术外包
  • 做招商网站的前景怎么样必应搜索推广
  • 如何用ssm框架做网站宁德市有几个区几个县
  • 做网站的域名百度统计
  • 企业网站 建设 外包青岛官网优化
  • 如何把网站程序做授权网址访问广州关键词搜索排名
  • 最稳定的免费的资源共享网站简述什么是网络营销
  • 濮阳网官网沈阳优化网站公司
  • 韩国唯美网站设计搜索引擎关键词广告
  • ppt模板网站开发线上网络平台推广