123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126 |
- #!/usr/bin/env python2.7
- # -*- encoding: utf-8 -*-
- #
- # author: mrxrobot
- # contact: IRC -> Freenode -> #vivaolinux
- #
- """
- This is free and unencumbered software released into the public domain.
- Anyone is free to copy, modify, publish, use, compile, sell, or
- distribute this software, either in source code form or as a compiled
- binary, for any purpose, commercial or non-commercial, and by any
- means.
- In jurisdictions that recognize copyright laws, the author or authors
- of this software dedicate any and all copyright interest in the
- software to the public domain. We make this dedication for the benefit
- of the public at large and to the detriment of our heirs and
- successors. We intend this dedication to be an overt act of
- relinquishment in perpetuity of all present and future rights to this
- software under copyright law.
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
- IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
- OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- OTHER DEALINGS IN THE SOFTWARE.
- For more information, please refer to <http://unlicense.org/>
- """
- import socket
- import sys
- from re import search
- class Connect:
- def __init__(self, ip, port, wordlist):
-
- self.ip = str(ip)
- self.port = int(port)
- self.wordlist = open(str(wordlist)).readlines()
- self.p = ""
- self.d = ""
-
- def Sock(self):
- self.s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
- self.s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
- self.s.connect((self.ip, self.port))
- def Send_all(self):
-
- for line in self.wordlist:
- self.Sock()
- self.s.send("GET /{s}{p} HTTP/1.0\n\n".format(s=line.strip("\r\n"), p=self.p))
- self.resp = self.s.recv(1024)
- if search("200 OK", self.resp):
- self.code = self.resp.split(' ')[1]
- print("[+] [{c}] http://{ip}:{port}/{s}{d}".format(ip=self.ip, port=self.port, s=line.strip("\r\n"), c=self.code, d=self.d))
- def Show_arch(self):
- print("=> Archives <" + 100 * "=")
- self.p = ""
- self.d = ""
- self.Send_all()
- def Show_file(self):
- print("=> Files <"+ 100 * "=")
- self.p = "/"
- self.d = "/"
- self.Send_all()
-
- if len(sys.argv) < 4:
- print("Usage: pyhton %s ip port wordlist_file.txt" %sys.argv[0])
- sys.exit(0)
-
- a = Connect(ip=sys.argv[1], port=sys.argv[2], wordlist=sys.argv[3])
- a.Show_arch()
- a.Show_file()
- """
- The software works by analyzing the HTTP response codes
- If a resource that is requested to the Servirdor exists, the HTTP response will return a code 200
- Example usage:
-
- python enum.py 127.0.0.1 80 /home/seu_usuario/wordlist.txt
-
- exemple of wordlist:
- adm.txt
- robots.txt
- enum.py
- update.apk
- index.html
- manual
- htdig
- license
- wp-admin
- wp-login
- admin
- exemple:
- out:
- => Archives <====================================================================================================
- [+] [200] http://127.0.0.1:80/update.apk
- [+] [200] http://127.0.0.1:80/index.html
- [+] [200] http://127.0.0.1:80/robots.txt
- => Files <====================================================================================================
- [+] [200] http://127.0.0.1:80/manual/
- [+] [200] http://127.0.0.1:80/htdig/
- [+] [200] http://127.0.0.1:80/wp-admin/
- [+] [200] http://127.0.0.1:80/admin/
- """
|