GithubHelp home page GithubHelp logo

polygo's Introduction

Polygo

Polymorphic Linux x86 shellcode engine

Introduction

Polygo is polymorphic shellcode engine made in Go.

💡 Features

  • Polymorphism
  • No NULL bytes
  • Shellcode x86
  • Cross-plateform engine
  • Multiple obfuscation methods
  • Multi-layer encapsulation
  • Crazy mode

Functionning

🌑 Obfuscation methods

Polygo uses predefined assembly stubs (decoders) for each obfuscation method (ADD, SUB, XOR, SWAP).

  • ADD

Engine substracts a random byte to each shellcode's byte. At runtime, decoder adds the same byte to retrieve original shellcode and pass execution to it.

  • SUB

Engine adds a random byte to each shellcode's byte. At runtime, decoder substracts the same byte to retrieve original shellcode and pass execution to it.

  • XOR

Engine xors each shellcode's byte using a random byte. At runtime, decoder xors it again to retrieve original shellcode and pass execution to it.

  • SWAP

Engine swaps byte pairs in-place across the entire shellcode. If the number of bytes is odd, the engine adds a NOP byte at the end. At runtime, decoded swaps them back and pass execution to the shellcode.

Multi-layer encapsulation

Polygo is capable of chaining multiple obfuscation methods. For example you can decide to chain SUB, XOR and ADD. In this case, shellcode will first be obfuscated using ADD method, then the new generated shellcode will obfuscated using XOR method and at the end this last shellcode will be obfuscated using ADD method producing the final shellcode.

Usage

Compilation

go build polygo.go

ℹī¸ Help

Usage of ./polygo:
  -add
        Use add ofuscation
  -brainless uint
        Specify the number of recursive encapsulated obfuscation methods (default: 5)
  -crazy
        Recursively obfuscate the shellcode with all methods
  -f string
        File with the shellcode
  -random
        Use random ofuscation
  -sub
        Use sub ofuscation
  -swap
        Use swap ofuscation
  -xor
        Use xor ofuscation

Example:

./polygo -f shellcode.bin -xor

Options

  • -add/sub/xor/swap : use a single spcified obfuscation method
  • -random : use a single random obfuscation method
  • -crazy : use each method in a random order
  • -brainless N : Number of encapsulations with random methods

⚠ī¸ Be careful with -brainless option's parameter, it might get your shellcode much longer.

Raw shellcode

In order to get a raw shellcode, you first need to compile your ASM file to an object file (.o).

nasm -f elf32 revshell.asm

Then you need to retrieve opcodes from the object file using objdump.

for i in $(objdump -d revshell.o |grep "^ " |cut -f2); do echo -En '\x'$i; done;

Finally, use echo to write shellcode to file as raw bytes.

echo -n -e '<objdump output>' > shellcode.bin

⚠ī¸ You must use single quotes when echoing shellcode to file.

Made with â™Ĩ by Leco & Atsika

polygo's People

Contributors

atsika avatar l-e-c-o avatar

Stargazers

 avatar

Watchers

Felix-Pichard 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.