USArmyResearchLab / Dshell

Dshell is a network forensic analysis framework.
Other
5.44k stars 1.14k forks source link

Cleaning up Json Output #136

Closed amm3 closed 3 years ago

amm3 commented 3 years ago

Recent changes in the core code have resulted in additional data being presented to the jsonout module (by way, I gather of data fed from blob.info() and/or conn.info(). Namely these are internal data members starting with an underscore character and a complete list of packets related to the connection or blob. Not only do these items clutter json output, but largely they are throwing "Type not serializable" errors as they are not datetime or bytes objects.

I'm completely open to other approaches here, such as providing serialization methods for more data types in the jsonout module, but the completely list of Packets seemed of limited use in json output, at least for my needs.

dev195 commented 3 years ago

Pull request #137 solved some of this problem, and I just posted pull request #138 that should fix the rest of it.

I opted to not remove 'packets' within the output module for fear that it might unintentionally break plugins that try to provide a 'packets' argument unrelated to the .info() functions. Instead, the fixes in #138 do two things: remove 'packets' from the .info() function, and make some of the Dshell core types serializable. The serialization currently just calls their .info() functions, which may or may not be the best option, depending on what users need.

Do those two pull requests solve the problem?

amm3 commented 3 years ago

The fix in #138 looks good. Thanks!