Git Product home page Git Product logo

jvm-rasp's Introduction

jvm-rasp

基于JVM-Sandbox实现RASP安全监控防护。防护基本的RCE攻击和SQL注入。

0x00 安装部署

先下载阿里的工具:JVM-Sandbox。下载二进制包,解压。

使用Maven构建该工程:
mvn clean package
将target下的jvm-rasp-1.0-SNAPSHOT-jar-with-dependencies.jar文件放在JVM-Sandbox的module目录下~

0x01 运行

参考JVM-Sandbox的wiki,这里用热插拔的形式。

  • 找到运行Java Web程序的进程号(Tomcat、Jetty、SpringBoot都可以)
  • 使用sandox的bin目录下sandbox.sh脚本,即可动态启动检测程序。

./sandbox.sh -p ${pid}
./sandbox.sh -p ${pid} -d "detect-rce-logger/rcedetect"
./sandbox.sh -p ${pid} -d "detect-SQL-injection/sql_injection_detect

0x02 整合jvm-sandbox

  • 我把jvm-sandbox(版本1.0.16)下载下来,放在了sandbox目录下。
  • log日志在~/logs/sandbox/
  • 运行前在AlarmSendMailThread类配置邮箱pop3密码和管理员邮箱。
  • 参考我写run.sh脚本运行。
  • 使用springboot框架,测试检测fastjson漏洞成功。

示例视频请看: ./images/demo.mp4

邮件收到的报警信息:

0x03 问题

0x04 功能和原理

DetectSQLInjectionModule 检测SQL注入,用了百度的OpenRASP算法。
DetectRCELoggerModule 通过Hook底层执行命令的函数,回溯判断攻击类型,并迅速定位整个调用栈。

0x05 参考文章

https://www.angelwhu.com/blog/?p=555

jvm-rasp's People

Contributors

angelwhu avatar

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.