Skip to content

Commit

Permalink
Merge pull request #108 from DedSecInside/changelog
Browse files Browse the repository at this point in the history
Adding get_args
  • Loading branch information
PSNAppz authored Aug 4, 2018
2 parents 68eb9a2 + bab571b commit 075eea5
Showing 1 changed file with 46 additions and 8 deletions.
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

0 comments on commit 075eea5

Please sign in to comment.