Skip to content

Commit

Permalink
Updated credcon and removed images just in case.
Browse files Browse the repository at this point in the history
  • Loading branch information
DaanSelen committed Dec 18, 2024
1 parent f7a2072 commit cea6612
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 1 deletion.
Binary file removed assets/images/debian12-credcon-inaction.png
Binary file not shown.
Binary file not shown.
26 changes: 25 additions & 1 deletion ntos/credcon/credcon.sh
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,29 @@ show_connection_failure() {
--height=200
}

list_usb_devices() {
declare -A usb_ids_map

while read -r id; do
usb_ids_map["$id"]=1
done < <(lsusb -tv | awk '
/Mass Storage|Wireless/ {
getline
if ($0 ~ /ID/) {
sub(/.*ID /, "", $0)
print $1
}
}
')

usb_ids=()
for id in "${!usb_ids_map[@]}"; do
usb_ids+=("/usb:id,dev:$id")
done

echo "${usb_ids[*]}"
}

# Main loop, because I am a bit used to that programming structure.
main() {
# Start the script by displaying the credential prompt.
Expand All @@ -67,10 +90,11 @@ main() {

# Show the loading bar in the background, this is made because the FreeRDP session will take over the entire screen.
show_loading_bar &
usb_devices=$(list_usb_devices)

# Start xfreerdp session in the background and get its process ID (PID).
# This does not hinder the process from taking over the (screen/monitor) session.
xfreerdp "$rdpFile" /u:"${username}" /p:"${password}" /cert-ignore | tee /dev/tty &
xfreerdp "$rdpFile" /u:"${username}" /p:"${password}" "${usb_devices}" /cert-ignore | tee /dev/tty &
xfreerdp_pid=$!

# Wait for the xfreerdp process up to $interval seconds, default 30.
Expand Down

0 comments on commit cea6612

Please sign in to comment.