Complete the initial Transport work... finally#896
Conversation
…ort' the agent uses it just passed into 'new'
hulto
left a comment
There was a problem hiding this comment.
🔥🔥🔥🔥🔥🔥🔥
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.
implants/imix/src/run.rs
Outdated
|
|
||
| async fn run(cfg: Config) -> anyhow::Result<()> { | ||
| let mut agent = Agent::new(cfg)?; | ||
| let mut agent = Agent::new(cfg, GRPC::init()?)?; |
There was a problem hiding this comment.
Is this where like SMB would go?
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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
* 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
* 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>
/kind cleanup