来唠唠Jerbrains绕过激活新思路

鸣谢

首先先感谢大佬的文章提供的绕过激活思路。

思路分析

开局上图,又到了大伙怒闻悲见的激活环节 :tieba_006: :tieba_006: :tieba_006:

有没有一种可能,我们能hook这个窗口,在他打开之前就立马关闭,那我们就能愉悦的使用(白嫖)了

包有的,上面鸣谢的大佬都用javassist实现了,但是使用javassist还需要替换原来的jar包,属实有点麻烦,作为懒狗,我想能不能用大伙喜欢用的bytebuddy来实现,所以就有了这篇文章

前期操作

使用arthas的ognl '@java.awt.Window@getWindows()'获取窗口信息,找到窗口类名com.intellij.openapi.ui.impl.DialogWrapperPeerImpl,接下来需要找到它所在的jar包做后续分析

继续用sc -d com.intellij.openapi.ui.impl.DialogWrapperPeerImpl$MyDialog显示类的详细信息,包括类加载器、类加载的时间、类的字节码、源代码位置等详细信息。

这里用classloader -l 2ac1fdc4查看类加载器的详细信息

捏麻麻滴,太多信息了,果断让兄弟分析一下

而你,我的兄弟,你才是真正的英雄。不过你还不能休息,赶快把目录树给他,让他再烧脑一下


好的,相信兄弟,接下来JADX,启动!

JADX分析

一顿反编译终于找到你的位置了,藏在app-client里

快给我康康!

public void dispose() {
        LOG.assertTrue(EventQueue.isDispatchThread(), "Access is allowed from event dispatch thread only");
        for (Runnable runnable : this.myDisposeActions) {
            runnable.run();
        }
        this.myDisposeActions.clear();
        Runnable disposer = () -> {
            Disposer.dispose(this.myDialog);
            this.myProject = null;
            SwingUtilities.invokeLater(() -> {
                if (this.myDialog.getRootPane() != null) {
                    this.myDialog.remove(this.myDialog.getRootPane());
                }
            });
        };
        EdtInvocationManager.invokeLaterIfNeeded(disposer);
    }

好兄弟说它是释放资源的,其实名字就能看出来,那就靠他实现关闭窗口的操作了

代码实现

package org.example;
import net.bytebuddy.agent.builder.AgentBuilder;
import net.bytebuddy.asm.Advice;
import net.bytebuddy.matcher.ElementMatchers;
import java.lang.instrument.Instrumentation;
import java.lang.reflect.Method;

public class MyAgent {
    public static void premain(String agentArgs, Instrumentation inst) throws Exception {
        System.out.println("premain");
        AgentBuilder agentBuilder = new AgentBuilder.Default()
                .with(AgentBuilder.RedefinitionStrategy.RETRANSFORMATION)
                .with(AgentBuilder.InitializationStrategy.NoOp.INSTANCE)
                .with(AgentBuilder.TypeStrategy.Default.REDEFINE)
                .ignore(ElementMatchers.nameStartsWith("net.bytebuddy."));
        // .with(new MyAgentListener());
        // Eat Window
        agentBuilder.type(ElementMatchers.named("com.intellij.openapi.ui.impl.DialogWrapperPeerImpl"))
                .transform((builder, typeDescription, classLoader, module, protectionDomain) -> builder
                        .visit(Advice.to(EatWindowAdvice.class)
                                .on((ElementMatchers.named("setTitle"))
                                        .and(ElementMatchers.takesArgument(0, String.class)))))
                .installOn(inst);

    }
    public static class EatWindowAdvice {
        @Advice.OnMethodEnter
        public static void intercept(@Advice.This Object thisObject, @Advice.Argument(0) String title)
                throws ClassNotFoundException {
            System.out.println("Window is about to open ==> title is: " + title);
            if (title.contains("许可证") || title.contains("Licenses")) {
                System.out.println("Eat! Eat! Eat!");
                try {
                       thisObject.getClass().getMethod("dispose").invoke(thisObject);
                } catch (Exception e) {
                    e.printStackTrace();
                }
            }
        }
    }
}

康康效果

什么,你根本没吃掉,dispose()为什么会调用不了呢,再回去看看JADX,看到了这个东西
/* JADX INFO: Access modifiers changed from: protected */,那我们再来改改代码

package org.example;
import net.bytebuddy.agent.builder.AgentBuilder;
import net.bytebuddy.asm.Advice;
import net.bytebuddy.matcher.ElementMatchers;
import java.lang.instrument.Instrumentation;
import java.lang.reflect.Method;

public class MyAgent {
    public static void premain(String agentArgs, Instrumentation inst) throws Exception {
        System.out.println("premain");
        AgentBuilder agentBuilder = new AgentBuilder.Default()
                .with(AgentBuilder.RedefinitionStrategy.RETRANSFORMATION)
                .with(AgentBuilder.InitializationStrategy.NoOp.INSTANCE)
                .with(AgentBuilder.TypeStrategy.Default.REDEFINE)
                .ignore(ElementMatchers.nameStartsWith("net.bytebuddy."));
        // .with(new MyAgentListener());
        // Eat Window
        agentBuilder.type(ElementMatchers.named("com.intellij.openapi.ui.impl.DialogWrapperPeerImpl"))
                .transform((builder, typeDescription, classLoader, module, protectionDomain) -> builder
                        .visit(Advice.to(EatWindowAdvice.class)
                                .on((ElementMatchers.named("setTitle"))
                                        .and(ElementMatchers.takesArgument(0, String.class)))))
                .installOn(inst);

    }
    public static class EatWindowAdvice {
        @Advice.OnMethodEnter
        public static void intercept(@Advice.This Object thisObject, @Advice.Argument(0) String title)
                throws ClassNotFoundException {
            System.out.println("Window is about to open ==> title is: " + title);
            if (title.contains("许可证") || title.contains("Licenses")) {
                System.out.println("Eat! Eat! Eat!");
                try {
                    // thisObject.getClass().getMethod("dispose").invoke(thisObject);
                    Method disposeMethod = thisObject.getClass().getDeclaredMethod("dispose");
                    disposeMethod.setAccessible(true);
                    disposeMethod.invoke(thisObject);
                } catch (Exception e) {
                    e.printStackTrace();
                }
            }
        }
    }
}

再来康康效果


达到预期效果,完美,又成功水了一帖 :tieba_095: :tieba_095: :tieba_095:

51 个赞

破解点太多了,比如mymap,这种破解就比power的容易理解,不涉及证书x509、签名、asn1、rsa那一套。

4 个赞

很强

3 个赞

:tieba_002: :tieba_002:

3 个赞

确确实实,但是这种不能破插件,证书的搞完插件都能破,顺便细嗦一下mymap

2 个赞

牛,,牛的!这波全是干货

2 个赞

大佬厉害

2 个赞

强啊!

2 个赞

点赞 点赞

1 个赞

强啊啊

3 个赞

666 又可以研究一波了

2 个赞

我也想用用你的朋友

2 个赞

这也可以 :tieba_006:

1 个赞

不给用 :tieba_006: :tieba_006: :tieba_006:

1 个赞

还真可以:tieba_095: :tieba_095: :tieba_095:

1 个赞

才发现大佬是 粗暴版某括号 的作者 :tieba_003:

什么玩

1 个赞

这家公司好可怜啊,害的我也C了一个

:joy: 小菜鸡一枚,还是得多像大佬们学习学习

大佬太谦虚了