Giter Site home page Giter Site logo

palantir / phishcatch Goto Github PK

View Code? Open in Web Editor NEW
85.0 232.0 20.0 614 KB

A browser extension and API server for detecting corporate password use on external websites

Home Page: https://github.com/palantir/phishcatch/wiki

License: Apache License 2.0

Dockerfile 0.03% Python 1.14% Shell 0.01% JavaScript 0.86% CSS 68.66% HTML 0.21% TypeScript 29.10%
octo-correct-managed

phishcatch's Introduction

phishcatch's People

Contributors

carbureted avatar cryps1s avatar dependabot[bot] avatar primarytyler avatar slw07g avatar svc-excavator-bot avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

phishcatch's Issues

Mention that you must build extension before packing it

I was trying to follow this wiki step:

https://github.com/palantir/phishcatch/wiki/Installing-the-extension#building-and-installing-from-source

Download the source code from this repo.
In Chrome, open chrome://extensions/ and enable the "Developer mode" toggle in the top right.
Click the "Pack extension" button and select the extension folder from your local copy of this repo as the "Extension root directory".

Specifically, here's what I did

  1. Cloned the phishcatch repo from GitHub
  2. Clicked Pack Extension and selected my phishcatch/extension folder locally

However I kept getting a "manifest file not found error"

Through trial and error I learned that the instructions are misleading, and here's what I need to do:

  1. Clone the phishcatch repo
  2. Go into extension and run yarn install and yarn build
  3. Click Pack Extension and choose the resulting phishcatch/extension/dist folder

Let's update the wiki page with the up to date instructions no?

I would create a PR but I can't as this is a wiki page!

[Security] Domain verification could be easily bypassed

Summary

While giving a quick look to the code I noticed that the hostMatches function used to verify if a given host is in the config.enterprise_domains array is weak and could be easily bypassed.

Description

While visiting a website the extension reads the current hostname and calls the getDomainType function in order to understand if, among the others, a green badge should be displayed or not, indicating that the website is a corporate one and should be trusted.

The getDomainType calls under the hood the hostMatches:

function hostMatches(host: string, domainList: string[]) {
return domainList.some((domain) => {
if (domain === host) {
return true
}
if (starRegexp.exec(domain)) {
const domainWithoutStar = domain.replace('*.', '')
const mainDomainRegex = new RegExp(`.*?${domainWithoutStar}$`)
return mainDomainRegex.test(host)
}
return false
})
}

It basically loops over all the domains stored in config.enterprise_domains and:

  • If the stored domain matches the visited one it returns true.
  • If the stored domain is a wildcard one (i.e. *.google.com) it checks that the visited one ends with the wildcard domain without the *..

This approach is very weak because it would mark as an enterprise domain any domain ending with (in my example) google.com (i.e. nomoregoogle.com).
It should be also pointed out that using fake domains ending with the legit one is a very common phishing technique.

PoC

  1. Install the Phishcatch extension
  2. Set as enterprise_domains: ["*.google.com"]
  3. Visit https://nomoregoogle.com
  4. Notice that the green badge on the Phishcatch extension appears

Addendum

While writing this issue I also realized that as enterprise_domains are threated as RegExp then the . character is evaluated as a wildcard. This means that if the enterprise_domains contains ["*.nomor.google.com"] then nomoregoogle.com would be matched as an enterprise domain.

Active development?

Love the concept - exactly what I was looking for but the development seem to have been stopped, correct?
Is the Firefox extension still in development?

Create a community slack/discord/spectrum group

hi, would be great to have a place to discuss phishcatch and potentially collaborate on new functionality through a group like slack, discord, or spectrum, like other OSS projects have!

Support Configurable Server Alert Path

Problem

Currently, clients will use {{ server }}/alerts for sending new alert info. If a organization would rather not install & manage the server component but instead receive alerts directly to another tool, for many generic webhook utilities or HTTP Event Collectors (Splunk, SumoLogic two off hand examples) appending a path of /alerts would add an extra step which can sometimes be cumbersome.

Proposed Solution

Allow for clients to send to just the base endpoint to support more generic webhook type solutions.

curl statement to test webhook fails

The test curl statement to see if the webhook is configured properly automatically responds with "Couldn't send stack alert". Even though slack webhook is configured properly in the dockerfile. Running the server locally. Curl statement to get server status returns as healthy. Not sure why I can't curl the slack app.

Connecting extension to alerting server not working

Here's my debug configuration:

Screen Shot 2021-06-17 at 6 42 47 PM

As you can see I've set the phishcatch server URL to a ngrok site which points to localhost:8000. I am running the server locally at port 8000 using PRESHARED_KEY=MYPSK123 dev.sh

I am able to trigger phishcatch browser notifications, however I am not seeing any alerts logged by my alert server.

What do I need to do to get the extension and server to cooperate?

[enhancement] Adding Parameter in config for better Username Detection.

Add a new parameters in debug configuration which taking as input a string : idusername
This string should be the value of the id on the MainPage, to detect the username.

for example, a main login page with the html code :
<input class="mdc-text-field__input pwd" type="password" id="pwd_pass" size="25" name="password" value="">

The Parameter isUsername should be pwd_pass, then the extension can automatically take the username when logging and store it for better logging/information.

New code should have for example in content.js

function runUsernameScraper() { const username = <HTMLInputElement>document.getElementById(IdUsername) if (username != null) { return username.value }

Support alternate configurations to send data

It would be very useful to simply specify in the config file that I want alerts to ship out via syslog or just give it an Elasticsearch API endpoint to send data to - either way I'd like to play around with getting these alerts and metadata into a Security Onion instance. I know this is something that could probably be easily hobbled together on the API server but nonetheless would be nice to see OOB.

Update to Manifest V3?

Amazing project, any plans to update this to Manifest V3? Looks like it drops supports for DOM access and I'm not sure how that will affect the feasibility of the project.

False positives with the checkDOMHash function

Hello,

Thank you for this amazing project !
We meet false positives with the domhash capabilities of the extension.
It lies in the checkDOMHash function.

Some users trigger potential phishing alerts of type 'domhash' on different URLs that seem unrelated to the entreprise page we want to protect.
Could you share hints on how I could proceed to debug this ?

For now, we implemented a new option ('display_domhash_alerts') in config.ts so that users do not see the alerts while we still receive them on the server side, quite useful.

Thanks !

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.