Skip to content

Instantly share code, notes, and snippets.

@darkhelmet
Created August 10, 2010 23:19
Show Gist options
  • Select an option

  • Save darkhelmet/518206 to your computer and use it in GitHub Desktop.

Select an option

Save darkhelmet/518206 to your computer and use it in GitHub Desktop.
system("tar cf - #{user.archive_folder} | 7za a -si -mx=#{params[:compression_level]} #{user.temp_archive_name}")
# Go on to serve file...
if system('tar', 'cf', user.temp_archive_name(1), 'hacker_folder')
system('7za', 'a', "-mx=#{params[:compression_level]}", user.temp_archive_name(1), user.temp_archive_name(2))
end
# Go on to serve file...
params[:compression_level] # => "9; rm -rf /;"
# OH THE HUMANITY! Now you get this
system("tar cf - hacker_folder | 7za a -si -mx=9; rm -rf /; hacker_folder.tmp")
my $dataPath = "/users/cwe/profiles";
my $username = param("user");
my $profilePath = $dataPath . "/" . $username;
open(my $fh, "<$profilePath") || ExitError("profile read error: $profilePath");
print "<ul>\n";
while (<$fh>) {
print "<li>$_</li>\n";
}
print "</ul>\n";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment