Created
August 7, 2017 06:10
-
-
Save bearice/2cb343b258d3826ef46e821c7b8f3f66 to your computer and use it in GitHub Desktop.
run Dell idrac Remote console from shell (POC)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#/bin/bash | |
HOST=$1 | |
USER=root | |
PASS=calvin | |
RET=$(curl -s https://$HOST/data/login -duser=$USER -dpassword=$PASS -c .cookie -b .cookie -k) | |
ST1=$(echo "$RET" | awk 'match($0, /ST1=[0-9a-f]+/){ print substr( $0, RSTART, RLENGTH )}') | |
echo $ST1 | |
PARAM="$HOST@0@$HOST@0@$ST1" | |
curl -s "https://$HOST/viewer.jnlp($PARAM)" -c .cookie -b .cookie -k > start.jnlp | |
javaws start.jnlp | |
rm .cookie start.jnlp |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi,
awesome script! I need to open the same bunch of old idrac consoles every now and then and idrac being idrac that was a pain!
A small note though:
You leave your idrac web session open. That will clog your idrac eventually and it will become none responsive for a while because it reached it's maximum number of open sessions.
I'de recommend adding the following line after line 9:
RET=$(curl -s https://${HOST}/data/logout -c .cookie -b .cookie -k)
cheers