GithubHelp home page GithubHelp logo

bleszily / bash-malware-dropper Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ice-wzl/bash-malware-dropper

0.0 0.0 0.0 450 KB

Malware written in bash to serve as an initial dropper script that will provide a strong foothold on the target device via reverse shells and persistence techniques, can be set to run via user interaction or coupled with a bot.

License: The Unlicense

Shell 100.00%

bash-malware-dropper's Introduction

Bash Malware Dropper

initial_access.sh

Overview

  • Designed as an initial dropper script to gain multiple foot holds into a target system.
  • Coupled with a bot that brute forces SSH credentials it can be a formidable way to persist on a target device.
  • All code in this project is my own.
  • Please use responsibly, this project was created for research purposes only, and to allow for better identification of malware infections. The author assumes no liability for the use or misuse of any and all code contained in this or other repositories.

Usage

  • git clone the repository
  • Host the dropper script on a VPS or other internet connected device with a static ip.
  • Have your bot call out to the hosting device and pull the dropper script down.
  • Execute with:
./initial_access.sh 2>/dev/null
  • Enjoy your foothold

Methods

Pre-Execution Checks

- Script checks to ensure that it is running as root, if not it deletes itself
- Script ensures that the target device is a compatable Linux System, if not it deletes itself
- Script checks that it is a systemd system, if not it deletes

Cowrie Checks

- Script will run through various checks to ensure it is not running in a Cowrie honeypot
- If it is, it will delete itself

Internet Test

- Script will test to see if it has internet access

Execution

  • After those checks are completed it will ensure netcat is on the target system
  • If it is, it will call out back to a VPS of your choosing, if not it will skip that step
  • It will then add a service unit called network.service located in /etc/systemd/system
  • This will call out on device reboot, and upon the service unit being loaded immediately after file creation
  • It will then create two cron jobs one which serves as another call out method
  • The second is the execution of the checker script that ensures the network.service file has not been deleted.
  • It then moves on to create a checker script called proc that is located in /dev/shm/.proc/proc
  • This will check to ensure the service unit has been been deleted every 10 minutes.
  • If it has been deleted it will copy the mirror image of the service file located at /dev/shm/.fstab/fstab back to /etc/systemd/system.
  • It will finally install a public ssh key in /root/.ssh/authorized_keys allowing for ssh key peristance.
  • It will then delete itself off disk.

Recommendations

  • Upon recieving a reverse shell, recommendation is to immediately capture the device ip address in order to utilize the ssh key method of persistance.

implant.sh

  • Add your C2 ip address to the file
  • Add your own SSH public key
  • Set up your nc listener on port 9001
  • Execute the implant script on the target
  • Recieve call back and enter help to see the range of commands
  • Profit

bash-malware-dropper's People

Contributors

ice-wzl avatar lw8192 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.