Reverse Electron Apps – EverSecMeet at BSidesRDU

During the BSidesRDU CTF, there was a challenge to reverse Electron apps.

Reverse Electron Apps - Introduction

If you haven't read the rest of my challenge solutions, then you can find them here.

I have never reversed Electron apps before, so I figured that this was a good challenge to cover. This will be the last write-up I have planned for this CTF, but please let me know if you want to see any more.

The Challenge

First, I downloaded the application and opened it up.

Reverse Electron Apps - EverSecMeet

As nothing showed up when I opened the app, I verified that it was a real application.

doyler@macbookpro:~/Downloads$ file directory

Flags in Files

First, I looked at the Info.plist file. This is a great place to find out the configuration of the application, as well as a flag.

doyler@macbookpro:~/Downloads/$ cat Info.plist 
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "">
<plist version="1.0">
    <string>Copyright © 2019 L3g10n0fGl00m</string>

Next, I looked at the frameworks in use, and identified that it was Electron.

doyler@macbookpro:~/Downloads/$ ls Frameworks/
Electron Framework.framework/ EversecMeet Helper    Mantle.framework/             Squirrel.framework/
EversecMeet Helper    EversecMeet       ReactiveCocoa.framework/

Reverse Electron Apps - asar

To reverse the application, I first installed asar.

doyler@macbookpro:~/Downloads/$ npm install -g asar
/usr/local/bin/asar -> /usr/local/lib/node_modules/asar/bin/asar.js
+ asar@2.0.1
added 21 packages from 9 contributors in 2.174s

For another example of reversing Electron apps, I recommend this post.

Next, I extracted the application into my eversecmeet directory.

doyler@macbookpro:~/Downloads/$ mkdir eversecmeet
doyler@macbookpro:~/Downloads/$ asar extract app.asar eversecmeet/

The next flag was in the package.json file.

doyler@macbookpro:~/Downloads/$ cat package.json 
  "name": "eversec-meet",
  "productName": "EversecMeet",
  "description": "Fake Eversec meeting updater",
  "version": "1.0.0",
  "private": true,
  "author": "L3g10n0fGl00m",
  "copyright": "© 2017, Gumby inc.",
  "main": "app/background.js",
  "dependencies": {
    "fs-jetpack": "^2.1.0"

When I looked at the application's resources, I found another flag in the main app.html file, inside of a hidden div that we couldn't see when we opened it initially.

doyler@macbookpro:~/Downloads/$ cat app.html 


... <snip> ...

<div id="loaded" class="" style="display:none;">
    <h3> Success!</h3>
    <p>Eversec Meet has been updated! </p>
    <span style="visibility:hidden;">T3hFuTr3Fr3@kzm30ut</span>
  var loader = document.getElementById("loading");
  var loaded = document.getElementById("loaded");
  setTimeout(function () { = 'none'; = 'block';
  }, 3000)




The final interesting file in resources was legion.html, which you can find below.

<!DOCTYPE html>

  <meta charset="utf-8" />
    body {
      margin: 0;

  var a=['fromCharCode','fa4ae513eecd8d3455d328cba83de7b6','VCU5OCVBMyVENyVEOSVBMjclRTIlOTQlRUYlOUUlQTY=','length','charCodeAt','charAt','replace','indexOf'];xyz=console.log;(function(c,d){var e=function(f){while(--f){c['push'](c['shift']());}};e(++d);}(a,0xeb));var b=function(c,d){c=c-0x0;var e=a[c];return e;};var c1;var xPcKu=function(c,d){var e=[],f=0x0,g,h='';for(var i=0x0;i<0x100;i++){e[i]=i;}for(i=0x0;i<0x100;i++){f=(f+e[i]+c['charCodeAt'](i%c[b('0x0')]))%0x100;g=e[i];e[i]=e[f];e[f]=g;}i=0x0;f=0x0;for(var j=0x0;j<d['length'];j++){i=(i+0x1)%0x100;f=(f+e[i])%0x100;g=e[i];e[i]=e[f];e[f]=g;h+=String['fromCharCode'](d[b('0x1')](j)^e[(e[i]+e[f])%0x100]);}return h;};var c3;var c2;var keyStr='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';function encode(k){k=escape(k);var l,m,n,o,p,q='',r='',s='',t=0x0;do{n=(l=k[b('0x1')](t++))>>0x2,o=(0x3&l)<<0x4|(m=k[b('0x1')](t++))>>0x4,p=(0xf&m)<<0x2|(r=k[b('0x1')](t++))>>0x6,s=0x3f&r,isNaN(m)?p=s=0x40:isNaN(r)&&(s=0x40),q=q+keyStr[b('0x2')](n)+keyStr[b('0x2')](o)+keyStr[b('0x2')](p)+keyStr[b('0x2')](s),l=m=r='',n=o=p=s='';}while(t<k[b('0x0')]);return q;}function decode(u){var v,w,x,y,z='',A='',B='',C=0x0;u=u[b('0x3')](/[^A-Za-z0-9\+\/\=]/g,'');do{v=keyStr[b('0x4')](u[b('0x2')](C++))<<0x2|(x=keyStr[b('0x4')](u[b('0x2')](C++)))>>0x4,w=(0xf&x)<<0x4|(y=keyStr[b('0x4')](u[b('0x2')](C++)))>>0x2,A=(0x3&y)<<0x6|(B=keyStr['indexOf'](u[b('0x2')](C++))),z+=String['fromCharCode'](v),0x40!=y&&(z+=String[b('0x5')](w)),0x40!=B&&(z+=String[b('0x5')](A)),v=w=A='',x=y=B='';}while(C<u['length']);return unescape(z);}var gGltY=xPcKu(b('0x6'),decode(b('0x7')));xyz(gGltY);


This looked like a moderately complicated and obfuscated encryption problem.

That said, if you look, it actually performs a console.log (xyz method) at the very end. When you open this file in a browser, the console prints the final flag without any extra work!

Reverse Electron Apps - Legion.html

I am not sure if this was an oversight or indented to be an easier challenge. That said, I submitted the last flag, and was done trying out challenges!

Reverse Electron Apps - Conclusion

This was a fun challenge to solve, and something that I had never done before.

If you know another way to reverse electron apps, then definitely let me know.

I have no more BSidesRDU write-ups to post, but I have some older CTFs that I might go through again soon.

doyler on Githubdoyler on Twitter
Ray Doyle is an avid pentester/security enthusiast/beer connoisseur who has worked in IT for almost 16 years now. From building machines and the software on them, to breaking into them and tearing it all down; he's done it all. To show for it, he has obtained an OSCE, OSCP, eCPPT, GXPN, eWPT, eWPTX, SLAE, eMAPT, Security+, ICAgile CP, ITIL v3 Foundation, and even a sabermetrics certification!

He currently serves as a Senior Staff Adversarial Engineer for Avalara, and his previous position was a Principal Penetration Testing Consultant for Secureworks.

When he's not figuring out what cert to get next or side project to work on, he enjoys playing video games, traveling, and watching sports.

As an Amazon Associate I earn from qualifying purchases.

Common passed on this blog, I made it to a jam.

1 Comment

Filed under Security Not Included

One Response to Reverse Electron Apps – EverSecMeet at BSidesRDU

  1. Pingback: Reverse Electron Apps – EverSecMeet at BSidesRDU | – The Library 6.0

Leave a Reply

Your email address will not be published. Required fields are marked *


This site uses Akismet to reduce spam. Learn how your comment data is processed.