initial version

This commit is contained in:
2025-03-23 11:03:36 +01:00
commit 5b1953df37
2 changed files with 40 additions and 0 deletions

5
Readme.md Normal file
View File

@@ -0,0 +1,5 @@
# Burp Check
try to restore some random files from a random burp backup
random file taken from a dir listed in burp.conf file

35
burpcheck.sh Normal file
View File

@@ -0,0 +1,35 @@
#! /bin/bash
set -eu -o pipefail
burpconf=/etc/burp/burp.conf
numFiles=10
restoreFolder=/tmp/test_restauration
IFS=$(echo -ne '\b\n')
function _getRandomBurpFolders {
folderList=$(awk -F " = " '/^include/{ print $2}' $burpconf)
echo $folderList | sort --random-sort | tail -n 1
}
function _getRandomBackup {
burp -a l | awk '{ print $2}' | sort --random-sort | tail -n 1
}
function _getRandomFile {
f=$(_getRandomBurpFolders )
test -d "${f}" || { echo "error opening $f" ; exit 1 ; }
find $f -type f | sort --random-sort | tail -n ${numFiles}
}
backup=$(_getRandomBackup)
files=$(_getRandomFile )
for file in $files ; do
echo "Trying to restore ${file} from backup #${backup}"
burp -a r -b ${backup} -r "${file}" -d ${restoreFolder}
done
exit $?