Skip to content

Conversation

shreyamalviya
Copy link
Contributor

Fixes #703

@codecov
Copy link

codecov bot commented Aug 10, 2020

Codecov Report

Merging #776 into develop will decrease coverage by 0.00%.
The diff coverage is 55.55%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop     #776      +/-   ##
===========================================
- Coverage    60.34%   60.33%   -0.01%     
===========================================
  Files          161      162       +1     
  Lines         4902     4911       +9     
===========================================
+ Hits          2958     2963       +5     
- Misses        1944     1948       +4     
Impacted Files Coverage Δ
...s/config_schema/definitions/post_breach_actions.py 100.00% <ø> (ø)
monkey/infection_monkey/control.py 21.10% <42.85%> (+0.72%) ⬆️
monkey/common/data/api_url_consts.py 100.00% <100.00%> (ø)
monkey/common/data/post_breach_consts.py 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f8e1e76...cff06a1. Read the comment docs.

Copy link
Contributor

@ShayNehmad ShayNehmad left a comment

Choose a reason for hiding this comment

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

Some changes post including: The "Random executable" is problematic for quite a few reasons:

  1. You need to make sure pyinstaller picks it up and dumps it where you're expecting
  2. 5.9MB file really makes the agent 38.5% bigger which is very bad for propagating. We should find a smaller executable, and possibly choose to download it from the Island when this technique is executed instead of packaging this with Monkey by default.
  3. I think this technique should be configured OFF by default. Now that the report clearly indicates why techniques weren't executed this is not as problematic as it used to be.

global ORIGINAL_COMSPEC
ORIGINAL_COMSPEC = subprocess.check_output('echo %COMSPEC%', shell=True).decode() # noqa: DUO116
return [
r'set comspec=infection_monkey\post_breach\signed_script_proxy\windows\random_executable.exe &&',
Copy link
Contributor

Choose a reason for hiding this comment

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

While this is Windows-only, I'd still prefer to use Pathlib to manipulate/create paths.

Copy link
Contributor

Choose a reason for hiding this comment

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

What's random_executable.exe? How do we compile it? Where's it's source code?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's just a program that outputs "Successfully executed an arbitrary program with the help of a pre-existing signed script on Windows."

showPagination={false}
defaultPageSize={this.props.data.info.length}
/> : ''}
<MitigationsComponent mitigations={this.props.data.mitigations}/>
Copy link
Contributor

Choose a reason for hiding this comment

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

Off topic, but maybe we should only display mitigations if the technique was used?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah that's how it is right now, but now that you mention it, maybe it's a good idea to show it even otherwise? It's informative.

Copy link
Contributor

Choose a reason for hiding this comment

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

Here's a suggestion. Have the mitigations component expandable. It should be open by default on used/attempted techniques and closed on the grey ones.

@shreyamalviya shreyamalviya marked this pull request as draft August 17, 2020 19:22
@shreyamalviya shreyamalviya force-pushed the T1216 branch 3 times, most recently from cc54877 to 163b816 Compare August 17, 2020 19:41
- smaller executable file; fetches it from the island when pba needs to run
- technique configured off by default
- other implementation changes
- smaller executable file; fetches it from the island when pba needs to run
- technique configured off by default
- other implementation changes
@shreyamalviya shreyamalviya force-pushed the T1216 branch 2 times, most recently from 359772f to 028b7b7 Compare August 17, 2020 20:47
- smaller executable file; fetches it from the island when pba needs to run
- technique configured off by default
- other implementation changes
@shreyamalviya shreyamalviya marked this pull request as ready for review August 19, 2020 20:31
Copy link
Contributor

@ShayNehmad ShayNehmad left a comment

Choose a reason for hiding this comment

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

Very cool technique 🚀 The PR still needs a little more polishing :)

showPagination={false}
defaultPageSize={this.props.data.info.length}
/> : ''}
<MitigationsComponent mitigations={this.props.data.mitigations}/>
Copy link
Contributor

Choose a reason for hiding this comment

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

Here's a suggestion. Have the mitigations component expandable. It should be open by default on used/attempted techniques and closed on the grey ones.

@shreyamalviya shreyamalviya merged commit bd062de into guardicore:develop Aug 27, 2020
@shreyamalviya shreyamalviya deleted the T1216 branch September 2, 2020 18:46
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.

Add "Signed Script Proxy Execution" technique (T1216)
3 participants