Skip to content

Commit 7c1417e

Browse files
author
Michael Skelton
committed
File restructure for helpers
1 parent c0361b6 commit 7c1417e

File tree

5 files changed

+12
-24
lines changed

5 files changed

+12
-24
lines changed

VHostScan.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
import sys
55
from argparse import ArgumentParser
66
from lib.core.virtual_host_scanner import *
7-
from lib.outputs.output_normal import *
7+
from lib.helpers.output_helper import *
8+
89

910
def print_banner():
1011
print("+-+-+-+-+-+-+-+-+-+ v. 0.2")
@@ -51,7 +52,7 @@ def main():
5152
print("\n[+] Most likely matches with a unique count of %s or less:" % arguments.unique_depth)
5253
for p in scanner.likely_matches(): print(" [>] %s" % p)
5354

54-
output = output_normal()
55+
output = output_helper()
5556
output.hosts = scanner.hosts
5657
output.print_current()
5758

lib/core/discovered_host.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,5 @@ class discovered_host(object):
66
def __init__(self):
77
self.hostname = ''
88
self.response_code = 0
9-
self.hash = ''
9+
self.hash = ''
10+
self.keys = []

lib/core/virtual_host_scanner.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import pandas as pd
55
from lib.core.discovered_host import *
66

7+
78
class virtual_host_scanner(object):
89
"""Virtual host scanning class
910
@@ -73,18 +74,19 @@ def scan(self):
7374
page_hash = hashlib.sha256(res.text.encode('utf-8')).hexdigest()
7475
output = '[#] Found: {} (code: {}, length: {}, hash: {})\n'.format(hostname, res.status_code,
7576
res.headers.get('content-length'), page_hash)
77+
# temporary host class code
78+
host = discovered_host()
79+
host.hostname = hostname
80+
host.response_code = res.status_code
81+
host.hash = page_hash
7682

7783
for key, val in res.headers.items():
7884
output += ' {}: {}\n'.format(key, val)
85+
host.keys.append(' {}: {}\n'.format(key, val))
7986

8087
# print current results so feedback remains in "realtime"
8188
print(output)
8289

83-
# temporary host class code
84-
host = discovered_host()
85-
host.hostname = hostname
86-
host.response_code = res.status_code
87-
host.hash = page_hash
8890
self.hosts.append(host)
8991

9092
# add url and hash into array for likely matches

lib/outputs/__init__.py

Lines changed: 0 additions & 8 deletions
This file was deleted.

lib/outputs/output_normal.py

Lines changed: 0 additions & 8 deletions
This file was deleted.

0 commit comments

Comments
 (0)