Skip to content

Commit 82f53ba

Browse files
author
Duke B
committed
add inventory
1 parent a573c5a commit 82f53ba

1 file changed

Lines changed: 34 additions & 5 deletions

File tree

index.html

Lines changed: 34 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -760,7 +760,13 @@
760760
user@1000.service
761761
wpa_supplicant.service'
762762

763-
users='drwho
763+
users='whiteteam
764+
blackteam
765+
grayteam
766+
grayteam
767+
dd-dog
768+
datadog
769+
drwho
764770
martymcFly
765771
arthurdent
766772
sambeckett
@@ -769,8 +775,7 @@
769775
theflash
770776
tonystark
771777
drstrange
772-
bartallen
773-
whiteteam'
778+
bartallen'
774779

775780
function get_key {
776781
IFS= read -r -n1 -s key
@@ -911,14 +916,38 @@
911916
finished=false
912917

913918
while [[ $finished == false ]]; do
914-
select_option 'services' 'users' 'packages' 'integrity' 'stop services' 'lock users' 'remove packages' 'reinstall packages' 'clone' 'test' 'exit'
919+
select_option 'inventory' 'services' 'users' 'packages' 'integrity' 'stop services' 'lock users' 'remove packages' 'reinstall packages' 'clone' 'test' 'exit'
915920
clear
916921
case "$selection" in
922+
'inventory')
923+
header "inventory of $hostname"
924+
subh 'users'
925+
cat /etc/passwd | cut -d ":" -f 1 | tr '\n' ' '
926+
echo
927+
echo
928+
subh 'hostname'
929+
hostname
930+
echo
931+
subh 'ip'
932+
hostname -i
933+
echo
934+
subh 'operating system'
935+
source /etc/os-release
936+
echo "$NAME"
937+
echo
938+
subh 'version'
939+
echo "$VERSION"
940+
echo
941+
942+
subh 'open ports'
943+
ss -tuln | awk '{print $5}'
944+
get_key
945+
;;
917946
'services')
918947
display 'services' "$(systemctl list-units --type=service --state=running --no-pager --quiet | cut -d " " -f 3)" "${!services}"
919948
;;
920949
'users')
921-
display 'unlocked users' "$(sudo cat /etc/shadow | grep -Ev ':\!|:\*' | cut -d ':' -f 1)" "$users"
950+
display 'unlocked users' "$(sudo cat /etc/shadow | grep -Ev ':!|:\*' | cut -d ':' -f 1)" "$users"
922951
;;
923952
'packages')
924953
if [[ "$os" == 'redhat' ]]; then

0 commit comments

Comments
 (0)