Skip to content

Commit 81bbb76

Browse files
committed
Add output_grepable
1 parent 9f8e25a commit 81bbb76

File tree

2 files changed

+23
-1
lines changed

2 files changed

+23
-1
lines changed

VHostScan.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,11 @@ def main():
120120

121121
if(arguments.output_json):
122122
output.output_json(arguments.output_json)
123-
print("\n[+] Writing json ouptut to %s" % arguments.output_json)
123+
print("\n[+] Writing json output to %s" % arguments.output_json)
124+
125+
if(arguments.output_grepable):
126+
output.output_grepable(arguments.output_grepable)
127+
print("\n[+] Writing grepable ouptut to %s" % arguments.output_json)
124128

125129

126130
if __name__ == "__main__":

lib/helpers/output_helper.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,14 @@ def write_normal(self, filename):
2424
output += self.output_normal_detail()
2525
file.write_file(output)
2626

27+
def write_grepable(self, filename):
28+
file = file_helper(filename)
29+
30+
output = self.generate_header()
31+
output += self.output_grepable_detail()
32+
33+
file.write_file(output)
34+
2735
def output_normal_likely(self):
2836
uniques = False
2937
depth = str(self.scanner.unique_depth)
@@ -107,6 +115,16 @@ def output_normal_detail(self):
107115

108116
return output
109117

118+
def output_grepable_detail(self):
119+
for host in self.scanner.hosts:
120+
output += "\n{}\t{}\t{}".format(
121+
str(host.hostname),
122+
str(host.response_code),
123+
str(host.hash)
124+
)
125+
126+
return output
127+
110128
def generate_header(self):
111129
output = "VHostScanner Log: {} {}\n".format(
112130
time.strftime("%d/%m/%Y"),

0 commit comments

Comments
 (0)