Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add set_encode_hex_dash for set-misc #24

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Add set_encode_hex_dash for set-misc #24

wants to merge 2 commits into from

Conversation

ghost
Copy link

@ghost ghost commented Jan 11, 2015

with some secure required reason, user might need Nginx to encode string to JavaScript-understanding \xff like format.
for example, a web application firewall, user may to configure nginx to generate a IP-unified-hash to set_encode_hex and set_encode_hex_dash, and echo to Web browser, javascript engine will under stand what the hash exactly is and request hash to server another location to verify to turn off alarm.

waf example:

<!DOCTYPE html><html><head><title></title></head><body><script type="text/javascript">_$=function($_){_$=[
"\x78\x68","\x78\x68","\x78\x68","\x78\x68","\x78\x68","\x78\x68","\x78\x68","\x78\x68","\x78\x68","\x78\x68","\x78\x68","\x78\x68","\x78\x68","\x78\x68","\x78\x68","\x78\x68","\x2f\x73\x65\x74\x5f\x6c\x6f\x67\x2f\x3f\x6a\x64\x66\x77\x6b\x65\x79\x3d\x70\x6c\x6e\x32\x61\x33\x68\x63\x64\x6c\x36\x67\x66\x33\x35\x39\x63\x31\x38\x36\x74\x38\x34\x38\x71\x62\x31\x69\x37\x72\x34\x39\x26\x6e\x65\x78\x74\x3d\x25\x32\x46\x61\x64\x6d\x69\x6e\x25\x32\x46\x6c\x6f\x67\x69\x6e\x25\x32\x46\x26\x72\x3d\x32\x30\x31\x35\x30\x31\x31\x31\x31\x32\x32\x30",
"\x83\x67\x67","\x83\x67\x67","\x83\x67\x67","\x83\x67\x67","\x83\x67\x67","\x83\x67\x67","\x6e"];$_["\x6c\x6f\x63\x61\x74\x69\x6f\x6e"]["\x68\x72\x65\x66"]=_$["\x31\x36"];};_$(window);</script><noscript>Please enable javascript to continue.</noscript></body></html>

@@ -1,72 +0,0 @@
reindex
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please do not change unrelated files. What's the purpose of removing this file here?

@agentzh
Copy link
Member

agentzh commented Jan 12, 2015

@Xoxossl Thank you for your contribution! But I think set_encode_hex_dash is a bad name and ill implemented. How about introducing a set_encode_escaped_hex directive that accepts raw binary inputs just like set_encode_hex? It looks strang to me to make the new directive work on the output of set_encode_hex instead of its input.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants