colloide

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit 73fefb1146a2b419bfb671be49b3252ae4d0e0b3
parent 71de4eb1ff30acd0b0a7cde76cadad8dd3653e20
Author: MichaelDim02 <31562759+MichaelDim02@users.noreply.github.com>
Date:   Sun, 12 Nov 2017 21:40:22 +0000

Colloide v0.6

Info on Releases;
Diffstat:
Mcolloide.py | 121++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-----------------
1 file changed, 95 insertions(+), 26 deletions(-)

diff --git a/colloide.py b/colloide.py @@ -1,11 +1,25 @@ -# Colloide v0.5 +# Colloide v0.6 # Thessaloniki, GREECE 2017 - greekhacking.gr # Michael Constantine Dimopoulos # GNU General Public Lisence -# Pronounced: Kow Lowd +# Pronounced: Kow Lawd +# In this version (0.6): +# Minor bugs fixed +# Option to save the pages into a txt page added +# Added some comments to help contributors read the code +# Added a function that checks whether the URL is valid or not +# https://github.com/MichaelDim02/colloide +# Report bugs: anivsante2@gmail.com +# or /issues if you use github +# # # # # # # # # # # # # # # # # # + +#CODE: + +from __future__ import print_function #because some print functions print quotation marks and commas import sys import argparse import os +import socket from urllib2 import Request, urlopen, URLError, HTTPError def banner(): #banner with logo - patorjk.com @@ -15,16 +29,19 @@ def banner(): #banner with logo - patorjk.com print("\ \___( <_> ) |_| |_( <_> ) / /_/ \ ___/") print(" \______ /\____/|____/____/\____/|__\____ |\___ >") print(" \/ \/ \/ ") - print("Colloide v 0.5") - print("Michael C. Dimopoulos 2017\n\n") + print("Colloide v 0.6") + print("Michael C. Dimopoulos 2017") + print("www.greekhacking.gr\n\n") def opts(): print(" -h --help Display the help panel (Shown right now)") - print(" -u, --URL The URL to the website") - print(" -p, --pages Path to the wordlist with the page names / links") - print(" -l, --legals License & legal disclaimer\n\n") + print(" -u --URL The URL to the website") + print(" -p --pages Path to the wordlist with the page names / links") + print(" -l --legals License & legal disclaimer") + print(" -s --save Save pages on a text file (name of the file will be asked lat)") + print(" -L --limit Add limit to the pages (Integer)\n\n") def legals(): #License - print("Colloide version 0.5 is free software. It can be re-distributed ") + print("Colloide version 0.6 is free software. It can be re-distributed ") print("and / or modified under the terms of the GNU General Public License") print("as published by the Free Software Foundation; For more information") print("read the GNU General Public License that comes") @@ -59,37 +76,82 @@ def check_names(infile): #Checking the path to the wordlist else: #in case wordlist cant be found banner() opts() - print("Invalid path to the wordlis. File could not be found.") + print("[-] Invalid path to the wordlis. File could not be found.\n") def findAdmin(): - f = open(links,"r"); + if txt: + #print("Please type the name of the text file to save the pages to.") + #print("example: pages.txt") COMMENTED CODE + #tfilename = raw_input(">> ") WONT BE USED - YOU CAN REMOVE IT + tfilename = txt + f = open(str(tfilename) ,'w+') + f.write("Colloide v0.6\n") + f.write("Michel Constantine Dimopoulos\n") + f.write("Thessaloniki, Greece 2017\n") + f.write("greekhacking.gr\n") + print("\n") print("[!] Report bugs: anivsante2@gmail.com \n") #OR https://github.com/MichaelDim02/colloide.py/issues - while True: - sub_link = f.readline() #Page name - if not sub_link: - break - link = URL #website name - req_link = "http://"+link+"/"+sub_link #Final link for attempt - req = Request(req_link) + print("[!] Press Ctrl + C to terminate the process.\n") + try: + IP = socket.gethostbyname(URL) + print("[!] Attacking host: ", IP, " - ", URL, "\n") + if txt: + f.write("Attacking:\n") + f.write("\n") + f.write(str(URL)) + f.write("\n") + f.write(str(IP)) + f.write("\n") + except socket.gaierror: + print("[!] Invalid URL address. Connection could not be established;\n") + sys.exit(0) + fi = open(links,"r"); + attempts = 0 + while (attempts <= int(limit)): try: - response = urlopen(req) + sub_link = fi.readline() #Page name + if not sub_link: + break + link = URL #website name + req_link = "http://"+link+"/"+sub_link #Final link for attempt + req = Request(req_link) #identifies links that show up HTTP error - except HTTPError as e: - continue - except URLError as e: - continue - else: #prints working link - print "[+] Link Found -> " + req_link - + try: + response = urlopen(req) + except HTTPError as e: + continue + except URLError as e: + continue + else: #prints working link + print("[+] Link Found -> " + req_link) + if txt: + f = open(str(tfilename) ,'a') + f.write(req_link + "\n") + else: + pass + except KeyboardInterrupt: + print("\n[!] Process has been terminated - Ctrl + C has been pressed.\n") + print("All working pages have been saved at: ", tfilename, "\n") + sys.exit(0) + attempts = attempts + 1 + if attempts > int(limit): + print("[!] Process has been terminated due to the limitation that has been set\n") + print("All working pages have been saved at: ", tfilename, "\n") #Argument parsing parser = argparse.ArgumentParser() parser.add_argument("-u", "--URL", help="The URL to the website") parser.add_argument("-p", "--pages", help="Path to the wordlist with the page names / links") parser.add_argument("-l", "--legals", action='store_true', help="License & legal disclaimer") +parser.add_argument("-s", "--save", help="Save all working pages on a text file") +parser.add_argument("-L", "--limit", help="Add limit to the pages. Integer", default="10") +#Declaring Argument Variables args = parser.parse_args() links = args.pages URL = args.URL +txt = args.save +limit = args.limit + if args.URL and args.pages: check_names(links) elif args.legals: @@ -98,4 +160,11 @@ elif args.legals: else: banner() opts() - print("Usage: python colloide.py -u [URL] -p [WORDLIST]") +print("Usage: python colloide.py -u [URL] -p [WORDLIST]") + +#Can be modified +#Can be distributed commercially +#Can be distributed non-commercially +#Under the terms of the GNU general public license (2007) +#Michael Constantine Dimopoulos +#https://github.com/MichaelDim02/colloide