Created
April 1, 2021 20:29
-
-
Save averagesecurityguy/6dfd1564ac3b86783a01a5bc9d6ba97e to your computer and use it in GitHub Desktop.
Find launch messages in nessusd.messages file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import sys | |
import re | |
# Define regular expressions for the nessusd.messages format. | |
# | |
# Launching | |
# [Wed Mar 31 09:19:34 2021][5372.0][user=nessususer][name= scan name FULL DEBUG][JOB_UUID=94613384-4ad4-655a-6f52-00e87dc0f9a8a640e3918796fe3d][target=10.210.1.10][plugin=vmware_multiple_vmsa_2008_0008.nasl][plugin_id=32503] : Launching | |
launch_re = re.compile(r'^\[(.*?)\].*\[target=(.*?)\]\[plugin=(.*?)\]\[plugin_id=.*?\] : Launching$') | |
def parse_line(line): | |
m = launch_re.match(line) | |
if m is not None: | |
date, target, plugin = m.groups() | |
print('Launching {0} against {1} at {2}\n'.format(plugin, target, date)) | |
if __name__ == '__main__': | |
if len(sys.argv) != 2: | |
print('{0} path/to/file'.format(sys.argv[0])) | |
sys.exit(1) | |
for line in open(sys.argv[1]): | |
line = line.strip() | |
if line == '': | |
continue | |
if line.startswith('#'): | |
continue | |
parse_line(line) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment