elhacker.net cabecera Bienvenido(a), Visitante. Por favor Ingresar o Registrarse
¿Perdiste tu email de activación?.

 

 


Tema destacado: Como proteger una cartera - billetera de Bitcoin


  Mostrar Mensajes
Páginas: [1]
1  Programación / Programación Visual Basic / Re: [SC] Simple Local Shell en: 8 Enero 2012, 17:57 pm
valla ya veo el error  :-X  :rolleyes: jaja, lo tendre en cuenta futuros proyectos  ;)

Gracias x tomarte el time para reescribirle  >:D

Saludos  ;D
2  Programación / Programación Visual Basic / Re: [SC] Simple Local Shell en: 7 Enero 2012, 21:52 pm
men, pk dices que anda mal estructurado?
3  Programación / Programación Visual Basic / Re: [SC] Simple Local Shell en: 7 Enero 2012, 20:07 pm
vale, pero esos son handles a una socket, pero a nivel local que alternativa hay a un Pipe?

Saludos :D
4  Programación / Programación Visual Basic / Re: [SC] Simple Local Shell en: 7 Enero 2012, 18:00 pm
Mal estructurado e indentado :rolleyes:
Código:
http://foro.elhacker.net/programacion_visual_basic/ayuda_con_cmd_pipe_vb6-t277687.0.html;msg1367077#msg1367077
http://www.ngssoftware.com/research/papers/WritingSmallShellcode.pdf
Este es un buen ejemplo de como redirigir el flujo de datos entre un proceso (cmd) y el socket :)

yeah, ley tus codes sobre la shell remota, pero la quise hacer local :rolleyes:

Saludos  ;D
5  Programación / Programación Visual Basic / [SC] Simple Local Shell en: 6 Enero 2012, 20:08 pm
Hola gente!

Pues andaba un poco aburrido ayer y me desidi a crear una shell local, con unas modificaiones podran meterla en un subproseso, una socket, o lo que se les ocurra   :rolleyes:

Les dejo el codigo y un ejemplo de uso

