Welcome! Log In Create A New Profile

Advanced

Strange rewrite_by_lua outcome

Nginx User
October 16, 2011 04:12PM
This works produces a 403 Forbidden error as expected:
#GET /submit_links/
if ($request_uri ~*
\:|\[|\]|\-\-|\@|\^|\{|\}|\~|\<|\>|\.\.|\+\+|//|\%0|\%A|\%B|\%C|\%D|\%E|\%F|\%22|\%27|\%28|\%29|\%3C|\%3E|\%5C|\%7B|\%7C|\%7D|select(\s*)\(|convert(\s*)\(|/query/|function\.|remoteFile|servername|\&rptmode\=|/\(null\)/|(maincore|authorize|macromates|head_auth|submit_links|change_action|admin_db_utilities|admin\.webring\.docs|Table/Latest/index)\.|w00t|MNG/LIVE|/x[0-9][0-9]|\\x[0-9][0-9]|/(cgi|https?)/|\.css\(|\)\+|/\,/|\{0\}|eval\(|\_vti\_|\(null\)|echo.*kae|function(\.array\-rand|\(\))
) {
return 403;
}

This produces a 500 Internal server error instead:
#GET /submit_links/
rewrite_by_lua '
local request_uri = ngx.re.match(ngx.var.request_uri,
"\:|\[|\]|\-\-|\@|\^|\{|\}|\~|\<|\>|\.\.|\+\+|//|\%0|\%A|\%B|\%C|\%D|\%E|\%F|\%22|\%27|\%28|\%29|\%3C|\%3E|\%5C|\%7B|\%7C|\%7D|select(\s*)\(|convert(\s*)\(|/query/|function\.|remoteFile|servername|\&rptmode\=|/\(null\)/|(maincore|authorize|macromates|head_auth|submit_links|change_action|admin_db_utilities|admin\.webring\.docs|Table/Latest/index)\.|w00t|MNG/LIVE|/x[0-9][0-9]|\\x[0-9][0-9]|/(cgi|https?)/|\.css\(|\)\+|/\,/|\{0\}|eval\(|\_vti\_|\(null\)|echo.*kae|function(\.array\-rand|\(\))",
"io")
if request_uri then
ngx.exit(ngx.HTTP_FORBIDDEN)
end
';

Line 62: "23388#0: *258 Failed to load Lua inlined code: [string
"rewrite_by_lua"]:24: ')' expected near '|', client: xx.xxx.xx.xx,
server: testsite.com, request: "GET /submit_links HTTP/1.1", host:
"testsite.com""
http://pastebin.com/XYNwEciX

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

Strange rewrite_by_lua outcome

Nginx User October 16, 2011 04:12PM

Re: Strange rewrite_by_lua outcome

agentzh October 16, 2011 08:56PM

Re: Strange rewrite_by_lua outcome

Nginx User October 17, 2011 12:48AM

Re: Strange rewrite_by_lua outcome

Nginx User October 17, 2011 12:52AM

Re: Strange rewrite_by_lua outcome

Tim Mensch October 17, 2011 01:04AM

Re: Strange rewrite_by_lua outcome

Nginx User October 17, 2011 12:34PM

Re: Strange rewrite_by_lua outcome

Tim Mensch October 17, 2011 01:46PM

Re: Strange rewrite_by_lua outcome

Nginx User October 17, 2011 01:56PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 107
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready