Giter Site home page Giter Site logo

httphijack's Introduction

httphijack

使用 Javascript 实现前端防御http劫持及防御XSS攻击,并且对可疑攻击进行上报。

相关文章

【前端安全】JavaScript防http劫持与XSS

使用方法

引入 httphijack1.0.0.js

httphijack.init()

防范范围:

  • 所有内联 on* 事件执行的代码
  • a标签 href 属性 javascript: 内嵌的代码
  • 静态脚本、iframe 等恶意内容
  • 动态添加的脚本文件、iframe 等恶意内容
  • document-write添加的内容
  • 页面被 iframe 嵌套劫持

使用须知

建立自己的域名白名单、关键字黑名单、上报系统及接收后端。

组件处于测试修改阶段,未在生产环境使用,使用了很多 HTML5 才支持的 API,仅供学习交流。

License

MIT

httphijack's People

Contributors

chokcoco avatar

Watchers

James Cloos avatar

Forkers

zhangmuzhi

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.