-
-
Notifications
You must be signed in to change notification settings - Fork 133
REMOTE SHELL integration using tmux to interact without ssh creds #127
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
Merged
Merged
Changes from 7 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
7a79d22
merge-request for v0.4.0
andreashappe 842b3ed
Merge pull request #118 from ipa-lab/development
andreashappe 0442b84
Display query in the URL on failed request
emmanuel-ferdman a089d89
Merge pull request #119 from emmanuel-ferdman/main
andreashappe 77c860b
Create dependency-review.yml
andreashappe 276ef06
Merge pull request #124 from ipa-lab/andreashappe-patch-1
andreashappe f40bbc2
complete tmux local shell integration
ShreyasMahajann 9ee831b
Merge branch 'development' into production
ShreyasMahajann File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| # Dependency Review Action | ||
| # | ||
| # This Action will scan dependency manifest files that change as part of a Pull Request, | ||
| # surfacing known-vulnerable versions of the packages declared or updated in the PR. | ||
| # Once installed, if the workflow run is marked as required, PRs introducing known-vulnerable | ||
| # packages will be blocked from merging. | ||
| # | ||
| # Source repository: https://github.com/actions/dependency-review-action | ||
| # Public documentation: https://docs.github.com/en/code-security/supply-chain-security/understanding-your-software-supply-chain/about-dependency-review#dependency-review-enforcement | ||
| name: 'Dependency review' | ||
| on: | ||
| pull_request: | ||
| branches: [ "main", "development" ] | ||
|
|
||
| # If using a dependency submission action in this workflow this permission will need to be set to: | ||
| # | ||
| # permissions: | ||
| # contents: write | ||
| # | ||
| # https://docs.github.com/en/enterprise-cloud@latest/code-security/supply-chain-security/understanding-your-software-supply-chain/using-the-dependency-submission-api | ||
| permissions: | ||
| contents: read | ||
| # Write permissions for pull-requests are required for using the `comment-summary-in-pr` option, comment out if you aren't using this option | ||
| pull-requests: write | ||
|
|
||
| jobs: | ||
| dependency-review: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: 'Checkout repository' | ||
| uses: actions/checkout@v4 | ||
| - name: 'Dependency Review' | ||
| uses: actions/dependency-review-action@v4 | ||
| # Commonly enabled options, see https://github.com/actions/dependency-review-action#configuration-options for all available options. | ||
| with: | ||
| comment-summary-in-pr: always | ||
| # fail-on-severity: moderate | ||
| # deny-licenses: GPL-1.0-or-later, LGPL-2.0-or-later | ||
| # retry-on-snapshot-warnings: true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| import re | ||
| from dataclasses import dataclass | ||
| from typing import Tuple | ||
|
|
||
| from hackingBuddyGPT.capabilities import Capability | ||
| from hackingBuddyGPT.utils.local_shell import LocalShellConnection | ||
|
|
||
|
|
||
| @dataclass | ||
| class LocalShellCapability(Capability): | ||
| conn: LocalShellConnection | ||
|
|
||
| def describe(self) -> str: | ||
| return "give a command to be executed and I will respond with the terminal output when running this command on the shell via tmux. The given command must not require user interaction. Do not use quotation marks in front and after your command." | ||
|
|
||
| def get_name(self): | ||
| return "local_exec" | ||
|
|
||
| def _got_root(self, output: str) -> bool: | ||
| """Check if we got root access based on the command output.""" | ||
| if not output.strip(): | ||
| return False | ||
|
|
||
| lines = output.strip().split('\n') | ||
| last_line = lines[-1] if lines else '' | ||
|
|
||
| # Check for common root indicators | ||
| return ( | ||
| "root" in output.lower() or | ||
| last_line.strip().endswith("#") or | ||
| "root@" in last_line or | ||
| last_line.strip() == "#" | ||
| ) | ||
|
|
||
| def __call__(self, cmd: str) -> Tuple[str, bool]: | ||
| out, _, _ = self.conn.run(cmd) # This is CORRECT - use the commented version | ||
| return out, self._got_root(out) | ||
14 changes: 10 additions & 4 deletions
14
src/hackingBuddyGPT/usecases/privesc/linux.py
100644 → 100755
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| from .local_shell import LocalShellConnection | ||
|
|
||
| __all__ = ["LocalShellConnection"] |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The comment '# This is CORRECT - use the commented version' is confusing and doesn't provide useful information. Consider removing it or making it more descriptive.