|
| 1 | +# Comparing `tmp/HakObserverpy-0.6.4.tar.gz` & `tmp/HakObserverpy-0.6.5.tar.gz` |
| 2 | + |
| 3 | +## filetype from file(1) |
| 4 | + |
| 5 | +```diff |
| 6 | +@@ -1 +1 @@ |
| 7 | +-gzip compressed data, was "HakObserverpy-0.6.4.tar", last modified: Tue May 14 07:29:43 2024, max compression |
| 8 | ++gzip compressed data, was "HakObserverpy-0.6.5.tar", last modified: Sat Jun 1 09:58:45 2024, max compression |
| 9 | +``` |
| 10 | + |
| 11 | +## Comparing `HakObserverpy-0.6.4.tar` & `HakObserverpy-0.6.5.tar` |
| 12 | + |
| 13 | +### file list |
| 14 | + |
| 15 | +```diff |
| 16 | +@@ -1,14 +1,14 @@ |
| 17 | +-drwxrwxrwx 0 0 0 0 2024-05-14 07:29:43.536583 HakObserverpy-0.6.4/ |
| 18 | +-drwxrwxrwx 0 0 0 0 2024-05-14 07:29:43.514582 HakObserverpy-0.6.4/HakObserverpy/ |
| 19 | +--rw-rw-rw- 0 0 0 9618 2024-05-14 07:29:29.000000 HakObserverpy-0.6.4/HakObserverpy/HakObserverpy.py |
| 20 | +--rw-rw-rw- 0 0 0 332 2024-05-14 07:29:33.000000 HakObserverpy-0.6.4/HakObserverpy/__init__.py |
| 21 | +-drwxrwxrwx 0 0 0 0 2024-05-14 07:29:43.534581 HakObserverpy-0.6.4/HakObserverpy.egg-info/ |
| 22 | +--rw-rw-rw- 0 0 0 705 2024-05-14 07:29:43.000000 HakObserverpy-0.6.4/HakObserverpy.egg-info/PKG-INFO |
| 23 | +--rw-rw-rw- 0 0 0 259 2024-05-14 07:29:43.000000 HakObserverpy-0.6.4/HakObserverpy.egg-info/SOURCES.txt |
| 24 | +--rw-rw-rw- 0 0 0 1 2024-05-14 07:29:43.000000 HakObserverpy-0.6.4/HakObserverpy.egg-info/dependency_links.txt |
| 25 | +--rw-rw-rw- 0 0 0 30 2024-05-14 07:29:43.000000 HakObserverpy-0.6.4/HakObserverpy.egg-info/requires.txt |
| 26 | +--rw-rw-rw- 0 0 0 14 2024-05-14 07:29:43.000000 HakObserverpy-0.6.4/HakObserverpy.egg-info/top_level.txt |
| 27 | +--rw-rw-rw- 0 0 0 705 2024-05-14 07:29:43.535582 HakObserverpy-0.6.4/PKG-INFO |
| 28 | +--rw-rw-rw- 0 0 0 280 2024-05-13 09:19:09.000000 HakObserverpy-0.6.4/README.md |
| 29 | +--rw-rw-rw- 0 0 0 42 2024-05-14 07:29:43.536583 HakObserverpy-0.6.4/setup.cfg |
| 30 | +--rw-rw-rw- 0 0 0 1044 2024-05-14 07:29:10.000000 HakObserverpy-0.6.4/setup.py |
| 31 | ++drwxrwxrwx 0 0 0 0 2024-06-01 09:58:45.679000 HakObserverpy-0.6.5/ |
| 32 | ++drwxrwxrwx 0 0 0 0 2024-06-01 09:58:45.612000 HakObserverpy-0.6.5/HakObserverpy/ |
| 33 | ++-rw-rw-rw- 0 0 0 6190 2024-06-01 09:58:25.000000 HakObserverpy-0.6.5/HakObserverpy/HakObserverpy.py |
| 34 | ++-rw-rw-rw- 0 0 0 281 2024-06-01 09:57:43.000000 HakObserverpy-0.6.5/HakObserverpy/__init__.py |
| 35 | ++drwxrwxrwx 0 0 0 0 2024-06-01 09:58:45.667000 HakObserverpy-0.6.5/HakObserverpy.egg-info/ |
| 36 | ++-rw-rw-rw- 0 0 0 705 2024-06-01 09:58:45.000000 HakObserverpy-0.6.5/HakObserverpy.egg-info/PKG-INFO |
| 37 | ++-rw-rw-rw- 0 0 0 259 2024-06-01 09:58:45.000000 HakObserverpy-0.6.5/HakObserverpy.egg-info/SOURCES.txt |
| 38 | ++-rw-rw-rw- 0 0 0 1 2024-06-01 09:58:45.000000 HakObserverpy-0.6.5/HakObserverpy.egg-info/dependency_links.txt |
| 39 | ++-rw-rw-rw- 0 0 0 30 2024-06-01 09:58:45.000000 HakObserverpy-0.6.5/HakObserverpy.egg-info/requires.txt |
| 40 | ++-rw-rw-rw- 0 0 0 14 2024-06-01 09:58:45.000000 HakObserverpy-0.6.5/HakObserverpy.egg-info/top_level.txt |
| 41 | ++-rw-rw-rw- 0 0 0 705 2024-06-01 09:58:45.674000 HakObserverpy-0.6.5/PKG-INFO |
| 42 | ++-rw-rw-rw- 0 0 0 280 2024-05-13 09:19:09.000000 HakObserverpy-0.6.5/README.md |
| 43 | ++-rw-rw-rw- 0 0 0 42 2024-06-01 09:58:45.678000 HakObserverpy-0.6.5/setup.cfg |
| 44 | ++-rw-rw-rw- 0 0 0 1044 2024-06-01 09:57:39.000000 HakObserverpy-0.6.5/setup.py |
| 45 | +``` |
| 46 | + |
| 47 | +### Comparing `HakObserverpy-0.6.4/HakObserverpy/HakObserverpy.py` & `HakObserverpy-0.6.5/HakObserverpy/HakObserverpy.py` |
| 48 | + |
| 49 | + * *Files 23% similar despite different names* |
| 50 | + |
| 51 | +```diff |
| 52 | +@@ -13,15 +13,15 @@ |
| 53 | + |
| 54 | + log_entry = { |
| 55 | + "time": error_time, |
| 56 | + "type": Type, |
| 57 | + "details": Message |
| 58 | + } |
| 59 | + |
| 60 | +- # Create or append to log.json |
| 61 | ++ #Create or append to log.json |
| 62 | + with open("log.json", "a+") as log_file: |
| 63 | + log_file.seek(0) |
| 64 | + if log_file.read(1): |
| 65 | + log_file.write(",\n") |
| 66 | + else: |
| 67 | + log_file.write("[\n") |
| 68 | + json.dump(log_entry, log_file, indent=4) |
| 69 | +@@ -36,45 +36,41 @@ |
| 70 | + log("get_installed_applications", "Starting") |
| 71 | + get_installed_applications(HWDeviceID) |
| 72 | + log("get_installed_applications", "Completed") |
| 73 | + |
| 74 | + collect_firewall_logs() |
| 75 | + |
| 76 | + def collect_firewall_logs(): |
| 77 | +- # Use PowerShell to collect firewall logs |
| 78 | ++ #Use PowerShell to collect firewall logs |
| 79 | + powershell_command = """ |
| 80 | + $events = Get-WinEvent -LogName 'Security' -MaxEvents 100 |
| 81 | + $logs = $events | ForEach-Object { $_.Message } |
| 82 | + $logs |
| 83 | + """ |
| 84 | + logs = subprocess.check_output(["powershell", "-Command", powershell_command], shell=True) |
| 85 | + return logs.decode('utf-8') |
| 86 | + |
| 87 | + def get_installed_applications(HWDeviceID): |
| 88 | +- |
| 89 | +- |
| 90 | +- |
| 91 | +- |
| 92 | +- # Example: Retrieve installed applications and their version numbers from the Windows Registry |
| 93 | ++ #Example: Retrieve installed applications and their version numbers from the Windows Registry |
| 94 | + key = r"SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall" |
| 95 | + installed_apps = [] |
| 96 | + with winreg.OpenKey(winreg.HKEY_LOCAL_MACHINE, key) as reg_key: |
| 97 | + for i in range(winreg.QueryInfoKey(reg_key)[0]): |
| 98 | + try: |
| 99 | + app_key = winreg.EnumKey(reg_key, i) |
| 100 | + with winreg.OpenKey(reg_key, app_key) as app_reg_key: |
| 101 | + app_name = winreg.QueryValueEx(app_reg_key, "DisplayName")[0] |
| 102 | + app_version = winreg.QueryValueEx(app_reg_key, "DisplayVersion")[0] |
| 103 | + app_name = str(app_name).replace("-","").replace("/","").replace("(","").replace(")","") |
| 104 | + |
| 105 | +- # Replace special characters in app_name |
| 106 | ++ #Replace special characters in app_name |
| 107 | + |
| 108 | + url = f"https://api.hakware.com/HakObserver/DeviceApps/{HWDeviceID}/{app_name}/{app_version}" |
| 109 | + |
| 110 | +- # Make a GET request to the URL |
| 111 | ++ #Make a GET request to the URL |
| 112 | + session = HTMLSession() |
| 113 | + |
| 114 | + response = session.get(url, verify=False) |
| 115 | + |
| 116 | + if response.status_code == 200: |
| 117 | + print("Device Data inserted successfully via API.") |
| 118 | + else: |
| 119 | +@@ -85,34 +81,34 @@ |
| 120 | + installed_apps.append({"name": app_name, "version": app_version}) |
| 121 | + except FileNotFoundError: |
| 122 | + pass |
| 123 | + return installed_apps |
| 124 | + |
| 125 | + def get_system_usage(HWDeviceID,ObserverVersion): |
| 126 | + |
| 127 | +- # Example: Retrieve OS version using system-specific commands |
| 128 | ++ #Example: Retrieve OS version using system-specific commands |
| 129 | + os_version = str(subprocess.check_output("ver", shell=True)).replace('(', '').replace(')', '') |
| 130 | + |
| 131 | +- # Retrieve CPU, RAM, and disk usage |
| 132 | ++ # CPU, RAM, and disk usage |
| 133 | + cpu_usage = psutil.cpu_percent() |
| 134 | + ram_usage = psutil.virtual_memory().percent |
| 135 | +- #disk_usage = psutil.disk_usage('C:').percent # Replace 'C:' with appropriate drive letter |
| 136 | ++ #disk_usage = psutil.disk_usage('C:').percent Replace 'C:' with appropriate drive letter |
| 137 | + |
| 138 | +- # Retrieve total memory |
| 139 | ++ #Retrieve total memory |
| 140 | + total_memory = psutil.virtual_memory().total |
| 141 | + total_memory_gb = total_memory / (1024**3) |
| 142 | +- # Retrieve total number of CPUs and cores |
| 143 | +- total_cpus = psutil.cpu_count(logical=False) # Physical CPUs |
| 144 | +- total_cores = psutil.cpu_count(logical=True) # Logical CPUs (cores) |
| 145 | ++ #Retrieve total number of CPUs and cores |
| 146 | ++ total_cpus = psutil.cpu_count(logical=False) #Physical CPUs |
| 147 | ++ total_cores = psutil.cpu_count(logical=True) #Logical CPUs (cores) |
| 148 | + |
| 149 | + |
| 150 | + |
| 151 | + device_name = str(platform.node()).replace('(', '').replace(')', ''), |
| 152 | + processor = str(platform.processor()).replace('(', '').replace(')', ''), |
| 153 | +- device_id = str(platform.node()).replace('(', '').replace(')', ''), # You may replace this with an appropriate identifier for your system |
| 154 | ++ device_id = str(platform.node()).replace('(', '').replace(')', ''), #You may replace this with an appropriate identifier for your system |
| 155 | + system_type = str(platform.system()).replace('(', '').replace(')', '') |
| 156 | + |
| 157 | + |
| 158 | + |
| 159 | + ObserverVersion = str(ObserverVersion).replace("(","").replace(")","").replace(",","").replace("\\r\\n","").replace("'","") |
| 160 | + device_id =str(device_id).replace("(","").replace(")","").replace(",","").replace("\\r\\n","").replace("'","") |
| 161 | + device_name = str(device_name).replace("(","").replace(")","").replace(",","").replace("\\r\\n","").replace("'","") |
| 162 | +@@ -129,15 +125,15 @@ |
| 163 | + |
| 164 | + from requests_html import HTMLSession |
| 165 | + |
| 166 | + url = f"https://api.hakware.com/HakObserver/Device/{HWDeviceID}/{ObserverVersion}/{device_name}/{processor}/{device_id}/{system_type}/{os_version}/{total_memory_gb}/{total_cpus}/{total_cores}" |
| 167 | + |
| 168 | + |
| 169 | + |
| 170 | +- # Make a GET request to the URL |
| 171 | ++ #Make a GET request to the URL |
| 172 | + session = HTMLSession() |
| 173 | + |
| 174 | + response = session.get(url, verify=False, timeout=10) |
| 175 | + |
| 176 | + print(response) |
| 177 | + |
| 178 | + if response.status_code == 200: |
| 179 | +@@ -148,98 +144,8 @@ |
| 180 | + "cpu_usage_percent": cpu_usage, |
| 181 | + "ram_usage_percent": ram_usage, |
| 182 | + #"disk_usage_percent": disk_usage, |
| 183 | + "total_memory": total_memory_gb, |
| 184 | + "total_cpus": total_cpus, |
| 185 | + "total_cores": total_cores |
| 186 | + } |
| 187 | +- |
| 188 | +- |
| 189 | + ############################################################################################################################################################################### |
| 190 | +- |
| 191 | +-def LinInitiateCollecection(HWDeviceID, ObserverVersion): |
| 192 | +- |
| 193 | +- |
| 194 | +- Linget_system_usage(HWDeviceID,ObserverVersion) |
| 195 | +- |
| 196 | +- |
| 197 | +- Linget_installed_applications(HWDeviceID) |
| 198 | +- |
| 199 | +- |
| 200 | +- Lincollect_firewall_logs() |
| 201 | +- |
| 202 | +-def Lincollect_firewall_logs(): |
| 203 | +- # Placeholder function for firewall log collection on Linux |
| 204 | +- pass |
| 205 | +- |
| 206 | +-def Linget_installed_applications(HWDeviceID): |
| 207 | +- installed_apps = [] |
| 208 | +- |
| 209 | +- # Use dpkg-query to list installed packages |
| 210 | +- try: |
| 211 | +- dpkg_output = subprocess.check_output(["dpkg-query", "-l"], universal_newlines=True) |
| 212 | +- lines = dpkg_output.strip().split('\n')[5:] # Skip first 5 lines which are headers |
| 213 | +- for line in lines: |
| 214 | +- columns = line.split() |
| 215 | +- if len(columns) >= 2: |
| 216 | +- app_name = columns[1] |
| 217 | +- app_version = columns[2] |
| 218 | +- installed_apps.append({"name": app_name, "version": app_version}) |
| 219 | +- except subprocess.CalledProcessError as e: |
| 220 | +- print("Error:", e) |
| 221 | +- |
| 222 | +- # Now you can process installed_apps list as needed |
| 223 | +- for app in installed_apps: |
| 224 | +- # Replace special characters in app_name |
| 225 | +- app_name = app['name'].replace("-", "").replace("/", "").replace("(", "").replace(")", "") |
| 226 | +- app_version = app['version'].replace("-", "").replace("/", "").replace("(", "").replace(")", "").replace("'","").replace("+"," ") |
| 227 | +- # Hakware API URL for inserting installed applications |
| 228 | +- url = f"https://api.hakware.com/HakObserver/DeviceApps/{HWDeviceID}/{app_name}/{app_version}" |
| 229 | +- |
| 230 | +- # Make a GET request to the URL |
| 231 | +- session = HTMLSession() |
| 232 | +- response = session.get(url, verify=False) |
| 233 | +- |
| 234 | +- if response.status_code == 200: |
| 235 | +- print(f"Installed application '{app_name}' version '{app['version']}' data inserted successfully via API.") |
| 236 | +- else: |
| 237 | +- print(url) |
| 238 | +- print(f"Failed to insert installed application '{app_name}' version '{app_version}' data via API. Status code: {response.status_code}") |
| 239 | +- |
| 240 | +- return installed_apps |
| 241 | +- |
| 242 | +-def Linget_system_usage(HWDeviceID, ObserverVersion): |
| 243 | +- # Retrieve system information |
| 244 | +- os_version = platform.platform() |
| 245 | +- cpu_usage = psutil.cpu_percent() |
| 246 | +- ram_usage = psutil.virtual_memory().percent |
| 247 | +- total_memory = psutil.virtual_memory().total / (1024**3) |
| 248 | +- total_cpus = psutil.cpu_count(logical=False) |
| 249 | +- total_cores = psutil.cpu_count(logical=True) |
| 250 | +- device_name = platform.node() |
| 251 | +- processor = platform.processor() |
| 252 | +- device_id = platform.node() |
| 253 | +- system_type = platform.system() |
| 254 | +- |
| 255 | +- if processor == '': |
| 256 | +- processor = 'unknown' |
| 257 | +- |
| 258 | +- # API URL |
| 259 | +- url = f"https://api.hakware.com/HakObserver/Device/{HWDeviceID}/{ObserverVersion}/{device_name}/{processor}/{device_id}/{system_type}/{os_version}/{total_memory}/{total_cpus}/{total_cores}" |
| 260 | +- |
| 261 | +- print(url) |
| 262 | +- # Make a GET request to the URL |
| 263 | +- session = HTMLSession() |
| 264 | +- response = session.get(url, verify=False, timeout=10) |
| 265 | +- |
| 266 | +- if response.status_code == 200: |
| 267 | +- print("Device Data inserted successfully via API.") |
| 268 | +- else: |
| 269 | +- print(f"Failed to insert data via API. Status code: {response.status_code}") |
| 270 | +- |
| 271 | +- return { |
| 272 | +- "cpu_usage_percent": cpu_usage, |
| 273 | +- "ram_usage_percent": ram_usage, |
| 274 | +- "total_memory": total_memory, |
| 275 | +- "total_cpus": total_cpus, |
| 276 | +- "total_cores": total_cores |
| 277 | +- } |
| 278 | +``` |
| 279 | + |
| 280 | +### Comparing `HakObserverpy-0.6.4/HakObserverpy.egg-info/PKG-INFO` & `HakObserverpy-0.6.5/HakObserverpy.egg-info/PKG-INFO` |
| 281 | + |
| 282 | + * *Files 1% similar despite different names* |
| 283 | + |
| 284 | +```diff |
| 285 | +@@ -1,10 +1,10 @@ |
| 286 | + Metadata-Version: 2.1 |
| 287 | + Name: HakObserverpy |
| 288 | +-Version: 0.6.4 |
| 289 | ++Version: 0.6.5 |
| 290 | + Summary: A package connect endpoints to the Hakware Application |
| 291 | + Home-page: UNKNOWN |
| 292 | + Author: Jacob O'Brien |
| 293 | + License: UNKNOWN |
| 294 | + Platform: UNKNOWN |
| 295 | + Classifier: Programming Language :: Python :: 3 |
| 296 | + Classifier: License :: OSI Approved :: MIT License |
| 297 | +``` |
| 298 | + |
| 299 | +### Comparing `HakObserverpy-0.6.4/PKG-INFO` & `HakObserverpy-0.6.5/PKG-INFO` |
| 300 | + |
| 301 | + * *Files 1% similar despite different names* |
| 302 | + |
| 303 | +```diff |
| 304 | +@@ -1,10 +1,10 @@ |
| 305 | + Metadata-Version: 2.1 |
| 306 | + Name: HakObserverpy |
| 307 | +-Version: 0.6.4 |
| 308 | ++Version: 0.6.5 |
| 309 | + Summary: A package connect endpoints to the Hakware Application |
| 310 | + Home-page: UNKNOWN |
| 311 | + Author: Jacob O'Brien |
| 312 | + License: UNKNOWN |
| 313 | + Platform: UNKNOWN |
| 314 | + Classifier: Programming Language :: Python :: 3 |
| 315 | + Classifier: License :: OSI Approved :: MIT License |
| 316 | +``` |
| 317 | + |
| 318 | +### Comparing `HakObserverpy-0.6.4/setup.py` & `HakObserverpy-0.6.5/setup.py` |
| 319 | + |
| 320 | + * *Files 12% similar despite different names* |
| 321 | + |
| 322 | +```diff |
| 323 | +@@ -1,13 +1,13 @@ |
| 324 | + import platform |
| 325 | + from setuptools import setup, find_packages |
| 326 | + |
| 327 | + setup( |
| 328 | + name='HakObserverpy', # Your package name |
| 329 | +- version='0.6.4', # Start with a version number |
| 330 | ++ version='0.6.5', # Start with a version number |
| 331 | + description='A package connect endpoints to the Hakware Application', # Short description |
| 332 | + long_description=open('README.md').read(), # Long description from README |
| 333 | + long_description_content_type='text/markdown', |
| 334 | + author='Jacob O\'Brien', # Your name |
| 335 | + # author_email=' [email protected]', # Your email |
| 336 | + # url='https://github.com/your-username/XGRCPy', # Your package's URL (if applicable) |
| 337 | + packages=find_packages(), # Find all sub-packages |
| 338 | +``` |
| 339 | + |
0 commit comments