I have to make a project on Vulnerability Management System so I've generated a text report related to vulnerability scan. Now I have to parse this report into mysql. So please tell me how can I do this??
How to parse a text file through PERL into MySQL?
Collapse
X
-
Tags: None
-
Easy, use Perl. :) I know, simplistic answer.
The hard part is we have no clue what this report looks like. If the report is a list of lines, each containing a set of data, then you could split each line into its parts and input the data into the database using DBI. No matter what format it is, you just need to figure out how to parse each element you need out, then use DBI to input the data into the db table(s) you create(d).
Write code and do what you can. If you have issues with the coding, post your code and data samples here and we will help you where you get stuck.
Regards,
JeffComment
-
The file type is .nbe . I show a sample type of that file:
results|IP REMOVED|IP REMOVED|general/udp|10287|Secur ity Note|\nSynopsis :\n\nIt was possible to obtain traceroute information.\n\ nDescription :\n\nMakes a traceroute to the remote host.\n\nSoluti on :\n\nn/a\n\nRisk factor :\n\nNone\n\nPl ugin output :\n\nFor your information, here is the traceroute from IP REMOVED to IP REMOVED : \nIP REMOVED\nIP REMOVED\n\nLast edited by numberwhun; Dec 19 '10, 05:49 PM. Reason: Please DO NOT post IPs or personal information in the forums!Comment
-
You should have started with information that you use Nessus.
Try Parse::Nessus:: NBE from CPAN. It is old, but if .nbe format did not change, it will work.Comment
-
@akshay mokhalga Please do not post IP Addresses, Email addresses, or any other personal information in the forums. Information posted here is scrapable from the internet and not guarded as it would be on private sites.
I have removed your IP information, please be more mindful next time.
Regards,
JeffComment
-
-
Also, using quote tags around your samples better separates the sample from the rest of the post's text, that way we don't have to guess what your sample is and what your comment is.
Regards,
JeffComment
-
-
> I have one more question how can I call a perl program through C compiler??
1. You can use exec or system (I don't remember this part of C, so you need to look yourself).
2. You can embed Perl into your program. See perlembed.pod.Comment
Comment