-
Notifications
You must be signed in to change notification settings - Fork 0
/
recon.html
56 lines (48 loc) · 1.5 KB
/
recon.html
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
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>recon</title>
</head>
<body>
<script>
const apiKey = 'dc636aa2bdb6431961ac16273ebaf3d1';
const ipstackEndpoint = `http:https://api.ipstack.com/check?access_key=${apiKey}`;
// Step 1: Get your IP address using ipstack API
fetch(ipstackEndpoint)
.then(response => response.json())
.then(data => {
const ipAddress = data.ip;
// Step 2: Prepare data for the HTTP POST request
const postData = {
ip: ipAddress,
};
// Step 3: Make an HTTP POST request to the target server with CORS headers
const targetEndpoint = 'https://static.blitzd.uk:1880/data/recon';
fetch(targetEndpoint, {
method: 'POST',
body: JSON.stringify(postData),
headers: {
'Content-Type': 'application/json',
'Access-Control-Allow-Origin': '*',
'Access-Control-Allow-Methods': 'POST',
'Access-Control-Allow-Headers': 'Content-Type',
},
})
.then(response => response.json())
.then(responseData => {
// Handle the response from the target server here
console.log('POST Request Successful:', responseData);
})
.catch(error => {
// Handle errors from the POST request here
console.error('POST Request Error:', error);
});
})
.catch(error => {
// Handle errors from the IP retrieval here
console.error('IP Retrieval Error:', error);
});
</script>
</body>
</html>