find_pixy_class_file_locations.sh 526 B

123456789101112131415
  1. #!/bin/bash
  2. locations=$(strace -ff -e trace=file /home/m2mazmud/good_code/Verifier/a.out ~/pixy-master/sample_mitigator/index.php 2>&1 | perl -ne 's/^[^"]+"(([^\\"]|\\[\\"nt])*)".*/$1/ && print' | grep ".class" | cut -d. -f1 | rev | cut -d/ -f 2- | rev | sort -u )
  3. counter=0;
  4. for x in $locations;
  5. do
  6. y=$(find $x -maxdepth 1 -type f | grep .class);
  7. if [[ ! -z "$y" ]];
  8. then
  9. let counter++;
  10. key=$(echo "$x" | rev | cut -d/ -f1 | rev);
  11. echo "sgx.allowed_files.pixy_classes_"$key"_"$counter" = file:"$x;
  12. fi;
  13. done;