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

 

 


Tema destacado: Recopilación Tutoriales y Manuales Hacking, Seguridad, Privacidad, Hardware, etc


+  Foro de elhacker.net
|-+  Programación
| |-+  Scripting
| | |-+  LockUrl 5.1
0 Usuarios y 1 Visitante están viendo este tema.
Páginas: [1] Ir Abajo Respuesta Imprimir
Autor Tema: LockUrl 5.1  (Leído 2,060 veces)
carlitos.dll

Desconectado Desconectado

Mensajes: 266



Ver Perfil
LockUrl 5.1
« en: 5 Septiembre 2008, 19:42 pm »

Publico este script ultra-mejorado.

Código
  1.  
  2. ::Lock Url 5.1
  3. ::by Carlos
  4. ::Accepts parameter by the name of a text file with a list of urls
  5.  
  6. @echo off
  7.  
  8. set FILE=%SystemRoot%\system32\drivers\etc\hosts
  9. set IP=0.0.0.0
  10. set argfile=%~1
  11. set findstr="%WinDir%\system32\findstr.exe"
  12. set find="%WinDir%\system32\find.exe"
  13.  
  14. :start
  15. call :logo
  16. call :mode
  17.  
  18. :lock
  19. call :logo
  20. set option=
  21. echo Options:
  22. echo - 1 Add url
  23. echo - 2 Del url
  24. echo - 3 Show urls
  25. set /p option=Enter option:
  26. if not defined option (goto lock)
  27. if ["%option%"]==["1"] (goto add)
  28. if ["%option%"]==["2"] (goto del)
  29. if ["%option%"]==["3"] (goto show)
  30. if ["%option%"]==["4"] (goto exit)
  31. goto lock
  32. set option | %find% """" >NUL 2>&1 && goto lock
  33. set option | %find% " " >NUL 2>&1 && goto lock
  34. set option | %findstr% "| & ^ > < # $ ' ` . ; , / \  + - ~ ! ) ( ] [ } { : style="color: #b100b1; font-weight: bold;">? *" >NUL 2>&1 && goto lock
  35. echo %option% | find "=" >NUL 2>&1 && goto lock
  36. if not [{carlitos.dll}]==[{%option%}] (echo off) 2>NUL
  37. if "%errorlevel%"=="9009" (goto lock)
  38. goto lock
  39.  
  40. :show
  41. type "%FILE%" | %findstr% /b /v "#" | sort | more
  42. goto lock
  43. goto:eof
  44.  
  45. set delurl=
  46. set /p delurl="Enter Url to del: "
  47. if not defined delurl (goto del)
  48. set delurl | %find% """" >NUL 2>&1 && goto del
  49. set delurl | %find% " " >NUL 2>&1 && goto del
  50. set delurl | %findstr% "| & ^ > < # $ ' ` ; , \  + ~ ! ) ( ] [ } { ? *" >NUL 2>&1 && goto del
  51. echo %delurl% | find "=" >NUL 2>&1 && goto del
  52. if not [{carlitos.dll}]==[{%delurl%}] (echo off) 2>NUL
  53. if "%errorlevel%"=="9009" (goto del)
  54. goto yesoryes
  55.  
  56. :yesoryes
  57. echo You joined address to del: %delurl%
  58. set confirm=
  59. set /p confirm="Is that correct? [y/n/cancel]: "
  60. if not defined confirm (goto yesoryes)
  61. set confirm | %find% """" >NUL 2>&1 && goto yesoryes
  62. set confirm | %find% " " >NUL 2>&1 && goto yesoryes
  63. set confirm | %findstr% "| & ^ > < # $ ' ` . ; , / \  + - ~ ! ) ( ] [ } { : style="color: #b100b1; font-weight: bold;">? *" >NUL 2>&1 && goto yesoryes
  64. echo %confirm% | find "=" >NUL 2>&1 && goto yesoryes
  65. if not [{carlitos.dll}]==[{%confirm%}] (echo off) 2>NUL
  66. if "%errorlevel%"=="9009" (goto yesoryes)
  67. if /i "%confirm%"=="y" (goto find)
  68. if /i "%confirm%"=="n" (goto del)
  69. if /i "%confirm%"=="cancel" (goto lock)
  70. goto yesoryes
  71.  
  72. :find
  73. type "%FILE%" | %findstr% /i "%delurl%$" >nul && (
  74. cd.>"%FILE%.bak" ||goto message
  75. type "%FILE%" | %findstr% /i /v "%delurl%$">"%FILE%.bak"
  76. del/f/q/a "%FILE%" >nul ||goto message
  77. ren "%FILE%.bak" "hosts" >nul ||goto message
  78. echo The url has been deleted.
  79. ) || (echo The url not found.)
  80. goto lock
  81.  
  82. :add
  83. set url=
  84. set /p url="Enter Url to add: "
  85. if not defined url (goto add)
  86. set url | %find% """" >NUL 2>&1 && goto add
  87. set url | %find% " " >NUL 2>&1 && goto add
  88. set url | %findstr% "| & ^ > < # $ ' ` ; , \  + ~ ! ) ( ] [ } { ? *" >NUL 2>&1 && goto add
  89. echo %url% | find "=" >NUL 2>&1 && goto add
  90. if not [{carlitos.dll}]==[{%url%}] (echo off) 2>NUL
  91. if "%errorlevel%"=="9009" (goto add)
  92. goto yesorno
  93.  
  94. :yesorno
  95. echo You joined address to add: %url%
  96. set confirm=
  97. set /p confirm="Is that correct? [y/n/cancel]: "
  98. if not defined confirm (goto yesorno)
  99. set confirm | %find% """" >NUL 2>&1 && goto yesorno
  100. set confirm | %find% " " >NUL 2>&1 && goto yesorno
  101. set confirm | %findstr% "| & ^ > < # $ ' ` . ; , / \  + - ~ ! ) ( ] [ } { : style="color: #b100b1; font-weight: bold;">? *" >NUL 2>&1 && goto yesorno
  102. echo %confirm% | find "=" >NUL 2>&1 && goto yesorno
  103. if not [{carlitos.dll}]==[{%confirm%}] (echo off) 2>NUL
  104. if "%errorlevel%"=="9009" (goto yesorno)
  105. if /i "%confirm%"=="y" (goto verify_0)
  106. if /i "%confirm%"=="n" (goto add)
  107. if /i "%confirm%"=="cancel" (goto lock)
  108. goto yesorno
  109.  
  110. :attrib
  111. if not exist "%FILE%" (echo.>>"%FILE%"||goto message)
  112. attrib -r -h -s "%FILE%">NUL||goto message)
  113. goto:eof
  114.  
  115. :mode
  116. if defined argfile (if exist "%argfile%" (goto argmode))
  117. goto lock
  118. goto:eof
  119.  
  120. :argmode
  121. for /f %%a in ('type "%argfile%"') do (set url=%%a&call:verify_1&set url=)
  122.  
  123. :verify_0
  124. if /i "%url:~0,4%"=="www." (goto with0)
  125. goto without0
  126.  
  127. :verify_1
  128. set url | %find% """" >NUL 2>&1 && goto:eof
  129. set url | %find% " " >NUL 2>&1 && goto:eof
  130. set url | %findstr% "| & ^ > < # $ ' ` ; , \  + ~ ! ) ( ] [ } { ? *" >NUL 2>&1 && goto:eof
  131. echo %url% | find "=" >NUL 2>&1 && goto:eof
  132. if not [{carlitos.dll}]==[{%url%}] (echo off) 2>NUL
  133. if "%errorlevel%"=="9009" (goto:eof)
  134. if /i "%url:~0,4%"=="www." (goto with1)
  135. goto without1
  136.  
  137. goto:eof
  138.  
  139. :with0
  140. call :with1
  141. goto again
  142.  
  143. :without0
  144. call :without1
  145. goto again
  146.  
  147. :with1
  148. call :attrib
  149. echo %IP%    %url:~4%>>"%FILE%"||goto message
  150. echo %IP%    www.%url:~4%>>"%FILE%"||goto message
  151. echo The url has been added.
  152. goto:eof
  153.  
  154. :without1
  155. call :attrib
  156. echo %IP%    %url%>>"%FILE%"||goto message
  157. echo %IP%    www.%url%>>"%FILE%"||goto message
  158. echo The url has been added.
  159. goto:eof
  160.  
  161. :again
  162. set again=
  163. set /p again="Add other url? [y/n]"
  164. if /i "%again%"=="y" (goto add)
  165. if /i "%again%"=="n" (goto lock)
  166. goto again
  167.  
  168. :logo
  169. cls
  170. echo \--------------------/
  171. echo \ LockUrl v5.1       /
  172. echo \ by Carlos          /
  173. echo \--------------------/
  174. call:attrib
  175. goto:eof
  176.  
  177. :message
  178. echo You do not have sufficient privileges.
  179.  
  180.  
  181. ::Lock Url 5.1
  182. ::by Carlos
  183.  


En línea

Darioxhcx


Desconectado Desconectado

Mensajes: 2.294


Ver Perfil
Re: LockUrl 5.1
« Respuesta #1 en: 5 Septiembre 2008, 21:47 pm »

esta parte no mas entiendo :P

set option=
echo Options:
echo - 1 Add url
echo - 2 Del url
echo - 3 Show urls
echo - 4 Exit

ajjajaj
nah joda , esta muy bueno aunque no lo mire detenidamente
muy bueno como siempre man
saludos


En línea

Nakp
casi es
Ex-Staff
*
Desconectado Desconectado

Mensajes: 6.336

he vuelto :)


Ver Perfil WWW
Re: LockUrl 5.1
« Respuesta #2 en: 5 Septiembre 2008, 22:03 pm »

hay algo que no hace bien... borrar una url con www

si agrego www.url.ltd agrega tambien url.ltd... pero si borro www.url.ltd no se borra la otra

por lo demás bastante bueno el script

salu2
En línea

Ojo por ojo, y el mundo acabará ciego.
Páginas: [1] Ir Arriba Respuesta Imprimir 

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