Last active
January 4, 2016 11:19
-
-
Save kfatehi/8614879 to your computer and use it in GitHub Desktop.
disk diff payload via afick
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
afick -p > ~/before # dump the db prior to update | |
afick --update # update the db now | |
afick -p > after # dump the new db | |
diff before after > db_diff | |
cat db_diff | egrep -o "> directory .*|" > new_directories | |
cat db_diff | egrep -o "> file .*|" > new_files | |
./build_payload.rb | |
tar -cvpzf payload.tar.gz payload/ | |
# scp tar.gz to target and go like: | |
# cd / && tar --strip-components 1 -xvzf /path/to/payload.tar.gz |
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
echo "deb http://eric.gerbier.free.fr/download/pool ./" >> /etc/apt/sources.list | |
apt-get update | |
apt-get install afick | |
afick -i # build base db |
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
#!/usr/bin/env ruby | |
require('fileutils') | |
if File.directory? "payload" | |
FileUtils.rm_rf "payload" | |
end | |
FileUtils.mkdir "payload" | |
File.open("new_files").each do |line| | |
path = line.match(/\> file (.+)/)[1].split("|")[0]; | |
new_path = File.join("payload", path) | |
if !File.directory? File.dirname(new_path) | |
FileUtils.mkdir_p new_path | |
end | |
print "#{new_path} ... " | |
FileUtils.cp path, new_path | |
puts "OK" | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
dont actually use this -- it destroys all your bin permissions