Advertisement
AlexaMP

babi.sh

Nov 24th, 2019
1,291
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 10.13 KB | None | 0 0
  1. #!/bin/bash
  2. # Slackerc0de Family Present
  3. # Apple Valid Checker 2018
  4. # 17 December 2K17
  5. # By Malhadi Jr.
  6.  
  7. RED='\033[0;31m'
  8. CYAN='\033[0;36m'
  9. YELLOW='\033[1;33m'
  10. ORANGE='\033[0;33m'
  11. PUR='\033[0;35m'
  12. GRN="\e[32m"
  13. WHI="\e[37m"
  14. NC='\033[0m'
  15. echo ""
  16. printf "$RED           ##########################   $GRN#\n"
  17. printf "$RED           ########################    $GRN##\n"
  18. printf "$RED           ####                       $GRN###\n"
  19. printf "$RED           ####                      $GRN####\n"
  20. printf "$RED           #######################   $GRN####\n"
  21. printf "$RED           #######################   $GRN####\n"
  22. printf "$RED                              ####   $GRN####\n"
  23. printf "$RED                              ####   $GRN####\n"
  24. printf "$WHI           ##########$RED     ########   $GRN####\n"
  25. printf "$WHI           ############$RED     ######   $GRN####\n"
  26. printf "$WHI           #####                     $GRN####\n"
  27. printf "$WHI           #####                     $GRN####\n"
  28. printf "$WHI           ##################    $GRN########\n"
  29. printf "$WHI           ####################    $GRN######\n"
  30. printf "$NC\n"
  31. cat <<EOF
  32.              - https://malhadijr.com -
  33.           [+] malhadijr@slackerc0de.us [+]
  34.        
  35. ---------------------------------------------------
  36.    Slackerc0de Family - AppleID Validator 2018
  37. ---------------------------------------------------
  38.  
  39. EOF
  40.  
  41. usage() {
  42.   echo "Usage: ./myscript.sh COMMANDS: [-i <list.txt>] [-r <folder/>] [-l {1-1000}] [-t {1-10}] OPTIONS: [-d] [-c]
  43.  
  44. Command:
  45. -i (20k-US.txt)     File input that contain email to check
  46. -r (result/)        Folder to store the result live.txt and die.txt
  47. -l (60|90|110)      How many list you want to send per delayTime
  48. -t (3|5|8)          Sleep for -t when check is reach -l fold
  49.  
  50. Options:
  51. -d                  Delete the list from input file per check
  52. -c                  Compress result to compressed/ folder and
  53.                    move result folder to haschecked/
  54. -h                  Show this manual to screen
  55. -u                  Check integrity file then update
  56.  
  57. Report any bugs to: <Malhadi Jr> contact@malhadi.slackerc0de.us
  58. "
  59.   exit 1
  60. }
  61.  
  62. # Assign the arguments for each
  63. # parameter to global variable
  64. while getopts ":i:r:l:t:dchu" o; do
  65.     case "${o}" in
  66.         i)
  67.             inputFile=${OPTARG}
  68.             ;;
  69.         r)
  70.             targetFolder=${OPTARG}
  71.             ;;
  72.         l)
  73.             sendList=${OPTARG}
  74.             ;;
  75.         t)
  76.             perSec=${OPTARG}
  77.             ;;
  78.         d)
  79.             isDel='y'
  80.             ;;
  81.         c)
  82.             isCompress='y'
  83.             ;;
  84.         h)
  85.             usage
  86.             ;;
  87.         u)
  88.             updater "manual"
  89.             ;;
  90.     esac
  91. done
  92.  
  93. # Do automatic update
  94. # before passing arguments
  95. echo "[+] Doing an automatic update from server slackerc0de.us on `date`"
  96. updater "auto"
  97.  
  98. if [[ $inputFile == '' || $targetFolder == '' || $sendList == '' || $perSec == '' ]]; then
  99.   cli_mode="interactive"
  100. else
  101.   cli_mode="interpreter"
  102. fi
  103.  
  104. # Assign false value boolean
  105. # to both options when its null
  106. if [ -z "${isDel}" ]; then
  107.   isDel='n'
  108. fi
  109.  
  110. if [ -z "${isCompress}" ]; then
  111.   isCompress='n'
  112. fi
  113.  
  114. SECONDS=0
  115.  
  116. # Asking user whenever the
  117. # parameter is blank or null
  118. if [[ $inputFile == '' ]]; then
  119.   # Print available file on
  120.   # current folder
  121.   # clear
  122.   tree
  123.   read -p "Enter mailist file: " inputFile
  124. fi
  125.  
  126. if [[ $targetFolder == '' ]]; then
  127.   read -p "Enter target folder: " targetFolder
  128.   # Check if result folder exists
  129.   # then create if it didn't
  130.   if [[ ! -d "$targetFolder" ]]; then
  131.     echo "[+] Creating $targetFolder/ folder"
  132.     mkdir $targetFolder
  133.   else
  134.     read -p "$targetFolder/ folder are exists, append to them ? [y/n]: " isAppend
  135.     if [[ $isAppend == 'n' ]]; then
  136.       exit
  137.     fi
  138.   fi
  139. else
  140.   if [[ ! -d "$targetFolder" ]]; then
  141.     echo "[+] Creating $targetFolder/ folder"
  142.     mkdir $targetFolder
  143.   fi
  144. fi
  145.  
  146. if [[ $isDel == '' || $cli_mode == 'interactive' ]]; then
  147.   read -p "Delete list per check ? [y/n]: " isDel
  148. fi
  149.  
  150. if [[ $isCompress == '' || $cli_mode == 'interactive' ]]; then
  151.   read -p "Compress the result ? [y/n]: " isCompress
  152. fi
  153.  
  154. if [[ $sendList == '' ]]; then
  155.   read -p "How many list send: " sendList
  156. fi
  157.  
  158. if [[ $perSec == '' ]]; then
  159.   read -p "Delay time: " perSec
  160. fi
  161.  
  162. malhadi_appleval() {
  163.   SECONDS=0
  164.  
  165.   check=`curl 'https://appleid.apple.com/account/validation/appleid' -H 'scnt: '$scnt'' -H 'Origin: https://appleid.apple.com' -H 'Accept-Encoding: gzip, deflate, br' -H 'X-Apple-I-FD-Client-Info: {"U":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.84 Safari/537.36","L":"en-US","Z":"GMT+08:00","V":"1.1","F":"sWa44j1e3NlY5BSo9z4ofjb75PaK4Vpjt3Q9cUVlOrXTAxw63UYOKES5jfzmkflJfmczl998tp7ppfAaZ6m1CdC5MQjGejuTDRNziCvTDfWk3qwyWEQEe6qgXK_Pmtd0SHp815LyjaY2.rINj.rINYOK0UjVsYUMnGWFfwMHDCQyG5me6sBLSsbXzU0l6sqKIrGfuzwg9wK9weEwHXXTSHCSPmtd0wVYPIG_qvoPfybYb5EvYTrYesR0CjEcIqnuWxf7_OLgiPFMtrs1OeyjaY2_GGEQIgwe98vDdYejftckuyPBDjaY2ftckZZLQ084akJlJWu_uWA16fUfR0odm_dhrxbuJjkWxv5iJ6KVg8cGYiKY.6elV2pN9csgdmX3ivm_Ud_UeAwHCSFQ_0pNvS_MNJZNlY5DuV25BNnOVgw24uy.CfT"}' -H 'Accept-Language: en-US,en;q=0.9,id;q=0.8,fr;q=0.7,la;q=0.6' -H 'X-Requested-With: XMLHttpRequest' -H 'Cookie: idclient=web; dslang=US-EN; site=USA; aidsp='$sessionId'; ccl=OXqm9r6b+jMZIrOKHBgGZQ==; geo=ID' -H 'Connection: keep-alive' -H 'X-Apple-Api-Key: '$apiKey'' -H 'X-Apple-ID-Session-Id: '$sessionId'' -H 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.84 Safari/537.36' -H 'Content-Type: application/json' -H 'Accept: application/json, text/javascript, */*; q=0.01' -H 'Referer: https://appleid.apple.com/account' -H 'X-Apple-Request-Context: create' --data-binary '{"emailAddress":"'$1'"}' --compressed -D - -s`
  166.   duration=$SECONDS
  167.   header="`date +%H:%M:%S` from $inputFile to $targetFolder"
  168.   footer="[Slackercode - AppleValid 2018] $(($duration % 60))sec.\n"
  169.   val="$(echo "$check" | grep -c 'used" : true')"
  170.   inv="$(echo "$check" | grep -c 'used" : false')"
  171.   bad="$(echo "$check" | grep -c 'valid" : false')"
  172.   icl="$(echo "$check" | grep -c 'appleOwnedDomain" : true')"
  173.  
  174.   if [[ $val > 0 || $icl > 0 ]]; then
  175.     printf "[$header] $2/$3. ${ORANGE}LIVE => $1 ${NC} $footer"
  176.     echo "LIVE => $1" >> $4/live.txt
  177.   else
  178.     if [[ $inv > 0 || $bad > 0 ]]; then
  179.       printf "[$header] $2/$3. ${RED}DIE => $1 ${NC} $footer"
  180.       echo "DIE => $1" >> $4/die.txt
  181.     else
  182.       printf "[$header] $2/$3. ${CYAN}UNKNOWN => $1 ${NC} $footer"
  183.       echo "$1 => $check" >> reason.txt
  184.       echo "UNKNOWN => $1" >> $inputFile
  185.     fi
  186.   fi
  187.  
  188.   printf "\r"
  189. }
  190.  
  191. if [[ ! -f $inputFile ]]; then
  192.   echo "[404] File mailist not found. Check your mailist file name."
  193.   ls -l
  194.   exit
  195. fi
  196.  
  197. # Preparing file list
  198. # by using email pattern
  199. # every line in $inputFile
  200. echo "[+] Cleaning your mailist file"
  201. grep -Eiorh '([[:alnum:]_.-]+@[[:alnum:]_.-]+?\.[[:alpha:].]{2,6})' $inputFile | tr '[:upper:]' '[:lower:]' | sort | uniq > temp_list && mv temp_list $inputFile
  202.  
  203. # Finding match mail provider
  204. echo "########################################"
  205. # Print total line of mailist
  206. totalLines=`grep -c "@" $inputFile`
  207. echo "There are $totalLines of list."
  208. echo " "
  209. echo "Hotmail: `grep -c "@hotmail" $inputFile`"
  210. echo "Yahoo: `grep -c "@yahoo" $inputFile`"
  211. echo "Gmail: `grep -c "@gmail" $inputFile`"
  212. echo "Aol: `grep -c "@aol" $inputFile`"
  213. echo "########################################"
  214.  
  215. # Extract email per line
  216. # from both input file
  217. IFS=$'\r\n' GLOBIGNORE='*' command eval  'mailist=($(cat $inputFile))'
  218. con=1
  219.  
  220. getKey() {
  221.   echo "Generating token now. Please wait..."
  222.   wait
  223.   resp=`curl 'https://appleid.apple.com/account' -H 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8' -H 'Connection: keep-alive' -H 'Accept-Encoding: gzip, deflate, br' -H 'Accept-Language: en-US,en;q=0.9,id;q=0.8,fr;q=0.7,la;q=0.6' -H 'Upgrade-Insecure-Requests: 1' -H 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.84 Safari/537.36' --compressed -D - -s -o /dev/null`
  224.   scnt="$(echo "$resp" | grep "scnt: " | cut -c7- | xargs)"
  225.   sessionId="$(echo "$resp" | grep "aidsp" | awk -F[=\;] '{print $2}' | xargs)"
  226.   apiKey='cbf64fd6843ee630b463f358ea0b707b'
  227.  
  228.   # echo "$resp"
  229.   # echo "SCNT: $scnt"
  230.   # echo "SESSIONID: $sessionId"
  231.  
  232.   if [[ $scnt == '' || $sessionId == '' || $apiKey = '' ]]; then
  233.     sleep 4
  234.     echo "IP Blocked by Apple."
  235.     getKey
  236.     sleep 2
  237.   fi
  238. }
  239.  
  240. getKey
  241.  
  242. echo "[+] Sending $sendList email per $perSec seconds"
  243.  
  244. for (( i = 0; i < "${#mailist[@]}"; i++ )); do
  245.   username="${mailist[$i]}"
  246.   indexer=$((con++))
  247.   tot=$((totalLines--))
  248.   fold=`expr $i % $sendList`
  249.   if [[ $fold == 0 && $i > 0 ]]; then
  250.     header="`date +%H:%M:%S`"
  251.     duration=$SECONDS
  252.     echo "[$header] Waiting $perSec second. $(($duration / 3600)) hours $(($duration / 60 % 60)) minutes and $(($duration % 60)) seconds elapsed, With $sendList req / $perSec seconds."
  253.     sleep $perSec
  254.   fi
  255.   vander=`expr $i % 8`
  256.   if [[ $vander == 0 && $i > 0 ]]; then
  257.     getKey
  258.   fi
  259.  
  260.   malhadi_appleval "$username" "$indexer" "$tot" "$targetFolder" "$inputFile" &
  261.  
  262.   if [[ $isDel == 'y' ]]; then
  263.     grep -v -- "$username" $inputFile > "$inputFile"_temp && mv "$inputFile"_temp $inputFile
  264.   fi
  265. done
  266.  
  267. # waiting the background process to be done
  268. # then checking list from garbage collector
  269. # located on $targetFolder/unknown.txt
  270. echo "[+] Waiting background process to be done"
  271. wait
  272. wc -l $targetFolder/*
  273.  
  274. if [[ $isCompress == 'y' ]]; then
  275.   tgl=`date`
  276.   tgl=${tgl// /-}
  277.   zipped="$targetFolder-$tgl.zip"
  278.  
  279.   echo "[+] Compressing result"
  280.   zip -r "compressed/$zipped" "$targetFolder/die.txt" "$targetFolder/live.txt"
  281.   echo "[+] Saved to compressed/$zipped"
  282.   mv $targetFolder haschecked
  283.   echo "[+] $targetFolder has been moved to haschecked/"
  284. fi
  285. #rm $inputFile
  286. duration=$SECONDS
  287. echo "$(($duration / 3600)) hours $(($duration / 60)) minutes and $(($duration % 60)) seconds elapsed."
  288. echo "+==========+ Slackerc0de Family - Applevalid 2018 - Malhadi Jr +==========+"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement