Skip to content

Complete the initial Transport work... finally#896

Merged
Cictrone merged 3 commits intomainfrom
complete_transport_work
Apr 6, 2025
Merged

Complete the initial Transport work... finally#896
Cictrone merged 3 commits intomainfrom
complete_transport_work

Conversation

@Cictrone
Copy link
Copy Markdown
Collaborator

@Cictrone Cictrone commented Apr 6, 2025

/kind cleanup

…ort' the agent uses it just passed into 'new'
hulto
hulto previously approved these changes Apr 6, 2025
Copy link
Copy Markdown
Collaborator

@hulto hulto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔥🔥🔥🔥🔥🔥🔥

Do we need unwraps?
If a transport can't implement a feature Eg. DNS and reverse shell is there a safe way to error / NOOP it?
Can you add developer docs about how to add a transport.


async fn run(cfg: Config) -> anyhow::Result<()> {
let mut agent = Agent::new(cfg)?;
let mut agent = Agent::new(cfg, GRPC::init()?)?;
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this where like SMB would go?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep! after we merge its literally just make SMB.rs that implements the Transport trait and then just swap out GRPC::init here with SMB::init and it should just work. atleast theoretically :)

req.extensions_mut()
.insert(GrpcMethod::new("c2.C2", "ReportCredential"));
self.grpc.unary(req, path, codec).await
self.grpc.as_mut().unwrap().unary(req, path, codec).await
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unwrap!

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah we check to see if the value exists above each of these so i think it should be okay? it seems extremely difficult to have it be None'd out in between the check and when we use it. that being said it is a TOCTOU

hulto
hulto previously approved these changes Apr 6, 2025
Copy link
Copy Markdown
Collaborator

@hulto hulto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One typo

@Cictrone Cictrone merged commit 4d603f5 into main Apr 6, 2025
4 checks passed
@Cictrone Cictrone deleted the complete_transport_work branch April 6, 2025 21:14
Cictrone added a commit that referenced this pull request Apr 11, 2025
* fully plump through the trait constrained generic so that the 'transport' the agent uses it just passed into 'new'

* added docs for hulto and also changed a few things

* typo fix
Cictrone added a commit that referenced this pull request Apr 11, 2025
* added

* Complete the initial Transport work... finally (#896)

* fully plump through the trait constrained generic so that the 'transport' the agent uses it just passed into 'new'

* added docs for hulto and also changed a few things

* typo fix

---------

Co-authored-by: Hulto <7121375+hulto@users.noreply.github.com>
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