<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>vulnerability management - RiskInsight</title>
	<atom:link href="https://www.riskinsight-wavestone.com/tag/vulnerability-management-2/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.riskinsight-wavestone.com/tag/vulnerability-management-2/</link>
	<description>Le blog cybersécurité des consultants Wavestone</description>
	<lastBuildDate>Thu, 17 Jun 2021 07:25:49 +0000</lastBuildDate>
	<language>fr-FR</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	

<image>
	<url>https://www.riskinsight-wavestone.com/wp-content/uploads/2024/02/Blogs-2024_RI-39x39.png</url>
	<title>vulnerability management - RiskInsight</title>
	<link>https://www.riskinsight-wavestone.com/tag/vulnerability-management-2/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>BEEMKA &#8211; Electron Post-Exploitation When The Land Is Dry</title>
		<link>https://www.riskinsight-wavestone.com/2019/08/beemka-electron-post-exploitation-when-the-land-is-dry/</link>
		
		<dc:creator><![CDATA[Rémi Escourrou]]></dc:creator>
		<pubDate>Thu, 29 Aug 2019 16:15:54 +0000</pubDate>
				<category><![CDATA[Challenges]]></category>
		<category><![CDATA[Cybersecurity & Digital Trust]]></category>
		<category><![CDATA[How to]]></category>
		<category><![CDATA[beemka]]></category>
		<category><![CDATA[compte rendu]]></category>
		<category><![CDATA[détection]]></category>
		<category><![CDATA[discord]]></category>
		<category><![CDATA[electron]]></category>
		<category><![CDATA[framework]]></category>
		<category><![CDATA[github]]></category>
		<category><![CDATA[Skype]]></category>
		<category><![CDATA[Slack]]></category>
		<category><![CDATA[vulnerability management]]></category>
		<guid isPermaLink="false">https://www.riskinsight-wavestone.com/?p=15574</guid>

					<description><![CDATA[<p>Lors de les BSides Las Vegas 2019, Pavel « @ sadreck » Tsakalidis a présenté un nouveau framework de post-exploitation qui repose sur l’utilisation d’Electron par des « applications desktop ». Sa présentation démontre que l’utilisation massive d’Electron ces dernières...</p>
<p>Cet article <a href="https://www.riskinsight-wavestone.com/2019/08/beemka-electron-post-exploitation-when-the-land-is-dry/">BEEMKA &#8211; Electron Post-Exploitation When The Land Is Dry</a> est apparu en premier sur <a href="https://www.riskinsight-wavestone.com">RiskInsight</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p><a style="margin-left: 1em; margin-right: 1em; text-align: center;" href="https://1.bp.blogspot.com/--k9GnoyEsSA/XWeNvLIgHmI/AAAAAAAAArc/MZmZ_YLU1tIfDG85RMpZVTRT_tYOvItFACLcBGAs/s1600/header.png"><img fetchpriority="high" decoding="async" src="https://1.bp.blogspot.com/--k9GnoyEsSA/XWeNvLIgHmI/AAAAAAAAArc/MZmZ_YLU1tIfDG85RMpZVTRT_tYOvItFACLcBGAs/s640/header.png" width="640" height="240" border="0" data-original-height="350" data-original-width="927" /></a></p>
<div style="text-align: justify;">
<div>Lors de les BSides Las Vegas 2019, Pavel « @ sadreck » Tsakalidis a présenté un nouveau framework de post-exploitation qui repose sur l’utilisation d’Electron par des « applications desktop ». Sa présentation démontre que l’utilisation massive d’Electron ces dernières années peut être utilisée pour injecter du code malveillant dans des applications légitimes.</div>
<div>Le projet peut être retrouvé sur le dépôt GitHub suivant : <a href="https://github.com/ctxis/beemka">https://github.com/ctxis/beemka</a>.</div>
</div>
<div style="text-align: justify;"></div>
<h3 style="text-align: justify;">Introduction</h3>
<div style="text-align: justify;">Electron est un framework permettant de développer des applications multiplateformes avec des technologies web (Javascript, HTLM et CSS).</div>
<div style="text-align: justify;">Son fonctionnement est assez simple, Electron utilise « node.js » en backend et « Chromium » en frontend :</div>
<div style="text-align: justify;"></div>
<div style="text-align: justify;">
<figure id="post-15898 media-15898" class="align-none"><img decoding="async" class="alignnone size-medium wp-image-15898" src="https://www.riskinsight-wavestone.com/wp-content/uploads/2019/08/2-BEEMKA-437x165.png" alt="" width="437" height="165" srcset="https://www.riskinsight-wavestone.com/wp-content/uploads/2019/08/2-BEEMKA-437x165.png 437w, https://www.riskinsight-wavestone.com/wp-content/uploads/2019/08/2-BEEMKA-71x27.png 71w, https://www.riskinsight-wavestone.com/wp-content/uploads/2019/08/2-BEEMKA-768x290.png 768w, https://www.riskinsight-wavestone.com/wp-content/uploads/2019/08/2-BEEMKA.png 927w" sizes="(max-width: 437px) 100vw, 437px" /></figure>
<div style="text-align: center;"><span style="font-size: x-small;"><i>Components of Electron </i></span></div>
<div style="text-align: center;"><span style="font-size: x-small;"><i><a href="https://www.wildnettechnologies.com/build-cross-platform-desktop-apps-with-electron/">https://www.wildnettechnologies.com/build-cross-platform-desktop-apps-with-electron/</a></i></span></div>
<div></div>
</div>
<div style="text-align: justify;"></div>
<div style="text-align: justify;">Electron a notamment permis de développer des applications aujourd’hui incontournables en entreprise :</div>
<div style="text-align: justify;"></div>
<div class="separator" style="clear: both; text-align: center;"><a style="margin-left: 1em; margin-right: 1em;" href="https://1.bp.blogspot.com/-tnbHTpC5ffw/XWeNuKPtguI/AAAAAAAAAro/jl-POTPMvlAqpnWfA56w1MVllExfB5BBgCEwYBhgL/s1600/2.png"><img decoding="async" src="https://1.bp.blogspot.com/-tnbHTpC5ffw/XWeNuKPtguI/AAAAAAAAAro/jl-POTPMvlAqpnWfA56w1MVllExfB5BBgCEwYBhgL/s640/2.png" width="640" height="208" border="0" data-original-height="394" data-original-width="1201" /></a></div>
<div style="text-align: justify;"></div>
<div style="text-align: center;"><i><span style="font-size: x-small;">Applications Electron</span></i></div>
<div style="text-align: justify;"></div>
<h3 style="text-align: justify;">Principe de l’attaque</h3>
<div style="text-align: justify;">Les applications Slack, GitHub ou encore Microsoft Teams utilisent le dossier « App Data » lors de l’installation. Il est donc possible pour l’utilisateur d’accéder en écriture au répertoire d’installation.</div>
<div style="text-align: justify;">Toutes les applications Electron possèdent un dossier « resources » dans leur répertoire d&rsquo;installation :</div>
<div style="text-align: justify;"></div>
<div class="separator" style="clear: both; text-align: center;"></div>
<div><img decoding="async" class="aligncenter" src="https://1.bp.blogspot.com/-xw6deGNkoZI/XWeNuBTgTyI/AAAAAAAAArg/8Gm4R6E1tA0Ox8jFgFR6Fca7U5HkKcfkwCEwYBhgL/s1600/3.png" /></div>
<div style="text-align: center;"><i><span style="font-size: x-small;">Illustration avec GitHubDesktop</span></i></div>
<div style="text-align: center;"><i> </i></div>
<div style="text-align: justify;">Ce dossier contient généralement :</div>
<ul>
<li>Le dossier « app » qui contient l’application ;</li>
<li>Le fichier « electron.asar » qui prépare l’environnement Chronium au lancement de l’application.</li>
</ul>
<div style="text-align: justify;"></div>
<div style="text-align: justify;">Le fichier « electron.asar » peut être considéré comme une archive qui contient des scripts « *.js » :</div>
<div style="text-align: justify;"><img loading="lazy" decoding="async" class="alignnone size-medium wp-image-16154" src="https://www.riskinsight-wavestone.com/wp-content/uploads/2019/08/code-beemka-js-437x37.png" alt="" width="437" height="37" srcset="https://www.riskinsight-wavestone.com/wp-content/uploads/2019/08/code-beemka-js-437x37.png 437w, https://www.riskinsight-wavestone.com/wp-content/uploads/2019/08/code-beemka-js-71x6.png 71w, https://www.riskinsight-wavestone.com/wp-content/uploads/2019/08/code-beemka-js.png 712w" sizes="auto, (max-width: 437px) 100vw, 437px" /></div>
<div></div>
<div></div>
<div class="separator" style="clear: both; text-align: center;"><img decoding="async" src="https://1.bp.blogspot.com/-G0TPjCyHF3c/XWeNuDmYBII/AAAAAAAAAro/OQ7CY0443e8i6GXHJwk_Z-_RAVK686RwgCEwYBhgL/s1600/4.png" /></div>
<div style="text-align: center;"><i><span style="font-size: x-small;">Conteneur « electron.asar »</span></i></div>
<div style="text-align: justify;"></div>
<div style="text-align: justify;">Le fichier « chrome-extension.js » permet la gestion de l’environnement Chronium :</div>
<figure id="post-16156 media-16156" class="align-none"><img loading="lazy" decoding="async" class="size-medium wp-image-16156 alignleft" src="https://www.riskinsight-wavestone.com/wp-content/uploads/2019/08/code-beem-ka-2-437x23.png" alt="" width="437" height="23" srcset="https://www.riskinsight-wavestone.com/wp-content/uploads/2019/08/code-beem-ka-2-437x23.png 437w, https://www.riskinsight-wavestone.com/wp-content/uploads/2019/08/code-beem-ka-2-71x4.png 71w, https://www.riskinsight-wavestone.com/wp-content/uploads/2019/08/code-beem-ka-2.png 714w" sizes="auto, (max-width: 437px) 100vw, 437px" /></figure>
<p>&nbsp;</p>
<div style="text-align: justify;"></div>
<div style="text-align: justify;">Pavel propose ainsi d’injecter directement dans ce fichier du code javascript, permettant de lancer une action malveillante lors d’un évènement spécifique :</div>
<p><span class="w-code"><span class="w-root">app</span>.on(&lsquo;<span class="w-server">browser-window-focus</span>&lsquo;, function (event, bWindow) { <span class="w-root">bWindow</span>.webContents.<span class="w-grepped">executeJavaScript</span>(« <span class="w-server">alert(Hello Github !!&rsquo;);</span>« ) }) </span></p>
<p>&nbsp;</p>
<div style="text-align: justify;">Lors de l’ouverture de l’application (après avoir packé le fichier « electron.asar » et redéposé dans le répertoire « resource »), un pop-up (XSS style) va s’ouvrir dans l’application GitHub Desktop :</div>
<div style="text-align: justify;"></div>
<div><img loading="lazy" decoding="async" class="aligncenter" src="https://1.bp.blogspot.com/-AvxSdvn3kMg/XWeNu780hcI/AAAAAAAAArk/_psRbes4m7YyzYT5icMD_mYD7xRT2YeXQCEwYBhgL/s1600/5.png" width="314" height="177" /></div>
<div style="text-align: justify;"></div>
<div style="text-align: center;"><i><span style="font-size: x-small;">Illustration avec GitHub Desktop</span></i></div>
<div style="text-align: justify;"></div>
<div style="text-align: justify;">Le code est donc correctement exécuté.</div>
<div style="text-align: justify;"></div>
<h3 style="text-align: justify;">Démonstration</h3>
<div style="text-align: justify;">La vidéo suivante présente une démonstration du module « rshell_cmd » dans GitHub Desktop, permettant d’ouvrir un reverse shell vers notre listener :</div>
<div style="text-align: center;"><iframe loading="lazy" src="https://bit.ly/2PBBGb1" width="560" height="315" frameborder="0" allowfullscreen="allowfullscreen"></iframe></div>
<div style="text-align: justify;"></div>
<div style="text-align: justify;">
<div>La commande utilisée est la suivante :</div>
<p><span class="w-code">$ <span class="w-cli">python3</span> ./beemka/beemka.py &#8212;<span class="w-cli">inject </span>&#8212;<span class="w-cli">module </span>rshell_cmd &#8212;<span class="w-cli">asar</span> ./electron_safe.asar &#8212;<span class="w-cli">output </span>./electron.asar</span></p>
</div>
<div style="text-align: justify;"></div>
<div style="text-align: justify;">De plus, l’exécutable de l’application « GitHub Desktop » n’est jamais modifié durant la modification du fichier « asar ». Cette technique peut donc permettre de contourner une politique de filtrage présente sur le poste.</div>
<div style="text-align: justify;"></div>
<h3 style="text-align: justify;">Conclusion</h3>
<div style="text-align: justify;">Le framework présenté par Pavel est très intéressant pour compléter ses techniques de persistance. En effet, il se base sur le fonctionnement intrinsèque d’Electron et ne nécessite pas d’exploiter une vulnérabilité présente dans les applications.</div>
<div style="text-align: justify;">Le framework permet aussi d’aller plus loin en accédant aux données des applications mais aussi de réaliser d’autres opérations comme déposer un keylogger, prendre un Screenshot, …</div>
<div style="text-align: justify;">A ce jour, aucune solution n’était proposée par Electron pour mieux vérifier l’intégrité des fichiers des applications. Le plus simple est d’installer les applications dans « Programmes files » avec les privilèges administrateurs pour ne pas permettre à un utilisateur standard d’éditer le fichier « electron.asar ».</div>
<div style="text-align: justify;"></div>
<div style="text-align: justify;">Ps : BloodHound est aussi une application Electron, une bonne « blague » à faire aux équipes Red/Blue Team :</div>
<div style="text-align: center;"><iframe loading="lazy" src="https://bit.ly/2L30Yuk" width="560" height="315" frameborder="0" allowfullscreen="allowfullscreen"></iframe></div>
<div style="text-align: justify;"></div>
<div style="text-align: justify;">
<div style="text-align: right;"></div>
<div style="text-align: justify;"></div>
<div style="text-align: justify;">
<h4>Références</h4>
</div>
<div style="text-align: justify;"><a href="https://www.contextis.com/en/blog/basic-electron-framework-exploitation">https://www.contextis.com/en/blog/basic-electron-framework-exploitation</a></div>
<div style="text-align: justify;"><a href="https://github.com/ctxis/beemka">https://github.com/ctxis/beemka</a></div>
<div style="text-align: justify;"><a href="https://electronjs.org/docs/tutorial/application-architecture">https://electronjs.org/docs/tutorial/application-architecture</a></div>
<div style="text-align: justify;"><a href="https://www.wildnettechnologies.com/build-cross-platform-desktop-apps-with-electron/">https://www.wildnettechnologies.com/build-cross-platform-desktop-apps-with-electron/</a></div>
<div style="text-align: justify;"></div>
</div>
<p>Cet article <a href="https://www.riskinsight-wavestone.com/2019/08/beemka-electron-post-exploitation-when-the-land-is-dry/">BEEMKA &#8211; Electron Post-Exploitation When The Land Is Dry</a> est apparu en premier sur <a href="https://www.riskinsight-wavestone.com">RiskInsight</a>.</p>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
