REM Linux Information Gathering Script for Rubber Duck
REM -----------------------------------------------
REM This script opens a terminal and gathers basic system information

REM Wait for OS to recognize the device
DELAY 1000

REM Open terminal (Ctrl+Alt+T on most Linux distros)
CTRL ALT T
DELAY 1500

REM Create a directory for collected information
STRING mkdir -p ~/duck_info
DELAY 200
ENTER
DELAY 500

REM Switch to that directory
STRING cd ~/duck_info
DELAY 200
ENTER
DELAY 300

REM Create a script file to collect information
STRING cat > collect.sh << 'EOF'
DELAY 200
ENTER
STRING #!/bin/bash
DELAY 100
ENTER
STRING echo "=== System Information Collected by Rubber Duck ===" > report.txt
DELAY 100
ENTER
STRING echo -e "\n=== Date and Time ===" >> report.txt
DELAY 100
ENTER
STRING date >> report.txt
DELAY 100
ENTER
STRING echo -e "\n=== Hostname and IP ===" >> report.txt
DELAY 100
ENTER
STRING hostname -I >> report.txt
DELAY 100
ENTER
STRING echo -e "\n=== System Info ===" >> report.txt
DELAY 100
ENTER
STRING uname -a >> report.txt
DELAY 100
ENTER
STRING echo -e "\n=== CPU Info ===" >> report.txt
DELAY 100
ENTER
STRING lscpu | grep "Model name" >> report.txt
DELAY 100
ENTER
STRING echo -e "\n=== Memory Info ===" >> report.txt
DELAY 100
ENTER
STRING free -h >> report.txt
DELAY 100
ENTER
STRING echo -e "\n=== Disk Space ===" >> report.txt
DELAY 100
ENTER
STRING df -h >> report.txt
DELAY 100
ENTER
STRING echo -e "\n=== Network Connections ===" >> report.txt
DELAY 100
ENTER
STRING netstat -tun | head -20 >> report.txt
DELAY 100
ENTER
STRING echo -e "\n=== Running Processes ===" >> report.txt
DELAY 100
ENTER
STRING ps aux | head -20 >> report.txt
DELAY 100
ENTER
STRING echo -e "\n=== Logged In Users ===" >> report.txt
DELAY 100
ENTER
STRING who >> report.txt
DELAY 100
ENTER
STRING echo -e "\n=== Package Information ===" >> report.txt
DELAY 100
ENTER
STRING if [ -x "$(command -v dpkg)" ]; then dpkg --list | grep -v "^ii" | wc -l >> report.txt; fi
DELAY 100
ENTER
STRING if [ -x "$(command -v rpm)" ]; then rpm -qa | wc -l >> report.txt; fi
DELAY 100
ENTER
STRING echo "Information collection complete!" >> report.txt
DELAY 100
ENTER
STRING EOF
DELAY 200
ENTER
DELAY 500

REM Make the script executable
STRING chmod +x collect.sh
DELAY 200
ENTER
DELAY 500

REM Run the script
STRING ./collect.sh
DELAY 200
ENTER
DELAY 5000

REM Display the collected information
STRING cat report.txt
DELAY 200
ENTER
DELAY 2000

REM Close the terminal with exit command
STRING exit
DELAY 200
ENTER 