Coder Social home page Coder Social logo

shellcodecarver's Introduction

Shellcode Carver Script

This python script is for carving out shellcode into the EAX register in situations when standard encoding methods are not possible due to the bad characters.

Usage Instructions

1. Verify bad characters that cannot be used and add them to the "badChar" list in the Python script

Example:

badChar=[0x00, 0x0a, 0x0d]

2. Define the target values based on shellcode you wish to encode.

How to do this:

A full explanation on the encoding process has been written by Vellosec [1].

The target address is the result of the following equation:

0xFFFFFFFF - [4 byte shellcode] + 1 = Target address

Example using 4 bytes from Matt Miller's Egghunter shellcode (\xe7\xff\xe7\x75):

FFFFFFFF - E7FFE775 + 1 = 1800188B

Add or remove sets as needed depending on your shellcode

3. Find out your current ESP location and the address where you want the decoding to take place

In the location where you will be placing this shellcode, first place the following ASM instructions:

PUSH ESP
POP EAX

Step through the code and note what the ESP address is after the POP EAX instruction. This is the "current ESP address". When running the script, input this value when asked, followed by the value of the address you wish to decode.

4. Modify the genShellcode() function for your shellcode below "Begin actual shellcode encoding:" by calling the encoding functions as needed for your target addresses.

Four different functions:

  • encodeNorm(set#) - Use when no null bytes present in target address
  • encodeNullFirst(set#) - Use when first byte of target is a null byte
  • encodeNullSecond(set#) - Use when second byte of target is a null byte
  • encodeNullThird(set#) - Use when third byte of target is a null byte

References:

shellcodecarver's People

Contributors

keramas avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 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.