diff --git a/API-Documentation.md b/API-Documentation.md index cf43794..322d25d 100644 --- a/API-Documentation.md +++ b/API-Documentation.md @@ -88,7 +88,7 @@ The `name` attribute returns a string representation of the name of the service The `port` attribute returns an integer representation of the port that the service is running on (e.g. 80). #### protocol -The `protocol` attribute returns a string representation of the protocol that the service is using (e.g. 'tcp'). +The `protocol` attribute returns a lowercase string representation of the protocol that the service is using (e.g. 'tcp'). #### secure The `secure` attribute returns a boolean representation of whether or not the service is running over SSL/TLS. @@ -104,11 +104,13 @@ The `add_manual_commands` method can be used by ServiceScan plugins to add manua #### add_manual_command(description, command) The `add_manual_command` method is an alias for `add_manual_commands` and works the same way. -#### execute(cmd, blocking=True, outfile=None, errfile=None) +#### execute(cmd, blocking=True, outfile=None, errfile=None, future_outfile=None) The `execute` method can be used by a ServiceScan plugin to execute a command in a /bin/bash shell. The `cmd` argument should be a string representation of the command you wish to execute. The following markers can be used within the string, and will get automatically converted to their correct values by AutoRecon: -* `{address}` - The address of the target (e.g. 127.0.0.1, ::1) -* `{addressv6}` - Despite its name, this still represents the address of the target if it is IPv4. The difference is the IPv6 address will be represented as [::1] which is a common format for several tools. +* `{address}` - The address of the target (e.g. 127.0.0.1, ::1, example.com). +* `{addressv6}` - Despite its name, this still represents the address of the target if it is IPv4 or a hostname. However, an IPv6 address will be surrounded with square brackets (e.g. [::1]) which is a common format for several tools. +* `{ipaddress}` - The IP address of the target (e.g. 127.0.0.1, ::1). If the target is a hostname, the resolved IP will be used. +* `{ipaddressv6}` - Despite its name, this still represents the IP address of the target if it is IPv4. However, an IPv6 address will be surrounded with square brackets (e.g. [::1]) which is a common format for several tools. If the target is a hostname, the resolved IP will be used. * `{http_scheme}` - A special marker which is either 'https' or 'http' depending on whether the service is secure or not. * `{name}` - The name of the service (e.g. 'http') * `{nmap_extra}` - Extra nmap options provided by the user at runtime. Defaults to: -vv --reason -Pn @@ -124,6 +126,8 @@ await process.wait() The optional `outfile` and `errfile` arguments can be used to specify filenames to save stdout and stderr to respectively. Note that only the filename is required (e.g. "scan_output.txt", as the scandir path will be prepended. +The optional `future_outfile` argument can be used to specify a future filename for the command, if you don't want the `execute` method to write to one immediately, but the plugin will eventually. This is needed for Report plugins to include results. + This method returns a Process object, a CommandStreamReader object for stdout, and a CommandStreamReader object for stderr. #### full_tag()