Skip to content

ralfgunter/ePerspectives

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

51 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ePerspectives

ePerspectives aims to be a pure-erlang implementation of a Perspectives client, API and Notary server/scanner. Thanks to the concurrency features of erlang, the server/scanner should be able to handle several requests at once without much difficulty.

About Perspectives

Perspectives makes use of a network of “notary servers” around the world to retrieve a given website’s SSL certificate from multiple vantage points, so as to diminish the effectivity of a MITM (man-in-the-middle) attack.

Basically, man-in-the-middle attacks work by tampering with the connection between the user and a given server, and, say, diverging the connection to a malicious copy of the website. By providing different levels of authentication, SSL can help guarantee that the connection is not being tampered with. Unfortunately, this comes at a sometimes unfeasible cost, and can’t always ensure that the received certificate belongs to the real website. For example, if the attacker gets a certificate from a “Certificate Authority” for his fake website, then the user might not notice anything unusual unless they manually verify it.

By probing the target website from multiple “perspectives”, one diminishes the probability of being fooled by a fake certificate. This is because it would require compromising several paths to the website at the same time. If even one of them is kept intact, the user can easily notice the tampering by checking the discrepancies in the reported fingerprints. Furthermore, each server keeps a record of the keys used by servers over time, so a suspicious recent change in the fingerprint can be noticed as well.

For more information and a paper on Perspectives, please visit the official website at www.cs.cmu.edu/~perspectives

Compiling

Calling make without arguments will compile the entire suite (client + server/scanner). If you need only one component, you can pass client or server to make (make common is required in either case).

Usage - CLIENT

Note: I cannot guarantee that the API will remain the same.

User interaction is done through the persp_interface module:

  • Function_name/Arity - [Arguments]: Description

  • start/0 - []: spawns a persp_client instance, and is required before any of the other functions below;

  • scan/3 - [Domain, Port, Type]: requests a scan from the notary servers; currently, Type can only be 2 (it means ssl);

  • print/0 - []: prints the scan results that have already been received;

  • add_server/4 - [IP, Port, Public_Key, Server_type]: adds a notary server to the servers list (Server_type can be either udp or http);

  • del_server/1 - [IP]: deletes a notary server from the servers list;

  • pubkey_pem_to_string/1 - [Filepath]: returns a string containing the pem-encoded public key.

Usage - SERVER/SCANNER

Note: The same note above applies here.

After compiling, make sure all necessary folders/files are in place:

server/keys/ - holds the private/public key
  \_ private.pem
              - default private key file;
              - must be in the PEM format.
  \_ public.pem 
              - default public key file;
              - must be in the PEM format.

server/db/ - holds the cached results
  \_ cache
              - default storage for the cache table;
              - subject to change;
  \_ sids
              - default storage for the sids table;
              - subject to change;
  \_ signatures
              - default storage for the signatures table;
              - subject to change.

server/http_root/htdocs/ - empty folder required to run the httpd

If so, you can start the server/scanner from the server/ebin folder as follows:

% erl
Erlang R13B04 (erts-5.7.5) [source] [smp:2:2] [rq:2] [async-threads:0] [hipe] [kernel-poll:false]

Eshell V5.7.5  (abort with ^G)
1> application:start(persp_server).
ok

To cleanly stop the server, use the following command:

application:stop(persp_server).

If you want more information, it is recommended that you start the eshell with the command line argument -boot start_sasl, though that might slow down things a bit. Finally, the shell command appmon:start() gives you a nice visual overview of how things are running (when on it, click on persp_server to see more).

Compatibility

ePerspectives has been tested on Ubuntu 9.10, 10.04, and Debian testing/“squeeze”, running Erlang/OTP R13B04. It doesn’t seem to work with Erlang <= R12B03.

License

This project is licensed under the EPL 1.0, though this is flexible.

About

ePerspectives is a pure erlang implementation of Perspectives - "host authentication with multi-path network probing"

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages