GithubHelp home page GithubHelp logo

modsecurity-backdoor's Introduction

ModSecurity Backdoor

Description

This is a proof-of-concept of malicious software running inside of ModSecurity WAF.

Software has two main functions:

  • Retrieving content of files.
  • Running commands and retrieving output (remote shell).

Additionaly, it includes these functions:

  • Dynamic setting of control POST arguments names for harder detection.
  • Logging disabling for harder detection (only for attacker's requests identified by POST arguments names).
  • All other rules disabling (only for attacker's requests identified by POST arguments names).

Prerequisities

  • ModSecurity compiled with Lua support
  • Lua
  • ModSecurity directives SecStreamOutBodyInspection and SecContentInjection are set to On

Installation

Get files backdoor.conf and backdoor.lua and load the first one into the web server.

Configuration

Configuration can be done in the first rule in file backdoor.conf.

tx.backdoor_file_argument_name

This setting can be used to set name of the POST argument used for retrieving files content. Set it to anything random like koomem6Shmog.

tx.backdoor_command_argument_name

This setting can be used to set name of the POST argument used for running commands. Set it to anything random like tys4Olhuibves.

Usage

Commands can be run on any address (domain) on the target server which is behind the ModSecurity WAF. Output from commands is appended to the standard server response.

Usage examples

Retrieving file content:
curl -X POST -d "koomem6Shmog=/etc/passwd" "http://example.com/"

Running command and getting output:
curl -X POST -d "tys4Olhuibves=/bin/ps aux" "http://example.com/"

License

Copyright (c) 2022 Jozef Sudolsky. All rights reserved.

"THE BEER-WARE LICENSE" (Revision 42): [email protected] wrote this file. As long as you retain this notice you can do whatever you want with this stuff. If we meet some day, and you think this stuff is worth it, you can buy me a beer in return. Jozef Sudolsky

modsecurity-backdoor's People

Contributors

azurit avatar

Stargazers

 avatar  avatar Hamid avatar hirak0 avatar Aliyu Yakubu avatar Erik avatar xrkk avatar  avatar Ofer Chen avatar  avatar Autopsie avatar Rafael  avatar soap avatar Henri Salo avatar Thomas K. avatar Or Guetta avatar Suri avatar  avatar  avatar Mark Koskei avatar Luca Maranzano avatar Marijus Briedis avatar guly avatar Andras avatar  avatar Brendan avatar Samuel FORESTIER avatar  avatar J. Hackenthal avatar Tim Ehrhart avatar

Watchers

Christian M. Grube avatar  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.