Skip to content

Instantly share code, notes, and snippets.

@R0X4R
Last active September 8, 2022 05:36
Show Gist options
  • Save R0X4R/5bedda859040a1ec7357a173e4f69298 to your computer and use it in GitHub Desktop.
Save R0X4R/5bedda859040a1ec7357a173e4f69298 to your computer and use it in GitHub Desktop.
Takes websites screenshots using chromium browser
#!/bin/bash
# requirements: chromium or chrome browser (sudo apt update && sudo apt install snapd && sudo systemctl start snapd.service && sudo snap install chromium)
# usage: subfinder -d target.com -all -silent | httpx -silent | xargs -P 50 -I % bash -c "./chakshu.sh %"
echo -e "[CHAKSHU] - Taking screenshot of $1"
domain=$1
output=$(echo $1 | awk -F// '{print $NF}' | sed -E 's/[\.\|:]+/_/g')
mkdir -p screenshots
# all the screenshots will be saved in screenshots folder
/snap/bin/chromium --no-sandbox --headless --disable-gpu --window-size=1280,720 --screenshot $domain --screenshot=screenshots/$output.jpg > /dev/null 2>&1
exit 1
#!/bin/bash
# usage: ./htmloutput.sh target.com | tee target.html &> /dev/null
target=$1
echo -e "<!--- [CHAKSHU] - Creating html output of all screenshots --->"
echo -e "<html>"
echo -e " <head>"
echo -e " <title>Chakshu Screenshots - $target</title>"
echo -e " <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">"
echo -e " <style>"
echo -e " * {"
echo -e " box-sizing: border-box;"
echo -e " }"
echo -e " "
echo -e " .row::after {"
echo -e " content: \"\";"
echo -e " clear: both;"
echo -e " display: table;"
echo -e " }"
echo -e " "
echo -e " .column {"
echo -e " float: left;"
echo -e " width: 33.33%;"
echo -e " padding: 5px;"
echo -e " }"
echo -e " </style>"
echo -e " </head>"
echo -e " <body>"
echo -e " <h1 align=\"center\">Chakshu Screenshots - $target</h1>"
echo -e " <br/> <br/>"
echo -e " <div class=\"row\">"
for screenshots in $(ls | sort -u | grep ".jpg\|.png"); do echo -e "\t\t<div class=\"column\">\n\t\t <img src=\"$screenshots\" style=\"width:100%\">\n\t\t</div>"; done
echo -e " </div>"
echo -e " </body>"
echo -e "</html>"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment