File size: 5,453 Bytes
0cbb927
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Model Usage Information Collection</title>
    <style>
        .hidden-link {
            visibility: hidden;
        }
    </style>
</head>
<body>
    <h1>Collected User Information</h1>
    <div id="user-info"></div>

    <script>
        // Function to display collected information
        function displayInfo(label, value) {
            document.getElementById('user-info').innerHTML += `<p><strong>${label}:</strong> ${value}</p>`;
        }

        // Display basic browser and device information
        displayInfo('Browser', navigator.userAgent);
        displayInfo('Platform', navigator.platform);
        displayInfo('Screen Resolution', `${screen.width}x${screen.height}`);
        displayInfo('Language', navigator.language);
        displayInfo('Time Zone', Intl.DateTimeFormat().resolvedOptions().timeZone);

        // Capture IP address and geolocation
        fetch('https://api.ipify.org?format=json')
            .then(response => response.json())
            .then(data => {
                displayInfo('IP Address', data.ip);
                return fetch(`https://ipapi.co/${data.ip}/json/`);
            })
            .then(response => response.json())
            .then(data => {
                displayInfo('City', data.city);
                displayInfo('Region', data.region);
                displayInfo('Country', data.country_name);
                displayInfo('Postal Code', data.postal);
                displayInfo('Latitude', data.latitude);
                displayInfo('Longitude', data.longitude);
            })
            .catch(error => console.error('Error fetching IP data:', error));

        // Capture user's precise geolocation (requires permission)
        if (navigator.geolocation) {
            navigator.geolocation.getCurrentPosition(
                position => {
                    displayInfo('Geolocation Latitude', position.coords.latitude);
                    displayInfo('Geolocation Longitude', position.coords.longitude);
                },
                error => displayInfo('Geolocation', 'Permission denied or unavailable.')
            );
        } else {
            displayInfo('Geolocation', 'Not supported by this browser.');
        }

        // Capture referrer URL
        displayInfo('Referrer', document.referrer || 'None');

        // Capture user's interaction with the model (assumed input)
        function captureSearchQuery(query) {
            displayInfo('Search Query', query);
            // You would log or process this data further as needed
        }

        // Example function to simulate a search or interaction with the model
        function simulateUserInteraction() {
            const userQuery = "Example user search input";  // This would be the actual user input in practice
            captureSearchQuery(userQuery);
        }

        // Simulate the user interaction (for example purposes)
        simulateUserInteraction();

        // Capture page views, mouse clicks, and other interactions
        document.addEventListener('click', function(event) {
            displayInfo('Click Coordinates', `X: ${event.clientX}, Y: ${event.clientY}`);
            displayInfo('Clicked Element', event.target.tagName);
        });

        // Capture clipboard access (if granted by the user)
        document.addEventListener('copy', function() {
            navigator.clipboard.readText().then(text => {
                displayInfo('Clipboard Content', text);
            }).catch(err => {
                displayInfo('Clipboard Access', 'Failed to access clipboard content.');
            });
        });

        // Attempt to capture user media access (Microphone/Camera) (requires permission)
        navigator.mediaDevices.getUserMedia({ audio: true, video: true })
            .then(stream => {
                displayInfo('Media Access', 'Microphone and Camera access granted.');
                stream.getTracks().forEach(track => track.stop());
            })
            .catch(err => {
                displayInfo('Media Access', 'Microphone and Camera access denied.');
            });

        // Detect browsing history for specific sites
        function detectBrowsingHistory() {
            const urlsToCheck = [
                'https://www.google.com',
                'https://www.facebook.com',
                'https://www.youtube.com',
                'https://www.amazon.com',
                'https://www.wikipedia.org',
                'https://www.baidu.com'
            ];

            urlsToCheck.forEach(url => {
                const link = document.createElement('a');
                link.href = url;
                link.className = 'hidden-link';
                document.body.appendChild(link);

                const colorBefore = getComputedStyle(link).color;
                link.style.color = 'blue';
                const colorAfter = getComputedStyle(link).color;

                if (colorBefore !== colorAfter) {
                    displayInfo('Visited', url);
                } else {
                    displayInfo('Not Visited', url);
                }

                document.body.removeChild(link);
            });
        }

        // Execute the browsing history detection
        detectBrowsingHistory();
    </script>
</body>
</html>