Add xdg-open package for generic graphical sample detonation on Linux#2966
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces a new Xdg_open package module for Linux analysis, which enables running samples using the xdg-open utility. The review feedback highlights a deviation from PEP 8 naming conventions for the class name and recommends avoiding hardcoded binary paths to ensure better compatibility across different Linux distributions.
| from lib.core.packages import Package | ||
|
|
||
|
|
||
| class Xdg_open(Package): |
There was a problem hiding this comment.
The class name Xdg_open does not follow PEP 8 naming conventions for classes (CapWords). While the current loader logic in lib/core/packages.py uses .capitalize() on the filename, which results in Xdg_open, it would be better to update the loader to handle snake_case to PascalCase conversion properly so that standard naming can be used. If the loader cannot be changed, this is acceptable but inconsistent with Python standards.
References
- Class names should normally use the CapWords convention as per PEP 8. (link)
|
|
||
| def prepare(self): | ||
| self.args = [self.target] + self.args | ||
| self.target = "/usr/bin/xdg-open" |
There was a problem hiding this comment.
|
Thank you |
xdg-openis a generic way to open files on linux that respects users preferences, making detonation of documents like pdf files in system configured pdf reader possible