Code Monkey home page Code Monkey logo

sysdiagnose's People

Contributors

aaronkaplan avatar benroussille avatar cvandeplas avatar dario-br avatar ddurvaux avatar dependabot[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

sysdiagnose's Issues

[Bug] Can't run the scripts from another folder because of relative paths used

If you run the tools from another folder, it wont' work :

$ python ~/tools/forensic/sysdiagnose/initialyze.py file FILE      
Could not read version info, bailing out. Something is wrong: [Errno 2] No such file or directory: 'VERSION.txt'

This is because the get_version function checks for VERSION.txt in the local folder instead of the script folder. It would be nice to allow to run it from another folder

What's that variable json_ps in sysdiagnose-uuid2path.py + 62

In sysdiagnose-uuid2path.py +62 there is a variable which seems that it should be a different one...

def export_to_json(json, filename="./uuid2path.json"):
    json_u2p = json.dumps(json, indent=4)
    try:
        fd = open(filename, "w")
        fd.write(json_ps)       # XXX FIXME! What is json_ps?? XXX FIXME
        fd.close()
    except Exception as e:
        print(f"Impossible to dump the UUID to Path to {filename}. Reason: {str(e)}\n")
    return

@ddurvaux could you take a look pls?

(UC) UC2: wifi APs

  • see all Wifi (B)SSIDs that the iPhone saw
  • see which Wifis the iPhone connected to
  • check if we can also see the mac addresses and map to device types (?)
  • update the timeliner for it
  • be able to detect where the WiFi entry came from (iCloud sync?)

[Bug] Fix decoding of bytes in the plist cleaning functions

Today its handled with

d[k]=binascii.hexlify(v).decode('utf-8')

But it should handle differently outputs from the plist module

  • Data
  • UiD

depending on the data it output with b' or b"

Maybe reading the code of the plist module would figure out how they handle different classes.

simplify all of the python version checks. Since we use python3 syntax, the file won't run anyway in python2.x . So get rid of the version check all together!

if sys.version_info[0] < 3:

Apply this to all files where the version check is present. It's really a useless if statement.
Reasoning: Since all files, use python3 syntax only (f-strings, print(), etc.), the file won't run anyway in python2.x . So get rid of the version check all together! If you try to run it in python2, the interpreter will spit out the file anyway.

[parser] create parser for .ips files

I identified 2 types of IPS files located in ./crashes_and_spins/ :

  • panic-full-XXX,ips
  • stacks-*.ips

Should be easy as the IPS format is... a json.
So maybe a parser to put together all the IPS files so it is easier to analyse/ingest in a consistent way

(important) scenarios

Possible scenarios:

  • list of all wifi networks seen (+ timestamp) the device has connected to (+ BSSIDs)
  • app installation: when was which app installed? app install history
  • ... TBD

simulate rogue app

  • create a hello world / calc.exe app which does nothing
  • It is just there to demo that we can detect rogue apps (-> #27 )

check and fix the powerlog json format

Timeliner complains about JSON format of powerlog export

ERROR while extracting timestamp from ./parsed_data//4//sysdiagnose-powerlogs.json. Reason: not all arguments converted during string formatting

python parsing.py parse sysdiagnose-appinstallation 1 produces wrong JSON

produces:

"{\n    \"application\": [],\n    \"asset\": [],\n    \"client\": [],\n    \"download_policy\": [],\n    \"download_state\": [],\n    \"download\": [],\n    \"finished_download\": [],\n    \"job_restore\": [],\n    \"job_software\": [],\n    \"job\": [],\n    \"persistent_job\": [],\n    \"persistent_manager\": [],\n    \"purchase\": []\n}

initialize already fails

aaron@host:~/Desktop/git/work/ec/sysdiagnose$ python initialyze.py file data/sysdiagnose_2023.02.24_15-37-15+0100_iPhone-OS_iPhone_20D67.tar.gz
fff3dcf24bed8acfc7734a22b0b29565e6890a425f90d91ae4789d5b874e9de7
Traceback (most recent call last):
  File "/Users/aaron/Desktop/git/work/ec/sysdiagnose/initialyze.py", line 290, in <module>
    main()
  File "/Users/aaron/Desktop/git/work/ec/sysdiagnose/initialyze.py", line 278, in main
    init(arguments['<sysdiagnose_file>'])
  File "/Users/aaron/Desktop/git/work/ec/sysdiagnose/initialyze.py", line 225, in init
    with open(new_case_json['sysdiagnose.log'], 'r') as f:
FileNotFoundError: [Errno 2] No such file or directory: './data/1/sysdiagnose_2023.02.24_15-37-15+0100_iPhone-OS_iPhone_20D67/sysdiagnose.log'

--> identify why and fix

unify logarchive mac & linux model

Need to implement the export and parsing via httsp://github.com/ydkhatri/UnifiedLogReader. The UnifiedLogReader has a different format than the OS X /usr/bin/log show command.

Wifi parsers

Building parsers for:

  • com.apple.wifi.plist
  • com.apple.wifi-private-mac-networks.plist
  • com.apple.wifi-known-networks.plist
  • com.apple.wifi.recent-networks.json
  • wifi_scan.txt and wifi_scan_cache.txt
  • security.txt

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.