Coder Social home page Coder Social logo

codeqlrule's Introduction

CodeQLRule

个人使用CodeQL编写的一些规则

ApplicationRoutes

查询应用的路由信息

SpringMVC

相关细节可以阅读:CodeQL 提升篇之路由收集

SpringMVC

脚本处理

$ python SpringMVCMapping.py -h
usage: SpringMVCMapping.py [-h] [-r REQ] [-f FILE] [-p PROXY] [-a {0,1}]

optional arguments:
  -h, --help            show this help message and exit
  -r REQ, --req REQ     输入请求目标地址默认为http://127.0.0.1
  -f FILE, --file FILE  存放路由的文件名文件需存放在脚本相同目录中
  -p PROXY, --proxy PROXY
                        输入请求代理地址
  -a {0,1}, --action {0,1}
                        0表示保存文件默认生成在当前目录中1表示直接发送请求默认为0

Example:
python3 SpringMVCMapping.py -r http://sample.com/ -f route.txt -a 0
python3 SpringMVCMapping.py -r http://sample.com/ -f route.txt -a 1
python3 SpringMVCMapping.py -r http://sample.com/ -p http://127.0.0.1:8080 -f route.txt -a 1

选择保存在本地则会生成以host+_RoutesSave_+时间戳命名的文本 image

TODO

  • python工具脚本完成:codeql查询结果再进行处理包括本地保存处理后的内容、自动发送请求至目标
  • Mapping注解中使用headers表示需要带上的header头
  • GetMapping注解中使用produces表示Context-Type类型,可能需要添加该项
  • Mapping注解中设置了params表示需要带上的参数名,可以没有值
  • Date类型目前只考虑了@DateTimeFormat(iso=ISO.DATE)
  • Entity类中实现PathVariable RESTful风格,在Entity类中绑定参数,
    @GetMapping("dataBinding/{foo}/{fruit}")
    public String dataBinding(@Valid JavaBean javaBean, Model model){}
  • RESTful风格,使用PathVariable等注解,目前可能存在问题,而且导致代码量较大,后期可能去除该项,直接取注解等信息然后通过Python额外处理
  • 参数存在@Valid注解对参数进行校验,将该类中在字段的注解定义了规范
  • 参数类型为Map则需要找到Map.get获取参数值的地方获取参数名(优先处理完成该项)
  • setter和构造函数传入参数和字段名不一致情况,是否需要考虑
  • 当接口的方法中使用Mapping等注解配置好,其实现类中再重写相应的方法,这种情况下实现类没有任何注解则需要额外考虑这种情况
  • 是否可以适用Struts2

codeqlrule's People

Contributors

ice-doom 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.