Giter Site home page Giter Site logo

easyrasp's Introduction

EasyRasp

Easy Java-Rasp ,一款简单的轻量级Java-Rasp框架🔥

image

示例代码:

image

拦截结果:

image

你可以通过注解RaspMonitor来自定义Handler,例如拦截Runtime

package com.boogipop.easyrasp.monitors;


import com.boogipop.easyrasp.annotations.FrozenMonitor;
import com.boogipop.easyrasp.annotations.PreMethodMonitor;
import com.boogipop.easyrasp.annotations.RaspMonitor;


/**
 * Not finished yet,only hook one single exec method which's type is String.class
 */
@RaspMonitor(targetClass = Runtime.class,isConstructor = false,methodName = "exec",paramTypes ={String.class},isFrozen = true,IgnoreOverloading = true)
public class RuntimeMethodMonitor implements BasicMonitors{
    /**
     * modify the blacklist by yourself XD
     */
    private static String [] blacklist={"test","test"};
    /**
     * Method Name can not be changed
     * Will be changed in next version
     * Will add Source Annotiations
     */

    @Deprecated
    private static String FrozenSource="new %s().%s();";
    @Deprecated
    private static String HookSource="new %s($args).%s();";

    @Override
    public void HookMethod(Object... args) {

    }

    @Override
    @PreMethodMonitor
    public void HookMethod(String cmd) {
        for (String banword : blacklist) {
            if (cmd.contains(banword)){
                throw new RuntimeException("Evil Command Detected!!!");
            }
        }
    }

    @Override
    public void HookMethod() {

    }

    @Override
    @FrozenMonitor
    public void FrozenMethod() {
        throw new RuntimeException("Runtime.exec() methods have been hooked!");
    }
}

easyrasp's People

Contributors

boogipop avatar ra1nyd4nc3r avatar

Stargazers

Retr_0 avatar pysnow avatar  avatar  avatar unknown avatar  avatar

Watchers

 avatar

Forkers

ra1nyd4nc3r

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.