Skip to content

Instantly share code, notes, and snippets.

@EdOverflow
Created April 5, 2018 14:06
Show Gist options
  • Star 8 You must be signed in to star a gist
  • Fork 4 You must be signed in to fork a gist
  • Save EdOverflow/8e12e8c26b6bc96168e6b55324b91fa1 to your computer and use it in GitHub Desktop.
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.
#!/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
@0xmilan
Copy link

0xmilan commented Jan 9, 2020

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.

@EdOverflow
Copy link
Author

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.

@0xmilan
Copy link

0xmilan commented Jan 17, 2020

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