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??
9 2621 chorny 80
Recognized Expert New Member
If this report is in CSV format, you can use Text::CSV module to parse it.
numberwhun 3,509
Recognized Expert Moderator Specialist
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,
Jeff
The file type is .nbe . I show a sample type of that file:
results|IP REMOVED|IP REMOVED|general/udp|10287|Security Note|\nSynopsis :\n\nIt was possible to obtain traceroute information.\n\nDescription :\n\nMakes a traceroute to the remote host.\n\nSolution :\n\nn/a\n\nRisk factor :\n\nNone\n\nPlugin output :\n\nFor your information, here is the traceroute from IP REMOVED to IP REMOVED : \nIP REMOVED\nIP REMOVED\n\n
This is a small part of that file so tell me how I can do parsing of this file also tell me what pattern I can follow to parse it.
chorny 80
Recognized Expert New Member
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.
numberwhun 3,509
Recognized Expert Moderator Specialist
@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,
Jeff
@Jeff:-ok Jeff I will take care of this in future....
numberwhun 3,509
Recognized Expert Moderator Specialist
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,
Jeff
I have one more question how can I call a perl program through C compiler??
chorny 80
Recognized Expert New Member
> 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.
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: John M. Lembo |
last post by:
I am using Perl to parse a text file and output to another file. The text
file has data on Unix virtual memory (vmstat) and I want to delete lines
that I don't want and output lines that I want to...
|
by: Tyaan |
last post by:
Hi.. I'm a perl noob need to know how to write a script to parse a
file containing one to four of the following blocks of text? I then
want to print the results in a format showing the memory size...
|
by: Jamie |
last post by:
A B C D E F G H I J K L M N O P Q R
insert into test (building,dep,owner,pcdesc,host,pctag,os,sp) values
(' A ,' Catering ,' User 3 ,' EVO N410 ,' PC24346 ,' TAG-24346 ,' WIN 2000
,' 4 );
insert...
|
by: Sacha Korell |
last post by:
How would I check for an end of file when parsing a text file using the
StreamReader object?
I would like to do something like this:
'********************************
Dim objStreamReader As...
|
by: boukaka |
last post by:
Hi there,
I have a text file that does not have any delimiters - it is simply assumed that I know how long each field is and they are always in the same order.
(i.e. JOHN DOE ...
| |
by: ramaraog80 |
last post by:
Hi,
I want VB Script which exports data from a text file to MySql Tables. Please help me regarding this.
Regards
Ramarao G
|
by: kkazakos |
last post by:
Hello,
I am a newbie in perl and i have the following problem.
I have as input a text file in the following format:...
|
by: vaibhavkansara |
last post by:
Hello friends,
I am vaibhav
I am a new to PHP/MYSQL.I have a problem to uploading a text file into MYSQL using php, and a text file is a tabdelimited file so pleas give me solution as soon as...
|
by: mantrid |
last post by:
Hello
Can anyone point me in the right direction for the way to read a text file a
line at a time and separate the fields on that line and use them as data in
an INSERT to add a record to a mysql...
|
by: Noorain |
last post by:
sir
my data are in text file. i want import text file in mysql data to use php script. please help me.............
my text file is
1#AA#2,345.00
2#BB#850.00
3#CC#31,855.00
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
| |
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The...
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
|
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...
| |