Created
June 4, 2023 04:35
-
-
Save DancinParrot/56d955ffc8d4e4922a222877c4f0c540 to your computer and use it in GitHub Desktop.
Bash script to quickly setup apache web server with files for CEH.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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