banner 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. #!/bin/bash
  2. clear
  3. chk=$(cat /etc/ssh/sshd_config | grep Banner)
  4. [[ $(netstat -nltp|grep 'dropbear' | wc -l) != '0' ]] && {
  5. local="/etc/bannerssh"
  6. [[ $(grep -wc $local /etc/default/dropbear) = '0' ]] && echo 'DROPBEAR_BANNER="/etc/bannerssh"' >> /etc/default/dropbear
  7. }
  8. [[ "$(echo "$chk" | grep -v '#Banner' | grep Banner)" != "" ]] && {
  9. local=$(echo "$chk" |grep -v "#Banner" | grep Banner | awk '{print $2}')
  10. } || {
  11. local="/etc/bannerssh"
  12. [[ $(grep -wc $local /etc/ssh/sshd_config) = '0' ]] && echo "Banner /etc/bannerssh" >> /etc/ssh/sshd_config
  13. }
  14. echo -e "\E[44;1;37m BANNER \E[0m"
  15. echo ""
  16. echo -e "\033[1;32mMANUAL SSH BANNER COMMAND"
  17. echo -e "\033[1;31msudo nano /etc/bannerssh"
  18. echo -e "\033[1;37mpest baner html text"
  19. echo -e "\033[1;36mCTRL+O enter CTRL+X"
  20. echo -e "\033[1;31mhttps://youtu.be/0qW64kxY7a0"
  21. echo -e "\033[1;32mFOLLOW VIDEOD LIKE AND SUBSCRIBE PLZ"
  22. echo ""
  23. echo -e "\033[1;31m[\033[1;36m1\033[1;31m]\033[1;37m • \033[1;33mADD BANNER"
  24. echo -e "\033[1;31m[\033[1;36m2\033[1;31m]\033[1;37m • \033[1;33mREMOVE BANNER"
  25. echo -e "\033[1;31m[\033[1;36m3\033[1;31m]\033[1;37m • \033[1;33mCOME BACK"
  26. echo ""
  27. echo -ne "\033[1;32mWHAT DO YOU WANT TO DO\033[1;31m ?\033[1;37m : "; read resp
  28. if [[ "$resp" = "1" ]]; then
  29. echo ""
  30. echo -ne "\033[1;32mWHICH MESSAGE YOU WANT TO DISPLAY\033[1;31m ?\033[1;37m : "; read msg1
  31. if [[ -z "$msg1" ]]; then
  32. echo -e "\n\033[1;31mEmpty or invalid field!\033[0m"
  33. sleep 2
  34. banner
  35. fi
  36. echo -e "\n\033[1;31m[\033[1;36m01\033[1;31m]\033[1;33m SMALL SOURCE (කුඩා)"
  37. echo -e "\033[1;31m[\033[1;36m02\033[1;31m]\033[1;33m MEDIA SOURCE (මාධ්‍)"
  38. echo -e "\033[1;31m[\033[1;36m03\033[1;31m]\033[1;33m LARGE SOURCE (මහා)"
  39. echo -e "\033[1;31m[\033[1;36m04\033[1;31m]\033[1;33m GIANT SOURCE (යෝධ)"
  40. echo ""
  41. echo -ne "\033[1;32mWHAT SOURCE OF THE SOURCE\033[1;31m ?\033[1;37m : "; read opc
  42. if [[ "$opc" = "1" ]] || [[ "$opc" = "01" ]]; then
  43. _size='6'
  44. elif [[ "$opc" = "2" ]] || [[ "$opc" = "02" ]]; then
  45. _size='4'
  46. elif [[ "$opc" = "3" ]] || [[ "$opc" = "03" ]]; then
  47. _size='3'
  48. elif [[ "$opc" = "4" ]] || [[ "$opc" = "04" ]]; then
  49. _size='1'
  50. fi
  51. echo -e "\n\033[1;31m[\033[1;36m01\033[1;31m]\033[1;33m BLUE (නිල්)"
  52. echo -e "\033[1;31m[\033[1;36m02\033[1;31m]\033[1;33m GREEN (කොළ)"
  53. echo -e "\033[1;31m[\033[1;36m03\033[1;31m]\033[1;33m RED (රතු)"
  54. echo -e "\033[1;31m[\033[1;36m04\033[1;31m]\033[1;33m YELLOW (කහ)"
  55. echo -e "\033[1;31m[\033[1;36m05\033[1;31m]\033[1;33m PINK (රෝස)"
  56. echo -e "\033[1;31m[\033[1;36m06\033[1;31m]\033[1;33m CYANO (සයනෝ)"
  57. echo -e "\033[1;31m[\033[1;36m07\033[1;31m]\033[1;33m ORANGE (තැඹිලි)"
  58. echo -e "\033[1;31m[\033[1;36m08\033[1;31m]\033[1;33m PURPLE (දම් පාට)"
  59. echo -e "\033[1;31m[\033[1;36m09\033[1;31m]\033[1;33m BLACK (කලු)"
  60. echo -e "\033[1;31m[\033[1;36m10\033[1;31m]\033[1;33m WITHOUT COLOR (වර්ණයකින් තොරව)"
  61. echo ""
  62. echo -ne "\033[1;32mQUAL A COR\033[1;31m ?\033[1;37m : "; read ban_cor
  63. if [[ "$ban_cor" = "1" ]] || [[ "$ban_cor" = "01" ]]; then
  64. echo "<h$_size><font color='blue'>$msg1" >> $local
  65. elif [[ "$ban_cor" = "2" ]] || [[ "$ban_cor" = "02" ]]; then
  66. echo "<h$_size><font color='green'>$msg1" >> $local
  67. elif [[ "$ban_cor" = "3" ]] || [[ "$ban_cor" = "03" ]]; then
  68. echo "<h$_size><font color='red'>$msg1" >> $local
  69. elif [[ "$ban_cor" = "4" ]] || [[ "$ban_cor" = "04" ]]; then
  70. echo "<h$_size><font color='yellow'>$msg1" >> $local
  71. elif [[ "$ban_cor" = "5" ]] || [[ "$ban_cor" = "05" ]]; then
  72. echo "<h$_size><font color='#F535AA'>$msg1" >> $local
  73. elif [[ "$ban_cor" = "6" ]] || [[ "$ban_cor" = "06" ]]; then
  74. echo "<h$_size><font color='cyan'>$msg1" >> $local
  75. elif [[ "$ban_cor" = "7" ]] || [[ "$ban_cor" = "07" ]]; then
  76. echo "<h$_size><font color='#FF7F00'>$msg1" >> $local
  77. elif [[ "$ban_cor" = "8" ]] || [[ "$ban_cor" = "08" ]]; then
  78. echo "<h$_size><font color='#9932CD'>$msg1" >> $local
  79. elif [[ "$ban_cor" = "9" ]] || [[ "$ban_cor" = "09" ]]; then
  80. echo "<h$_size><font color='black'>$msg1" >> $local
  81. elif [[ "$ban_cor" = "10" ]]; then
  82. echo "<h$_size>$msg1</h$_size>" >> $local
  83. /etc/init.d/ssh restart > /dev/null 2>&1
  84. echo -e "\n\033[1;32mBANNER DEFINED!\033[0m"
  85. sleep 2
  86. menu
  87. else
  88. echo -e "\n\033[1;31mOption invalid!\033[0m"
  89. sleep 2
  90. banner
  91. fi
  92. echo "</font></h$_size>" >> $local
  93. service ssh restart > /dev/null 2>&1 && service dropbear restart > /dev/null 2>&1
  94. echo -e "\n\033[1;32mBANNER DEFINED!\033[0m"
  95. unset ban_cor
  96. elif [[ "$resp" = "2" ]]; then
  97. echo " " > $local
  98. echo -e "\n\033[1;32mBANNER EXCLUDED!\033[0m"
  99. service ssh restart > /dev/null 2>&1 && service dropbear restart > /dev/null 2>&1
  100. sleep 2
  101. menu
  102. elif [[ "$resp" = "3" ]]; then
  103. menu
  104. else
  105. echo -e "\n\033[1;31mOption invalid!\033[0m"
  106. sleep 2
  107. banner
  108. fi