Advertisement
Guest User

Untitled

a guest
Feb 21st, 2016
238
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.88 KB | None | 0 0
  1. function Splitt(Text, Delimiter: string; Index: Integer): string;
  2. var
  3. Position : Integer;
  4. SubIndex : Integer;
  5. begin
  6. for SubIndex := 1 to Index do
  7. begin
  8. Position := Pos(Delimiter, Text);
  9. if Position <> 0 then
  10. Delete(Text, 1, Position + Length(Delimiter) - 1);
  11. end;
  12. Position := Pos(Delimiter, Text);
  13. if Position <> 0 then
  14. Text:= Copy(Text, 1, Position - 1);
  15. SetLength(Result, Length(Text));
  16. Result:= Text;
  17. end;
  18.  
  19. procedure TForm1.Button8Click(Sender: TObject);
  20. var
  21. Params : TStringList;
  22. SSLIOHandler : TIdSSLIOHandlerSocketOpenSSL;
  23. IdCookieManager1 : TIdCookieManager;
  24. SessionID : string;
  25. Index : Integer;
  26. begin
  27. IdCookieManager1 := TIdCookieManager.Create(Self);
  28. SSLIOHandler := TIdSSLIOHandlerSocketOpenSSL.Create;
  29. IdHttp1.IOHandler := SSLIOHandler;
  30. IdHTTP1.CookieManager := IdCookieManager1;
  31. IdHTTP1.AllowCookies := True;
  32. IdHTTP1.HandleRedirects := True;
  33.  
  34. IdHTTP1.ProtocolVersion := pv1_1; // Set HTTP Protocol Version To v1.1 (Default Value)
  35. // IdHTTP1.HTTPOptions:= IdHTTP1.HTTPOptions + [TIdHTTPOption.hoKeepOrigProtocol]; // Very important, otherwise Indy sets the HTTP Protocol to v1.0
  36. IdHTTP1.HTTPOptions := [hoKeepOrigProtocol];
  37. // You need a vaild User-Agent, otherwise you get wrong Cookies
  38. IdHTTP1.Request.UserAgent:= 'Mozilla/5.0 (Linux; U; Android 2.2.1; en-us; Nexus One Build/FRG83) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1';
  39.  
  40. // Set all parameters
  41. Params := TStringList.Create;
  42. Params.Append('service=' + 'freemail');
  43. Params.Append('successURL=' + 'https://navigator.gmx.net/login');
  44. Params.Append('loginErrorURL=' + 'https://navigator.gmx.net/loginerror');
  45. Params.Append('loginFailedURL=' + 'http://www.gmx.net/logoutlounge/free_ssl/?status=login-failed&site=gmx&agof=97_L&pg=null&pa=-1&pp=___NULL&region=de');
  46. Params.Append('statistics=' + '');
  47. Params.Append('username=' + 'Beurnd_Scmhroetesr@gmx.de');
  48. Params.Append('password=' + '3Xra5CiYU');
  49. Params.Append('uinguserid=' + '');
  50.  
  51. try
  52. IdHTTP1.Get('http://www.gmx.net/'); // Get vaild Cookies
  53.  
  54. IdHTTP1.Request.ContentType := 'application/x-www-form-urlencoded';
  55. IdHTTP1.Request.ContentLength := Length(Trim(Params.Text));
  56.  
  57. IdHTTP1.Post('https://service.gmx.net/de/cgi/login?hal=true', Params);
  58.  
  59. if IdHTTP1.Response.ResponseCode = 200 then
  60. begin
  61. Memo1.Lines.Add('Login OK');
  62. Memo1.Lines.Add(IdHTTP1.Response.ResponseText);
  63. end
  64. else
  65. if IdHTTP1.ResponseCode = 401 then
  66. begin
  67. Memo1.Lines.Add('login invalid');
  68. end
  69. else
  70. ShowMessage('Error')
  71. finally
  72. Params.Free;
  73. end;
  74.  
  75. IdHTTP1.Get('https://service.gmx.net');
  76.  
  77. with IdCookieManager1.CookieCollection do
  78. for Index := 0 to Count - 1 do // alle Cookies durchsuchen
  79.  
  80. if Cookies[Index].CookieText <> '' then
  81. begin
  82. Memo1.Lines.Add(Cookies[Index].CookieText + ' : ' + Cookies[Index].Value);
  83. end;
  84.  
  85.  
  86. with IdCookieManager1.CookieCollection do
  87. for Index := 0 to Count - 1 do // alle Cookies durchsuchen
  88. if Pos('JSESSIONID',Cookies[Index].CookieText) > 0 then
  89. begin
  90. SessionID := Cookies[Index].Value;
  91. // SessionID := Splitt(SessionID, '.', 0);
  92. Memo1.Lines.Add(SessionID);
  93. end;
  94.  
  95. // HttpFox
  96. // https://3c.gmx.net/mail/client/settings/mailsecurity;jsessionid=19C178A2CBC5CC1222B9A96366AE379E-n4.bs62b?2-1.IBehaviorListener.0-splitPanel-splitPanel_body-childContainer-form-spamProtectionChapter-spamProtectionChapter_body-spamProtection-fieldSet-checkboxFormItem-checkboxFormItem_body-checkbox-checkbox&_=1456056625848
  97. // Hier ist der Unterschied -n4.bs62b?2-1
  98.  
  99. Memo1.Lines.Add(IdHTTP1.Get('https://3c.gmx.net/mail/client/settings/mailsecurity;jsessionid=' + SessionID + '.IBehaviorListener.' +
  100. '0-splitPanel-splitPanel_body-childContainer-form-spamProtectionChapter-spamProtectionChapter_body-spamProtection-fieldSet-checkboxFormItem-checkboxFormItem_body-checkbox-checkbox&&origReferre'));
  101.  
  102. //GET /mail/client/settings/mailsecurity;jsessionid=B77C9676AB8B8202EB9BB3C6DE492FF5-n1.bs29b?10-1.IBehaviorListener.0-splitPanel-splitPanel_body-childContainer-form-spamProtectionChapter-spamProtectionChapter_body-spamProtection-fieldSet-checkboxFormItem-checkboxFormItem_body-checkbox-checkbox&_=1456045911329
  103. //GET /mail/client/settings/mailsecurity;jsessionid=B77C9676AB8B8202EB9BB3C6DE492FF5-n1.bs29b?6-1.IBehaviorListener.0-splitPanel-splitPanel_body-childContainer-form-spamProtectionChapter-spamProtectionChapter_body-spamProtection-fieldSet-checkboxFormItem-checkboxFormItem_body-checkbox-checkbox&_=1456042796674
  104.  
  105. end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement