Strange response from IIS

35 views
Skip to first unread message

Roman Rusakov

unread,
Sep 9, 2014, 8:51:17 AM9/9/14
to webi...@googlegroups.com
Dear all. Please help me to understand. I'm doing a simple http get request with webinject and getting something like this in http.log:

<.h.t.m.l.>.
.
.<.h.e.a.d.>.<.i.>.S.o.m.e.. .t.e.x.t.. .2..1.5...0.<./.i.>.,.
.
.<.h.1.>..<.f.o.n.t. .c.o.l.o
.
.<.l.i.>.P.r.o.f.i.l.e. .'.
.
.<./.u.l.>.
.
.<./.h.t.m.l.>.
.
.

Waht are all those dots in response?

P.S. I tried in 1.41 nagios version and in 1.84 from github. 

Karsten Sievert

unread,
Sep 9, 2014, 10:26:27 AM9/9/14
to webi...@googlegroups.com
Hi!

You may want to check if the server is responding with a UTF-16 encoded page.
In that case, the dots represent the upper byte of each 2-byte character
(usually null bytes). Hope this helps.


-K
> --
> You received this message because you are subscribed to the Google Groups "WebInject" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to webinject+...@googlegroups.com <mailto:webinject+...@googlegroups.com>.
> For more options, visit https://groups.google.com/d/optout.

Roman Rusakov

unread,
Sep 9, 2014, 1:12:32 PM9/9/14
to webi...@googlegroups.com
Thank you very much  KarstenSie! Yes it is in utf-16. 

But i can't understand why I can get this page in normal view using a simple script - 
require LWP::UserAgent;
$useragent = LWP::UserAgent->new;
$useragent->agent('WebInject');
$useragent->max_redirect('0');
$request = new HTTP::Request('GET',"https://some.url/status");
$response = $useragent->request($request);
print $response->as_string; print "\n\n";


All commands I just copied from webinject.pl as is.

So maybe I cant get normaly encoded content from webinject.pl too? But I totaly don't understand in what string of webinject.pl should I change something?

вторник, 9 сентября 2014 г., 17:26:27 UTC+3 пользователь KarstenSie написал:

Karsten Sievert

unread,
Sep 9, 2014, 5:53:35 PM9/9/14
to webi...@googlegroups.com
Hi, Roman,

I'm guessing here, but it looks like in this line,
$response = $useragent->request($request);
the variale $response contains UTF-16, and the next line is naïvely printing it as_string.
print $response->as_string; print "\n\n";

But before it can be printed, a conversion has to be performed.
Here is where my knowledge ends. Neither do I know how to detect this situatioon,
nor do I know how to convert from UTF-16 to UTF-8 or latin-1 (whatever you need,
UTF-8 preferred) in Perl.

Wikipedia has great articles about Unicode character representation and it's UTF-16/8 encoding.
You will probably have to read them until you understand the topic -- it took me several reads
to wrap my head around it.

I understand this: Webinject produces output in plain ASCII, which is compatible to both
UTF-8 and Latin-*. So inserting sniplets from UTF-8 web pages makes the output UTF-8,
inserting sniplets in Latin-* makes the output Latin-*. But sniplets in UTF-16 are
incompatible and need to be converted to UTF-8, so that the output is legal UTF-8.

Anybody else who can fill in here and help Roman or fix the code? I am out.


Regards
-Karsten
> > To unsubscribe from this group and stop receiving emails from it, send an email to webinject+...@googlegroups.com <javascript:> <mailto:webinject+...@googlegroups.com <javascript:>>.
> > For more options, visit https://groups.google.com/d/optout <https://groups.google.com/d/optout>.
Reply all
Reply to author
Forward
0 new messages