-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathv1.sh
More file actions
executable file
·35 lines (30 loc) · 2.06 KB
/
Copy pathv1.sh
File metadata and controls
executable file
·35 lines (30 loc) · 2.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/usr/bin/bash
echo -e "
████████╗██╗░░██╗███╗░░░███╗░█████╗░████████╗███████╗
╚══██╔══╝██║░░██║████╗░████║██╔══██╗╚══██╔══╝██╔════╝
░░░██║░░░███████║██╔████╔██║███████║░░░██║░░░█████╗░░
░░░██║░░░██╔══██║██║╚██╔╝██║██╔══██║░░░██║░░░██╔══╝░░
░░░██║░░░██║░░██║██║░╚═╝░██║██║░░██║░░░██║░░░███████╗
░░░╚═╝░░░╚═╝░░╚═╝╚═╝░░░░░╚═╝╚═╝░░╚═╝░░░╚═╝░░░╚══════╝ \n
Made by @br0wnboi
https://github.com/br0wnboi https://twitter.com/br0wnboi \n
Your CTF mate for everything CTFs \n"
TOTALUSERS=$(curl -s https://tryhackme.com/api/site-stats | jq '.totalUsers')
echo "Total TryHackMe Users: 🌐 $TOTALUSERS"
read -p "Enter your TryHackMe Username: " USERNAME;
echo " "
# Welcome User:
RANK=$(curl -s https://tryhackme.com/api/user/rank/$USERNAME | jq '.userRank')
TOPPERCENT=$(echo "scale=10; $RANK/$TOTALUSERS*100" | bc | cut -b -4)
echo "Hi 🤖 $USERNAME"
echo -e "You're in the Top 🔝 $TOPPERCENT%"
# Grab UserDetails
BADGE=$(curl -s https://tryhackme.com/api/badges/get/$USERNAME | jq '.[] | .name' | wc -l)
DONEROOMS=$(curl -s https://tryhackme.com/api/no-completed-rooms-public/$USERNAME)
LEVEL=$(curl -s https://tryhackme.com/p/$USERNAME | grep -Po "<span class=\"level level\-(\d+)\">" | grep -Po "\d+")
STREAK=$(curl -s https://tryhackme.com/p/$USERNAME | grep -Po "hacker-green\"><\/i>\s+\d+<\/span>" | grep -Po "\d+")
echo "Rank: 🏅 $RANK"
echo "Completed Rooms: 🚪 $DONEROOMS"
echo "Badges Earned: 👾 $BADGE"
echo "Level: 🛡 $LEVEL"
echo "Streak: 🔥 $STREAK"