1

我需要查询 Google 的一项服务。我读了这个答案:从谷歌洞察下载 csv 进行搜索
该问题的复制和粘贴代码是:

using (var client = new WebClient())
    {
        // TODO: put your real email and password in the request string
        var response = client.DownloadString("https://www.google.com/accounts/ClientLogin?accountType=GOOGLE&Email=youraccount@gmail.com&Passwd=secret&service=trendspro&source=test-test-v1");
        // The SID is the first line in the response
        var sid = response.Split('\n')[0];
        client.Headers.Add("Cookie", sid);
        byte[] csv = client.DownloadData("http://www.google.com/insights/search/overviewReport?q=test&cmpt=q&content=1&export=2");

        // TODO: do something with the downloaded csv file:
        Console.WriteLine(Encoding.UTF8.GetString(csv));
        File.WriteAllBytes("report.csv", csv);
    }

我想知道在字符串中发送密码是否安全或可以被抓取?

如果这不安全,应该怎么做?

4

2 回答 2

2

由于它使用https(不是纯 HTTP),因此它应该与网络上的大多数其他东西一样安全。建立基础 TLS 连接后,包括 URL 在内的所有数据都会在加密通道上传输。

于 2010-03-06T18:31:43.750 回答
1

这是那些“好消息,坏消息”的情况之一。

好消息:窃听者无法获取密码(因为它是通过 HTTPS 发送的:加密)。

坏消息:会话 cookie 可以被窃听者获取(因为它是通过 HTTP 发送的:未加密)。正如 Firesheep 所证明的那样,让某人访问您的 Google 会话 cookie 是危险的,因为它使攻击者可以访问您的电子邮件和存储在 Google 上的其他内容。

如果您可以将httpURL更改为httpsURL,那会更安全。

于 2011-09-19T03:28:33.593 回答