Skip to content

Commit 29cb25b

Browse files
authored
Merge pull request #105 from linted/python3
Python3 Refactoring (first phase)
2 parents 5be49c6 + bb3bde7 commit 29cb25b

File tree

6 files changed

+24
-17
lines changed

6 files changed

+24
-17
lines changed

VHostScan/VHostScan.py

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
#!/usr/bin/python
1+
#!/usr/bin/env python3
22

33
import sys
44
import dns.resolver
55
from argparse import ArgumentParser
66
from socket import gethostbyaddr
77
from pkg_resources import resource_filename
8-
from .lib.core.virtual_host_scanner import *
9-
from .lib.helpers.output_helper import *
8+
from .lib.core.virtual_host_soutput_helpercanner import virtual_host_scanner
9+
from .lib.helpers.output_helper import output_helper
1010
from .lib.helpers.file_helper import load_random_user_agents
1111
from .lib.helpers.wordlist_helper import WordList
1212
from .lib.core.__version__ import __version__
@@ -17,7 +17,7 @@
1717

1818

1919
def print_banner():
20-
print("+-+-+-+-+-+-+-+-+-+ v. %s" % __version__)
20+
print("+-+-+-+-+-+-+-+-+-+ v. {}".format(__version__))
2121
print("|V|H|o|s|t|S|c|a|n| Developed by @codingo_ & @__timk")
2222
print("+-+-+-+-+-+-+-+-+-+ https://github.com/codingo/VHostScan\n")
2323

@@ -88,7 +88,7 @@ def main():
8888
print("[!] Couldn't find any records (NoAnswer)")
8989

9090
if arguments.verbose:
91-
print("[>] Scanning with %s items in wordlist" % len(wordlist))
91+
print("[>] Scanning with {} items in wordlist".format(len(wordlist)))
9292

9393
scanner_args = vars(arguments)
9494
scanner_args.update({
@@ -108,15 +108,18 @@ def main():
108108

109109
if(arguments.output_normal):
110110
output.write_normal(arguments.output_normal)
111-
print("\n[+] Writing normal ouptut to %s" % arguments.output_normal)
111+
print("\n[+] Writing normal ouptut to {}".format(
112+
arguments.output_normal))
112113

113114
if(arguments.output_json):
114115
output.output_json(arguments.output_json)
115-
print("\n[+] Writing json output to %s" % arguments.output_json)
116+
print("\n[+] Writing json output to {}".format(
117+
arguments.output_json))
116118

117119
if(arguments.output_grepable):
118120
output.output_grepable(arguments.output_grepable)
119-
print("\n[+] Writing grepable ouptut to %s" % arguments.output_json)
121+
print("\n[+] Writing grepable ouptut to {}".format(
122+
arguments.output_json))
120123

121124

122125
if __name__ == "__main__":

VHostScan/lib/core/virtual_host_scanner.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
1+
import hashlib
12
import os
23
import random
4+
import time
35

46
import requests
5-
import hashlib
7+
import urllib3
8+
69
import pandas as pd
7-
import time
8-
from .discovered_host import *
910

10-
import urllib3
11+
from .discovered_host import discovered_host
12+
1113
urllib3.disable_warnings()
1214
requests.packages.urllib3.disable_warnings()
1315

VHostScan/lib/helpers/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/env python
1+
#!/usr/bin/env python3
22

33
"""
44
Copyright (c) 2017 vhostscan developers (https://github.com/codingo/VHostScan)

VHostScan/lib/helpers/file_helper.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ def check_directory(self):
2020
os.stat(directory)
2121
except:
2222
os.mkdir(directory)
23-
print("[!] %s didn't exist and has been created." % directory)
23+
print("[!] {} didn't exist and has been created.".format(
24+
directory))
2425

2526
def is_json(json_file):
2627
try:

VHostScan/lib/helpers/output_helper.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import itertools
22
import json
33
import time
4-
54
import numpy as np
65

76
from fuzzywuzzy import fuzz

VHostScan/lib/helpers/wordlist_helper.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
import sys
2-
from .file_helper import get_combined_word_lists
3-
from pkg_resources import resource_filename
42
from ipaddress import ip_address
53

4+
from pkg_resources import resource_filename
5+
6+
from .file_helper import get_combined_word_lists
7+
68
DEFAULT_WORDLIST_FILE = resource_filename(
79
'VHostScan', 'wordlists/virtual-host-scanning.txt')
810

0 commit comments

Comments
 (0)