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

 

 


Tema destacado: ¿Eres nuevo? ¿Tienes dudas acerca del funcionamiento de la comunidad? Lee las Reglas Generales


  Mostrar Mensajes
Páginas: [1]
1  Programación / Scripting / [BAT] Generar txt registro simplificado en: 25 Abril 2017, 19:52 pm
Hola amigos,
Tengo el siguiente archivo de registro (log-web):

2017.04.24-16:52:42 <10.10.10.1>: web-proxy,debug logaccount:     GET http://www.msftncsi.com/ncsi.txt HTTP/1.1
2017.04.24-16:52:42 <10.10.10.1>: web-proxy,debug logaccount:     User-Agent: Microsoft NCSI
2017.04.24-16:52:42 <10.10.10.1>: web-proxy,debug logaccount:     Host: www.msftncsi.com
2017.04.24-16:52:42 <10.10.10.1>: web-proxy,debug logaccount:     X-Proxy-ID: 1806486836
2017.04.24-16:52:42 <10.10.10.1>: web-proxy,debug logaccount:     X-Forwarded-For: 192.168.13.221
2017.04.24-16:52:42 <10.10.10.1>: web-proxy,debug logaccount:     Via: 1.1 192.168.0.1 (Mikrotik HttpProxy)
2017.04.24-16:52:42 <10.10.10.1>: web-proxy,debug logaccount:


Debe ser configurado de forma txt (newlog.txt):
GET http://www.msftncsi.com/ncsi.txt
192.168.13.221
2017.04.24-16:52:42

Pero (newlog.txt):
GET http://www.msftncsi.com/ncsi.txt  192.168.13.221 2017.04.24-16:52:42

Traté de hacer algo
Código
  1.  @Echo OFF & SetLocal EnableDelayedExpansion & Title by Elektro
  2.  
  3.    Set /A "flag=0"
  4.  
  5.    For /F "UseBackQ Tokens=* Delims=" %%a In (
  6.        "C:\Documents and Settings\Unifi\Desktop\Syslog25042017.txt"
  7.    ) Do (
  8.        (Echo "%%a" >>teste5.txt | Find.exe /I "logaccount:     GET")1>Nul && (Set /A "flag=0")
  9.        (Echo "%%a" >>teste5.txt | Find.exe /I "logaccount:     Host:")1>Nul && (Set /A "flag=1")
  10.        (Echo "%%a" >>teste5.txt | Find.exe /I "logaccount:     X-Forwarded-For:")1>Nul && (Set /A "flag=2")
  11.  
  12.        If !flag! EQU 0 (Url: %%a)
  13.        If !flag! EQU 1 (Host  : %%a)
  14.        If !flag! EQU 2 (IP     : %%a)
  15.  
  16.    )
  17.  
  18.    Pause&Exit /B 0

¿Alguien me ayuda?
Gracias por todo  ;D
2  Programación / Scripting / ayudar con lotes en: 8 Junio 2015, 20:17 pm
Hola, buenas tardes...
Necesito ayuda con un script...
Tengo 2 txts

SENHA.txt
12322111,0990
32322121,3994
62322191,5997
72322181,1998
formado por CPF y contraseña

Users.txt
Citar
"array('12322111','0990',' 'fsdfsdfsdfsdfsdfsdfsdfsdfsdfsdf')
"array('32322121','3994',' 'rrtyrutytyutyututyutyututyutyut')
"array('62322191','3994',' 'sfrgthtyutyututyuyeefsdffgfgdg')
"array('72322181','0000',' 'cvxcvxcvxcvxcvxcvxcvxcvxcvx')

que tenga que buscar la CPF y contraseña en arquvio SENHA.txt
localizar el otro aquivo la CPF y si la contraseña es diferente que el par de torsión al mismo que el archivo SENHA.txt

Hice algo como esto:

Código
  1. @echo off
  2. set "fileA=Users.txt"
  3. set "filmeB=Senhas.txt"
  4. for /F "Tokens=1,* Delims=," %%a In ('Type "%fileA" ^| Sort') Do (
  5. Call :InnerLoop
  6. )
  7.  
  8. Pause&Exit /B 0
  9.  
  10. :InnerLoop
  11. for /F "Tokens=1,* Delims=," %%a In ('Type "%fileB" ^| Sort') Do (
  12.    If "%%~a" EQU "%%~A" (
  13.    echo %%~a,%%~b,%%~B >> roda1.txt
  14.    Exit /B 0 :: Break.
  15.   )
  16. )

Mod: los códigos deben ir en etiquetas GeSHi
3  Programación / Scripting / Re: Ayuda con FOR en: 12 Mayo 2015, 17:38 pm
lo siento, pero no duplica los datos
cometido un error de mecanografía

Tengo un txt con a1.txt
1212,6777
1342,6767
3453,3456
3451,4743

Tengo otro con txt a2.txt
1342,BBBB
3453,DDDD
3451,CCCC
1212,AAAA

Quiero que buscan lotes 2 archivos y de impresión
result.txt
1212,6777,AAAA
1342,6767,BBBB
3453,3456,DDDD
3451,4743,CCCC



muchas gracias
Te debo una cerveza

[MOD]: Porfavor, no hagas doble post, está prohibido.
4  Programación / Scripting / Ayuda con FOR en: 12 Mayo 2015, 17:05 pm
Hola tengo una pregunta que alguien me ayude

Tengo un txt con a1.txt
1212,6777
1342,6767
3453,3456
3453,4743

Tengo otro con txt a2.txt
1342,BBBB
3453,DDDD
3453,CCCC
1212,AAAA

Quiero que buscan lotes 2 archivos y de impresión
result.txt
1212,6777,AAAA
1342,6767,BBBB
3453,3456,CCCC
3453,4743,DDDD

Vine a este, pero no funciona, alguien me ayude

Código:
FOR /F "tokens=1,2,3,4,5,6,7,8 delims=," %%A IN (A1.txt) DO  find /i "%%A" A2.TXT %%D,%%B,%%A >> result.txt
Páginas: [1]
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines