uninstall-nessus.in
上传用户:tjescc
上传日期:2021-02-23
资源大小:419k
文件大小:3k
源码类别:

Telnet服务器

开发平台:

Unix_Linux

  1. #!/bin/sh
  2. #
  3. # uninstall-nessus
  4. #
  5. # Removes the previous configuration of Nessus
  6. #
  7. # Written by Renaud Deraison <deraison@cvs.nessus.org>
  8. #
  9. # This script is distributed under the Gnu General Public License (GPL)
  10. #
  11. prefix=@prefix@
  12. exec_prefix=@exec_prefix@
  13. bindir=@bindir@
  14. sbindir=@sbindir@
  15. libexecdir=@libexecdir@
  16. datadir=@datadir@
  17. sysconfdir=@sysconfdir@
  18. sharedstatedir=@sharedstatedir@
  19. localstatedir=@localstatedir@
  20. libdir=@libdir@
  21. includedir=@includedir@
  22. oldincludedir=@oldincludedir@
  23. infodir=@infodir@
  24. mandir=@mandir@
  25. test "$1" = "-q" && quiet=yes
  26. # check whether we have echo -n, depending
  27. # on the current shell, used
  28. case `echo -n` in
  29. -n)    Xn=   ; Xc='c' ;;
  30. *)      Xn=-n ; Xc=
  31. esac
  32. # make sure that we are root, if there is no id command,
  33. # you loose, anyway
  34. case `id 2>/dev/null` in 
  35. uid=0*) 
  36.     ;; 
  37. *)
  38.     echo "only root should use uninstall-nessus"
  39.     exit 1
  40. esac
  41. test -z "$quiet" && 
  42. {
  43. clear
  44. echo "--------------------------------------------------------------------------------"
  45. echo "                          UN-INSTALLATION OF NESSUS"
  46. echo "--------------------------------------------------------------------------------"
  47. echo
  48. echo
  49. echo "This script will de-install older versions Nessus from this system"
  50. echo
  51. echo
  52. echo $Xn "Do you want to also delete your configuration files and keys ? (y/n) [n] " $Xc
  53. read answer < /dev/tty
  54. }
  55. test -z "$answer" && answer=n
  56. test "$answer" = "y" && {
  57.  deleteall=y
  58.  echo "Do you want to delete the configurations of ALL nessus users on this "
  59.  echo $Xn "host ? (y/n) [y] " $Xc
  60.  read answer < /dev/tty
  61.  test "$answer" = "y" && 
  62.  {
  63.   deleteconfs=y
  64.  }
  65. }
  66. test -z "$quiet" && 
  67. {
  68. clear
  69. echo "--------------------------------------------------------------------------------"
  70. echo "                          UN-INSTALLATION OF NESSUS"
  71. echo "--------------------------------------------------------------------------------"
  72. echo
  73. echo
  74. echo "We are now ready to uninstall Nessus from this system"
  75. test -n "$deleteall" && echo "All configuration files will be destroyed"
  76. echo "Press a key to continue"
  77. read nothing < /dev/tty
  78. }
  79. #
  80. # Step 2 - delete files
  81. #
  82. set -x
  83. rm -f  $bindir/nasl
  84. rm -f  $bindir/nasl-config
  85. rm -f  $bindir/nessus
  86. rm -f  $bindir/nessus-config
  87. rm -f  $bindir/nessus-build
  88. rm -f  $bindir/nessus-mkrand
  89. rm -f  $bindir/nessus-mkcert-client
  90. rm -f  $sbindir/nessus-adduser
  91. rm -f  $sbindir/nessus-rmuser
  92. rm -f  $sbindir/nessusd
  93. rm -f  $sbindir/nessus-update-plugins
  94. rm -f  $sbindir/nessus-mkcert
  95. rm -f  $sbindir/nessus-check-signature
  96. rm -rf $includedir/nessus
  97. rm -f  $libdir/libhosts_gatherer.*
  98. rm -f  $libdir/libnasl.*
  99. rm -f  $libdir/libnessus.*
  100. rm -f  $libdir/libpcap-nessus.*
  101. rm -rf $libdir/nessus
  102. rm -f  $mandir/man1/nasl-config.1
  103. rm -f  $mandir/man1/nasl.1
  104. rm -f  $mandir/man1/nessus-build.1
  105. rm -f  $mandir/man1/nessus-config.1
  106. rm -f  $mandir/man1/nessus.1
  107. rm -f  $mandir/man1/nessus-mkrand.1
  108. rm -f  $mandir/man1/nessus-mkcert-client.1
  109. rm -f  $mandir/man8/nessus-mkcert.8
  110. rm -f  $mandir/man8/nessus-adduser.8
  111. rm -f  $mandir/man8/nessus-rmuser.8
  112. rm -f  $mandir/man8/nessus-update-plugins.8
  113. rm -f  $mandir/man8/nessusd.8
  114. test -n "$deleteall" && {
  115.  rm -rf $localstatedir/nessus
  116.  rm -rf $sysconfdir/nessus
  117.  test -n "$deleteconfs" &&
  118.  {
  119.   for i in `cat /etc/passwd | sed 's/.*:.*:.*:.*:.*:(.*):.*/1/g'|sort|uniq`
  120.   do
  121.     test -f $i/.nessusrc && rm -f $i/.nessusrc
  122.   done
  123.  }
  124. }
  125. set +x
  126. echo "Finished"
  127. rm -f $sbindir/uninstall-nessus