| 1 |
--- changes per libwhisker release ------------------------------------- |
| 2 |
|
| 3 |
[] libwhisker 2.5 |
| 4 |
|
| 5 |
- LibWhisker is now licensed under the 'simplied' (2 clause) BSD license. |
| 6 |
|
| 7 |
- Added the {whisker}->{allow_short_reads} option, which will return success |
| 8 |
if some body data is read but it is less than the server-advertised content |
| 9 |
length. Thanks to Dave Lodge for the suggestion. |
| 10 |
|
| 11 |
- Thomas Reinke pointed out that cookie_parse() was lowercasing cookie |
| 12 |
names, which causes problems if the server is being case-sensitive with |
| 13 |
cookie names. |
| 14 |
|
| 15 |
- Fixed a documentation typo for uri_absolute(). Thanks to Sullo for |
| 16 |
pointing it out. |
| 17 |
|
| 18 |
- A bug in http_fixup_request() would append a port to the Host header even |
| 19 |
if there was already one. Thanks to Sullo for reporting it. |
| 20 |
|
| 21 |
- Francisco Amato recommended two new anti-IDS modes that involve using |
| 22 |
0x0d and 0x0b as request separator/spacers. IDS modes 'A' and 'B' were |
| 23 |
added, respectively. |
| 24 |
|
| 25 |
---------------------------------------------------------------------------- |
| 26 |
|
| 27 |
[] libwhisker 2.4 |
| 28 |
|
| 29 |
- Minor code change to utils_delete_lowercase_key(), but it doesn't change |
| 30 |
the functionality. Mostly just performance. |
| 31 |
|
| 32 |
- Modifications to Makefile.pl. I have become a big fan of the three |
| 33 |
argument open() variant, but that's not backwards compatible with older |
| 34 |
perl versions. So I switched everything back to the two argument version. |
| 35 |
|
| 36 |
- More modifications to Makefile.pl, having to do with backwards |
| 37 |
compatibility with older perl versions. |
| 38 |
|
| 39 |
- Major overhaul to utils_request_clone(). Basically changed it to fully |
| 40 |
copy the source request elements into the destination request, while |
| 41 |
deep copying embedded arrays and such. This is different behavior than |
| 42 |
previous, where utils_request_clone() would only copy a few specific |
| 43 |
values from the source to the destination. After thinking about it for |
| 44 |
quite a while, I decided the previous functionality was not very useful |
| 45 |
and had shortcomings. The current change in functionality only affects |
| 46 |
people who set unique values in the destination request *prior* to |
| 47 |
cloning. Under the old functionality, the unique values could be carried |
| 48 |
over. Under the new version, they will be clobbered/deleted to match the |
| 49 |
source request. |
| 50 |
|
| 51 |
- POD docs for utils_array_shuffle() was wrong; the function takes \@array |
| 52 |
as a parameter, not @array. |
| 53 |
|
| 54 |
- Added new option: {whisker}->{save_raw_chunks}. When set to a value of |
| 55 |
1, the raw chunked data, including chunk sizes, will be saved to |
| 56 |
{whisker}->{data}. Normally libwhisker interprets the chunk sizes and |
| 57 |
stitches just the raw data together on your behalf; use this option if |
| 58 |
you just want the raw chunked server response. |
| 59 |
|
| 60 |
- Added new option: {whisker}->{hide_chunked_responses}. By default, |
| 61 |
when libwhisker gets a chunked response, it will interpret the chunks into |
| 62 |
the final output; however, the original 'Transfer-Encoding: chunked' |
| 63 |
header is left and the Content-Length header is not set. If you set |
| 64 |
the {hide_chunked_responses} option to 1, libwhisker will cleanup the |
| 65 |
response so that it resembles a regular non-chunked response...namely, |
| 66 |
libwhisker deletes the Transfer-Encoding header and adds an appropriate |
| 67 |
Content-Length header. Thus the fact that the server used chunk |
| 68 |
encoding is completely normalized out and hidden from the application. |
| 69 |
|
| 70 |
- Changes to _http_do_request_ex() and http_read_body() in order to |
| 71 |
account for the above two new options. |
| 72 |
|
| 73 |
- http_construct_headers() incorrectly included empty headers if a |
| 74 |
header name was found in {whisker}->{header_order} but was not actually |
| 75 |
set. |
| 76 |
|
| 77 |
- http_do_request() wasn't correctly returning the value returned by |
| 78 |
http_do_request_ex(), so {whisker}->{invalid_protocol_return_value} |
| 79 |
wasn't actually being honored. All fixed now. |
| 80 |
|
| 81 |
- If the server didn't return a Connection header, then http_do_request_ex |
| 82 |
looked into the request for a Connection header; when doing so, it |
| 83 |
assumed only one header would exist, and it would explicitly be named |
| 84 |
'Connection'. This has been changed to use utils_find_lowercase_key() |
| 85 |
and to account for the possibility that multiple connection header values |
| 86 |
might be defined (in which case, it uses the first one). |
| 87 |
|
| 88 |
- SSL requests silently went through and failed if an SSL library wasn't |
| 89 |
available; now stream_new() should return an error. |
| 90 |
|
| 91 |
- Added ssl_is_available() function for an official way to check to see |
| 92 |
if SSL is installed. No more relying on $LW_SSL_LIB global variable! |
| 93 |
|
| 94 |
- This is a preemptive notice that $LW_SSL_LIB might be going away, and |
| 95 |
that you should no longer use it! Use the new ssl_is_installed() instead. |
| 96 |
|
| 97 |
- Changed how optional modules are loaded. MIME::Base64 and MD5 are only |
| 98 |
loaded when you try to use a related function; they are no longer loaded |
| 99 |
automatically every time you use LW2. This helps speed up load time, but |
| 100 |
the first call to md5() or [encode|decode]_base64() will have a small lag |
| 101 |
while the module is initially loaded. If you anticipate needing these |
| 102 |
functions and can't tolerate the initial latency of the first call, you |
| 103 |
should call them ahead of time with empty/test data in order to force the |
| 104 |
module load before it comes time to use them in latency-critical operations. |
| 105 |
Note that other libwhisker functions operate in the same manner--the |
| 106 |
internal pure-perl MD5, MD4, and DES/NTLM crypto code suffers latency upon |
| 107 |
the very first function call because the code has to be compiled before |
| 108 |
use. |
| 109 |
|
| 110 |
- The %LW2::AVAILABLE hash has been depreciated, since it was redundant |
| 111 |
with Perl's normal global symbol table. You can get the same information |
| 112 |
by checking for the module's $VERSION variable. |
| 113 |
|
| 114 |
- A major overhaul was made in the underlying stream/network communication |
| 115 |
code. Non-blocking connects() on Windows has been implemented, which |
| 116 |
should speed up error conditions and enforce timeouts on Windows platforms. |
| 117 |
Sockets are left in non-blocking state for normal TCP connections; they are |
| 118 |
put back into blocking more for everything else. Thus the stream code had |
| 119 |
to be updated to account for EWOULDBLOCK non-blocking conditions. |
| 120 |
|
| 121 |
- $LW_NONBLOCK_CONNECT is now 1/enabled by default. If you want to turn |
| 122 |
off non-blocking connects, set this to 0. If Libwhisker encounters errors |
| 123 |
during nonblocking connect operations, it will still degrade to regular |
| 124 |
(blocking) connections (with an eval+alarm wrapper). |
| 125 |
|
| 126 |
- While not a change to the code itself, I just want to officially note |
| 127 |
that I am no longer testing Libwhisker2 on platforms other than Windows |
| 128 |
and Linux. I just don't have the time to account for more OSes. This |
| 129 |
has been unofficial for quite a while; every so often, I would do a sanity |
| 130 |
check by running Libwhisker2 on various platforms (IRIX, Tru64, Solaris, |
| 131 |
etc.) and checking that most things were compatible. I have downsized my |
| 132 |
lab and purged those platforms, so I no longer have the ability to test |
| 133 |
them. I am still willing to support them, if someone else will run |
| 134 |
Libwhisker on them and send me bug reports. :) |
| 135 |
|
| 136 |
- A new $LW2::_SSL_LIBRARY variable was added, for internal purposes only. |
| 137 |
Use ssl_is_available(), as I make no guarantees that $_SSL_LIBRARY will |
| 138 |
stick around. |
| 139 |
|
| 140 |
- Blocking connects had an error, due to the use of a return in an eval |
| 141 |
block. The end result was that failed connect() attempts were being |
| 142 |
treated as successful, and then failing later down the line when the |
| 143 |
HTTP request write failed. Since the error appeared to happen during |
| 144 |
the write, and not during the connect, the default retry value was |
| 145 |
kicking in and the process was repeating a second time, making it a double- |
| 146 |
whammy. This would only occur on systems where libwhisker downgraded |
| 147 |
to a blocking connect, and a connection attempt was made to a closed |
| 148 |
or non-existing host/port combo. |
| 149 |
|
| 150 |
- It kind of goes without saying, but I'm going to say it anyways: |
| 151 |
functions and variables beginning with '_' (underscore) are internal only |
| 152 |
and can be subject to change without notice or backwards compatibility. |
| 153 |
In short, you should not be using them; if you feel a certain internal |
| 154 |
function/variable is vital to your application and there is no way to |
| 155 |
achieve the functionality with other official libwhisker resources, please |
| 156 |
email me and we will come up with a way to resolve it. |
| 157 |
|
| 158 |
- The stream code wasn't updating the connect count ("syns"), which was |
| 159 |
causing {whisker}->{stats_syns} to always be zero. |
| 160 |
|
| 161 |
- Net::SSLeay SSL sockets are now closed with the SSL_shutdown function, |
| 162 |
which is more courteous than just closing the raw TCP connection. This |
| 163 |
allows for the SSL close notify alerts to be sent. |
| 164 |
|
| 165 |
- SSL keep-alive support has been added! It is currently only supported |
| 166 |
with Net::SSLeay, and is disabled by default. If you wish to enable it, |
| 167 |
you need to set $LW::LW_SSL_KEEPALIVE=1. This results in a drastic |
| 168 |
performance increase if you are making multiple requests to the same SSL |
| 169 |
server, and the server supports keep-alive connections (i.e. HTTP 1.1). |
| 170 |
This isn't enabled by default because I haven't been able to thoroughly |
| 171 |
test it against a large number of different SSL server implementations. |
| 172 |
And obviously keep-alive support only matters if you and the server use the |
| 173 |
proper HTTP headers to indicate the connection should be kept alive... |
| 174 |
|
| 175 |
- http_do_request() had a small change in order to make sure ssl_save_info |
| 176 |
was always honored with the new SSL keep-alive feature. |
| 177 |
|
| 178 |
- http_do_request[_ex]() had a string case comparision bug in handling |
| 179 |
keep-alives when the server didn't respond with an official connection |
| 180 |
header. The result was that connections were not kept-alive, even though |
| 181 |
they could have been. |
| 182 |
|
| 183 |
- http_do_request[_ex]() used a non-robust method to locate Connection |
| 184 |
headers in determining whether or not to close the connection. It's been |
| 185 |
changed to use utils_find_lowercase_key(). The close code was also |
| 186 |
refactored to take into account some other close situations. |
| 187 |
|
| 188 |
- dump()/_dumpd() was modified to no longer escape NULLs (\x00) as "\0", |
| 189 |
since that is a kludge shorthand which can backfire if numbers follow |
| 190 |
it. |
| 191 |
|
| 192 |
- dump()/_dump() didn't print out hash entries which had an empty key. |
| 193 |
|
| 194 |
- perltidy was used on all the src/ files. It was about that time...using |
| 195 |
multiple different text editors on multiple different platforms has resulted |
| 196 |
in a whitespace mess. |
| 197 |
|
| 198 |
- There is now a libwhisker2 test harness! Well, the beginnings of one, |
| 199 |
anyways. Essentially this your standard fare of tests to ensure the |
| 200 |
library functions are operating as expected, and that no regression errors |
| 201 |
creep into the mix. The new test/ directory houses the test harness and |
| 202 |
associated files. Included with the test harness is testserver.pl, a |
| 203 |
testcase web server which can be used to feed premade HTTP response |
| 204 |
testcases or create ad-hoc testcase responses based on URL designations. |
| 205 |
|
| 206 |
- uri_split() didn't set {whisker}->{ssl}=0 when splitting a non-HTTPS URL |
| 207 |
into a request hash that previously had SSL enabled. |
| 208 |
|
| 209 |
- Lots of POD documentation clarifications, additions, and updates. |
| 210 |
|
| 211 |
- Modified uri_absolute() to not add the port (":443") into the URL for |
| 212 |
HTTPS URLs (because it's redundant). |
| 213 |
|
| 214 |
- Modified uri_normalize() to now preserve any URL parameters and fragments, |
| 215 |
so things like "http://server/a/b/../p?foo" will now come out as |
| 216 |
"http://server/a/p?foo", while "http://server/a/b/../p?foo=/../" will also |
| 217 |
correctly come out as "http://server/a/p?foo=/../" and not "http://server/a/" |
| 218 |
|
| 219 |
- uri_strip_path_parameters() was not correctly returning any trailing |
| 220 |
slashes. This was actually caused by Perl's split(), which ignores |
| 221 |
trailing elements if no 3rd parameter limit is defined. Supposedly using |
| 222 |
a -1 for the limit fixes this in more recent Perls, but I'm not sure how |
| 223 |
backwards-compatible this is to older Perls. If split() behaves differently |
| 224 |
in this respect, I likely will create a run-time test to determine the |
| 225 |
available split behavior and act accordingly. |
| 226 |
|
| 227 |
- uri_parse_parameters() incorrectly took a shortcut and returned an empty |
| 228 |
parameter set if there was as single name parameter without a value. |
| 229 |
|
| 230 |
- uri_parse_parameters() had a little bit of refactoring, in order to use |
| 231 |
uri_unescape() rather than internally duplicating the same functionality. |
| 232 |
|
| 233 |
- uri_escape() didn't escape the #, /, or \ characters (which have special |
| 234 |
meaning to web browsers). I also added the @ and ; characters to the list |
| 235 |
to always escape, since they could have special meaning depending on where |
| 236 |
they are used (username or password embedded into the URL, path parameter, |
| 237 |
etc.). Better safe than sorry (and it doesn't hurt anything to encode |
| 238 |
them, other than wasting an extra two bytes per character). |
| 239 |
|
| 240 |
- utils_lowercase_keys() had an improper test to determine if the key |
| 241 |
needed lower-casing (it looked for tr/A-Z//c rather than tr/A-Z//). |
| 242 |
|
| 243 |
- utils_find_lowercase_keys() (and utils_find_key()) were modified to |
| 244 |
account for times when two unique normal keys result in the same lowercase |
| 245 |
name. Previously, libwhisker just returned value(s) associated with the |
| 246 |
first key that matches. Now the function gathers all values of all possible |
| 247 |
matches, and returns a value/array based on the final super-set. |
| 248 |
|
| 249 |
- utils_getline() and utils_getline_crlf() were modified to use \x0d\x0a |
| 250 |
instead of \r\n, in order to be more portable. |
| 251 |
|
| 252 |
- Added 'my' to limit the scope of the $POS internal position variables used |
| 253 |
by utils_getline() and utils_getline_crlf(). |
| 254 |
|
| 255 |
- _stream_buffer_read() used len() instead of length(). |
| 256 |
|
| 257 |
- http_req2line() incorrectly added {uri_user} if {uri_password} was set, |
| 258 |
resulting in a string which looked like "user:user" rather than "user:pass" |
| 259 |
|
| 260 |
- Major overhaul to http_fixup_request() to make it more robust, and to |
| 261 |
clean out any lingering values which may conflict with having a RFC- |
| 262 |
compliant request. http_fixup_request() will now forcibly make the request |
| 263 |
HTTP compliant as much as possible. |
| 264 |
|
| 265 |
- Changes to all the various cookie functions, in order to accomodate the |
| 266 |
default domain and URL of a cookie and otherwise be RFC 2109 compliant. All |
| 267 |
of the information regarding how Libwhisker handles cookies is now available |
| 268 |
in the new docs/cookies.txt file. All changes are backwards compatible with |
| 269 |
previous 2.4 formats and functionality, with a single exception: cookie |
| 270 |
domains in the form of 'http://server.com/' are no longer accepted (they were |
| 271 |
never legal, and I'm not sure why I implemented that superfluous parsing to |
| 272 |
begin with). Also, the 'expires' cookie value is now always undefined. |
| 273 |
|
| 274 |
- cookie_write() didn't ignore the 'secure' restriction when $override was |
| 275 |
true. |
| 276 |
|
| 277 |
- Added cookie_get_names() function, so you can get the names for use with |
| 278 |
cookie_get() without having to access the raw $jar structure (which should |
| 279 |
be an undefined object that shouldn't be used directly). |
| 280 |
|
| 281 |
- Added cookie_get_valid_names() function, which gives you the list of |
| 282 |
cookies which qualify as valid for the specified domain and url. |
| 283 |
|
| 284 |
- Modified cookie_set() to delete the given cookie name if the cookie value |
| 285 |
is empty or undefined. |
| 286 |
|
| 287 |
- Added utils_carp() and utils_croak(), which act like the respective |
| 288 |
functions in the Carp module (except not quite as configurable/flexible). |
| 289 |
|
| 290 |
- Changed all internal use of die() and warn() to use the new utils_carp() |
| 291 |
and utils_croak() functions. |
| 292 |
|
| 293 |
- Added time_mktime(), which is similar to the mktime function in the POSIX |
| 294 |
module or the TimeLocal module. Namely it converts a set of values (such |
| 295 |
as those returned by localtime/gmtime) back to a single seconds value. |
| 296 |
|
| 297 |
- Added time_gmtolocal() which converts a GMT seconds value to a local |
| 298 |
timezone value. |
| 299 |
|
| 300 |
- Tweak the internal _http_get*() functions to not enter an infinite loop |
| 301 |
when reading from a partially filled buffer stream. |
| 302 |
|
| 303 |
- The internal _http_getall() function didn't clear stream->{bufin}, |
| 304 |
which is technically wrong but never caused a problem since _http_getall() |
| 305 |
was only used in situations where we read until EOF and then close the |
| 306 |
stream (and thus never use {bufin} again). |
| 307 |
|
| 308 |
- http_construct_headers() did not print out all values of a multi-value |
| 309 |
header if the header_order explicitly only printed out some (but not all) |
| 310 |
of the values; the remaining values were ignored. |
| 311 |
|
| 312 |
- Changed how the max_size parameter of the internal _http_getall() |
| 313 |
function is handled. Since it's an internal function, you shouldn't be |
| 314 |
using it anyway. :) |
| 315 |
|
| 316 |
- http_read_body() now clears {whisker}->{data} for all code paths, which |
| 317 |
it should have been doing but only did some of the time; caused a bug when |
| 318 |
the length parameter == 0. |
| 319 |
|
| 320 |
- http_read_body() how shortcuts out if the supplied length parameter is |
| 321 |
negative. |
| 322 |
|
| 323 |
- The max_size calculations when handling chunked bodies for |
| 324 |
http_read_body() were off, causing all kinds of read problems when a |
| 325 |
max_size was specified in the request. Note that when you specify a max_size, |
| 326 |
you run the risk of interrupting the chunk processing, which means the |
| 327 |
connection has to be closed and you lose any keep-alive advantages. |
| 328 |
|
| 329 |
- Just a quick note that http_read_body() doesn't quite honor {max_size} |
| 330 |
if {save_raw_chunks} is enabled. Only the size of the actual data value is |
| 331 |
computed against the max_size limit; the extra bytes comprising the chunk |
| 332 |
values, as well as any trailing headers, are not calculated against the |
| 333 |
max_size value. This might change in the future, but I feel this is an |
| 334 |
acceptable caveat for now. |
| 335 |
|
| 336 |
- Change to decode_unicode() in order to get rid of a Perl warning |
| 337 |
involving pack(). |
| 338 |
|
| 339 |
- http_reset() was modified to forcibly clear the internal http host cache. |
| 340 |
|
| 341 |
- Turns out Net::SSL die()'s during connection attempts if they don't |
| 342 |
succeed, and libwhisker wasn't trapping the die(). Basically just wrapped |
| 343 |
the connect in an eval{}. |
| 344 |
|
| 345 |
- Sprinkled in some missing binmode()'s to appease the spawn of Gates. |
| 346 |
|
| 347 |
- http_do_request_ex() incorrectly set {whisker}->{http_message} instead |
| 348 |
of {message} when dealing with HTTP/0.9 requests. |
| 349 |
|
| 350 |
- There was a call to Net::SSLeay::ctrl() which was causing occasional |
| 351 |
errors. The code was introduced way back in Libwhisker 1.5 for SSL |
| 352 |
session resuming, and has been carried through since then. It's now |
| 353 |
been removed. |
| 354 |
|
| 355 |
- Added the {whisker}->{shortcut_on_404} option, which causes http_do_request |
| 356 |
to *NOT* read the response body content and instead return (although all |
| 357 |
headers are read and returned like normal; just the body content is skipped). |
| 358 |
This can be a useful speed improvement for CGI scanners built on |
| 359 |
Libwhisker, since a 404 normally indicates the file isn't found, and there's |
| 360 |
no point on reading the body content. (Ultimately it's essentially the |
| 361 |
same outcome as a HEAD requestr; but in this case, it's like a HEAD request |
| 362 |
for 404's & a GET request for everything else, without having to make two |
| 363 |
different requests to get the body content for non-404 responses). |
| 364 |
|
| 365 |
- Sprinkled in some more error checking for Net::SSLeay functions. |
| 366 |
Apparently not all functions return the error value; it has to be checked for |
| 367 |
separately. |
| 368 |
|
| 369 |
- The Net::SSLeay stream had a bug when used to connect via a proxy, |
| 370 |
resulting in a malformed CONNECT request. |
| 371 |
|
| 372 |
- Auth_brute_force() was incorrectly calling auth_set_header() instead of |
| 373 |
auth_set(). |
| 374 |
|
| 375 |
---------------------------------------------------------------------------- |
| 376 |
|
| 377 |
[] libwhisker 2.3 |
| 378 |
|
| 379 |
- utils_find_key() had a bug which caused lowercase comparisions (which |
| 380 |
is fine for utils_find_lowercase_key(), but not utils_find_key()) |
| 381 |
|
| 382 |
- http_req2line() didn't take SSL into account when {include_host_in_uri} |
| 383 |
was set |
| 384 |
|
| 385 |
- David Maciejak pointed out that there was no way to use {whisker}-> |
| 386 |
{bind_socket} to bind a specific address but not a port (i.e. you were |
| 387 |
always required to specify a port). So I added the '*' option to |
| 388 |
{whisker}->{bind_port}, which will attempt to find a valid port to bind |
| 389 |
to. |
| 390 |
|
| 391 |
- The default behavior of {whisker}->{bind_socket} has been changed to use |
| 392 |
'*' as the value of {whisker}->{bind_port} if {bind_port} is not explicitly |
| 393 |
set. The prior behavior was to use port 14011 if {bind_port} was not set. |
| 394 |
|
| 395 |
- Added some error checking on the {whisker}->{bind_socket} values in |
| 396 |
_stream_socket_alloc(). |
| 397 |
|
| 398 |
- Added a new buffer stream type. Basically, if you define {whisker}-> |
| 399 |
{buffer_stream}, you get a stream which acts much like an echo server. |
| 400 |
First it starts out empty. Then, whatever you write to it, is turned |
| 401 |
around and available when you read from it. This functionality is only |
| 402 |
useful for those using the low-level stream abstractions in situations |
| 403 |
where you want to stuff dynamic data into a stream and then pass it to a |
| 404 |
function which reads from the stream. |
| 405 |
|
| 406 |
- Changed the stream key generation order around a bit. Prior to this |
| 407 |
version, SSL streams trumped file streams...which is incorrect. The |
| 408 |
new order of priority is: buffer, file, SSL, UDP, TCP. |
| 409 |
|
| 410 |
- Added http_resp2line() function, which is the compliment to |
| 411 |
http_req2line(). |
| 412 |
|
| 413 |
- Added utils_flatten_lwhash() function, which takes a %request or |
| 414 |
%response hash and recreates the approximate HTTP request/response text. |
| 415 |
|
| 416 |
- The {whisker}->{data_sock} option turned out to not be exactly ideal, |
| 417 |
since the stream wrapper might have buffered some of the socket data. So |
| 418 |
now when you set {whisker}->{data_sock}, you get {whisker}->{data_sock} |
| 419 |
(the old, not recommended way) and a newer {whisker}->{data_stream} response |
| 420 |
item. This is only for people who don't want libwhisker to read the body |
| 421 |
of an HTTP response, and would rather have direct access to the |
| 422 |
stream/socket to read it themselves. |
| 423 |
|
| 424 |
- Antonio "s4tan" Parata pointed out that uri_get_dir() returned the |
| 425 |
original URI when the URI didn't have a directory (i.e. "index.html"). This |
| 426 |
is obviously incorrect, as "index.html" would not be the directory. For the |
| 427 |
cases where no '/' is found in the URI, the return value will now be an empty |
| 428 |
string. |
| 429 |
|
| 430 |
- Uber at hush.com pointed out a bug in crawl() when {use_params} is enabled. |
| 431 |
Essentially a shortcut was taken prematurely, before the use_params |
| 432 |
processing occurred. |
| 433 |
|
| 434 |
- Dave King found a bug in _stream_is_valid(), due to my incorrect use of |
| 435 |
'last' in a 'do/while' block (which is NOT an actual loop!). |
| 436 |
|
| 437 |
- Uber at hush.com found that http_fixup_request() was setting |
| 438 |
Content-Encoding, rather than Content-Type, on POST requests. I'm amazed |
| 439 |
and embarrassed that I never noticed this before, especially by the fact that |
| 440 |
many servers still accept the bunk Content-Encoding and lack of Content-Type |
| 441 |
as valid. |
| 442 |
|
| 443 |
---------------------------------------------------------------------------- |
| 444 |
|
| 445 |
[] libwhisker 2.2 |
| 446 |
|
| 447 |
- Sullo pointed out that the api_demo.pl script uses save_ssl_info, rather |
| 448 |
than ssl_save_info. As it turns out, api_demo.pl was horribly out of date. |
| 449 |
It's been given an overhaul using the new libwhisker 2.x programming |
| 450 |
semantics. |
| 451 |
|
| 452 |
- Sullo also pointed out that ssl_save_info wasn't working. This was |
| 453 |
because _http_do_request_ex() was erasing the ssl data previously set by |
| 454 |
http_do_request(). |
| 455 |
|
| 456 |
- Added 'use_referrers' crawl() config option, which is enabled by default. |
| 457 |
This causes the crawler to send appropriate HTTP referrers for all crawled |
| 458 |
links. |
| 459 |
|
| 460 |
- Changed some internals of crawl() to keep the url_queue inside the |
| 461 |
crawl object, which makes it accessible to the source callback function. |
| 462 |
|
| 463 |
- Added 'install_lw1' option to Makefile to automatically install the LW(1) |
| 464 |
compatibility bridge file (which emulates Libwhisker 1.x, letting Libwhisker |
| 465 |
version 1.x programs use the Libwhisker 2.x library transparently). |
| 466 |
|
| 467 |
- Added cookie_new_jar() function, to handling creating new jars (which are |
| 468 |
still hashes at this point, but you should still use the function). |
| 469 |
|
| 470 |
- More documentation updates. |
| 471 |
|
| 472 |
- http_fixup_request() now forces the correct POST data length, and does some |
| 473 |
extra checks to make sure leftover POST headers from previous requests are |
| 474 |
dealt with. |
| 475 |
|
| 476 |
- Added utils_delete_lowercase_key() function for deleting hash keys without |
| 477 |
worrying about the capitalization. |
| 478 |
|
| 479 |
- Small change to http_read_headers() to reset the match position pointer. |
| 480 |
|
| 481 |
- sgt_b made me realize the need for a utils_find_key() function, which is |
| 482 |
similar to utils_find_lowercase_key() but is case-sensitive. Sure, a quick |
| 483 |
hash lookup would find the key too, but utils_find_key() has the added bonus |
| 484 |
of dereferencing anonymous arrays of multiple header values, if encountered. |
| 485 |
|
| 486 |
- Dave King's query on handling form data returned from forms_read() led me |
| 487 |
to creating a forms_walkthrough.txt document and the form_demo.pl scripts. |
| 488 |
|
| 489 |
- Found a bug in the _forms_parse_callback() (used internally by forms_read()) |
| 490 |
which caused it to mishandle textareas. The html_find_tags() function |
| 491 |
already does the work of finding the closing </textarea> tag, so |
| 492 |
_forms_parse_callback() doesn't need to do it. The HTML parser must do it |
| 493 |
this way, since tags within a <textarea></textarea> are not to be parsed. |
| 494 |
|
| 495 |
- Bug in uri_parse_parameters(), which took a shortcut exit if a '&' |
| 496 |
wasn't found. The shortcut should actually be triggered on a '='. |
| 497 |
|
| 498 |
- Bug in html_find_tags() which caused non-value attributes to be saved |
| 499 |
with a empty string value. Now non-value attributes are saved with an |
| 500 |
undef value. |
| 501 |
|
| 502 |
- For some reason an extra empty element was being introduced into |
| 503 |
hash during forms_write(). I've traced it and can't figure out where |
| 504 |
it's coming from. In the meantime, I've added a check to make sure |
| 505 |
any empty elements don't show up in the output. |
| 506 |
|
| 507 |
- Mathieu Dessus pointed out a bug where the older anti_ids() function was |
| 508 |
still being called, rather than the renamed encode_anti_ids(). You still |
| 509 |
use {whisker}->{anti_ids} to set the values though... |
| 510 |
|
| 511 |
---------------------------------------------------------------------------- |
| 512 |
|
| 513 |
[] libwhisker 2.1 |
| 514 |
|
| 515 |
- Sullo pointed out that $LW_HAS_SSL has disappeared. Forgot to document |
| 516 |
that. Use $LW_SSL_LIB instead. |
| 517 |
|
| 518 |
- Changed a (len!=0) to (len>0) check in the chunk decoder, to be more |
| 519 |
robust. |
| 520 |
|
| 521 |
- added html_link_extractor() function, which uses code already present in |
| 522 |
the crawl module. |
| 523 |
|
| 524 |
- The regex was a bit broken in encode_uri_randomhex(). Pointed out by |
| 525 |
John McDonald. |
| 526 |
|
| 527 |
- John also found a typo in encode_anti_ids(), causing it to call the |
| 528 |
non-existant function encode_randomase(). |
| 529 |
|
| 530 |
- New Makefile.pl build environment. |
| 531 |
|
| 532 |
- Bug in forms_read() and _forms_callback() which prevented the proper |
| 533 |
storage of multiple forms. |
| 534 |
|
| 535 |
---------------------------------------------------------------------------- |
| 536 |
|
| 537 |
[] libwhisker 2.0 |
| 538 |
|
| 539 |
- Libwhisker 2.0 is officially dubbed LW2. Below are the incompatible |
| 540 |
changes from libwhisker 1.x. There were lots of general changes, but |
| 541 |
only the non-backwards-compatible ones are documented. |
| 542 |
|
| 543 |
- Following were renamed: |
| 544 |
{whisker}->{req_spacer*} => {whisker}->{http_space*} |
| 545 |
{whisker}->{http_ver} => {whisker}->{version} |
| 546 |
{whisker}->{http_protocol} => {whisker]->{protocol} |
| 547 |
{whisker}->{uri_param} => {whisker}->{parameters} |
| 548 |
{whisker}->{recv_header_order} => {whisker}->{header_order} |
| 549 |
{whisker}->{http_resp_message} => {whisker}->{message} |
| 550 |
{whisker}->{INITIAL_MAGIC} => {whisker}->{MAGIC} |
| 551 |
{whisker}->{sockstate} => {whisker}->{socket_state} |
| 552 |
utils_lowercase_(hashkeys|headers) => utils_lowercase_keys |
| 553 |
utils_split_uri => uri_split |
| 554 |
utils_join_uri => uri_join |
| 555 |
utils_normalize_uri => uri_normalize |
| 556 |
utils_absolute_uri => uri_absolute |
| 557 |
utils_get_dir => uri_get_dir |
| 558 |
utils_unidecode_uri => decode_unicode |
| 559 |
anti_ids => encode_anti_ids |
| 560 |
bruteurl => utils_bruteurl |
| 561 |
auth_set_header => auth_set |
| 562 |
encode_str2uri => encode_uri_hex |
| 563 |
encode_str2ruri => encode_uri_randomhex |
| 564 |
dumper => dump |
| 565 |
dumper_writefile => dump_writefile |
| 566 |
|
| 567 |
- Following are now depreciated (along with their functionality): |
| 568 |
{whisker}->{method_postfix} |
| 569 |
{whisker}->{http_req_trailer} |
| 570 |
{whisker}->{queue_md5} (use {request_fingerprint}) |
| 571 |
{whisker}->{http_resp} (use {code}) |
| 572 |
{whisker}->{retry_errors} |
| 573 |
{whisker}->{ids_session_splice} |
| 574 |
do_auth (use auth_set) |
| 575 |
upload_file |
| 576 |
download_file (use get_page_to_file) |
| 577 |
md5_perl (use md5) |
| 578 |
md4_perl (use md4) |
| 579 |
(en|de)code_base64_perl (use (en|de)code_base64) |
| 580 |
crawl_get_config |
| 581 |
crawl_set_config |
| 582 |
|
| 583 |
- {whisker}->{parameters} will not be included if it's an empty string |
| 584 |
|
| 585 |
- {whisker}->{normalize_incoming_headers} now changes AA-Bb-cc-dD to |
| 586 |
Aa-Bb-Cc-Dd, instead of the prior AA-Bb-Cc-DD. |
| 587 |
|
| 588 |
- Invalid HTTP response error message does not include invalid response |
| 589 |
(but it's still in {whisker}->{data}) |
| 590 |
|
| 591 |
- IDS session splicing is depreciated. Most IDSes do stream reassembly |
| 592 |
anyways, so this is not a big loss. The depreciation is due to |
| 593 |
limitations of the current stream implementation. It will reappear in |
| 594 |
future versions. |
| 595 |
|
| 596 |
- cookie_* now operates independantly of the actual set-cookie header. |
| 597 |
http_do_request now has internal magic, so that all cookies are saved |
| 598 |
and processed regardless of header capitalization, normalization, |
| 599 |
and duplication (including the default ignore_duplicate_headers). |
| 600 |
|
| 601 |
- Lots of the global variables were changed/renamed or removed. See |
| 602 |
globals.pl for details. |
| 603 |
|
| 604 |
- Crawl was completely rebuilt to be more object-ish (the use of so |
| 605 |
many global variables made it hard to have multiple crawl sessions |
| 606 |
going at once). If you were using crawl(), then you will need to |
| 607 |
review the new way of calling crawl() and accessing related data. |
| 608 |
All the crawl data structures (and locations) were changed, as were |
| 609 |
the format for configuring the crawler and callbacks. |
| 610 |
|
| 611 |
- Dumper() returns undef on error, instead of the string 'ERROR'. |
| 612 |
|
| 613 |
- html_find_tags() takes a few more optional parameters. Using |
| 614 |
a tag map can lead to speed increases by reducing the amount of |
| 615 |
times the callback function is actually called. |
| 616 |
|
| 617 |
- The libwhisker 1.x series did not properly generate forms structures |
| 618 |
(via forms_read()). It was corrected, but the generated structure, while |
| 619 |
now accurate per documention, is not backwards-compatible. |
| 620 |
|
| 621 |
- Authorization is now handled via auth_set(), and not merely by the |
| 622 |
presence of the Authorization header. Also, the internal |
| 623 |
{whisker}->{ntlm_*} keys relating to NTLM authentication have been deleted. |
| 624 |
You shouldn't have been using them anyway. :) |
| 625 |
|
| 626 |
- Socket timeout values are read from {whisker}->{timeout}, and are |
| 627 |
saved per stream. The global $TIMEOUT variable no longer exists. |
| 628 |
|
| 629 |
- HTML rewriting via html_find_tags() is now done by calling |
| 630 |
html_find_tags_rewrite() within our callback function. The return value |
| 631 |
of the callback is ignored (and thus not required, unlike LW1.x). |
| 632 |
|
| 633 |
- auth_set() will now call http_reset() whenever any NTLM-based authentication |
| 634 |
is used. This is because NTLM is a connection-based authentication, and |
| 635 |
thus all connections need to start from scratch when NTLM is enabled. |
| 636 |
|
| 637 |
- The ETag header is now normalized to ETag, and not Etag. |
| 638 |
|
| 639 |
- All new POD documentation, which follows the more standard format for use with pod2man. |
| 640 |
|
| 641 |
- utils_find_lowercase_keys() will now dereference multi-value entries and |
| 642 |
return a full array if it is called in array context. |
| 643 |
|
| 644 |
- A bug in Crypt::SSLeay (Net::SSL) 0.51 (and probably prior) causes it to |
| 645 |
puke when it is used in proxy mode. Hopefully it will be fixed in future |
| 646 |
versions. |
| 647 |
|
| 648 |
- Turns out the Net::SSLeay implementation of MD5 was returning bad hashes |
| 649 |
(it truncated them at the first NULL byte). Use of Net::SSLeay::md5 has |
| 650 |
been discontinued permanently. |
| 651 |
|