Coder Social home page Coder Social logo

injectionattackinterceptor's Introduction

InjectionAttackInterceptor

注入攻击拦截器

  • XSS
  • SQL注入
  • 特殊字符

可自定义拦截策略

控制器中加入注解@PassInjectionAttackIntercept,那么这个Mapping则不会进行注入拦截处理,或者对某些特定字符忽略

    // 表示该请求,不会进行注入攻击拦截处理
    @RequestMapping( "demo" )
    @PassInjectionAttackIntercept
    public ResponseEntity< String > demo () {
        return ResponseEntity.ok();
    }

    // 表示该请求,进行注入攻击拦截处理时,如果请求参数中包含了 "update" 或者 "exec",那么对此进行忽略,排除这些关键字符
    @RequestMapping( "demo2" )
    @PassInjectionAttackIntercept( { "update" , "exec" } )
    public ResponseEntity< String > demo () {
        return ResponseEntity.ok();
    }
    // 注解在控制器方法上同理

支持@PathVariable路径变量拦截,以及@RequestBody参数拦截

	@GetMapping( "users/{name}" )
	@PassInjectionAttackIntercept( { "update" , "delete" } )
    public ResponseEntity< User > users ( @PathVariable String name ) {
        return ResponseEntity.ok().body( name );
    }

    @PostMapping( "users" )
    @PassInjectionAttackIntercept( { "update" , "delete" } )
    public ResponseEntity< User > users ( @RequestBody User user ) {
        return ResponseEntity.ok().body( user );
    }
	

injectionattackinterceptor's People

Contributors

yujunhao8831 avatar

Watchers

James Cloos avatar Naughty 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.