nikto -h ::IP:: -p::PORT::<\/pre>\n“But exactly what are ::IP:: and ::PORT:: going to be replaced with?” I hear you ask.\u00a0 Check out the “Filter” parameter below…<\/p>\n
Filter<\/h3>\n
This option lets you restrict the hosts \/ ports your external tool with run against.\u00a0 It is not mandatory.\u00a0 If omitted, your external tool will be run against everything.<\/p>\n
\u00a0\u00a0\u00a0 filter => { key => value, key => value}<\/pre>\nThe comma above is interpretted as AND, i.e. only hosts \/ ports matching ALL of the supplied key => value pairs will be selected by the filter.\u00a0 Read on and it’ll all make sense…<\/p>\n
Possible “key”s are:<\/p>\n
port<\/strong>.\u00a0 This lets you run your tool only against specific ports.\u00a0 The “value” is either a port number or an array of port numbers:<\/p>\n\u00a0\u00a0\u00a0 filter => { port => 22 }<\/pre>\n\u00a0\u00a0\u00a0 filter => { port => [80, 443, 8080] }<\/pre>\nNote that you can only have one filter line and the commas above are obviously interpretted as OR.\u00a0 Any mathing port is selected by the filter.<\/p>\n
transport_protocol<\/strong>.\u00a0 This lets you run your tool only against specific transport protocols.\u00a0 The value is a string “TCP” or “UDP”.\u00a0 It’s commonly used with ‘port’:<\/p>\n\u00a0\u00a0\u00a0 filter => { port => 22, transport_protocol => 'TCP' }<\/pre>\nport_info<\/strong>.\u00a0 This lets you run your tool only against ports that have certain attributes.\u00a0 These attributes are stored in yaptest’s port_info table.\u00a0 The “value” is a string.\u00a0 Typically you’ll use this run a tool against all ports that nmap has identified as HTTP (or SSH or oracle-tns or whatever).<\/p>\n\u00a0\u00a0\u00a0 filter => { port_info => \"nmap_service_name = http\" }<\/pre>\nssl<\/strong>.\u00a0 This lets you run your tool only SSL ports.\u00a0 The “value” is 0 or 1.<\/p>\n\u00a0\u00a0\u00a0 filter => { port_info => \"nmap_service_name = http\", ssl => 0 }<\/pre>\nip<\/strong>.\u00a0 This lets you run your tool only against a specific IP address.\u00a0 The “value” is a string.\u00a0 I don’t know why you’d use this feature.\u00a0 I never have.<\/p>\n\u00a0\u00a0\u00a0 filter => { ip => \"127.0.0.1\" }<\/pre>\nOutput File<\/h3>\n
This parameter tells yaptest where to store the output from the external tool.\u00a0 It is not mandatory.\u00a0 It defaults to a name based on the tool name.\u00a0 If you were to run something like this:<\/p>\n
\u00a0\u00a0\u00a0 command => \"ping -c 1 ::IP::\"<\/pre>\nThe output file would be called “ping.out”. Next time you run it, the output file will not be overwritten, it will be called “ping.out.1”, then “ping.out.2”, etc.<\/p>\n
My output files are not going to be particularly self-documenting are they? Can’t I store the target IP in the file name? Of course you can:<\/p>\n
\u00a0\u00a0\u00a0 output_file => \"ping-::IP::.out\"<\/pre>\nYou can use the same mark-up as for “command”, but some doesn’t make sense (like ::IPFILE::). ::IP:: and ::PORT:: are typically the only ones you’ll use in output file names.<\/p>\n
Parallel Processes<\/h3>\n
Yaptest can fork off several copies of the external tool to speed up testing.\u00a0 It is not mandatory and defaults to 1.<\/p>\n
\u00a0\u00a0\u00a0 parallel_processes => 5<\/pre>\nThis option is useful for lots of tools, for example on an internal network if you nikto on each website in turn you may never complete your test.\u00a0 You probably want to run (say) 5 in parallel.<\/p>\n
Timeout<\/h3>\n
Yaptest can kill external tools if they take too long.\u00a0 This option is not mandatory.\u00a0 The default is no timeout – tools can run forever.<\/p>\n
Some tools misbehave by just hanging forever.\u00a0 You don’t want this delaying the rest of your test, so specify a timeout in seconds like this:<\/p>\n
\u00a0\u00a0\u00a0 timeout => 60<\/pre>\nInactivity Timeout<\/h3>\n
If the “timeout” option above seems a little too harsh, this option may suit you better.\u00a0 It kills external tools only if they produce no output for a certain period of time:<\/p>\n
\u00a0\u00a0\u00a0 inactivity_timeout => 60<\/pre>\nIf you ran a command like “ping 127.0.0.1” that kept producing a line of output each second forever, yaptest would never <\/em>kill the external tool. Sometimes this is what you want, sometimes it isn’t. Choose carefully.<\/p>\nMaximum Lines<\/h3>\n
Yaptest is able to kill your external tools if they produce too much output (e.g. 1000 lines of “connection refused”).\u00a0 By default yaptest will not kill tools that produce a lot of output.<\/p>\n
\u00a0\u00a0\u00a0 max_lines => 4000<\/pre>\nParser<\/h3>\n
This lets you call a parsing script automatically on the output file created by yaptest.\u00a0 The output file contains output of the external tool an may contain information that needs to be parsed into the database.\u00a0 It’s not mandatory, though.\u00a0 If you have a parser for your tool’s output, you should use the auto-parse feature.\u00a0 If you don’t, then don’t worry.<\/p>\n
\u00a0\u00a0\u00a0 parser => \"yaptest-parse-nbtscan.pl\"<\/pre>\n<\/h3>\n
<\/p>\n
<\/p>\n
<\/p>\n","protected":false},"excerpt":{"rendered":"
This page documents how to use the run_test API from your own home-brew yaptest scripts. <\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[10],"tags":[69],"_links":{"self":[{"href":"https:\/\/pentestmonkey.net\/wp-json\/wp\/v2\/posts\/100"}],"collection":[{"href":"https:\/\/pentestmonkey.net\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/pentestmonkey.net\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/pentestmonkey.net\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/pentestmonkey.net\/wp-json\/wp\/v2\/comments?post=100"}],"version-history":[{"count":1,"href":"https:\/\/pentestmonkey.net\/wp-json\/wp\/v2\/posts\/100\/revisions"}],"predecessor-version":[{"id":370,"href":"https:\/\/pentestmonkey.net\/wp-json\/wp\/v2\/posts\/100\/revisions\/370"}],"wp:attachment":[{"href":"https:\/\/pentestmonkey.net\/wp-json\/wp\/v2\/media?parent=100"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/pentestmonkey.net\/wp-json\/wp\/v2\/categories?post=100"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/pentestmonkey.net\/wp-json\/wp\/v2\/tags?post=100"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}