Issue
Code backup
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
#!/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"
|
||||
@@ -0,0 +1,6 @@
|
||||
# Netscape HTTP Cookie File
|
||||
# https://curl.se/docs/http-cookies.html
|
||||
# This file was generated by libcurl! Edit at your own risk.
|
||||
|
||||
#HttpOnly_monitoring.solaredge.com FALSE / TRUE 0 TS01f1db2e 014c1b7298ca68ea2ef928dec008bef8acb1b2f66dc59f0f23813465ee09a6bafd405e9d34b7838cdfd749ccd005e119bba626ebe543d6f1a98b805861e40d0a87b03be0f3
|
||||
monitoring.solaredge.com FALSE / FALSE 0 CSRF-TOKEN 6C8D6F6E4D4C506D27A4FD3989833DA7B52CDFF9F21952B0141E300236B273A3B18D93C601B5D5C6CD472BAF4FEF570E462C
|
||||
@@ -0,0 +1,8 @@
|
||||
#!/bin/bash
|
||||
|
||||
username="ced@pal.it"
|
||||
password="#zPG6tax1yuiWU*8iw"
|
||||
urlTargetLogin="https://monitoring.solaredge.com/solaredge-web/p/login"
|
||||
urlTargetData="https://monitoring.solaredge.com/solaredge-web/p/site/3834979/#/alerts"
|
||||
|
||||
echo $(curl --cookie-jar cookies.txt --form passphrase=$password --form username=$username $urlTargetLogin)
|
||||
@@ -0,0 +1,15 @@
|
||||
#! /bin/sh
|
||||
|
||||
HOSTNAME=$(hostname)
|
||||
IP=$(hostname -I)
|
||||
MAC=$(cat /sys/class/net/eth0/address)
|
||||
|
||||
echo "Device Information:" > file.txt
|
||||
echo ">HOST:" >> file.txt
|
||||
echo " $HOSTNAME" >> file.txt
|
||||
echo ">IP:" >> file.txt
|
||||
echo " $IP" >> file.txt
|
||||
echo ">MAC:" >> file.txt
|
||||
echo " $MAC" >> file.txt
|
||||
|
||||
exit 0
|
||||
@@ -0,0 +1,5 @@
|
||||
Device Information
|
||||
PC210VM
|
||||
|
||||
172.31.237.42
|
||||
00:15:5d:52:af:07
|
||||
@@ -0,0 +1,132 @@
|
||||
#!/bin/bash
|
||||
|
||||
show_menu(){
|
||||
NORMAL=`echo "\033[m"`
|
||||
MENU=`echo "\033[36m"` #Blue
|
||||
NUMBER=`echo "\033[33m"` #yellow
|
||||
FGRED=`echo "\033[41m"`
|
||||
RED_TEXT=`echo "\033[31m"`
|
||||
ENTER_LINE=`echo "\033[33m"`
|
||||
echo -e "${MENU}*********************************************${NORMAL}"
|
||||
echo -e "Welcome to Parrot On-Debian Installer Script"
|
||||
echo -e "\t\trev 0.2 - 2015-06-10"
|
||||
echo -e "${MENU}**${NUMBER} 1)${MENU} Install Core Only ${NORMAL}"
|
||||
echo -e "${MENU}**${NUMBER} 2)${MENU} Install Headless Edition ${NORMAL}"
|
||||
echo -e "${MENU}**${NUMBER} 3)${MENU} Install Security Edition ${NORMAL}"
|
||||
echo -e "${MENU}**${NUMBER} 4)${MENU} Install Home Edition ${NORMAL}"
|
||||
echo -e "${MENU}**${NUMBER} 5)${MENU} Install Embedded Edition ${NORMAL}"
|
||||
echo -e "${MENU}*********************************************${NORMAL}"
|
||||
echo -e "${ENTER_LINE}Please enter a menu option and enter or ${RED_TEXT}enter to exit. ${NORMAL}"
|
||||
read opt
|
||||
}
|
||||
|
||||
function option_picked() {
|
||||
COLOR='\033[01;31m' # bold red
|
||||
RESET='\033[00;00m' # normal white
|
||||
MESSAGE=${@:-"${RESET}Error: No message passed"}
|
||||
echo -e "${COLOR}${MESSAGE}${RESET}"
|
||||
}
|
||||
|
||||
|
||||
function core_install() {
|
||||
# Protect against HTTP vulnerabilities [https://www.debian.org/security/2016/dsa-3733], [https://www.debian.org/security/2019/dsa-4371]
|
||||
apt-get update
|
||||
#echo -e "deb https://mirror.parrotsec.org/parrot rolling main contrib non-free" > /etc/apt/sources.list.d/parrot.list
|
||||
#echo -e "# This file is empty, feel free to add here your custom APT repositories\n\n# The standard Parrot repositories are NOT here. If you want to\n# edit them, take a look into\n# /etc/apt/sources.list.d/parrot.list\n# /etc/apt/sources.list.d/debian.list\n\n\n\n# If you want to change the default parrot repositories setting\n# another localized mirror, then use the command parrot-mirror-selector\n# and see its usage message to know what mirrors are available\n\n\n\n#uncomment the following line to enable the Parrot Testing Repository\n#deb http://us.repository.frozenbox.org/parrot testing main contrib nonfree" > /etc/apt/sources.list
|
||||
wget -qO - https://deb.parrotsec.org/parrot/misc/parrotsec.gpg | apt-key add -
|
||||
apt-get update
|
||||
apt-get -y --force-yes -o Dpkg::Options::="--force-overwrite" install apt-parrot parrot-archive-keyring --no-install-recommends
|
||||
#parrot-mirror-selector default stable #change it if you want another mirror, launch it without parameters to get the full list of available mirrors
|
||||
apt-get update
|
||||
apt -y --allow-downgrades -o Dpkg::Options::="--force-overwrite" install parrot-core
|
||||
apt -y --allow-downgrades -o Dpkg::Options::="--force-overwrite" dist-upgrade
|
||||
apt -y autoremove
|
||||
}
|
||||
|
||||
function headless_install() {
|
||||
apt -y --allow-downgrades install parrot-pico
|
||||
}
|
||||
|
||||
function security_install() {
|
||||
apt -y --allow-downgrades install parrot-interface parrot-interface-full parrot-tools-full
|
||||
}
|
||||
|
||||
function home_install() {
|
||||
apt -y --allow-downgrades install parrot-interface-full parrot-interface
|
||||
}
|
||||
|
||||
function embedded_install() {
|
||||
apt -y --allow-downgrades install parrot-interface parrot-mini
|
||||
}
|
||||
|
||||
|
||||
|
||||
function init_function() {
|
||||
clear
|
||||
show_menu
|
||||
while [ opt != '' ]
|
||||
do
|
||||
if [[ $opt = "" ]]; then
|
||||
exit;
|
||||
else
|
||||
case $opt in
|
||||
1) clear;
|
||||
option_picked "Installing Core";
|
||||
core_install;
|
||||
option_picked "Operation Done!";
|
||||
exit;
|
||||
;;
|
||||
|
||||
2) clear;
|
||||
option_picked "Installing Headless Edition";
|
||||
core_install;
|
||||
headless_install;
|
||||
option_picked "Operation Done!";
|
||||
exit;
|
||||
;;
|
||||
|
||||
3) clear;
|
||||
option_picked "Installing Parrot Security OS";
|
||||
core_install;
|
||||
security_install;
|
||||
option_picked "Operation Done!";
|
||||
exit;
|
||||
;;
|
||||
|
||||
4) clear;
|
||||
option_picked "Installing Home Edition";
|
||||
core_install;
|
||||
home_install;
|
||||
option_picked "Operation Done!";
|
||||
exit;
|
||||
;;
|
||||
5) clear;
|
||||
option_picked "Installing Embedded Edition";
|
||||
core_install;
|
||||
embedded_install;
|
||||
option_picked "Operation Done!";
|
||||
exit;
|
||||
;;
|
||||
x)exit;
|
||||
;;
|
||||
|
||||
q)exit;
|
||||
;;
|
||||
|
||||
\n)exit;
|
||||
;;
|
||||
|
||||
*)clear;
|
||||
option_picked "Pick an option from the menu";
|
||||
show_menu;
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
if [ `whoami` == "root" ]; then
|
||||
init_function;
|
||||
else
|
||||
echo "R U Drunk? This script needs to be run as root!"
|
||||
fi
|
||||
@@ -0,0 +1,3 @@
|
||||
usr= unknow
|
||||
psw= ##ED*4njz1tara0VsJ1X~cYt
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
#!/bin/sh
|
||||
|
||||
echo "Password Generator Started"
|
||||
|
||||
if [ -z "$1" ]
|
||||
then
|
||||
VAR="24"
|
||||
else
|
||||
VAR="$1"
|
||||
fi
|
||||
|
||||
PSW=$(head -c 500 /dev/urandom | tr -dc 'a-zA-Z0-9~!@#$%^&*_-' | fold -w $VAR | head -n 1)
|
||||
|
||||
if [ -z "$2" ]
|
||||
then
|
||||
USR="unknow"
|
||||
else
|
||||
USR="$2"
|
||||
fi
|
||||
|
||||
echo "Password Generated for:"
|
||||
|
||||
echo "usr= $USR" >> psw.txt
|
||||
echo "psw= $PSW" >> psw.txt
|
||||
echo "" >> psw.txt
|
||||
|
||||
echo "$USR"
|
||||
echo "$PSW"
|
||||
|
||||
exit 0
|
||||
@@ -0,0 +1,16 @@
|
||||
#!/bin/bash
|
||||
|
||||
number=$(( $RANDOM % 10 + 1 ))
|
||||
|
||||
echo "Guess a number between 1 and 10"
|
||||
|
||||
guess=0
|
||||
|
||||
while [ "0$guess" -ne $number ] ; do
|
||||
read guess
|
||||
[ "0$guess" -lt $number ] && echo "Too low"
|
||||
[ "0$guess" -gt $number ] && echo "Too high"
|
||||
done
|
||||
|
||||
echo "That's right!"
|
||||
exit 0
|
||||
@@ -0,0 +1,39 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Roll
|
||||
# This script returns the values and sum of a set of dice rolls. The first
|
||||
# arg is optional and gives a number of dice. The second arg is the number
|
||||
# of sides on the dice. For example "roll 2 6" will give two values from 1
|
||||
# to 6 and also returns their sum.
|
||||
#
|
||||
# (c)2009 Dominic Lepiane
|
||||
|
||||
sides=6
|
||||
dice=1
|
||||
total=0
|
||||
c=0
|
||||
|
||||
if [ $# = 2 ] ; then
|
||||
dice=$1
|
||||
sides=$2
|
||||
elif [ $# = 1 ] ; then
|
||||
sides=$1
|
||||
else
|
||||
echo "Usage: $0 [# of dice] <# of sides>" >&2
|
||||
exit -1
|
||||
fi
|
||||
|
||||
#echo "Rolling {$dice}d{$sides}"
|
||||
|
||||
while [ $c -lt $dice ] ; do
|
||||
c=$((c+1))
|
||||
roll=$((RANDOM%sides + 1))
|
||||
total=$((total+roll))
|
||||
echo -n "$roll "
|
||||
done
|
||||
|
||||
if [ $dice -gt 1 ] ; then
|
||||
echo -n " = $total"
|
||||
fi
|
||||
|
||||
echo ""
|
||||
@@ -0,0 +1,17 @@
|
||||
#! /bin/sh
|
||||
|
||||
#StartScript--V1.0
|
||||
|
||||
aprimi="/usr/pal.local/file/ApriMi"
|
||||
desktop="$HOME/Scrivania/"
|
||||
palterm="$HOME/Scrivania/ApriMi/PALTERM02.rpd"
|
||||
|
||||
if [ ! -f $HOME/Scrivania/ApriMi ];
|
||||
then
|
||||
cp -r -u $aprimi $desktop
|
||||
notify-send "$USER Benvenuto! Uttilizza Remmina per accedere alla tua area di lavoro"
|
||||
remmina -c $palterm
|
||||
else
|
||||
notify-send "$USER Benvenuto! Uttilizza Remmina per accedere alla tua area di lavoro"
|
||||
remmina -c $palterm
|
||||
fi
|
||||
@@ -0,0 +1,32 @@
|
||||
#!/bin/sh
|
||||
|
||||
#AutoUpdate--V1.2
|
||||
|
||||
host=$(hostname)
|
||||
date=$(date +"%T")
|
||||
|
||||
red=$(tput setaf 1)
|
||||
green=$(tput setaf 2)
|
||||
yellow=$(tput setaf 3)
|
||||
sgr=$(tput sgr 0)
|
||||
|
||||
if [ "$(id -u)" -ne 0 ]; then
|
||||
echo "${red}This script must be run with root privileges${sgr}" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "${yellow}! AutoUpdate start !${sgr}"
|
||||
notify-send "${date} - AutoUpdate start"
|
||||
echo "${date} - AutoUpdate start"
|
||||
|
||||
# Update && Upgrade
|
||||
|
||||
apt update && apt full-upgrade -y
|
||||
|
||||
if [ -f /var/run/reboot-required ]; then
|
||||
echo "A ${yellow}reboot${sgr} is required in order to proceed with the install." >&2
|
||||
echo "Please ${yellow}reboot${sgr} and re-run this script to finish the install." >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Update Success!"
|
||||
@@ -0,0 +1,55 @@
|
||||
#!/bin/sh
|
||||
|
||||
#AutoUpdate--V1.1
|
||||
|
||||
host=$(hostname)
|
||||
date=$(date +"%T")
|
||||
fail="Update Fail"
|
||||
success="Update Success"
|
||||
suc_reboot="Update Success and just rebooted"
|
||||
facility="Linux Server"
|
||||
|
||||
|
||||
red=$(tput setaf 1)
|
||||
green=$(tput setaf 2)
|
||||
yellow=$(tput setaf 3)
|
||||
sgr=$(tput sgr 0)
|
||||
|
||||
json_fail='{"version": "1.1","host":"'$host'","facility":"'$facility'","short_message":"Raspberry wrong update","full_message":"The Ubuntu '$facility' was fail check '$host'","level":1,"_user_id":9001,"_some_info":"foo","_some_env_var":"bar"}'
|
||||
json_success='{"version": "1.1","host":"'$host'","facility":"'$facility'","short_message":"Raspberry success update","full_message":"The Ubuntu '$facility' success","level":6,"_user_id":9001,"_some_info":"foo","_some_env_var":"bar"}'
|
||||
json_suc_reboot='{"version": "1.1","host":"'$host'","facility":"'$facility'","short_message":"Raspberry updated and start reboot","full_message":"The Ubuntu '$facility' success '$host' start reboot","level":6,"_user_id":9001,"_some_info":"foo","_some_env_var":"bar"}'
|
||||
|
||||
echo "${yellow}! AutoUpdate start !${sgr}"
|
||||
|
||||
apt update
|
||||
apt -y dist-upgrade
|
||||
|
||||
if [[ $? > 0 ]];
|
||||
then
|
||||
echo "${red}Wrong update${sgr}" && echo "${date} - ${fail}" > ./pal.log && echo $json_fail | gzip | nc -u -w 1 palgraylog01.pal.local 12201
|
||||
notify-send "Se il dispositivo presenta problemi contattare il CED"
|
||||
exit
|
||||
else
|
||||
echo "${green}Don't worry about your device is updating${sgr}"
|
||||
fi
|
||||
|
||||
apt -y autoremove
|
||||
apt clean
|
||||
apt purge -y $(dpkg -l | awk '/^rc/ { print $2 }')
|
||||
|
||||
echo "${green}! Update completed !${sgr}"
|
||||
|
||||
if [ ! -f /var/run/reboot-required ];
|
||||
then
|
||||
# no reboot required (0=OK)
|
||||
echo "${green}Good: no reboot required${sgr}" && echo "${date} - ${success}" > ../pal.log && echo $json_success | gzip | nc -u -w 1 palgraylog01.pal.local 12201
|
||||
notify-send "Aggiornamento eseguito con successo"
|
||||
exit 0
|
||||
else
|
||||
# reboot required (1=WARN)
|
||||
echo "${red}WARNING: ${yellow}`cat /var/run/reboot-required`${sgr}" && echo "${date} - ${suc_reboot}" > ../pal.log && echo $json_suc_reboot | gzip | nc -u -w 1 palgraylog01.pal.local 12201
|
||||
notify-send "Aggiornamento eseguito con successo il dispositivo si riavvia a breve"
|
||||
v
|
||||
reboot now
|
||||
exit 1
|
||||
fi
|
||||
Reference in New Issue
Block a user