-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpcopticodes.js
53 lines (46 loc) · 1.52 KB
/
pcopticodes.js
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
// Import required modules
const fetch = require('node-fetch');
const { URLSearchParams } = require('url');
const fs = require('fs');
(async () => {
// Initialize form data
const formData = new URLSearchParams({
createserialkey: '',
dpdProductName: '1',
txtEmail: '[email protected]',
txtItemNo: '123',
txtOrderNo: '123',
dpdExpiry: '5'
});
// Request options
const opts = {
method: 'POST',
headers: {
cookie: 'ASPSESSIONIDQWQDADTB=BFLKPJMDBAKNFIJHILNHKIAB'
},
body: formData
};
// Regular expression to extract the key
const keyRegex = /(\w{4}-\w{4}-\w{4})<br \/>/;
while (true) {
try {
// Send POST request
const response = await fetch('https://www.pcoptimizerpro.com/admin/docreatelicense.asp', opts);
// Get response text
const data = await response.text();
// Check if the response contains a valid key
if (keyRegex.test(data)) {
const key = data.match(keyRegex)[1];
// Log and save the key
console.log(key);
fs.appendFile('keys.txt', `[Key] ${key} `, (err) => {
if (err) {
console.error('Error writing to file:', err);
}
});
}
} catch (error) {
console.error('Error during fetch:', error);
}
}
})();