Advertisement
FlyFar

dev/regenerate_patch.sh

Aug 12th, 2023
960
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.45 KB | Cybersecurity | 0 0
  1. #!/bin/bash
  2. #
  3. # Copyright (C) 2017-2018  Joe Testa <jtesta@positronsecurity.com>
  4. #
  5. # This program is free software: you can redistribute it and/or modify
  6. # it under the terms version 3 of the GNU General Public License as
  7. # published by the Free Software Foundation.
  8. #
  9. # This program is distributed in the hope that it will be useful,
  10. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  12. # GNU General Public License for more details.
  13. #
  14. # You should have received a copy of the GNU General Public License
  15. # along with this program.  If not, see <http://www.gnu.org/licenses/>.
  16. #
  17. #
  18. #
  19. # This script will regenerate the openssh-7.5p1-mitm.patch file, then launch
  20. # "git diff" on it for manual review.
  21.  
  22. if [[ (! -d openssh-7.5p1-mitm) || (! -f openssh-7.5p1.tar.gz) ]]; then
  23.     echo -e "\nCould not find openssh-7.5p1-mitm directory or openssh-7.5p1.tar.gz file.  Ensure that you are in the top level directory of the SSH MITM project."
  24.     exit -1
  25. fi
  26.  
  27. rm -rf openssh-7.5p1
  28. tar xzf openssh-7.5p1.tar.gz
  29.  
  30. pushd openssh-7.5p1-mitm > /dev/null
  31. make clean > /dev/null
  32. popd > /dev/null
  33.  
  34. diff -ru --new-file -x '*~' -x 'config.*' -x Makefile -x opensshd.init -x survey.sh -x openssh.xml -x buildpkg.sh -x output.0 -x requests -x traces.0 -x configure openssh-7.5p1 openssh-7.5p1-mitm/ > openssh-7.5p1-mitm.patch
  35.  
  36. rm -rf openssh-7.5p1
  37.  
  38. git diff openssh-7.5p1-mitm.patch
  39. exit 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement