mkorman90 / regipy

Regipy is an os independent python library for parsing offline registry hives
MIT License
241 stars 52 forks source link

get_network_info() takes from 2 to 3 positional arguments but 4 were given #253

Open Aevyz opened 1 year ago

Aevyz commented 1 year ago

Hey,

we seem to have a problem with the new get_network_info function (network data from SYSTEM hive) introduced in 3.1.6 #250

We are triggering the plugins using...

from regipy.plugins.utils import run_relevant_plugins
...
system_reg_json = run_relevant_plugins(system_reg, as_json=True)

Traceback

Traceback (most recent call last):
  File "/registry-analyzer/registry-analyzer.py", line 168, in <module>
    run_regipy_plugins()
  File "/registry-analyzer/registry-analyzer.py", line 132, in run_regipy_plugins
    system_reg_json = run_relevant_plugins(system_reg, as_json=True)
  File "/usr/local/lib/python3.9/site-packages/regipy/plugins/utils.py", line 47, in run_relevant_plugins
    plugin.run()
  File "/usr/local/lib/python3.9/site-packages/regipy/plugins/system/network_data.py", line 82, in run
    interfaces = self.get_network_info(subkey, interfaces)
  File "/usr/local/lib/python3.9/site-packages/regipy/plugins/system/network_data.py", line 61, in get_network_info
    self.get_network_info(self, interface, sub_interfaces)
TypeError: get_network_info() takes from 2 to 3 positional arguments but 4 were given

Pip Freeze

root@3798ebdd8fae:/registry-analyzer# pip freeze
attrs==23.1.0
construct==2.10.68
inflection==0.5.1
pytz==2023.3
regipy==3.1.6

I am not quite sure what the best way of handing you guys information needed is, so if you need any further information, please just ask.

Thanks for any help in advance!

mkorman90 commented 10 months ago

Hey, sorry for the late response. could not reproduce from my side:

(regipy) martin@DESKTOP:/mnt/c/Users/martin/Documents/GitHub/regipy$ ipython
Python 3.8.13 (default, Mar 28 2022, 11:38:47)
Type 'copyright', 'credits' or 'license' for more information
IPython 8.4.0 -- An enhanced Interactive Python. Type '?' for help.

In [1]: from regipy.plugins.utils import run_relevant_plugins
In [2]: from regipy.registry import RegistryHive
In [3]: reg = RegistryHive('/tmp/regipy_data_tmp_unpacked/SYSTEM')
In [4]: result = run_relevant_plugins(reg, as_json=True)
Did not find bam at ControlSet001

In [5]: result.keys()
Out[5]: dict_keys(['wdigest', 'background_activity_moderator', 'safeboot_configuration', 'routes', 'active_control_set', 'host_domain_name', 'timezone_data', 'computer_name', 'services', 'shimcache', 'bootkey', 'usbstor_plugin', 'network_data'])

In [6]: result['network_data']
Out[6]:
{'\\ControlSet001\\Services\\Tcpip\\Parameters\\Interfaces': {'timestamp': '2011-09-17T13:43:23.770078+00:00',
  'interfaces': [{'interface_name': '{698E50A9-4F58-4D86-B61D-F42E58DCACF6}',
    'last_modified': '2011-09-17T13:43:23.770078+00:00',
    'dhcp_enabled': False,
    'ip_address': ['10.3.58.5'],
    'subnet_mask': ['255.255.255.0'],
    'default_gateway': ['10.3.58.1'],

Can you share the registry hive?