AlexaMP

botol

Nov 24th, 2019
615
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 7.32 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. # Email Extractor
  4. # Coded By AriestaHeart
  5. # Thanks to malhadijr
  6.  
  7. # text style
  8.  
  9. BOLD='\e[1m'
  10.  
  11. # text color
  12.  
  13. RED='\033[0;31m'
  14. GREEN='\033[0;32m'
  15. YELLOW='\033[0;33m'
  16. BLUE='\033[0;34m'
  17. MAENTA='\033[0;35m'
  18.  
  19. LIGHTRED='\033[0;91m'
  20. LIGHTGREEN='\033[0;92m'
  21. LIGHTCYAN='\033[0;96m'
  22.  
  23. # background color
  24.  
  25. BACKGREEN='\033[0;42m'
  26. BACKBLUE='\033[0;44m'
  27.  
  28. # no style
  29.  
  30. NC='\033[0m'
  31.  
  32.  
  33. header(){
  34.   printf "    ${LIGHTGREEN}___${NC}        ${LIGHTRED} __  __                __  ${NC}\n"
  35.   printf "   ${LIGHTGREEN}/   |${NC}       ${LIGHTRED}/ / / /__  ____ ______/ /_ ${NC}\n"
  36.   printf "  ${LIGHTGREEN}/ /| |${NC}      ${LIGHTRED}/ /_/ / _ \/ __ \`/ ___/ __/${NC}\n"
  37.   printf " ${LIGHTGREEN}/ ___ |${NC}     ${LIGHTRED}/ __  /  __/ /_/ / /  / /_   ${NC}\n"
  38.   printf "${LIGHTGREEN}/_/  |_|${NC}    ${LIGHTRED}/_/ /_/\___/\__,_/_/   \__/   ${NC}\n"
  39. }
  40.  
  41. #-----
  42. clear
  43. header
  44. #-----
  45.  
  46. echo ""
  47. echo "__________________________________________________________________________________"
  48. echo ""
  49. echo "Email Filter"
  50. echo "Coded By : Ariesta Heart ( ariestahrt )"
  51. echo "Date     : 22 March 2017"
  52. echo "__________________________________________________________________________________"
  53. echo ""
  54.  
  55. # end of banyol
  56.  
  57. echo "List of file on this directory : "
  58. echo ""
  59.  
  60. ls
  61.  
  62. echo ""
  63. echo "__________________________________________________________________________________"
  64.  
  65. # ---
  66.  
  67. echo ""
  68. printf "[+] Email List : ${LIGHTCYAN}"
  69. read emaillist
  70. printf "${NC}"
  71. # ---
  72.  
  73. printf "[+] Result will save in : ${LIGHTCYAN}"
  74. read save
  75. printf "${NC}"
  76.  
  77. # ---
  78.  
  79. printf "[+] Making directory : "
  80.  
  81. if [[ ! -d "$save" ]]; then
  82.   mkdir $save
  83.   echo -e "${GREEN}[OK]${NC}"
  84. else
  85.   echo -e "${RED}[ERR]${NC} | ${RED}File Already Exists${NC}"
  86. fi
  87.  
  88. echo ""
  89.  
  90. # ---
  91.  
  92. counter=$(wc -l < $emaillist)
  93. echo -e "${NC}[+] Total lines : [${LIGHTGREEN}$counter${NC}]"
  94. echo "[+] Cleaning your email list , lowering the word in your list , and removing duplicates email , Please wait ..."
  95.  
  96. # Code for cleaning email list
  97. grep -Eiorh '([[:alnum:]_.-]+@[[:alnum:]_.-]+?\.[[:alpha:].]{2,6})' $emaillist | sort | uniq > temp_list && mv temp_list $emaillist
  98. # Lowering the word
  99. cat $emaillist | awk '{print tolower($0)}' | sort | uniq > temp_list && mv temp_list $emaillist
  100. # Removing duplicates line
  101. sort -u $emaillist | uniq > temp_list && mv temp_list $emaillist
  102.  
  103. counter=$(wc -l < $emaillist)
  104.  
  105. echo ""
  106. echo "[+] Done ~"
  107. echo ""
  108. echo -e "[+] You have [${LIGHTGREEN}$counter${NC}] email"
  109. echo ""
  110.  
  111. # Array list here
  112.  
  113. microsoft_family=( hotmail live outlook msn )
  114. yahoo_family=( yahoo ymail btinternet bt rocketmail sky )
  115. google_family=( gmail google googlemail )
  116. aol_family=( aol )
  117.  
  118. # Array list here
  119.  
  120. otherpath="other_mail.txt"
  121. cp $emaillist "$save/$otherpath"
  122.  
  123. # ---- GREPING MICROSOFT FAMILY ---- #
  124.  
  125. # ---
  126.  
  127. thispath="microsoft_family.txt"
  128.  
  129. # ---
  130.  
  131. echo "[+] Catch microsoft family : "
  132. echo "[+] I have list : "
  133. for (( i = 0; i < ${#microsoft_family[@]}; i++ )); do
  134.   echo "      [-] @${microsoft_family[$i]}.*"
  135. done
  136. echo ""
  137.  
  138. # --- Looping ---- #
  139.  
  140. for (( i = 0; i < ${#microsoft_family[@]}; i++ )); do
  141.   emailtogrep="@${microsoft_family[$i]}."
  142.   printf "      [+] Catch $emailtogrep* : "
  143.   cat $emaillist | grep "$emailtogrep" | sort | uniq >> "$save/$thispath"
  144.   cat "$save/$otherpath" | grep -v "$emailtogrep" | sort | uniq > "$save/tmp_other" && mv "$save/tmp_other" "$save/$otherpath"
  145.   counter=$(cat "$save/$thispath" | grep -c "$emailtogrep")
  146.   if [[ $counter != 0 ]]; then
  147.     printf "${GREEN}[OK]${NC} | ${BLUE}$counter${NC} catched\n"
  148.   else
  149.     printf "${RED}[NO]${NC} | There is no ${BLUE}${emailtogrep}*${NC} email\n"
  150.   fi
  151. done
  152.  
  153. # --- Looping ---- #
  154.  
  155. counter=$(wc -l < "$save/$thispath")
  156. echo ""
  157. echo -e "[+] Finally you have [${LIGHTGREEN}$counter${NC}] Microsoft Family"
  158. echo ""
  159.  
  160. # ---- END OF GREPING HOTMAIL FAMILY ---- #
  161.  
  162. #############################
  163.  
  164. # ---- GREPING YAHOO FAMILY ---- #
  165.  
  166. # ---
  167.  
  168. thispath="yahoo_family.txt"
  169.  
  170. # ---
  171.  
  172. echo "[+] Catch yahoo family : "
  173. echo "[+] I have list : "
  174. for (( i = 0; i < ${#yahoo_family[@]}; i++ )); do
  175.   echo "      [-] @${yahoo_family[$i]}.*"
  176. done
  177. echo ""
  178.  
  179. # --- Looping ---- #
  180.  
  181. for (( i = 0; i < ${#yahoo_family[@]}; i++ )); do
  182.   emailtogrep="@${yahoo_family[$i]}."
  183.   printf "      [+] Catch $emailtogrep* : "
  184.   cat $emaillist | grep "$emailtogrep" | sort | uniq >> "$save/$thispath"
  185.   cat "$save/$otherpath" | grep -v "$emailtogrep" | sort | uniq > "$save/tmp_other" && mv "$save/tmp_other" "$save/$otherpath"
  186.   counter=$(cat "$save/$thispath" | grep -c "$emailtogrep")
  187.   if [[ $counter != 0 ]]; then
  188.     printf "${GREEN}[OK]${NC} | ${BLUE}$counter${NC} catched\n"
  189.   else
  190.     printf "${RED}[NO]${NC} | There is no ${BLUE}${emailtogrep}*${NC} email\n"
  191.   fi
  192. done
  193.  
  194. # --- Looping ---- #
  195.  
  196. counter=$(wc -l < "$save/$thispath")
  197. echo ""
  198. echo -e "[+] Finally you have [${LIGHTGREEN}$counter${NC}] Yahoo Family"
  199. echo ""
  200.  
  201. # ---- END OF GREPING YAHOO FAMILY ---- #
  202.  
  203. #############################
  204.  
  205. # ---- GREPING GOOGLE FAMILY ---- #
  206.  
  207. # ---
  208.  
  209. thispath="google_family.txt"
  210.  
  211. # ---
  212.  
  213. echo "[+] Catch google family : "
  214. echo "[+] I have list : "
  215. for (( i = 0; i < ${#google_family[@]}; i++ )); do
  216.   echo "      [-] @${google_family[$i]}.*"
  217. done
  218. echo ""
  219.  
  220. # --- Looping ---- #
  221.  
  222. for (( i = 0; i < ${#google_family[@]}; i++ )); do
  223.   emailtogrep="@${google_family[$i]}."
  224.   printf "      [+] Catch $emailtogrep* : "
  225.   cat $emaillist | grep "$emailtogrep" | sort | uniq >> "$save/$thispath"
  226.   cat "$save/$otherpath" | grep -v "$emailtogrep" | sort | uniq > "$save/tmp_other" && mv "$save/tmp_other" "$save/$otherpath"
  227.   counter=$(cat "$save/$thispath" | grep -c "$emailtogrep")
  228.   if [[ $counter != 0 ]]; then
  229.     printf "${GREEN}[OK]${NC} | ${BLUE}$counter${NC} catched\n"
  230.   else
  231.     printf "${RED}[NO]${NC} | There is no ${BLUE}${emailtogrep}*${NC} email\n"
  232.   fi
  233. done
  234.  
  235. # --- Looping ---- #
  236.  
  237. counter=$(wc -l < "$save/$thispath")
  238. echo ""
  239. echo -e "[+] Finally you have [${LIGHTGREEN}$counter${NC}] Google Family"
  240. echo ""
  241.  
  242. # ---- END OF GREPING GOOGLE FAMILY ---- #
  243.  
  244. # ---- GREPING AOL FAMILY ---- #
  245.  
  246. # ---
  247.  
  248. thispath="aol_family.txt"
  249.  
  250. # ---
  251.  
  252. echo "[+] Catch aol family : "
  253. echo "[+] I have list : "
  254. for (( i = 0; i < ${#aol_family[@]}; i++ )); do
  255.   echo "      [-] @${aol_family[$i]}.*"
  256. done
  257. echo ""
  258.  
  259. # --- Looping ---- #
  260.  
  261. for (( i = 0; i < ${#aol_family[@]}; i++ )); do
  262.   emailtogrep="@${aol_family[$i]}."
  263.   printf "      [+] Catch $emailtogrep* : "
  264.   cat $emaillist | grep "$emailtogrep" | sort | uniq >> "$save/$thispath"
  265.   cat "$save/$otherpath" | grep -v "$emailtogrep" | sort | uniq > "$save/tmp_other" && mv "$save/tmp_other" "$save/$otherpath"
  266.   counter=$(cat "$save/$thispath" | grep -c "$emailtogrep")
  267.   if [[ $counter != 0 ]]; then
  268.     printf "${GREEN}[OK]${NC} | ${BLUE}$counter${NC} catched\n"
  269.   else
  270.     printf "${RED}[NO]${NC} | There is no ${BLUE}${emailtogrep}*${NC} email\n"
  271.   fi
  272. done
  273.  
  274. # --- Looping ---- #
  275.  
  276. counter=$(wc -l < "$save/$thispath")
  277. echo ""
  278. echo -e "[+] Finally you have [${LIGHTGREEN}$counter${NC}] Aol Family"
  279. echo ""
  280.  
  281. # ---- END OF GREPING AOL FAMILY ---- #
  282.  
  283. #############################
  284.  
  285. # ---- OTHER MAIL ---- #
  286.  
  287. echo "[+] Other Mail"
  288.  
  289. counter=$(wc -l < "$save/$otherpath")
  290. echo ""
  291. echo -e "[+] Finally you have [${LIGHTGREEN}$counter${NC}] Other Mail"
  292. echo ""
  293. echo "[+] Done -"
  294. echo ""
  295.  
  296. # ---- OTHER MAIL ----#
Add Comment
Please, Sign In to add comment