LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 08-07-2017, 09:34 AM   #1
doctorstrange
LQ Newbie
 
Registered: Jul 2017
Posts: 9

Rep: Reputation: Disabled
OpenVAS command line target creation


I can create a target from the command line with something like:

omp --config-file=.ompconf --xml '
<create_target>
<name>254 IP Subnet</name>
<hosts>192.168.0.0/24</hosts>
</create_target>'

But let's say I wanted to exclude two IP's from that subnet because they belong to printers. How would I do that?
 
Old 08-08-2017, 03:33 AM   #2
AwesomeMachine
LQ Guru
 
Registered: Jan 2005
Location: USA and Italy
Distribution: Debian testing/sid; OpenSuSE; Fedora; Mint
Posts: 5,524

Rep: Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015
You need to list the hosts individually, or use multiple masks, as can be calculated using ipcalc.
 
Old 08-08-2017, 08:15 AM   #3
doctorstrange
LQ Newbie
 
Registered: Jul 2017
Posts: 9

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by AwesomeMachine View Post
You need to list the hosts individually, or use multiple masks, as can be calculated using ipcalc.
I was thinking I might have to just make a list of all 250+ IP's. I'm not sure how multiple masks would work, though. If I use smaller subnets, what about the extra network and broadcast addresses?

For instance, let's say I wanted to skip 192.168.0.66:

192.168.0.0/26
192.168.0.65
192.168.0.67
192.168.0.68/30
192.168.0.72/29
192.168.0.80/28
192.168.0.96/27
192.168.0.128/25

But then this assumes extra network addresses of:

192.168.0.68
192.168.0.72
192.168.0.80
192.168.0.96
192.168.0.128

And extra broadcast addresses of:

192.168.0.63
192.168.0.71
192.168.0.79
192.168.0.95
192.168.0.127

So won't the scanner skip all those extra network and broadcast addresses? Or can I get around that by listing those all separate at the end? If so, then my final list should look like this?

192.168.0.0/26
192.168.0.65
192.168.0.67
192.168.0.68/30
192.168.0.72/29
192.168.0.80/28
192.168.0.96/27
192.168.0.128/25
192.168.0.68
192.168.0.72
192.168.0.80
192.168.0.96
192.168.0.128
192.168.0.63
192.168.0.71
192.168.0.79
192.168.0.95
192.168.0.127
 
Old 08-08-2017, 03:55 PM   #4
AwesomeMachine
LQ Guru
 
Registered: Jan 2005
Location: USA and Italy
Distribution: Debian testing/sid; OpenSuSE; Fedora; Mint
Posts: 5,524

Rep: Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015
I think I would block the printer IPs with iptables rules
Code:
iptables -A OUTPUT -d 192.168.111.1 -j DROP
Just make a rule for each printer.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
OpenVAS command line interface -- creating new scans doctorstrange Linux - Security 1 07-28-2017 08:26 AM
enable wds/repeater/etc from command line and script creation ut0ugh1 Linux - Software 0 04-13-2012 05:30 AM
Command-line creation of Gnome launcher, like ln -s? magn Linux - Desktop 2 05-12-2011 09:55 AM
Openvas-manager & openvas-cli Minky Linux - Software 1 04-26-2010 06:59 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 02:33 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration