I'm writing a scanner in python that will gather various information about a target such as open ports, version info and so on. Also using a toml file that holds configuration settings for individual scans.
I need a method to store the scan results. So far I'm using a class that holds all target data. Is there a way to store the results in a file and have library functions parse and print them as requested?
In toml representation I'm thinking of something like
[target]
ip = xx.xx.xx.xx
[target.os]
os = 'win 10'
Arch = 'x64'
[target.ports]
ports = ['1', '2']
[target.ports.1]
service = 'xxx'
ver = '5.9'
Is there a way to dump scan results to toml file in this manner? Or is there another method that could do a better job?