{"id":358,"date":"2014-07-03T12:26:44","date_gmt":"2014-07-03T12:26:44","guid":{"rendered":"http:\/\/ixyzero.com\/blog\/?p=358"},"modified":"2014-07-03T12:26:44","modified_gmt":"2014-07-03T12:26:44","slug":"%e8%bd%acblackhat%e5%8e%86%e5%b9%b4paper%e6%95%b4%e7%90%86","status":"publish","type":"post","link":"https:\/\/ixyzero.com\/blog\/archives\/358.html","title":{"rendered":"[\u8f6c]Blackhat\u5386\u5e74paper\u6574\u7406"},"content":{"rendered":"<p><span style=\"color: #ff0000;\"><strong>\u539f\u6587\u94fe\u63a5<\/strong><\/span>\uff1a<a href=\"http:\/\/www.blackh4t.org\/archives\/911.html\" target=\"_blank\">http:\/\/www.blackh4t.org\/archives\/911.html<\/a><\/p>\n<p><a href=\"https:\/\/www.blackhat.com\/html\/archives.html\" target=\"_blank\">Blackhat\u5386\u5e74paper\u7684\u6c47\u603b\u9875\u9762<\/a><\/p>\n<div><span style=\"color: #000000; font-size: medium;\"><span style=\"color: #000000; font-size: medium;\">\u9644\u4e0a\u4e0b\u8f7d\u811a\u672c\uff08\u4ece\u5f53\u524d\u76ee\u5f55\u4e2d\u7684txt\u6587\u4ef6\u4e2d\u8bfb\u53d6\u8d44\u6e90\u7684\u4e0b\u8f7dURL\u4fe1\u606f\u7136\u540e\u4f7f\u7528wget\u8fdb\u884c\u4e0b\u8f7d\uff0c\u5e76\u5206\u522b\u653e\u5230\u5404\u4e2a\u76ee\u5f55\u4e2d\uff09\uff1a<br \/>\n# By notsobad &lt;&#8212;&#8211; thx this dude<br \/>\n<\/span><\/span><\/p>\n<pre class=\"lang:sh decode:true\">for i in *.txt;do mkdir ${i%.txt} ; ( cd ${i%.txt} &amp;&amp; wget -i ..\/$i --no-check-certificate ); done<\/pre>\n<\/div>\n<div>\n<hr \/>\n<p><span style=\"color: #000000; font-size: medium;\">\u8f6c\u4e2aPyhton\u4e0b\u8f7d\u811a\u672c\u7684<a href=\"http:\/\/www.cnblogs.com\/scrat\/archive\/2012\/11\/03\/2752374.html\" target=\"_blank\">\u6587\u7ae0<\/a>\uff1a<\/span><\/div>\n<ol>\n<li>\u9996\u5148\uff0c\u53bb\u6c47\u603b\u9875\u9762\uff0c\u4f7f\u7528Python\u811a\u672c\u83b7\u53d6\u5176\u4e2d\u6240\u6709paper\u7684\u94fe\u63a5\u4fe1\u606f\u5b58\u5165\u4e00\u6587\u672c\u6587\u4ef6\u4e2d\uff08\u8fd9\u4e2a\u5176\u5b9e\u4e5f\u53ef\u4ee5\u5206\u4e3a\uff1a1.\u4ece\u6c47\u603b\u9875\u9762\u83b7\u53d6\u6bcf\u4e00\u5e74\u6f14\u8bb2\u7684\u94fe\u63a5\uff1b2.\u4ece\u6bcf\u4e00\u5e74\u7684\u94fe\u63a5\u4e2d\u83b7\u53d6\u6240\u6709paper\u7684\u94fe\u63a5\u4fe1\u606f\uff09\uff1b<\/li>\n<li>\u7136\u540e\uff0c\u5c06\u6c47\u603b\u51fa\u7684\u6240\u6709txt\u6587\u4ef6\u653e\u5165\u4e00\u4e2a\u76ee\u5f55\u4e2d\uff0c\u6267\u884c\u4e0a\u9762\u7684\u90a3\u4e2ashell\u811a\u672c\uff0c\u5373\u53ef\u8fdb\u884c\u6279\u91cf\u4e0b\u8f7d\u3002<\/li>\n<\/ol>\n<div>\u83b7\u53d6paper\u4e0b\u8f7d\u94fe\u63a5\u7684Python\u811a\u672c\u5982\u4e0b\uff1a<\/div>\n<div>\n<pre class=\"lang:python decode:true  \">#!\/usr\/bin\/env python\n# coding=utf-8\n#-------author:Scr@t-------\n#----filename:spider.py----\n\nimport sys\nimport urllib2\nimport re\nimport HTMLParser\n\nclass myparser(HTMLParser.HTMLParser):\n\tdef __init__(self):\n\t\tHTMLParser.HTMLParser.__init__(self)\n\tdef handle_starttag(self,tag,attrs):\n\t\tif (tag == 'a'):\n\t\t\tURL = ''\n\t\tfor name,value in attrs:\n\t\t\tif (name == 'href'):\n\t\t\t\tfor xx in ['pdf','ppt','pptx','zip','rar']:\n\t\t\t\t\tval = value.find(xx)#\u6240\u8981\u4e0b\u8f7d\u7684\u6587\u4ef6\u7c7b\u578b\n\t\t\t\t\tif val != -1:\n\t\t\t\t\t\tfp.write(value + 'n')\n\nif len(sys.argv)&gt;=2 and sys.argv[1] == '-u':\n\tcontent = (urllib2.urlopen(sys.argv[2])).read()#\u6253\u5f00\u7f51\u5740\u5e76\u8bfb\u53d6\u5185\u5bb9\n\tfp = open(\"URL.list\",'w')\n\tcon = myparser()\n\tcon.feed(content)#\u628acontent\u7684\u5185\u5bb9\uff0c\u4f20\u7ed9myparser\u5206\u6790\nelse:\n\tprint 'Usage:%s -u url'%sys.argv[0]<\/pre>\n<p>\u7a0d\u5fae\u6539\u4e86\u4e0b\u811a\u672c\u4f7f\u5176\u80fd\u591f\u66f4\u597d\u8fd0\u884c\u3002<\/p>\n<p>========<\/p>\n<p>\u5bf9\u90a3\u4e2a\u6279\u91cf\u4e0b\u8f7d\u7684shell\u547d\u4ee4\u7ec4\u5408\u505a\u4e2a\u89e3\u91ca\uff1a<\/p>\n<pre class=\"lang:sh decode:true \">for i in *.txt;do mkdir ${i%.txt} ; ( cd ${i%.txt} &amp;&amp; wget -i ..\/$i --no-check-certificate ); done\n#\u4e0a\u9762\u7684\u8fd9\u4e00\u53e5\u8bdd\u8d77\u5230\u7684\u4f5c\u7528\u662f\uff0c\u904d\u5386\u5f53\u524d\u76ee\u5f55\u4e0b\u6240\u6709\u7684txt\u6587\u4ef6\uff0c\u6839\u636etxt\u6587\u4ef6\u540d\u521b\u5efa\u540c\u540d\u6587\u4ef6\u5939\uff0c\u7136\u540e\u6839\u636e\u5404txt\u6587\u4ef6\u5185\u5bb9\u4e2d\u6307\u5b9a\u7684URL\u4e0b\u8f7d\u76f8\u5e94\u8d44\u6e90\n\n#\u7ec6\u5206\u6bcf\u4e2a\u547d\u4ee4\u7684\u4f5c\u7528\u5982\u4e0b\nfor i in *.txt;do\n\tmkdir ${i%.txt};\t#\u53d6txt\u6587\u4ef6\u540d\u6765\u521b\u5efa\u76ee\u5f55\n\t( cd ${i%.txt} &amp;&amp; wget -i ..\/$i --no-check-certificate );\t#\u5207\u6362\u5230\u5bf9\u5e94\u76ee\u5f55\u5e76\u4f7f\u7528wget\u8fdb\u884c\u4e0b\u8f7d(-i\u9009\u9879\u6307\u5b9a\u4ece\u672c\u5730\/\u5916\u90e8\u6587\u4ef6\u4e2d\u8bfb\u53d6URL\u4fe1\u606f\uff0c\u53e6\u4e00\u4e2a\u9009\u9879\u6307\u5b9a\u4e0d\u8fdb\u884c\u68c0\u67e5)\ndone<\/pre>\n<p>&nbsp;<\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>\u539f\u6587\u94fe\u63a5\uff1ahttp:\/\/www.blackh4t.org\/archives\/911.html Blackhat [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[11,7,25,12],"tags":[175,8,65,66],"class_list":["post-358","post","type-post","status-publish","format-standard","hentry","category-linux","category-programing","category-security","category-tools","tag-htmlparser","tag-python","tag-shell","tag-wget"],"views":7712,"_links":{"self":[{"href":"https:\/\/ixyzero.com\/blog\/wp-json\/wp\/v2\/posts\/358","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=358"}],"version-history":[{"count":0,"href":"https:\/\/ixyzero.com\/blog\/wp-json\/wp\/v2\/posts\/358\/revisions"}],"wp:attachment":[{"href":"https:\/\/ixyzero.com\/blog\/wp-json\/wp\/v2\/media?parent=358"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ixyzero.com\/blog\/wp-json\/wp\/v2\/categories?post=358"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ixyzero.com\/blog\/wp-json\/wp\/v2\/tags?post=358"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}