Skip to content

Conversation

@ssst0n3
Copy link
Member

@ssst0n3 ssst0n3 commented Nov 9, 2025

st0n3 added 3 commits November 9, 2025 20:01
…sed action signatures

This patch updates all CLI command definitions and related helpers to use
urfave/cli v3. Key changes include:
- Replacing `cli.App` with `cli.Command`
- Updating `Action` and `Before` functions to accept `context.Context` and `*cli.Command`
- Updating field names (`Subcommands` → `Commands`)
- Modifying project dependencies in go.mod/go.sum accordingly
- Adjusting related tests and helper functions (e.g., in pkg/app, env, vul packages)
…ability actions

Add logic to iterate over command flags and inject their name-value pairs into the context before executing CheckSec or exploit actions.
This ensures that flag values are available to all vulnerability-related operations.
- Upgrade Go version to 1.22 in Dockerfile and go.mod
- Migrate CLI framework from urfave/cli/v2 to v3 across all command packages
- Refactor command actions to use context.Context and new function signatures
- Replace deprecated Subcommands with Commands field
- Update sploit-spec dependency to v0.8.0-rc4
- Clean up removed indirect dependencies in go.mod and go.sum
@ssst0n3 ssst0n3 self-assigned this Nov 9, 2025
@ssst0n3 ssst0n3 added the spec label Nov 9, 2025
Refactor the Vulnerability interface to use *cli.Command directly instead
of context.Context for CheckSec and Exploit methods. This follows the
recommended practice for urfave/cli/v3, which encourages passing *cli.Command
directly rather than using context.Context for flag access.

Changes:
- Removes manual flag extraction loop in pkg/app/vul.go that was copying
  flags from cmd.Flags into context values
- Changes CheckSec(context.Context) to CheckSec(cmd *cli.Command)
- Changes Exploit(context.Context) to Exploit(cmd *cli.Command)
- Updates BaseVulnerability.Exploit to use cmd.Bool("force") instead of
  ctx.Value("force") for accessing the force flag
- Updates Vulnerabilities.Check method signature accordingly
- Updates test cases to pass nil instead of context.TODO()
- Updates spec documentation to reflect the new API signatures

This aligns with urfave/cli/v3 best practices and simplifies the API by
eliminating the intermediate context layer, allowing direct access to CLI
command flags through the Command object.
…cli.Command

Refactors the vulnerability checking API in the xsploit example project to use *cli.Command instead of context.Context. Changes include:

- Update vulnerabilities.Check() call in checksec/auto.go from Check(ctx) to Check(cmd)

- Change Exploit() method signature in vul/cve-2099-9999/vul.go from Exploit(ctx context.Context) to Exploit(cmd *cli.Command)

- Remove unused context import from vul/cve-2099-9999/vul.go

- Upgrade sploit-spec dependency from v0.8.0-rc4 to v0.8.0-rc5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants