在我的网站上,我有一个具有文件上传功能的表单。但是,它可以上传恶意文件pdf文件来执行跨站脚本攻击。
\n参考此pdf https://github.com/osnr/horrifying-pdf-experiments
\n\n有什么办法可以在上传过程中防止这种pdf文件出现。
\n那个pdf代码
\n%PDF-1.3\n%\xc3\xa2\xc3\xa3\xc3\x8f\xc3\x93\n1 0 obj\n<</Pages 2 0 R /Type /Catalog>>\nendobj\n2 0 obj\n<</Count 1 /Kids [3 0 R] /Type /Pages>>\nendobj\n3 0 obj\n<</AA\n <</O\n <</JS\n (\ntry {\n app.alert\\("XSS"\\)\n} catch \\(e\\) {\n app.alert\\(e.message\\);\n}\n )\n /S /JavaScript>>>>\n /Annots [] /Contents 4 0 R /MediaBox [0 0 612 792] /Parent 2 0 R\n /Resources\n <</Font <</F1 <</BaseFont /Helvetica /Subtype /Type1 /Type /Font>>>>>>\n /Type /Page>>\nendobj\n4 0 obj\n<</Length 21>>\nstream\n\nBT\n/F1 24 Tf\nET\n \nendstream\nendobj\nxref\n0 5\n0000000000 65535 f\n0000000015 00000 n\n0000000062 00000 n\n0000000117 00000 n\n0000000424 00000 n\ntrailer\n\n<</Root 1 0 R /Size 5>>\nstartxref\n493\n%%EOF\n
Run Code Online (Sandbox Code Playgroud)\n
归档时间: |
|
查看次数: |
3099 次 |
最近记录: |