Skip to content

Instantly share code, notes, and snippets.

@serverok
Last active March 18, 2025 06:22
Show Gist options
  • Save serverok/95556e03de7857524a1e0f3389cfcda8 to your computer and use it in GitHub Desktop.
Save serverok/95556e03de7857524a1e0f3389cfcda8 to your computer and use it in GitHub Desktop.
pwndrop with nginx letsencrypt SSL
#!/bin/bash
# pwndrop Installer
# Author: Yujin Boby
# Email: [email protected]
# Web: https://serverok.in
# Point domain name and www to server IP
# Run this script on fresh ubuntu server
read -p "Enter your domain name (e.g., drop.serverok.in): " domain_name
systemctl disable systemd-resolved.service
systemctl stop systemd-resolved
rm -f /etc/resolv.conf
tee /etc/resolv.conf << END
nameserver 8.8.8.8
nameserver 1.1.1.1
END
curl https://raw.githubusercontent.com/kgretzky/pwndrop/master/install_linux.sh | bash
systemctl stop pwndrop
cat > /usr/local/pwndrop/pwndrop.ini <<EOL
[pwndrop]
listen_ip =
http_port = 800
https_port = 4430
data_dir = /usr/local/pwndrop/data
admin_dir = /usr/local/pwndrop/admin
EOL
systemctl start pwndrop
apt update
apt install nginx -y
wget https://raw.githubusercontent.com/serverok/server-setup/master/install/letsencrypt.sh
bash letsencrypt.sh
certbot --authenticator webroot --webroot-path /var/www/html --installer nginx --agree-tos --no-eff-email --email [email protected] -d $domain_name -d www.$domain_name
rm -f /etc/nginx/sites-enabled/default
cat > /etc/nginx/sites-enabled/$domain_name.conf <<EOL
server {
listen 80;
server_name $domain_name www.$domain_name;
location ~ ^/.well-known/ {
allow all;
autoindex on;
root /var/www/html;
}
location / {
return 301 https://\$host\$request_uri;
}
}
server {
listen *:443 ssl;
server_name $domain_name www.$domain_name;
ssl_certificate /etc/letsencrypt/live/$domain_name/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/$domain_name/privkey.pem; # managed by Certbot
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
client_max_body_size 100M;
proxy_read_timeout 600s;
proxy_buffer_size 128k;
proxy_buffers 4 256k;
proxy_busy_buffers_size 256k;
location / {
proxy_set_header X-Real-IP \$remote_addr;
proxy_set_header X-Forwarded-For \$remote_addr;
proxy_set_header Host \$host;
proxy_set_header X-Forwarded-Proto \$scheme;
proxy_pass http://127.0.0.1:800;
}
}
EOL
systemctl restart pwndrop
systemctl restart nginx
echo "Setup complete! Your domain $domain_name is now configured with pwndrop and nginx."
echo "You can access pwndrop at https://$domain_name/pwndrop"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment