jipegit / OSXAuditor

OS X Auditor is a free Mac OS X computer forensics tool
Other
3.13k stars 280 forks source link

IndexError: list index out of range for SystemVersionPlist array #32

Closed AndrewSB closed 9 years ago

AndrewSB commented 10 years ago

I'm having this error

PrimaVita:OSXAuditor-master asb$ sudo python osxauditor.py
DEBUG: Mac OS X Obj-C Foundation successfully imported
[INFO] Header
Traceback (most recent call last):
  File "osxauditor.py", line 1702, in <module>
    Main()
  File "osxauditor.py", line 1635, in Main
    AuditedSystemVersion = GetAuditedSystemVersion()
  File "osxauditor.py", line 1228, in GetAuditedSystemVersion
    "PatchVersion": int(SystemVersionPlist["ProductVersion"].split('.')[2])
IndexError: list index out of range
PrimaVita:OSXAuditor-master asb$ sudo /usr/bin/python osxcollector.py
/usr/bin/python: can't open file 'osxcollector.py': [Errno 2] No such file or directory
ccorcos commented 10 years ago

+1

I commented it out and it ran. (but I got another issue later)

I'm running Yosemite btw...

AndrewSB commented 10 years ago

I'm also running Yosemite

ghost commented 10 years ago

This worked on Yosemite, update the major version to "1" as my version of OSX is 10.10.

    if SystemVersionPlist:
        if "ProductName" in SystemVersionPlist: SysVersion = SystemVersionPlist["ProductName"]
        if "ProductVersion" in SystemVersionPlist: SysVersion += " " + SystemVersionPlist["ProductVersion"]
        if "ProductBuildVersion" in SystemVersionPlist: SysVersion += " build " + SystemVersionPlist["ProductBuildVersion"]

        OSX_VERSION = {
            "ProductBuildVersion": SystemVersionPlist["ProductBuildVersion"],
            "ProductVersion": SystemVersionPlist["ProductVersion"],
            "MajorVersion": int(SystemVersionPlist["ProductVersion"].split('.')[1]),
            "MinorVersion": int(SystemVersionPlist["ProductVersion"].split('.')[1]),
            "PatchVersion": int(SystemVersionPlist["ProductVersion"].split('.')[0])
        }
jaredsburrows commented 10 years ago

Thank you for posting this fix!

jipegit commented 9 years ago

Fixed, thanks.