nuclei/ssh
module/librarySSHClient
objectInfo
modeerror
variable is exposed in matcher/extractor with error message.
pre-condition
is a optional javascript code that is executed before running “code” and acts as pre-condition to exploit. In above template before attempting to bruteforce we are checking if
true
only then code is executed otherwise it is skippednuclei/ssh
module and create a new instance of SSHClient
objectinit
is a optional javascript code that can be used to initialize template and it is executed just after compiling template and before running it on any target. Although rarely needed, it can be used to load and preprocess data before running template on any target.
For example in below code block we are loading all ssh private keys from nuclei-templates/helpers
directory and storing them as a variable in payloads with name keys
, if we were loading private keys from ‘pre-condition’ code block then it would have been loaded for every target which is not ideal.
Function | Description |
---|---|
updatePayload(key,value) | updates payload with given key and value |
set(key,value) | sets a variable with given key and value |