NullSec ByteForge

February 27, 2026 ยท View on GitHub

Binary Payload Builder

A shellcode generation and encoding tool written in Kotlin, demonstrating modern language features for security-focused payload development.

Kotlin Security Version License

๐ŸŽฏ Overview

NullSec ByteForge builds binary payloads with encoding, bad character avoidance, and NOP sled generation. It supports multiple architectures and output formats for security research and exploit development education.

โœจ Features

  • Multi-Architecture - x86, x64, ARM, ARM64, MIPS support
  • Multiple Encodings - XOR, Base64, AES, custom encoders
  • Bad Character Avoidance - Detect and warn about null bytes
  • NOP Sled Generation - Configurable architecture-specific NOPs
  • Entropy Analysis - Measure payload randomness
  • Iterative Encoding - Multi-layer encoding support

๐Ÿ” Supported Configurations

ArchitectureFormatEncodingNOP
x86RAWNone0x90
x64ELFXOR0x90
ARMPEBase640x00
ARM64MACHOAES0x00
MIPSSHELLCODECustom0x00

๐Ÿ“ฆ Installation

# Clone the repository
git clone https://github.com/bad-antics/nullsec-byteforge
cd nullsec-byteforge

# Compile with Kotlin compiler
kotlinc ByteForge.kt -include-runtime -d byteforge.jar

# Run
java -jar byteforge.jar

# Or use Kotlin script mode
kotlin ByteForge.kt

๐Ÿš€ Usage

# Build payload from template
java -jar byteforge.jar exec_calc

# Specify architecture and encoding
java -jar byteforge.jar -a x64 -e xor template

# Add NOP sled
java -jar byteforge.jar -n 32 payload.bin

# Avoid bad characters
java -jar byteforge.jar -b "00,0a,0d" shell

# Multiple encoding iterations
java -jar byteforge.jar -e xor -i 3 payload

# List templates
java -jar byteforge.jar -l

# Run demo
java -jar byteforge.jar

๐Ÿ’ป Example Output

โ•”โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•—
โ•‘            NullSec ByteForge - Binary Payload Builder            โ•‘
โ•šโ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•

[Demo Mode]

Building sample payloads...

  [1] exec_calc

  Payload Built:
    Architecture: X86
    Format:       SHELLCODE
    Encoding:     None
    NOP Sled:     16 bytes
    Iterations:   1

  Result:
    Raw Size:     29 bytes
    Final Size:   45 bytes
    Entropy:      3.7842 bits/byte

  Preview (first 32 bytes):
    Hex:    9090909090909090909090909090909031c05068636
    Bytes:  \x90\x90\x90\x90\x90\x90\x90\x90...

  [2] reverse_shell

  Payload Built:
    Architecture: X64
    Format:       SHELLCODE
    Encoding:     XOR
    NOP Sled:     0 bytes
    Iterations:   1

  Result:
    Raw Size:     29 bytes
    Final Size:   29 bytes
    Entropy:      4.2156 bits/byte

  Warnings:
    โš  Bad characters found: [0x00]

โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•

  Summary:
    Payloads Built: 3
    Total Size:     118 bytes
    Avg Entropy:    3.9542 bits/byte
    With Warnings: 1

๐Ÿ—๏ธ Architecture

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                  Template/Input Selection                    โ”‚
โ”‚            Built-in Templates | Custom Input                โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                           โ”‚
                           โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                    PayloadBuilder                            โ”‚
โ”‚         setBytes() โ†’ addNopSled() โ†’ checkBadChars()         โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                           โ”‚
                           โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                      Encoder                                 โ”‚
โ”‚              XOR | Base64 | AES | Custom                    โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                           โ”‚
                           โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                   BuiltPayload                               โ”‚
โ”‚       Raw + Encoded Bytes | Size | Entropy | Warnings       โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

๐ŸŽฏ Kotlin Features Demonstrated

  • Data Classes - ShellcodeTemplate, PayloadConfig, BuiltPayload
  • Sealed Classes - Encoding hierarchy with subtypes
  • Extension Functions - toHex(), xorEncode(), calculateEntropy()
  • Null Safety - Safe handling with ? and ?:
  • When Expressions - Exhaustive pattern matching
  • Object Declarations - Color singleton
  • Collection Operations - map, filter, sumOf, groupingBy
  • Builder Pattern - Fluent PayloadBuilder API

๐Ÿ”ง Data Classes

data class PayloadConfig(
    val arch: Architecture,
    val format: PayloadFormat,
    val encoding: Encoding,
    val badChars: Set<Byte> = emptySet(),
    val nopSled: Int = 0,
    val iterations: Int = 1
)

data class BuiltPayload(
    val config: PayloadConfig,
    val rawBytes: ByteArray,
    val encodedBytes: ByteArray,
    val size: Int,
    val entropy: Double,
    val warnings: List<String>
)

๐Ÿ“ฆ Built-in Templates

NameArchDescription
exec_calcx86Execute calc.exe (demo)
reverse_shellx64Reverse TCP shell (demo)
bind_shellx64Bind shell port 4444 (demo)

๐Ÿ›ก๏ธ Security Use Cases

  • Exploit Development - Build and test payloads
  • CTF Challenges - Quick payload generation
  • Security Training - Understand shellcode concepts
  • AV Research - Encoding technique analysis
  • Red Team Tools - Payload customization

This tool is intended for:

  • โœ… Authorized penetration testing
  • โœ… Security research and education
  • โœ… CTF competitions
  • โœ… Controlled lab environments

Never use payloads against systems without explicit authorization.

๐Ÿ“„ License

MIT License - See LICENSE file for details.

๐Ÿท๏ธ Version History

  • v1.0.0 - Initial release with payload building and encoding

Part of the NullSec Security Toolkit