Created
October 27, 2016 16:28
-
-
Save zwetan/4f537f84dcdff7e7176a69d1decc1692 to your computer and use it in GitHub Desktop.
download and extract Phrack uuencoded stuff
This file contains hidden or 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
#!/usr/bin/as3shebang | |
import shell.*; | |
var name:String = "attacking_javascript_engines.html"; | |
if( FileSystem.exists( name ) ) | |
{ | |
FileSystem.remove( name ); | |
} | |
var online:String = "http://www.phrack.org/papers/" + name; | |
Program.exec( "wget " + online ); | |
var page:String = FileSystem.read( name ); | |
var mark_start:String = "begin 644 "; | |
var makr_end:String = "end"; | |
var data:Array = []; | |
var filename:String = ""; | |
var lines:Array = page.split( "\n" ); | |
var line:String; | |
var copy:Boolean = false; | |
for( var i:uint = 0; i < lines.length; i++ ) | |
{ | |
line = lines[i]; | |
if( line.substr( 0, mark_start.length ) == mark_start ) | |
{ | |
filename = line.substr( mark_start.length ); | |
copy = true; | |
} | |
if( line.substr( 0, makr_end.length ) == makr_end ) | |
{ | |
copy = false; | |
} | |
if( copy ) | |
{ | |
data.push( line ); | |
} | |
} | |
var flat:String = data.join( "\n" ); | |
flat = flat.split( "<" ).join( "<" ); | |
flat = flat.split( ">" ).join( ">" ); | |
flat = flat.split( """ ).join( "\"" ); | |
flat = flat.split( "&" ).join( "&" ); | |
FileSystem.write( filename + ".uue" , flat ); | |
Program.exec( "uudecode -o " + filename + " < " + filename + ".uue " ); | |
Program.exec( "tar zxvf " + filename ); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment