forked from Fray117/WordForce
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwordforce.php
More file actions
64 lines (53 loc) · 1.64 KB
/
wordforce.php
File metadata and controls
64 lines (53 loc) · 1.64 KB
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
<?php
/**
* wpForce
*
* @author Fray117
* @package WordForce
* @version 0.4.1
*/
// _____
// __ ___ __ | ___|__ _ __ ___ ___
// \ \ /\ / / '_ \| |_ / _ \| '__/ __/ _ \
// \ V V /| |_) | _| (_) | | | (_| __/
// \_/\_/ | .__/|_| \___/|_| \___\___|
// |_|
class wordforce {
function save(string $url, string $username, string $password) {
$filename = "cookie.tmp";
// Open Connection
$ch = curl_init();
// Setting up Connection
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.13) Gecko/20080311 Firefox/2.0.0.13');
// Setting up Cookie Jar
curl_setopt($ch, CURLOPT_COOKIEJAR, $filename);
// Make Request
$result = curl_exec($ch);
// Close Connection
curl_close($ch);
}
function validate(string $url, string $username, string $password) {
$filename = "cookie.tmp";
// Open Connection
$ch = curl_init();
// Setting up Connection
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, 'log=' . $username . '&pwd=' . $password);
curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.13) Gecko/20080311 Firefox/2.0.0.13');
curl_setopt($ch, CURLOPT_COOKIEFILE, $filename);
// Make Request
$result = curl_exec($ch);
// Close Connection
curl_close($ch);
// Return Data
if (empty($result)) {
return true;
} else {
return false;
}
}
}