Skip to content

Conversation

@adjusic
Copy link

@adjusic adjusic commented May 23, 2025

This PR improves the security of reverseshell.py and adds proper test coverage.

Fixes:

  • Replaces os.system() with subprocess.run() for safer command execution.
  • Validates all user inputs (e.g., shell type, yes/no prompts).
  • Removes unsafe or unnecessary system calls.
  • Adds graceful fallback handling.

Testing:

  • Added tests in tests/test_reverseshell.py
  • All tests pass via pytest
  • Manual tests confirm shell selection and payload generation work as expected

Result:

  • File now passes static analysis in security_scan.py
  • Hardened against input injection and misuse

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.

1 participant