connects to port and sends a HTTP GET request to the given url.
You are supposed to try to access AUTOEXEC.BAT, BOOT.INI or WIN.INI
If quickcheck is TRUE, the function returns TRUE if it gets
a 200 (OK) answer.
If quickcheck is FALSE, it looks for pattern in the answer;
it will returns TRUE if it can find ``ECHO'', ``SET'', ``export'',
``mode'', ``MODE'', ``doskey'', ``DOSKEY'', ``[boot loader]'',
``[fonts]'', ``[extensions]'', ``[mci extensions]'',
``[files]'', ``[Mail]'', or ``[operating systems]''.
You are supposed to set quickcheck if the server answers
with clean 404 codes to requests to unknown pages, i.e. if ``www/no404/port''
is not set in the KB.
returns the list of directories where the CGI might be installed.
The list is a string where the items are separated with ``:''.
WARNING: this function is not a good idea and may disappear in the
returns the HTTP banner that was stored in the KB under ``www/banner/port_number''.
If the KB item is void, the function connects to the HTTP server,
sends a GET request, and stores the result into the KB.
reads the KB item ``Services/www'', verifies that the
port is open, that there is an HTTP server behind it, and returns
it. Note that the function will fork if there are several web servers
on the target machine.
If the KB item is void, the default port is tested.
If no HTTP port is found, the script exits.
returns TRUE if the HTTP answer ``code'' is between 400
and 409 or something identified by no404.nasl; FALSE otherwise.
tries very hard to test if the web server is still alive even if there
is a transparent or reverse proxy on the way. It sends a HTTP GET
request for a random page (/NessusTest<rand>.html)
and waits for the answer. The optional argument retry is
the number of times it should wait (one second) and retry to open
the socket to the remote service if this failed in the first time
(by default, there is no retry).
It returns TRUE if
the connection was refused, or
no valid HTTP answer was received, or
a 502 (bad gateway) or 503 (service unavailable) was received.
reads N bytes from the socket. N is defined like this:
If the header field is not defined, the function first calls
http_recv_headers; the ``Content-Length'' field is
extracted from the headers.
Note that the headers will not be returned, only the HTTP ``body''.
Then, if length is set
if content_length could be extracted from the headers, N = max(length, content_length)
otherwise, N = length
else if content_length could be extracted from the headers, N = content_length,
else N defaults to 8192 bytes.
reads the HTTP headers and data from the socket and returns all this.
This function is efficient because it just reads the right number
of bytes without waiting for a network timeout. The code argument
is optional. If you read the HTTP code (with recv_line),
you have to put it into this argument41.
reads the HTTP headers, then calls http_recv_body with
length=bodylength, and returns the concatenated headers and body.
looks for a given CGI on a web server. It returns its path if it could
be found, or NULL otherwise.
WARNING: the implementation is wrong, so this function may disappear
in the future.
the function returns TRUE if the regex pattern matches a ``Server:''
ou ``X-Powered-by:'' line in the banner. A way to use this function
is, for example:
returns an array containing all the directories that may have CGIs
in it (by default /cgi-bin and /scripts). Several scripts try to augment
this list (in particular webmirror.nasl).