Skip to content

Commit 81000e0

Browse files
committed
Fixed object types from string to list for stdin
1 parent 8f06dc7 commit 81000e0

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

VHostScan.py

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,26 +30,28 @@ def main():
3030
parser.add_argument("-", dest="stdin", action="store_true", help="By passing a blank '-' you tell VHostScan to expect input from stdin (pipe).", default=False)
3131

3232
arguments = parser.parse_args()
33-
wordlist = ""
33+
wordlist = list()
3434

35-
if(arguments.stdin):
36-
for line in sys.stdin:
37-
wordlist += line
38-
print("[+] Starting virtual host scan for %s using port %s and stdin data" % (arguments.target_hosts,
39-
str(arguments.port)))
35+
if(arguments.stdin and not arguments.wordlist):
36+
input = list(line for line in sys.stdin.read().splitlines())
37+
wordlist.extend(input)
38+
print("[+] Starting virtual host scan for %s using port %s and stdin data" % (arguments.target_hosts,
39+
str(arguments.port)))
4040
elif(arguments.stdin and arguments.wordlist):
4141
if not os.path.exists(arguments.wordlist):
4242
print("[!] Wordlist %s doesn't exist and can't be appended to stdin." % arguments.wordlist)
4343
print("[+] Starting virtual host scan for %s using port %s and stdin data" % (arguments.target_hosts,
4444
str(arguments.port)))
4545
else:
46-
wordlist += open(arguments.wordlist).read().splitlines()
46+
wordlist_file = open(arguments.wordlist).read().splitlines()
47+
wordlist.extend(wordlist_file)
4748
print("[+] Starting virtual host scan for %s using port %s, stdin data, and wordlist %s" % (arguments.target_hosts,
4849
str(arguments.port),
4950
arguments.wordlist))
5051
else:
5152
# if no stdin, or wordlist pass, open default wordlist location
52-
wordlist = open("./wordlists/virtual-host-scanning.txt").read().splitlines()
53+
wordlist_file = open("./wordlists/virtual-host-scanning.txt").read().splitlines()
54+
wordlist.extend(wordlist_file)
5355
print("[+] Starting virtual host scan for %s using port %s and wordlist %s" % (arguments.target_hosts,
5456
str(arguments.port),
5557
"./wordlists/virtual-host-scanning.txt"))

0 commit comments

Comments
 (0)