Advertisement
Guest User

Untitled

a guest
Dec 16th, 2018
1,093
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 10.17 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. HIJAU="\e[92m"
  16. echo ""
  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 "$RED                              ####   $GRN####\n"
  25. printf "$WHI           ##########$RED     ########   $GRN####\n"
  26. printf "$WHI           ############$RED     ######   $GRN####\n"
  27. printf "$WHI           #####                     $GRN####\n"
  28. printf "$WHI           #####                     $GRN####\n"
  29. printf "$WHI           ##################    $GRN########\n"
  30. printf "$WHI           ####################    $GRN######\n"
  31. printf "$NC\n"
  32. cat <<EOF
  33.              - https://malhadijr.com -
  34.           [+] malhadijr@slackerc0de.us [+]
  35.        
  36. ---------------------------------------------------
  37.    Slackerc0de Family - AppleID Validator 2018
  38. ---------------------------------------------------
  39.  
  40. EOF
  41.  
  42. usage() {
  43.   echo "Usage: ./myscript.sh COMMANDS: [-i <list.txt>] [-r <folder/>] [-l {1-1000}] [-t {1-10}] OPTIONS: [-d] [-c]
  44.  
  45. Command:
  46. -i (20k-US.txt)     File input that contain email to check
  47. -r (result/)        Folder to store the result live.txt and die.txt
  48. -l (60|90|110)      How many list you want to send per delayTime
  49. -t (3|5|8)          Sleep for -t when check is reach -l fold
  50.  
  51. Options:
  52. -d                  Delete the list from input file per check
  53. -c                  Compress result to compressed/ folder and
  54.                    move result folder to haschecked/
  55. -h                  Show this manual to screen
  56. -u                  Check integrity file then update
  57.  
  58. Report any bugs to: <Malhadi Jr> contact@malhadi.slackerc0de.us
  59. "
  60.   exit 1
  61. }
  62.  
  63. # Assign the arguments for each
  64. # parameter to global variable
  65. while getopts ":i:r:l:t:dchu" o; do
  66.     case "${o}" in
  67.         i)
  68.             inputFile=${OPTARG}
  69.             ;;
  70.         r)
  71.             targetFolder=${OPTARG}
  72.             ;;
  73.         l)
  74.             sendList=${OPTARG}
  75.             ;;
  76.         t)
  77.             perSec=${OPTARG}
  78.             ;;
  79.         d)
  80.             isDel='y'
  81.             ;;
  82.         c)
  83.             isCompress='y'
  84.             ;;
  85.         h)
  86.             usage
  87.             ;;
  88.         u)
  89.             updater "manual"
  90.             ;;
  91.     esac
  92. done
  93.  
  94. # Do automatic update
  95. # before passing arguments
  96. echo "[+] Doing an automatic update from server slackerc0de.us on `date`"
  97. updater "auto"
  98.  
  99. if [[ $inputFile == '' || $targetFolder == '' || $sendList == '' || $perSec == '' ]]; then
  100.   cli_mode="interactive"
  101. else
  102.   cli_mode="interpreter"
  103. fi
  104.  
  105. # Assign false value boolean
  106. # to both options when its null
  107. if [ -z "${isDel}" ]; then
  108.   isDel='n'
  109. fi
  110.  
  111. if [ -z "${isCompress}" ]; then
  112.   isCompress='n'
  113. fi
  114.  
  115. SECONDS=0
  116.  
  117. # Asking user whenever the
  118. # parameter is blank or null
  119. if [[ $inputFile == '' ]]; then
  120.   # Print available file on
  121.   # current folder
  122.   # clear
  123.   tree
  124.   read -p "Enter mailist file: " inputFile
  125. fi
  126.  
  127. if [[ $targetFolder == '' ]]; then
  128.   read -p "Enter target folder: " targetFolder
  129.   # Check if result folder exists
  130.   # then create if it didn't
  131.   if [[ ! -d "$targetFolder" ]]; then
  132.     echo "[+] Creating $targetFolder/ folder"
  133.     mkdir $targetFolder
  134.   else
  135.     read -p "$targetFolder/ folder are exists, append to them ? [y/n]: " isAppend
  136.     if [[ $isAppend == 'n' ]]; then
  137.       exit
  138.     fi
  139.   fi
  140. else
  141.   if [[ ! -d "$targetFolder" ]]; then
  142.     echo "[+] Creating $targetFolder/ folder"
  143.     mkdir $targetFolder
  144.   fi
  145. fi
  146.  
  147. if [[ $isDel == '' || $cli_mode == 'interactive' ]]; then
  148.   read -p "Delete list per check ? [y/n]: " isDel
  149. fi
  150.  
  151. if [[ $isCompress == '' || $cli_mode == 'interactive' ]]; then
  152.   read -p "Compress the result ? [y/n]: " isCompress
  153. fi
  154.  
  155. if [[ $sendList == '' ]]; then
  156.   read -p "How many list send: " sendList
  157. fi
  158.  
  159. if [[ $perSec == '' ]]; then
  160.   read -p "Delay time: " perSec
  161. fi
  162.  
  163. malhadi_appleval() {
  164.   SECONDS=0
  165.  
  166.   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`
  167.   duration=$SECONDS
  168.   header="`date +%H:%M:%S` from $inputFile to $targetFolder"
  169.   footer="[ Nanda Raine koyo Jembut ] $(($duration % 60))sec.\n"
  170.   val="$(echo "$check" | grep -c 'used" : true')"
  171.   inv="$(echo "$check" | grep -c 'used" : false')"
  172.   bad="$(echo "$check" | grep -c 'valid" : false')"
  173.   icl="$(echo "$check" | grep -c 'appleOwnedDomain" : true')"
  174.  
  175.   if [[ $val > 0 || $icl > 0 ]]; then
  176.     printf "${YELLOW}[ $$ MONEY M4KERS $$ ] $2/$3. ${HIJAU}URIP COK => $1 ${NC} $footer"
  177.     echo "URIP COK => $1" >> $4/live.txt
  178.   else
  179.     if [[ $inv > 0 || $bad > 0 ]]; then
  180.       printf "${CYAN}[ $$ MONEY M4KERS $$ ] $2/$3. ${RED}MODAR SU => $1 ${NC} $footer"
  181.       echo "MODAR SU => $1" >> $4/die.txt
  182.     else
  183.       printf "[ $$ MONEY M4KERS $$ ] $2/$3. ${CYAN}UNKNOWN => $1 ${NC} $footer"
  184.       echo "$1 => $check" >> reason.txt
  185.       echo "UNKNOWN => $1" >> $inputFile
  186.     fi
  187.   fi
  188.  
  189.   printf "\r"
  190. }
  191.  
  192. if [[ ! -f $inputFile ]]; then
  193.   echo "[404] File mailist not found. Check your mailist file name."
  194.   ls -l
  195.   exit
  196. fi
  197.  
  198. # Preparing file list
  199. # by using email pattern
  200. # every line in $inputFile
  201. echo "[+] Cleaning your mailist file"
  202. grep -Eiorh '([[:alnum:]_.-]+@[[:alnum:]_.-]+?\.[[:alpha:].]{2,6})' $inputFile | tr '[:upper:]' '[:lower:]' | sort | uniq > temp_list && mv temp_list $inputFile
  203.  
  204. # Finding match mail provider
  205. echo "########################################"
  206. # Print total line of mailist
  207. totalLines=`grep -c "@" $inputFile`
  208. echo "There are $totalLines of list."
  209. echo " "
  210. echo "Hotmail: `grep -c "@hotmail" $inputFile`"
  211. echo "Yahoo: `grep -c "@yahoo" $inputFile`"
  212. echo "Gmail: `grep -c "@gmail" $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