0

私の目標は、C++/Winsock を使用して vBulletin フォーラムにログインすることです。フォーラムは、forums.randi.org です。

この目的のために、私はパケットを盗聴してきました。これは、ログインの詳細を提供する POST 要求に対するサーバー応答のヘッダーです。

HTTP/1.1 200 OK
Date    Tue, 19 Feb 2013 18:12:52 GMT
Server  Apache/2.0.63 (Unix) mod_ssl/2.0.63 OpenSSL/0.9.8e-fips-rhel5 mod_bwlimited/1.4 PHP/5.2.8
X-Powered-By    PHP/5.2.8
Set-Cookie  bblastvisit=1361297572; expires=Wed, 19-Feb-2014 18:12:52 GMT; path=/
Set-Cookie  bblastactivity=0; expires=Wed, 19-Feb-2014 18:12:52 GMT; path=/
Set-Cookie  bbwelcomeheaders=1361297572; path=/
Set-Cookie  bbsessionhash=9ad9da23b1399e81772437c3819a2501; path=/; HttpOnly
Cache-Control   private
Pragma  private
X-UA-Compatible IE=7
Content-Encoding    gzip
Content-Length  2152
Connection  close
Content-Type    text/html; charset=ISO-8859-1

私の問題は、応答の内容を読もうとしても役に立たないことです。ヘッダーが示すように、コンテンツの長さは 2152 バイトである必要があります。私は確かに2152バイトをいくつかのバッファに読み込みましたが、それらは意味不明です(応答ヘッダーは完全に正常に見えます)。同時に、私のスニファー (HttpFox、Firefox プラグイン) は完全に正当なコンテンツを表示しますが、そのサイズは指定された 2152 バイト (約 5900 バイト) よりもはるかに大きくなっています。

ログインに成功した後にスニファによって取得されるコンテンツが続きます。winsock でこのコンテンツを読み取る方法と、ヘッダーに示されている Content-Length よりも長いのはなぜでしょうか。

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!-- BEGIN TEMPLATE: STANDARD_REDIRECT -->

<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="en">
<head>

<!-- Tapatalk Detect Start -->
<script type="text/javascript">
var tapatalk_iphone_msg = "This forum has an app for iPhone and iPod Touch! Click OK to learn more about Tapatalk.";
var tapatalk_iphone_url = "http://itunes.apple.com/us/app/tapatalk-forum-app/id307880732?mt=8";
var tapatalk_ipad_msg = "This forum has an app for iPad! Click OK to learn more about Tapatalk.";
var tapatalk_ipad_url = "http://itunes.apple.com/us/app/tapatalk-hd-for-ipad/id481579541?mt=8";
var tapatalk_kindle_msg = "This forum has an app for Kindle Fire! Click OK to learn more about Tapatalk.";
var tapatalk_kindle_url = "http://www.amazon.com/gp/mas/dl/android?p=com.quoord.tapatalkpro.activity";
var tapatalk_android_msg = "This forum has an app for Android. Click OK to learn more about Tapatalk.";
var tapatalk_android_url = "market://details?id=com.quoord.tapatalkpro.activity";
var tapatalk_chrome_enable = true;
var tapatalkdir = "mobiquo";
</script>
<script type="text/javascript" src="http://forums.randi.org/mobiquo/tapatalkdetect.js"></script>
<!-- Tapatalk Detect End -->

<!-- BEGIN TEMPLATE: headinclude -->
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<meta name="generator" content="vBulletin 3.7.7" />

<meta name="keywords" content="randi, amazing, jref, skeptic, pigasus, debunk, critical thinking, lecture, geller, dowsing, cold reading, cottingley, weird things, paranormal, million dollar challenge, magic, faith healer, nostradamus, fraud, hoax, occult, supernatural, conjuring, uri geller, yuri, flim flam, psychics, john edward, sylvia browne, clock, van praagh,vbulletin,forum,bbs,discussion,jelsoft,bulletin board, psi, amazing meeting" />
<meta name="description" content="The JREF Forum is provided by the James Randi Educational Foundation, a non-profit educational organisation whose goals include promoting critical thinking everywhere, go to http://forums.randi.org/." />


<!-- CSS Stylesheet -->
<style type="text/css" id="vbulletin_css">
/**
* vBulletin 3.7.7 CSS
* Style: 'JREF'; Style ID: 23
*/
@import url("clientscript/vbulletin_css/style-f5050f4f-00023.css");
</style>
<link rel="stylesheet" type="text/css" href="clientscript/vbulletin_important.css?v=377" />


<!-- / CSS Stylesheet -->

<script type="text/javascript" src="http://yui.yahooapis.com/2.9.0/build/yahoo-dom-event/yahoo-dom-event.js?v=377"></script>
<script type="text/javascript" src="http://yui.yahooapis.com/2.9.0/build/connection/connection-min.js?v=377"></script>
<script type="text/javascript">
<!--
var SESSIONURL = "";
var SECURITYTOKEN = "guest";
var IMGDIR_MISC = "http://forums.randi.org/helloworld2/misc";
var vb_disable_ajax = parseInt("0", 10);
// -->
</script>
<script type="text/javascript" src="clientscript/vbulletin_global.js?v=377"></script>
<script type="text/javascript" src="clientscript/vbulletin_menu.js?v=377"></script>


    <link rel="alternate" type="application/rss+xml" title="JREF Forum RSS Feed" href="external.php?type=RSS2" />





<!-- END TEMPLATE: headinclude -->
<title>JREF Forum</title>
</head>
<body>

<br />
<br />
<br />
<br />

<form action="http://forums.randi.org/forumindex.php" method="post" name="postvarform">
<div style="width: 70%; margin: 0 auto;">
<table class="tcat-rounded" cellpadding="0" cellspacing="0" border="0" width="100%" align="center">
    <tr>
        <td width="10" class="tcat-rounded-left"><img src="http://forums.randi.org/helloworld2/misc/spacer.gif" width="10" height="28" border="0" alt="" /></td>

    <td class="tcat">Redirecting...</td>
        <td width="10" class="tcat-rounded-right"><img src="http://forums.randi.org/helloworld2/misc/spacer.gif" width="10" height="28" border="0" alt="" /></td>
    </tr>
</table>
</div>
<table class="tborder" cellpadding="6" cellspacing="1" border="0" width="70%" align="center">
<tr>
    <td class="panelsurround" align="center">
    <div class="panel">

        <blockquote>
            <p>&nbsp;</p>
            <p><strong>Thank you for logging in, XXXX.</strong></p>

                <p class="smallfont"><a href="http://forums.randi.org/forumindex.php">Click here if your browser does not automatically redirect you.</a></p>
                <div>&nbsp;</div>

        </blockquote>

    </div>
    </td>
</tr>
</table>
</div>
</form>



<noscript>
<meta http-equiv="Refresh" content="2; URL=http://forums.randi.org/forumindex.php" />
</noscript>

<script type="text/javascript">
<!--
function exec_refresh()
{
    window.status = "Redirecting..." + myvar;
    myvar = myvar + " .";
    var timerID = setTimeout("exec_refresh();", 100);
    if (timeout > 0)
    {
        timeout -= 1;
    }
    else
    {
        clearTimeout(timerID);
        window.status = "";
        window.location = "http://forums.randi.org/forumindex.php";
    }
}

var myvar = "";
var timeout = 20;
exec_refresh();
//-->
</script>



</body>
</html>
<!-- END TEMPLATE: STANDARD_REDIRECT -->
4

1 に答える 1

0

すでにgzipで圧縮されていないデータを表示しながら、2152バイトはgzipped data送信済み(Content-Encoding gzipヘッダーを参照)に参照されていると思います。HttpFox

于 2013-02-19T20:50:36.790 に答える