The HTTP functions are the core of Wal. Using these functions you can set many
values and perform HTTP request and HTTP responses.
Functions List
http_init
Function Name: def http_init(ireq)
Parameters: ireq (Input request dict)
Return: Nothing
Abstract: Sets all the HTTP parameters needed.
http_init
default values inside wal hash dict: |
key: host |
value: localhost |
Description: Set
the host. |
key: port |
value: 80 |
Description: Set
the port. |
key: method |
value: GET |
Description: Set
the default HTTP method, "GET" in this case. |
key: method_postfix |
value: Set to empty. '' |
Description: To
add whatever we want after the method. |
key: uri |
value: / |
Description: The
requested resource. |
key: uri_prefix |
value: Set to a single space.
' ' |
Description: Set
a space before URI or whatever you want. |
key: uri_postfix |
value: Set to empty. '' |
Description: To
add whatever we want after URI. |
key: uri_param_sep |
value: ? |
Description: The
URI parameter separator. |
key: http_ver |
value: 1.1 |
Description: The
HTTP version to use. (0.9/1.0/1.1) |
key: anti_ids |
value: |
Description: Apply
anti-ids tactics (1-9). |
key: req_space |
value: Set to empty. '' |
Description: |
key: req_space2 |
value: Set to a single space.
' ' |
Description: |
key: bind_socket |
value: 0 (zero) |
Description: Enable
Wal to bind to a port. (NO [0] or YES [1]) |
key: bind_host |
value: Set to empty. '' |
Description: The
host to bind. |
key: bind_port |
value: 33133 |
Description: The
port to bind. |
key: http_eol |
value: \x0d\x0a |
Description: Set
the end of line. |
key: include_host_in_uri |
value: 0 (zero) |
Description: |
key: http_req_trailer |
value: Set to empty. '' |
Description: |
key: proto |
value: TCP |
Description: Set
the protocol to use. TCP (1) or UDP (2). |
key: ssl |
value: |
Description: Set
SSL support. 1 = yes, 0 = no. |
key: force_close |
value: 0 (zero) |
Description: |
key: force_open |
value: 0 (zero) |
Description: |
key: timeout |
value: 10 |
Description: Set
network timeout. |
key: proxy_host |
value: |
Description: Set
proxy host. |
key: proxy_port |
value: |
Description: Set
proxy port. |
key: wal_id |
value: 1 |
Description: Enable
the WAL ID, so NIDS can detect WAL. (NO [0] or YES [1]). Wal will add a
special signature to the HTTP request, creating a "WTag" HTTP
header with the value: x77x61x6c |
The http_init function will also set some HTTP request headers, like:
key: Connection |
value: Keep-Alive |
Description: Set
the Connection HTTP header. |
key: User-Agent |
value: "Wal/" + wal
version |
Description: Set
a default User Agent. |
Home | Top
http_new_request
Function Name: def http_new_request(config = {})
Parameters: config
Return: Dict
Abstract: This function basically 'objectifies' the creation
of wal request hash objects.
Home | Top
http_new_response
Function Name: def http_new_response()
Parameters: Nothing
Return: Dict
Abstract: This function basically 'objectifies' the creation
of wal response hash objects.
Home | Top
http_do_request
Function Name: def http_do_request(ireq, oreq, config=None)
Parameters: Ireq (Input request dict), oreq (Output request
dict), config
Return: 0 (zero) on success, 1 on HTTP error and 2 on network
error.
Abstract: Performs the HTTP request.
Home | Top
http_create_req
Function Name: def http_create_req(ireq, flag=0)
Parameters: ireq (Input request dict), flag
Return: String with a HTTP request created.
Abstract: Creates an HTTP URI and returns it.
Home | Top
http_fixup_request
Function Name: def http_fixup_request(ireq = None)
Parameters: ireq (Input request dict)
Return: Nothing.
Abstract: Sets some default HTTP headers, like HOST and CONNECTION
if HTTP version is 1.1
This function will also take care of the CONTENT-LENGTH of the data and some
proxy stuff if proxy is used.
Home | Top