[Función] ExisteEnLaWeB

Iniciado por k0ws, Abril 16, 2013, 07:31:00 PM

Tema anterior - Siguiente tema

0 Miembros y 1 Visitante están viendo este tema.

Abril 16, 2013, 07:31:00 PM Ultima modificación: Abril 16, 2013, 07:35:22 PM por k0ws
Bueno, hacia algo de tiempo que no codeaba y me decidi a traer esta pequeña funcion:

Código: python
'''
Coder: k0ws | If you use this code or part of it, please, credit ;)
'''

import httplib, sys
def buscaArchivoWeb():
try:
  if (sys.argv[1] == "-h"):
   print '\nUse: py_filename.py -w www.host.com -f http://www.host.com/remote_file.ext';
   return;
  else:
   sHost = sys.argv[2];
   sFile = sys.argv[4];
   sCon = httplib.HTTPConnection(sHost);
   sCon.request("GET",sFile);
   sRes = sCon.getresponse().status;
   print '\nWeb: ' + sys.argv[2];
   print 'Remote File: ' + sys.argv[4];
   print 'Remote File Status: ' + str(sRes);
   if sRes == 200:
    print 'Remote Response: The file exist :D';
   else:
    print 'Remote Response: The file doesnt exist!';
except:
print '\nError: I need at least two parameters for working | Remember, the file needs the http:// header for working, the host can be definite like www.server...';

buscaArchivoWeb();




Con esta pequeña funcion se podria hacer un Admin Panel Finder en cuestion de minutos  8)

-Saludos-


Hola, buen día.

Podrías hacerlo más sencillo con urllib o urllib2 y solo usar getcode(), si es el status code es 200, existe.

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

@JaAViEr No se me había ocurrido, me lo apunto.  ;)

-Saludos-

No tienes permitido ver los links. Registrarse o Entrar a mi cuenta
@JaAViEr No se me había ocurrido, me lo apunto.  ;)

-Saludos-
Va a estar buena la V2 ;)
No tienes permitido ver los links. Registrarse o Entrar a mi cuenta

se agradece, pero le soy fiel al DirBuster  :'(