Giter Club home page Giter Club logo

behave's Introduction

Behave!

A (Still in Development) monitoring browser extension for pages acting as bad boys.

NB: This is the code repository of the project, if you're looking for the packed extensions:

Firefox: https://addons.mozilla.org/en-US/firefox/addon/behave/

Chrome: https://chrome.google.com/webstore/detail/mppjbkhgconmemoeagfbgilblohhcica/

Introduction.

Behave! monitors and warn if a web page performs any of following actions:

  • Browser based Port Scan
  • Access to Private IPs
  • DNS Rebinding attacks to Private IPs

Here's Behave! pointing the finger to at.tack.er page in the logs:

image

Port Scan Monitoring

Behave! will alert the user if the number of port or protocol used during a browser session exceeds a specific limit.

The limit is 20 by default, but it can be changed by the user via preferences.

Since Behave does not perform any DNS request,

Direct access to Private IPs Monitoring

Behave! will alert if a web page tries to directly access to an IP belonging to any the following blocks:

  • Loopback addresses IPv4 127.0.0.1/8
  • Loopback addresses IPv6 ::1/128
  • Private Networks IPv4 10.0.0.0/8 - 172.16.0.0/12 - 192.168.0.0/16
  • Unique Local Addresses IPv6 fc00::/7

DNS Resolution to Private IPs

If a malicious script instructs the Browser to connect to a FQDN whose authoritative DNS resolves to a private IP Behave! checks if the resolved IP is private. Anyway, the IP information of a resolved hostname is available only if the port is open.

Since Behave!, in order to prevent TOCTOU issues, does not perform any external DNS request, if the port is closed there will be no IP resolution available and therefore, no alert.

DNS Rebinding Bypasses

Behave! does not perform any direct DNS request, and the IP is taken from the intercepted response.

That means that it's not exposed to any TOCTOU attack like DNS Rebinding.

DNS Rebinding Monitoring

Behave! keeps track if a hostname is resolved with multiple IPs, and will alert if there's some mixing between public IPs and private ones.

Install

Behave! is available as packed extension on:

Firefox Extension: https://addons.mozilla.org/en-US/firefox/addon/behave/

Chrome Extension: https://chrome.google.com/webstore/detail/mppjbkhgconmemoeagfbgilblohhcica/

However, if like you want to play a bit with the code you can:

  • Clone it OR download the zip and unzip
  • Open Google Chrome/Chromium go to chrome://extension
  • Activate Developer Mode
  • Push "Load Unpacked" and choose the Behave directory.
  • Enjoy Behave!

Wanna Test Behave! ?

See what happens when you go to one of the following:

Singularity of Origin DNS Rebinding Attack: http://rebind.it:8080/manager.html

JavaScript Port Scan: http://jsscan.sourceforge.net/jsscan2.html

Nota Bene: At the moment it won't alert if DNS Rebinding attack is performed on non private IPs such as: http://www.alf.nu/BrowserCacheAndDnsRebinding

Wanna Help?

You are welcome to help! Feel free to create an Issue or fork the project and make a PR.

behave's People

Contributors

jennings avatar wisec avatar

Watchers

 avatar  avatar

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.