Execute command on detection

Started by David

David

Execute command on detection   03 March 2020, 13:10

In Advanced Settings, I see a feature named "Execute command on detection". Can this pass parameters as well?

Ideally I would like to launch an nmap scan of any device that is unrecognized, and hope that I can pass the device's IP address to nmap so I could do such scan. I would imagine that the command would be something like this:
C:\Program Files (x86)\Nmap\nmap.exe -v -A -oX "C:\reports\%ip_addr%.xml" %ip_addr%
SoftPerfect Support forum - Ann avatar image
Ann

Re: Execute command on detection   03 March 2020, 13:32

The command is invoked once per detection, which may contain multiple IP addresses.

What you could do instead, is to extract IP addresses directly from the database and feed them into nmap:
  1. Download SQLite command line tools from SQLite site.
  2. Extract sqlite3.exe and place it in a folder.
  3. Extract and place this .cmd script file into the same folder.
  4. Edit the file as needed and specify it to be launched from WiFi Guard.
The script will extract all last seen IP addresses, save them to a file, and then run an nmap scan against them.

Script code:
sqlite3 WiFiGuard.DB "SELECT ACTIVITY.IPADDR FROM DEVICE JOIN ACTIVITY ON DEVICE.HWADDR = ACTIVITY.HWADDR WHERE DEVICE.KNOWN = 0 AND ACTIVITY.DAY = CURRENT_DATE" > ips.txt
nmap.exe -v -A -oX report.xml -iL ips.txt

Reply to this topic

Sometimes you can find a solution faster if you try the forum search, have a look at the knowledge base, or check the software user manual to see if your question has already been answered.

Our forum rules are simple:

  • Be polite.
  • Do not spam.
  • Write in English. If possible, check your spelling and grammar.

Author:

Email:

Subject

A brief and informative title for your message, approximately 4–8 words:

     

Spam prevention: please enter the following code in the input field below.

 **    **  ********  **        **    **  ******** 
  **  **   **        **        ***   **     **    
   ****    **        **        ****  **     **    
    **     ******    **        ** ** **     **    
    **     **        **        **  ****     **    
    **     **        **        **   ***     **    
    **     ********  ********  **    **     **    

Message: