Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve legibility of terminal diff output #670

Merged
merged 5 commits into from
Dec 1, 2024

Conversation

tstromberg
Copy link
Collaborator

@tstromberg tstromberg commented Nov 30, 2024

The diff output got kind of chopped up. This PR insures that there is still a consistent prefix line in front of all output relating to a file.

new:

├─ 😈 Changed: /var/home/t/preso/magic/libffmpeg-N110035.dylib [MEDIUM → CRITICAL]
│+    ▲ anti-static [NONE → CRITICAL]
│+      😈 xor/user_agent — XOR'ed user agent, often found in backdoors, by Florian Roth: 7OTJ::$Mozilla_5_0
│     ≡ cryptography [MEDIUM]
│       🔵 aes — Supports AES (Advanced Encryption Standard)
│       🟡 encrypt — encrypts data
│       🔵 rc4 — RC4 key scheduling algorithm, by Thomas Barabosch
│     ≡ data [MEDIUM]
│       🟡 base64/decode — decode base64 strings
│+      🔵 compression/gzip — works with gzip files
│       🔵 encoding/base64 — Supports base64 encoded strings
│+      🔵 random/insecure — generate random numbers insecurely: _rand, srand
│+    ▲ discovery [NONE → LOW]
│+      🔵 system/hostname — get computer host name: gethostname
│+      🔵 user/HOME — Looks up the HOME directory for the current user: getenv
│+    ▲ evasion [NONE → MEDIUM]
│+      🟡 file/prefix — hidden path generated dynamically: %s/.main_storage
│     ▼ execution [LOW → MEDIUM]
│+      🟡 cmd/pipe — launches program and reads its output: _pclose, _popen
│       🔵 shell/TERM — Look up or override terminal settings
│+      🟡 shell/arbitrary_command_dev_null — runs commands, discards output: "%s" >/dev/null
│     ≡ filesystem [MEDIUM]
│       🔵 directory/create — creates directories
│+      🔵 lock_update — apply or remove an advisory lock on a file: flock
│       🟡 path/tmp — path reference within /tmp
│+      🟡 permission/modify — modifies file permissions: chmod
│     ▲ impact [MEDIUM → CRITICAL]
│       🟡 remote_access/agent — references an 'agent'
│+      😈 remote_access/net_exec — executes programs, sets permissions, sleeps, makes HTTP requests:
│+         NSMutableURLRequest, chmod, flock, gethostname, localtime, pclose, popen, rand, sprintf, strncpy

old:

├─ 😈 Changed: /var/home/t/preso/magic/libffmpeg-N110035.dylib [MEDIUM → CRITICAL]
│     ▲ anti-static [NONE → CRITICAL]
+++     😈 xor/user_agent — XOR'ed user agent, often found in backdoors, by Florian Roth: 7OTJ::$Mozilla_5_0
│     ≡ cryptography [MEDIUM]
        🔵 aes — Supports AES (Advanced Encryption Standard)
        🟡 encrypt — encrypts data
        🔵 rc4 — RC4 key scheduling algorithm, by Thomas Barabosch
│     ≡ data [MEDIUM]
        🟡 base64/decode — decode base64 strings
+++     🔵 compression/gzip — works with gzip files
        🔵 encoding/base64 — Supports base64 encoded strings
+++     🔵 random/insecure — generate random numbers insecurely: _rand, srand
│     ▲ discovery [NONE → LOW]
+++     🔵 system/hostname — get computer host name: gethostname
+++     🔵 user/HOME — Looks up the HOME directory for the current user: getenv
│     ▲ evasion [NONE → MEDIUM]
+++     🟡 file/prefix — hidden path generated dynamically: %s/.main_storage
│     ▼ execution [LOW → MEDIUM]
+++     🟡 cmd/pipe — launches program and reads its output: _pclose, _popen
        🔵 shell/TERM — Look up or override terminal settings
+++     🟡 shell/arbitrary_command_dev_null — runs commands, discards output: "%s" >/dev/null
│     ≡ filesystem [MEDIUM]
        🔵 directory/create — creates directories
+++     🔵 lock_update — apply or remove an advisory lock on a file: flock
        🟡 path/tmp — path reference within /tmp
+++     🟡 permission/modify — modifies file permissions: chmod
│     ▲ impact [MEDIUM → CRITICAL]
        🟡 remote_access/agent — references an 'agent'
+++     😈 remote_access/net_exec — executes programs, sets permissions, sleeps, makes HTTP requests:
+++           NSMutableURLRequest, chmod, flock, gethostname, localtime, pclose, popen, rand, sprintf, strncpy

@tstromberg tstromberg requested a review from egibs November 30, 2024 16:58
@tstromberg tstromberg enabled auto-merge (squash) November 30, 2024 23:24
@tstromberg tstromberg merged commit cc759b4 into chainguard-dev:main Dec 1, 2024
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants