redcanaryco / invoke-atomicredteam

Invoke-AtomicRedTeam is a PowerShell module to execute tests as defined in the [atomics folder](https://github.com/redcanaryco/atomic-red-team/tree/master/atomics) of Red Canary's Atomic Red Team project.
MIT License
815 stars 193 forks source link

Redundant line in Invoke-AtomicTest.ps1 #76

Closed arunppsg closed 2 years ago

arunppsg commented 2 years ago

Hey,

I was reading the source code and I came across these lines:

https://github.com/redcanaryco/invoke-atomicredteam/blob/0a4d1af95c2a30b42a3413b3ff2ed84230cc3704/Public/Invoke-AtomicTest.ps1#L263-L271

I think line 270 is not needed because it is a duplicate of L 263.

mgraeber-rc commented 2 years ago

@clr2of8 you may be more familiar with this bit of code but it looks to me like the first Invoke-ExecuteCommand $final_command_prereq attempts to invoke the prereqs but if it fails to, obtains them and then tries again, yeah? If that were the case then the two calls to Invoke-ExecuteCommand $final_command_prereq would be appropriate, yeah?

clr2of8 commented 2 years ago

That is right Matt, we do need both lines but I'm impressed @arunppsg that you are reading the source code and that you picked up on that! Keep it up!

arunppsg commented 2 years ago

Thanks for clarification @clr2of8 @mgraeber-rc!