Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function Splitt(Text, Delimiter: string; Index: Integer): string;
- var
- Position : Integer;
- SubIndex : Integer;
- begin
- for SubIndex := 1 to Index do
- begin
- Position := Pos(Delimiter, Text);
- if Position <> 0 then
- Delete(Text, 1, Position + Length(Delimiter) - 1);
- end;
- Position := Pos(Delimiter, Text);
- if Position <> 0 then
- Text:= Copy(Text, 1, Position - 1);
- SetLength(Result, Length(Text));
- Result:= Text;
- end;
- procedure TForm1.Button8Click(Sender: TObject);
- var
- Params : TStringList;
- SSLIOHandler : TIdSSLIOHandlerSocketOpenSSL;
- IdCookieManager1 : TIdCookieManager;
- SessionID : string;
- Index : Integer;
- begin
- IdCookieManager1 := TIdCookieManager.Create(Self);
- SSLIOHandler := TIdSSLIOHandlerSocketOpenSSL.Create;
- IdHttp1.IOHandler := SSLIOHandler;
- IdHTTP1.CookieManager := IdCookieManager1;
- IdHTTP1.AllowCookies := True;
- IdHTTP1.HandleRedirects := True;
- IdHTTP1.ProtocolVersion := pv1_1; // Set HTTP Protocol Version To v1.1 (Default Value)
- // IdHTTP1.HTTPOptions:= IdHTTP1.HTTPOptions + [TIdHTTPOption.hoKeepOrigProtocol]; // Very important, otherwise Indy sets the HTTP Protocol to v1.0
- IdHTTP1.HTTPOptions := [hoKeepOrigProtocol];
- // You need a vaild User-Agent, otherwise you get wrong Cookies
- 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';
- // Set all parameters
- Params := TStringList.Create;
- Params.Append('service=' + 'freemail');
- Params.Append('successURL=' + 'https://navigator.gmx.net/login');
- Params.Append('loginErrorURL=' + 'https://navigator.gmx.net/loginerror');
- Params.Append('loginFailedURL=' + 'http://www.gmx.net/logoutlounge/free_ssl/?status=login-failed&site=gmx&agof=97_L&pg=null&pa=-1&pp=___NULL®ion=de');
- Params.Append('statistics=' + '');
- Params.Append('username=' + 'Beurnd_Scmhroetesr@gmx.de');
- Params.Append('password=' + '3Xra5CiYU');
- Params.Append('uinguserid=' + '');
- try
- IdHTTP1.Get('http://www.gmx.net/'); // Get vaild Cookies
- IdHTTP1.Request.ContentType := 'application/x-www-form-urlencoded';
- IdHTTP1.Request.ContentLength := Length(Trim(Params.Text));
- IdHTTP1.Post('https://service.gmx.net/de/cgi/login?hal=true', Params);
- if IdHTTP1.Response.ResponseCode = 200 then
- begin
- Memo1.Lines.Add('Login OK');
- Memo1.Lines.Add(IdHTTP1.Response.ResponseText);
- end
- else
- if IdHTTP1.ResponseCode = 401 then
- begin
- Memo1.Lines.Add('login invalid');
- end
- else
- ShowMessage('Error')
- finally
- Params.Free;
- end;
- IdHTTP1.Get('https://service.gmx.net');
- with IdCookieManager1.CookieCollection do
- for Index := 0 to Count - 1 do // alle Cookies durchsuchen
- if Cookies[Index].CookieText <> '' then
- begin
- Memo1.Lines.Add(Cookies[Index].CookieText + ' : ' + Cookies[Index].Value);
- end;
- with IdCookieManager1.CookieCollection do
- for Index := 0 to Count - 1 do // alle Cookies durchsuchen
- if Pos('JSESSIONID',Cookies[Index].CookieText) > 0 then
- begin
- SessionID := Cookies[Index].Value;
- // SessionID := Splitt(SessionID, '.', 0);
- Memo1.Lines.Add(SessionID);
- end;
- // HttpFox
- // 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
- // Hier ist der Unterschied -n4.bs62b?2-1
- Memo1.Lines.Add(IdHTTP1.Get('https://3c.gmx.net/mail/client/settings/mailsecurity;jsessionid=' + SessionID + '.IBehaviorListener.' +
- '0-splitPanel-splitPanel_body-childContainer-form-spamProtectionChapter-spamProtectionChapter_body-spamProtection-fieldSet-checkboxFormItem-checkboxFormItem_body-checkbox-checkbox&&origReferre'));
- //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
- //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
- end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement