How to scan an entire subnet

Hi,
How I will able to run a scan for the entire subnet, I am trying the below format but it is giving an error
gvm-cli -c gmp.conf socket --socketpath /run/gvmd.sock --xml="<create_target>Seceon_scan_VA_Report_OME1234_192.168.19.13/32_1570791129192.168.19.1/32</create_target>"| xmlstarlet sel -t -v /create_target_response/@id
-:1.1: Start tag expected, ‘<’ not found
(‘Error in response. Error in host specification’, <Element create_target_respon

where my host is 192.168.19.1/32

~Arpita

Hi,

in this forum all questions are answered on voluntary basis. If you need support with a SLA please take a look at our products.

Did you have a look at the GMP API documentation for create_target already?

2 Likes

Yes, I looked target creation command is okay, but i am getting "Error in Host Specifiaction " for CIDR 192.168.0.0/16 , although it is a valid CIDR.

There are other posts about the maximal amount of IPs you can scan. Please consult the previous posts.

Could you paste the full xml command for creating your target? At least the one from you initial message was wrong.

1 Like

here is my create target command

gvm-cli socket --socketpath /run/gvmd.sock -c gmp.conf --xml “<create_target>test_cred192.168.9.111/32</create_target>”

This command is wrong. Please read the API docs again and especially take a look at the example.

7.21.3 Example: Create a target, giving a host list
Client

 <create_target>
   <name>All GNU/Linux machines</name>
   <hosts>192.168.1.0/24</hosts>
 </create_target>

Manager

 <create_target_response status="201"
                         status_text="OK, resource created"
                         id="254cd3ef-bbe1-4d58-859d-21b8d0c046c6"/>

1 Like

I m not able to create target with CIDR 1 to 20, 31-32.
It is working only for 20-30 CIDR

As you know with a /30 or /32 you can instead add singe hosts or a hostlist, as written above there is a limit scanning more then /20. Please read the related posts here.

Please check our fine documentation for the different Notation of targets.

1 Like