Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding get_args #108

Merged
merged 1 commit into from
Aug 4, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 46 additions & 8 deletions torBot.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import socket
import socks
from modules import (bcolors, getemails, pagereader, getweblinks, updater,
info, go_linker, savefile)
info, savefile)

# GLOBAL CONSTS
LOCALHOST = "127.0.0.1"
Expand Down Expand Up @@ -59,7 +59,7 @@ def header():
D3DSEC = b_color.FAIL + " D3DSEC " + b_color.WHITE
INS1DE = b_color.FAIL + " INS1DE " + b_color.WHITE

text_header = r"""
header = r"""
__ ____ ____ __ ______
/ /_/ __ \/ __ \/ /_ ____/_ __/
/ __/ / / / /_/ / __ \/ __ \/ /
Expand All @@ -76,10 +76,48 @@ def header():
BOLD=b_color.BOLD, VERSION=__VERSION, END=b_color.ENDC,
On_Black=b_color.On_Black, WHITE=b_color.WHITE
)
print(text_header)


def main():
print(header)


def get_args():
parser = argparse.ArgumentParser()
parser.add_argument("-v", "--version",
action="store_true",
help="Show current version of TorBot.")
parser.add_argument("--update",
action="store_true",
help="Update TorBot to the latest stable version")
parser.add_argument("-q", "--quiet",
action="store_true")
parser.add_argument("-u", "--url",
help="Specifiy a website link to crawl")
parser.add_argument("--ip", help="Change ip address for tor")
parser.add_argument("-p", "--port",
help="Change port number for tor")
parser.add_argument("-s", "--save",
action="store_true",
help="Save results in a file")
parser.add_argument("-m", "--mail",
action="store_true",
help="Get e-mail addresses from the crawled sites")
parser.add_argument("-e", "--extension",
action='append',
dest='extension',
default=[],
help=' '.join(("Specifiy additional website",
"extensions to the list(.com , .org",
",.etc)")))
parser.add_argument("-l", "--live",
action="store_true",
help="Check if websites are live or not (slow)")
parser.add_argument("-i", "--info",
action="store_true",
help=' '.join(("Info displays basic info of the",
"scanned site, (very slow)")))
return parser.parse_args()


def main(conn=False):
args = get_args()
connect(args.ip, args.port)
link = args.url
Expand Down Expand Up @@ -113,7 +151,7 @@ def main():
print('Nothing to save.\n')
else:
# Golang library isn't being used.
#links = go_linker.GetLinks(link, LOCALHOST, PORT, 15)
# links = go_linker.GetLinks(link, LOCALHOST, PORT, 15)
links = getweblinks.get_links(soup=html_content, ext=args.extension, live=args.live)
if args.save:
savefile.saveJson("Links", links)
Expand All @@ -123,7 +161,7 @@ def main():

print("\n\n")


if __name__ == '__main__':

try:
Expand Down