Giter VIP home page Giter VIP logo

poc-website-masquerading's Introduction

Another good reason to be careful when running script from untrusted source with sudo, or to not give to all users root capabilities

DEMO ๐ŸŽญ
demo

PoC

This a simple PoC on how to impersonnate a website locally.

After that you can imagine multiple scenarios. For example stealing credentials, by making the local server (which impersonates the target website) having the same frontend as the target but interacting with a remote server to exfiltrate the credentials.

It highlights the importance to monitor the capabilities given to scripts/users etc as this snipset could be integrated in any malicious script or by any user having root privileges. (Don't do this, of course)

How it works

~> Launch poc-impersonate

  1. Modify /etc/host to route the target domain to localhost. Note:the content of /etc/hosts is used before making DNS resolution at each request so it is priority. need sudo
  2. Make locally trusted certificates, it is important to avoid the "warning" page of the browser. Certs could be installed in the trusted store of the whole system, in this PoC it is only installed for the user launching the script.
  3. Launch a local server on port 443. need sudo

~> Visit the target website (here https://www.github.com)

See that you aren't were you wanted to. (You reach the local server)

~> Clear your tracks with clean

It stops local server, withdraws certs in trust store, and puts /etc/hosts as it was before the PoC

Notes

  • 2 command needs sudo (modifying /etc/host & launch https server on 443)
  • To ease cert regisstration in trust store the PoC use mkcert but it could be done manually w/ openssl
    • Hence the "certutil" is a prerequisite to make the PoC works for Chrome or Firefox
  • Need Browser restart to make it works

poc-website-masquerading's People

Contributors

ariary avatar

Stargazers

 avatar  avatar  avatar

Watchers

 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.