Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. #!/bin/bash
  2. # Prompt user for Prefix value
  3. read -p "Enter the prefix for the hostname: " Prefix
  4. files=( "clear.txt" "eicar.txt" "eicar_com.zip" "eicarcom2.zip" )
  5. for file in "${files[@]}"
  6. do
  7. if [ ! -f "$file" ]; then
  8. if [ "$file" == "clear.txt" ]; then
  9. echo "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras vel nunc ut velit porttitor congue nec a orci. Ut in massa ut sapien laoreet gravida in ac sem. Quisque et ipsum orci. Fusce diam quam, vulputate in finibus sed, pellentesque in nibh. Fusce sit amet augue quis diam ultrices auctor vel eu sem. Fusce rhoncus sit amet lectus et sollicitudin. Duis in laoreet dolor, quis porta ante. Nam pharetra nibh velit, sit amet venenatis turpis bibendum posuere. Proin volutpat sem sit amet magna scelerisque, nec eleifend neque tristique. Pellentesque in sapien sit amet magna lacinia sagittis. Aenean eget tincidunt risus, et mollis libero. Aenean vitae nisi ac velit volutpat faucibus. Proin dolor neque, congue non dictum ut, placerat vel justo. Sed pretium iaculis augue vitae dapibus. Aenean sed libero a dui ullamcorper blandit vitae eget elit. Quisque erat urna, suscipit at cursus eu, pellentesque non tortor.
  10. Mauris rutrum porttitor ex, eu posuere nunc vehicula id. Praesent ultricies laoreet odio, non aliquam risus dapibus nec. Integer sed congue ipsum, et pellentesque mauris. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Nulla sollicitudin augue aliquet, egestas urna eget, tincidunt arcu. Etiam luctus semper dignissim. Praesent nec ligula eu mauris laoreet accumsan." > "$file"
  11. elif [ "$file" == "eicar.txt" ]; then
  12. wget https://secure.eicar.org/eicar.com.txt -O "$file" &> /dev/null
  13. else
  14. wget "https://secure.eicar.org/$file" &> /dev/null
  15. fi
  16. fi
  17. done
  18. # Set default values for filename and hostname
  19. filename=${1:-"eicar.txt"}
  20. hostname=${2:-"${Prefix}malware.gslab-juiceshop.com"}
  21. # Ask user for input for filename, with default and example displayed
  22. read -e -p "Enter the filename (eicar.txt, eicar_com.zip, eicarcom2.zip, clear.txt): " input
  23. # Use user input if provided, otherwise use default
  24. filename=${input:-$filename}
  25. # Ask user for input for hostname, with default and example displayed
  26. read -p "Enter the hostname (default: $hostname): " input
  27. # Use user input if provided, otherwise use default
  28. hostname=${input:-$hostname}
  29. # Call upload_file.sh script with provided or default filename and hostname
  30. echo "Running the command: ./upload_file.sh --file \"$filename\" --host \"$hostname\""
  31. ./upload_file.sh --file "$filename" --host "$hostname"