Created
April 5, 2018 14:06
-
-
Save EdOverflow/8e12e8c26b6bc96168e6b55324b91fa1 to your computer and use it in GitHub Desktop.
Find a public Google group for a particular host. Some of these groups contain sensitive information. The tool runs against a list of hosts and returns all public groups.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Find a public Google group for a particular host. | |
# Some of these groups contain sensitive information. | |
# The tool runs against a list of hosts and returns all public groups. | |
while read domain; do | |
if curl -LIs "https://groups.google.com/a/$domain" | grep "overview" > /dev/null; then | |
echo "[+] https://groups.google.com/a/$domain/forum/#!overview" | |
fi | |
done < $1 |
Nice work, @milangfx! I wrote this merely as a proof of concept — not focusing on performance. If you really want performance, don't write a while loop in the script itself. Just have the script issue the requests and then run it using GNU parallel.
Thanks for the feedback. I was focusing on efficiency in a single threaded case. Making the same request run in parallel would be faster, but still inefficient.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The results above are with 100 domains that are either private or 404. For those curl makes 2 request (1 redirect), not 3.
If you take 100 public domains, then the difference in run time is higher (3 requests / domain vs. 1 request).
Before:
./googlegroups_old.sh 100public 6,29s user 1,50s system 3% cpu 3:48,46 total
After:
./googlegroups.sh 100public 6,20s user 1,56s system 7% cpu 1:38,67 total
3:48 > 1:38
200 requests and more than 2 minutes saved, only on 100 domains.