Código
  1. ' ****************************************************************************************************************************** '
  2. '
  3. ' --- Autor: Jhonjhon_123 (Jhon Jairo Pro Developer)
  4. ' --- Versión: 1.0
  5. ' --- Descripción: Shell a nivel local en windows
  6. ' --- Fallos y Mejoras: MSN; j.j.g.p@hotmail.com
  7. ' --- Licencia: GNU General Public License
  8. '
  9. ' ****************************************************************************************************************************** '
  10. Option Explicit
  11.  
  12. Private Declare Function PeekNamedPipe Lib "kernel32" (ByVal hNamedPipe As Long, lpBuffer As Any, ByVal nBufferSize As Long, lpBytesRead As Long, lpTotalBytesAvail As Long, lpBytesLeftThisMessage As Long) As Long
  13. Private Declare Function ReadFile Lib "kernel32" (ByVal hFile As Long, lpBuffer As Any, ByVal nNumberOfBytesToRead As Long, lpNumberOfBytesRead As Long, lpOverlapped As Any) As Long
  14. Private Declare Function WriteFile Lib "kernel32" (ByVal hFile As Long, lpBuffer As Any, ByVal nNumberOfBytesToWrite As Long, lpNumberOfBytesWritten As Long, ByVal lpOverlapped As Long) As Long
  15.  
  16. Private Declare Function CreatePipe Lib "kernel32" (phReadPipe As Long, phWritePipe As Long, lpPipeAttributes As Any, ByVal nSize As Long) As Long
  17. Private Declare Function CreateProcess Lib "kernel32" Alias "CreateProcessA" (ByVal lpApplicationName As String, ByVal lpCommandLine As String, lpProcessAttributes As Any, lpThreadAttributes As Any, ByVal bInheritHandles As Long, ByVal dwCreationFlags As Long, lpEnvironment As Any, ByVal lpCurrentDriectory As String, lpStartupInfo As STARTUPINFO, lpProcessInformation As PROCESS_INFORMATION) As Long
  18. Private Declare Function CloseHandle Lib "kernel32" (ByVal hObject As Long) As Long
  19.  
  20. Private Declare Function TerminateProcess Lib "kernel32" (ByVal hProcess As Long, ByVal uExitCode As Long) As Long
  21.  
  22. Private Declare Function DuplicateHandle Lib "kernel32" (ByVal hSourceProcessHandle As Long, ByVal hSourceHandle As Long, ByVal hTargetProcessHandle As Long, lpTargetHandle As Long, ByVal dwDesiredAccess As Long, ByVal bInheritHandle As Long, ByVal dwOptions As Long) As Long
  23. Private Declare Function GetCurrentProcess Lib "kernel32" () As Long
  24.  
  25. Private Const STARTF_USESTDHANDLES          As Long = &H100
  26. Private Const STARTF_USESHOWWINDOW          As Long = &H1
  27. Private Const DUPLICATE_SAME_ACCESS         As Long = &H2
  28. Private Const NORMAL_PRIORITY_CLASS         As Long = &H20
  29.  
  30.  
  31. Private Type SECURITY_ATTRIBUTES
  32.    nLength                                As Long
  33.    lpSecurityDescriptor                   As Long
  34.    bInheritHandle                         As Long
  35. End Type
  36.  
  37. Private Type STARTUPINFO
  38.    cb                                     As Long
  39.    lpReserved                             As String
  40.    lpDesktop                              As String
  41.    lpTitle                                As String
  42.    dwX                                    As Long
  43.    dwY                                    As Long
  44.    dwXSize                                As Long
  45.    dwYSize                                As Long
  46.    dwXCountChars                          As Long
  47.    dwYCountChars                          As Long
  48.    dwFillAttribute                        As Long
  49.    dwFlags                                As Long
  50.    wShowWindow                            As Integer
  51.    cbReserved2                            As Integer
  52.    lpReserved2                            As Long
  53.    hStdInput                              As Long
  54.    hStdOutput                             As Long
  55.    hStdError                              As Long
  56. End Type
  57.  
  58. Private Type PROCESS_INFORMATION
  59.    hProcess                               As Long
  60.    hThread                                As Long
  61.    dwProcessID                            As Long
  62.    dwThreadId                             As Long
  63. End Type
  64.  
  65. Dim lHInput As Long
  66. Dim lHOutput As Long
  67. Dim lCmdID As Long
  68.  
  69. Public Sub StopShell()
  70.  
  71. If lHInput > 0 Then Call CloseHandle(lHInput)
  72.  
  73. If lHOutput > 0 Then Call CloseHandle(lHOutput)
  74.  
  75. If lCmdID > 0 Then Call TerminateProcess(lCmdID, ByVal 0&): Call CloseHandle(lCmdID)
  76.  
  77. End Sub
  78.  
  79. Public Function GetOutTextShell(sOut As String) As Boolean
  80. Dim bBuffer() As Byte
  81. Dim lLen As Long
  82. Dim bRes As Boolean
  83. Dim lLenBuff As Long
  84.  
  85. bRes = CBool(PeekNamedPipe(lHOutput, 0&, 0&, 0&, lLen, 0&))
  86.  
  87. If Not bRes Then Exit Function
  88.  
  89. If lLen <= 0 Then Exit Function
  90.  
  91. ReDim bBuffer(lLen)
  92.  
  93. If ReadFile(lHOutput, bBuffer(0), lLen, lLenBuff, ByVal 0&) = 0 Then Exit Function
  94.  
  95. sOut = Left(StrConv(bBuffer, vbUnicode), lLenBuff)
  96.  
  97. GetOutTextShell = True
  98.  
  99. End Function
  100.  
  101. Public Sub SendToShell(sCMD As String)
  102. Dim sBytes() As Byte
  103. Dim BytesWritten As Long
  104.  
  105. If lHInput = 0 Then Exit Sub
  106. sCMD = sCMD & vbNewLine
  107. sBytes = StrConv(sCMD, vbFromUnicode)
  108.  
  109. If WriteFile(lHInput, ByVal sCMD, Len(sCMD), BytesWritten, 0&) = 0 Then
  110.    Exit Sub
  111. End If
  112.  
  113. End Sub
  114.  
  115. Public Function StartShell() As Boolean
  116. On Error GoTo Error
  117.  
  118. Dim tSecurityAttributes As SECURITY_ATTRIBUTES
  119. Dim tStartInfo          As STARTUPINFO
  120. Dim tProcessInfo        As PROCESS_INFORMATION
  121. Dim lCurrentID          As Long
  122.  
  123. lCurrentID = GetCurrentProcess()
  124.  
  125. With tStartInfo
  126.    .cb = Len(tStartInfo)
  127.    .dwFlags = STARTF_USESTDHANDLES Or STARTF_USESHOWWINDOW
  128. End With
  129.  
  130. With tSecurityAttributes
  131.    .nLength = Len(tSecurityAttributes)
  132.    .bInheritHandle = 1
  133. End With
  134.  
  135. If CreatePipe(lHOutput, tStartInfo.hStdOutput, tSecurityAttributes, 0) = 0 Then
  136.    GoTo Error
  137. End If
  138.  
  139. If CreatePipe(tStartInfo.hStdInput, lHInput, tSecurityAttributes, 0) = 0 Then
  140.    GoTo Error
  141. End If
  142.  
  143. If DuplicateHandle(lCurrentID, tStartInfo.hStdOutput, lCurrentID, tStartInfo.hStdError, 0&, True, DUPLICATE_SAME_ACCESS) = 0 Then
  144.    GoTo Error
  145. End If
  146.  
  147. If CreateProcess(vbNullString, "cmd", tSecurityAttributes, tSecurityAttributes, 1, NORMAL_PRIORITY_CLASS, ByVal 0&, vbNullString, tStartInfo, tProcessInfo) = 0 Then
  148.    GoTo Error
  149. End If
  150.  
  151. With tProcessInfo
  152.    Call CloseHandle(.hThread)
  153.  
  154.    lCmdID = .hProcess
  155.  
  156.    If .dwProcessID > 0 And .hProcess > 0 Then
  157.        StartShell = True
  158.    Else
  159.        GoTo Error
  160.    End If
  161. End With
  162.  
  163. Exit Function
  164. Error:
  165. Call StopShell
  166. StartShell = False
  167.  
  168. End Function
  169.  

Descarga Ejemplo: http://www.multiupload.com/1NVDU8LZSP

Saludos ::)
6  Programación / Programación Visual Basic / Re: [SRC] Todo mi soft en VB (Malware) by HaX991 en: 9 Febrero 2011, 18:51 pm
Casi que no los sacas a la luz  ;D XDD

Buenos codes! :o

Saludos!
Páginas: [1]
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines