Multiple scan modes for devices with different OS

Started by happy_user9933

happy_user9933

Multiple scan modes for devices with different OS   23 May 2025, 21:28

Having multiple OS in the environment - Windows and Linux. Windows have WMI or PowerShell or "scripts" or other access data methods, while Linux mostly SSH or SNMP.

The problem is, the output will be in two columns (and it is trying to access Windows computers with SSH, or Linux with WMI, that slows down speed and can create firewall alarms).

I know the app don't have a determination mechanism, so I will be glad to see any workarounds at least to make one columns instead of two smile

Also, the build-in "logged on user" don't works with Linux (for example, Synology) - it shows hostname instead.
SoftPerfect Support forum - Andrew avatar image

Re: Multiple scan modes for devices with different OS   24 May 2025, 20:51

The core issue here is that there isn't a straightforward way to determine whether a specific device is running Windows or Linux. While it's theoretically possible to probe ports, such as 22 for SSH or 135 for RPC, to infer the operating system, this approach still involves making connections to each device individually. Not only can this be slow, but the detection remains probabilistic and could produce inaccurate results. It also risks triggering firewall alerts or unwanted security scrutiny.

One workaround is to merge the output from two columns into a single one using a custom VBScript under Remote Scripting, like so:
Dim val1, val2

val1 = Input.Column("Host Name")
val2 = Input.Column("MAC address")

If val1 = "" Then
    Output.Write val2
ElseIf val2 = "" Then
    Output.Write val1
Else
    Output.Write val1 ' or val2, depending on preference
End If
This helps condense the output visually, but does require keeping the source columns visible. It's not ideal, especially when managing a large set of data.

A more robust solution would be to allow VBScript to specify what types of scans to perform. For instance:
val1 = ssh.run("item name")
val2 = wmi.run("item name")
This would make it possible to dynamically choose scan methods based on IP range, MAC prefix, or other criteria - thus avoiding unnecessary or inappropriate queries (e.g. attempting WMI on a Linux box). We're actively considering ways to implement this more intelligent targeting, please keep an eye on updates.
happy_user9933

Re: Multiple scan modes for devices with different OS   27 May 2025, 20:21

Thank you for the workarounds! But I'm trying this way and can't get ssh.run("user") to work (and don't see ssh.run in the help panel).
Dim ttl, loggeduser_win, loggeduser_linux
ttl = Input.Column("Time to live (TTL)")
loggeduser_win = Input.Column("Logged User")

If TTL = "128" OR TTL = "127" OR TTL = "126"  Then
  Output.Write loggeduser_win
Else
  loggeduser_linux = ssh.run("user")
  Output.Write  loggeduser_linux
End If
SoftPerfect Support forum - Andrew avatar image

Re: Multiple scan modes for devices with different OS   30 May 2025, 15:35

Apologies for the confusion! What I meant was that this functionality - being able to run named scan items like WMI or SSH directly from VBScript - is something we're planning to add to the application. It's not available yet, which is why ssh.run("user") doesn't currently work and isn't listed in the help panel.

The goal is to allow conditional execution of specific scan methods without displaying extra columns and without wasting time attempting SSH on Windows or WMI on Linux. This should also help avoid unnecessary network noise and potential firewall issues.

I expect this feature to be available for testing sometime next week. I'll keep you posted as soon as it's ready.
SoftPerfect Support forum - Andrew avatar image

Re: Multiple scan modes for devices with different OS   11 June 2025, 19:30

This functionality was added in version 25.6, which is available for download from the Network Scanner product page.
Remote.Files("name")         Checks for the existence of specified files or folders.
Remote.Groups("name")        Retrieves information about user groups and group membership.
Remote.JSON("name")          Extracts data from JSON responses obtained via HTTP.
Remote.Nmap("name")          Integrates with Nmap for OS detection and port scanning.
Remote.Performance("name")   Gathers CPU, memory, and other performance metrics.
Remote.PowerShell("name")    Executes PowerShell scripts on remote Windows systems.
Remote.Registry("name")      Queries the Windows Registry on remote computers.
Remote.SNMP("name")          Performs SNMP queries to retrieve device information.
Remote.SSH("name")           Executes commands via SSH on Unix/Linux systems.
Remote.Services("name")      Checks the status of services on remote Windows machines.
Remote.WMI("name")           Queries system information using WMI.
Remote.XML("name")           Parses XML data retrieved via HTTP.
Calling an item by its name will execute the corresponding scan. For example, the following line runs a WMI query named "Windows Name" against each IP address and stores the result as a string:
'This script prints the Windows version retrieved via WMI.
winName = Remote.WMI("Windows Name")
Output.Write "This comes from WMI: " & winName

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: