Skip to content

Commit 72eb1ca

Browse files
author
Michael Skelton
committed
Removing redundant code
1 parent 90db879 commit 72eb1ca

File tree

2 files changed

+5
-20
lines changed

2 files changed

+5
-20
lines changed

VHostScan.py

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,11 @@
99
def print_banner():
1010
print("+-+-+-+-+-+-+-+-+-+ v. 0.1")
1111
print("|V|H|o|s|t|S|c|a|n| Developed by @codingo_ & @__timk")
12-
print("+-+-+-+-+-+-+-+-+-+ https://github.com/codingo/VHostScan")
12+
print("+-+-+-+-+-+-+-+-+-+ https://github.com/codingo/VHostScan\n")
1313

1414

1515
def main():
16+
print_banner()
1617
parser = ArgumentParser()
1718
parser.add_argument("-t", dest="target_hosts", required=True, help="Set a target range of addresses to target. Ex 10.11.1.1-255" )
1819
parser.add_argument("-w", dest="wordlist", required=False, help="Set the wordlist to use for generated commands. Ex /usr/share/wordlist.txt", default="./wordlists/virtual-host-scanning.txt")
@@ -23,20 +24,7 @@ def main():
2324
parser.add_argument('--unique-depth', dest='unique_depth', type=int, help='Show likely matches of page content that is found x times (default 1).', default=1)
2425
arguments = parser.parse_args()
2526

26-
if len(sys.argv) == 1:
27-
print_banner()
28-
parser.error("No arguments given.")
29-
parser.print_usage
30-
sys.exit()
31-
32-
if arguments.output_directory.endswith('/' or '\\'):
33-
arguments.output_directory = arguments.output_directory[:-1]
34-
if arguments.target_hosts.endswith('/' or '\\'):
35-
arguments.target_hosts = arguments.target_hosts[:-1]
36-
37-
print_banner()
38-
39-
scanner = virtual_host_scanner(arguments.target_hosts, arguments.output_directory, arguments.port, arguments.unique_depth, arguments.ignore_http_codes, arguments.ignore_content_length, arguments.wordlist)
27+
scanner = virtual_host_scanner(arguments.target_hosts, arguments.port, arguments.unique_depth, arguments.ignore_http_codes, arguments.ignore_content_length, arguments.wordlist)
4028
scanner.scan()
4129
print(scanner.likely_matches())
4230

lib/core/virtual_host_scanner.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,9 @@ class virtual_host_scanner(object):
1717
output: folder to write output file to
1818
"""
1919

20-
def __init__(self, target, output, port=80, unique_depth=1, ignore_http_codes='404', ignore_content_length=0,
20+
def __init__(self, target, port=80, unique_depth=1, ignore_http_codes='404', ignore_content_length=0,
2121
wordlist="./wordlists/virtual-host-scanning.txt"):
2222
self.target = target
23-
self.output = output + '/' + target + '_virtualhosts.txt'
2423
self.port = port
2524
self.ignore_http_codes = list(map(int, ignore_http_codes.replace(' ', '').split(',')))
2625
self.ignore_content_length = ignore_content_length
@@ -98,6 +97,4 @@ def likely_matches(self):
9897
d=df.groupby("val_col").filter(lambda x: len(x) <= self.unique_depth)
9998
matches=((d["key_col"].values).tolist())
10099

101-
return matches
102-
103-
def page_difference_ratios
100+
return matches

0 commit comments

Comments
 (0)