Code Monkey home page Code Monkey logo

javaeasyscan's Introduction

███████╗██╗   ██╗██████╗  ██████╗
██╔════╝██║   ██║██╔══██╗██╔═══██╗
█████╗  ██║   ██║██████╔╝██║   ██║
██╔══╝  ██║   ██║██╔═══╝ ██║   ██║
██║     ╚██████╔╝██║     ╚██████╔╝
╚═╝      ╚═════╝ ╚═╝      ╚═════╝
                       JAVAEASYSCANNER  Fupo's series
—————————————————————————————————————————————————————

致力于解放大脑,方便双手

富婆系列,不想努力就用它

JAVA审计辅助工具

本工具以辅助审计Springboot/Springmvc项目为主,效果更佳

使用

java环境:JDK1.8

本工具的优势在于不用你写规则,所以在打包好项目后(懒得打包的可以直接到这里下载已经打包好的: releases),直接按照以下方式启动即可

java -jar javaeasyscan.jar 源码目录(暂不支持反编译class

工具实现思路:

使用反向跟进的方法: 定位漏洞点 ⟶ 定位漏洞所属方法、所属类 ⟶ 往上查找所属类及所属方法被调用的地方 ⟶ 直至没有被调用为止

示例:

有一个SQL注入的场景如下

  <select id="selectUser" resultType="com.javavul.javavulpoj.data.SubUsers">
        select * from subusers where id = ${id}
    </select>

首先记录selectUser,以及所在的Mappper,根据Mapper配置找到对应的Mapper接口

@Mapper
public interface ProductMapper {

    List<Product> selectUser(ProductExample example);
}

随后记录ProductMapper接口以及selectUser方法,接着往上找到调用该接口和方法的地方

public class ProductServiceImpl implements ProductService {
    @Autowired
    private ProductMapper productMapper;
   public List<Product>  selectUser(ProductExample example) {
        return productMapper.selectUser(example);
    }

随后记录ProductServiceImpl类、selectUser方法和ProductService,然后往前找调用了ProductService.selectUser的地方

@ResponseBody
    @RequestMapping("/sqlin")
    public List sqlin(HttpServletRequest req, HttpServletResponse rep, ProductExample example) throws IOException {
        String v = req.getParameter("sql");
        try {
            List reta = productService.selectUser(example);
            return ret;
        } catch (Exception e) {
           return Collections.singletonList(e.getMessage());
        }
    }

这个跟进的操作会重复到往上再没有调用,且如果mybatis xml文件存在注入写法,但是方法没有被调用,则工具就会忽略该场景

等所有漏洞扫描完后,会在当前目录生成一个HTML报告,报告示例:

image

image

计划

因为时间仓促,本工具只写了mybatis的SQL注入、JDBC拼接SQL注入、Fastjson反序列化、Groovy代码执行、命令注入五个模块,目前mybatis的SQL注入模块比较完善

后续需要优化的地方:

  • 所有模块增加入参校验,如果参数不可控则忽略场景,减少误报
  • JDBC拼接导致的注入需要增加调用链跟踪(目前只是输出了存在拼接的地方)
  • Fastjson反序列化增加版本检测
  • this.method没有被识别,会影响调用链跟踪

后续新增

  • 各种漏洞模块
  • 界面?

其他

  • 如果打包没有把依赖打包进去,请查看 解决maven打jar包时不把依赖打包进去的问题
  • 因为要带项目了,所以要视情况挤时间出来更新,如果你有想法等不及的话可以下载代码改或者加入本项目直接pull更新或者提交issues,我会不定期查看,谢谢
  • 不爱请别伤害,不好的评论我会删

javaeasyscan's People

Contributors

novysodope 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.