368d6fafea
Code backup
31 lines
1.1 KiB
Bash
31 lines
1.1 KiB
Bash
#!/bin/bash
|
|
|
|
#REQUIRED PARAMS
|
|
username="ced@pal.it"
|
|
password="#zPG6tax1yuiWU*8iw"
|
|
|
|
#EXTRA OPTIONS
|
|
uagent="Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Firefox/81.0" #user agent (fake a browser)
|
|
sleeptime=0 #add pause between requests
|
|
|
|
touch "cookie.txt" #create a temp. cookie file
|
|
|
|
#INITIAL PAGE
|
|
echo "[+] Fetching" && sleep $sleeptime
|
|
initpage=`curl -s -b "cookie.txt" -c "cookie.txt" -L --sslv3 -A "$uagent" "https://monitoring.solaredge.com/solaredge-web/p/login"`
|
|
token=`echo "$initpage" | grep "authenticity_token" | sed -e 's/.*value="//' | sed -e 's/" \/>.*//'`
|
|
|
|
#LOGIN
|
|
echo "[+] Submitting the login form..." && sleep $sleeptime
|
|
loginpage=`curl -s -b "cookie.txt" -c "cookie.txt" -L --sslv3 -A "$uagent" -d "username=$username&password=$password" "https://monitoring.solaredge.com/solaredge-web/p/login"`
|
|
|
|
#HOME PAGE
|
|
echo "[+] Getting page" && sleep $sleeptime
|
|
homepage=`curl -s -b "cookie.txt" -c "cookie.txt" -L -A "$uagent" "https://monitoring.solaredge.com/solaredge-web/p/site/3834979/#/alerts"`
|
|
|
|
echo $token > "tk.txt"
|
|
echo $loginpage > "lp.txt"
|
|
echo $homepage > "se.txt"
|
|
|
|
rm "cookie.txt"
|