-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathto.rc
97 lines (84 loc) · 2.71 KB
/
to.rc
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
#!/bin/sh
#to.rc
#nobody expects the tandem inquisition
USERS=""
getsubnet() {
echo "Doing an ipconfig..."
gtacl -cv 'scf info subnet,$ztcp1.*,detail'
}
getusers() {
echo "Listing users..."
USERS=$(gtacl -cv 'users *.*' | grep '\ \ ' | grep ',')
echo "$USERS"
if echo "$USERS" | grep -i NULL | tr -d ' ' | grep -qi NULL.NULL; then
echo ""
echo "[!] NULL.NULL default read-only account is present."
fi
}
ossinfo() {
echo "uname: `uname -a`"
echo "Our user: `id`"
echo "Process: `tty`"
ps -ef
}
getnodes() {
echo "Checking if we connect to other Tandems..."
EXPAND=$(ls -g /E/ | grep "^d" | awk -F ' ' '{print $8}')
if echo "$EXPAND" | grep -q "."; then
echo "[!] Other nodes that are available via EXPAND: $EXPAND"
fi;
}
netstat() {
echo "Doing the equivalent of a netstat..."
gtacl -cv 'scf listopens proc $ztcp1,detail'
}
procinfo() {
gtacl -cv "#processinfo / logonname,osspathname,processid / $1" | tail -n2 | head -n1
}
blankpass() {
echo "Don't run this as SUPER.SUPER."
if echo $USERS | grep -q "."; then
UARRAY=$(echo $users | awk -F '.' '{print $1" "$2}' | awk -F ' ' '{print $1"."$2}')
else
UARRAY=$(gtacl -cv 'users *.*' | grep "\ \ " | grep "," | awk -F '.' '{print $1" "$2}' | awk -F ' ' '{print $1"."$2}')
fi
echo "$UARRAY" | while read i;do
CHPASS=$(gtacl -cv "#changeuser $i" | tail -n2 | head -n1)
if echo "$CHPASS" | grep -q "1"; then
echo "$i has a blank password."
fi
done
}
gettaclconf(){
gtacl -cv '#getconfiguration / nochangeuser,remotesuperid /'
}
getinfo() {
ARG=$1
if echo "$ARG" | grep -vi "\/g\/"; then
echo "Use the full path to the Guardian filesystem."
echo "Guardian lives in /G/."
else
FPATH=$(echo "$ARG" | tr a-z A-Z| sed 's/\/G\//\$/' | sed 's/\//./g')
gtacl -cv "FUP INFO $FPATH, detail"
fi
}
getuserid() {
if id | grep -qi "SUPER.SUPER"; then
gtacl -cv 'FUP COPY $SYSTEM.SYSTEM.USERID,,SHARE,A'
fi
}
gethelp() {
echo "[*] getusers - lists users"
echo "[*] ossinfo - gets some useful info from OSS"
echo "[*] getinfo [file] - gets file info from FUP. Arg is full OSS path, eg /G/system/system/userid"
echo "[*] getuserid - if you're super.super, reads the userid file, the NonStop version of /etc/shadow"
echo "[*] procinfo [cpu id,pin] - gets user, oss process name or process id from #processinfo builtin."
echo "[*] getnodes - checks if there are any Tandem machines connected to us via EXPAND."
echo "[*] netstat - does a verbose netstat"
echo "[*] gettaclconf - checks for nochangeuser remotesuperid. 0 and -1 are the desired output."
echo "[*] blankpass - checks to see if any users have no password via the #changeuser builtin."
echo "[*] getsubnet - roughly equivalent to ipconfig/ifconfig."
}
echo "============================"
echo "===== Welcome to Torc! ====="
echo "Run gethelp to see a list of commands."