2

我使用此代码使用我的高级帐户连接到 fileserve.com 我想共享我的程序但他们可以使用“HTTP Analyzer”轻松嗅探用户名和密码有没有办法隐藏我的用户名和密码以防止嗅探?我使用 delphi 2007 .

procedure TForm1.Button1Click(Sender: TObject);
var
  i:integer;
  Data, Page : TStringList;
begin
  IdHTTP1.OnRedirect := nil;
  IdHTTP1.AllowCookies := True;
  IdHTTP1.HandleRedirects := True;
  IdHTTP1.ProtocolVersion := pv1_1;
  IdHTTP1.CookieManager := IdCookieManager1;
  IdHTTP1.RedirectMaximum := 15;
  IdHTTP1.Request.UserAgent := 'Mozilla/5.0 (compatible; MSIE 7.0; Windows NT 5.1)';

  Data := TStringList.Create;
  try
    Data.Add('loginUserName=[user]');
    Data.Add('loginUserPassword=[pass]');
    Data.Add('autoLogin=');
    Data.Add('loginFormSubmit=Login');
    IdHTTP1.Post('http://www.fileserve.com/login.php', Data);
  finally
    Data.Free;
  end;

  IdHTTP1.HandleRedirects := False;
  IdHTTP1.OnRedirect := IdHTTP1Redirect;
  IdHTTP1.Get('http://www.fileserve.com/file/aYkRqp3');

  Edit1.Text := idHTTP1.Response.Location;
  for i := 0 to IdCookieManager1.CookieCollection.Count - 1 do
    Memo2.Lines.Add(IdCookieManager1.CookieCollection.Items[i].CookieText);
end;
4

1 回答 1

4

没有办法隐藏您正在传输的位以防止嗅探。您唯一能做的就是加密这些位,这样即使有人掌握了它们,他们也无法弄清楚它们的含义。查看您要连接的网站是否有可用的 HTTPS 版本,并尝试使用该版本(以及 Indy 的 HTTPS 协议处理程序)而不是 HTTP 版本。

于 2011-07-01T18:21:58.327 回答