Skip to content

Instantly share code, notes, and snippets.

@DancinParrot
Created June 4, 2023 04:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save DancinParrot/56d955ffc8d4e4922a222877c4f0c540 to your computer and use it in GitHub Desktop.
Save DancinParrot/56d955ffc8d4e4922a222877c4f0c540 to your computer and use it in GitHub Desktop.
Bash script to quickly setup apache web server with files for CEH.
#!/bin/bash
if [[ $(id -u) == 0 ]]; then
echo "Running as root"
echo "Creating dir..." && mkdir /var/www/html/share
echo "Changing permissions..." && chmod -R 755 /var/www/html/share
echo "Changing owner..." && chown -R www-data:www-data /var/www/html/share
echo "Provide full path to payload:"
read payload_path
echo "Copying payload to share" && cp $payload_path /var/www/html/share
echo "Starting apache2 service..." && service apache2 start
echo "Done!"
else
echo "Please run as root"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment