angryip / ipscan

Angry IP Scanner - fast and friendly network scanner
angryip.org
GNU General Public License v2.0
4.08k stars 715 forks source link

URL GET Fetcher Class #427

Open KDMcMullan opened 10 months ago

KDMcMullan commented 10 months ago

Is your feature request related to a problem? Please describe.

This is not a problem report; purely a feature suggestion.

It is imagined that of the device count on any particular (home) network, many of the IP addresses will be used by IoT devices. Many of these will probably possess their own webserver as a user interface. This is particularly applicable where the device has been re-flashed with extremely common free firmware such as TASMOTA, which is not cloud-based.

Under Web Detect, Angry IP Scanner presently reports the server type. In the example of TASMOTA, we see that it is a TASMOTA server, the version number and the microcontroller type (the parameters the TASMOTA authors have chosen to advertise).

It would be extremely useful if it were possible to query / report the name of the device. This is a parameter which the end user normally sets once the firmware is installed.

Describe the solution you'd like

It is recognised that "query for device name" is an unreasonable request. It is suggested that a new Fetcher class be added, which is a configurable web query engine. The user must be able to configure a port number, a URL portion to be added to the end of a given IP address, and also the format of the returned data. The URL augmentation would constitute a GET query. The format might be a JSON string allowing a required subset of the return data to be isolated.

Describe alternatives you've considered

Initially, I considered a Fetcher which was an MQTT client, but without querying and returning multiple MQTT packets from the broker, it would not be easy to associate a particular IP address with a device name.

Additional context

In the case of TASMOTA, it would be possible to configure the Fetcher to append the string /cm?cmnd=status onto an IP address, such that the total URL might be http://192.168.1.101/cm?cmnd=status . This might return a string such as: {"Status":{"Module":1,"DeviceName":"studylight","PowerOnState":3}} . The user would be able to stipulate that the Status.DeviceName portion of this record is the required information.

I'm happy to provide information on TASMOTA, or other IoT devices' URL query languages, or steer the developer to the correct place. I'm a software engineer. I just haven't got my head around Java's paradigms!