GithubHelp home page GithubHelp logo

cascremers / scyther Goto Github PK

View Code? Open in Web Editor NEW
96.0 9.0 38.0 21.97 MB

The Scyther Tool for the symbolic analysis of security protocols

Home Page: https://cispa.saarland/group/cremers/scyther/index.html

Shell 1.32% Python 28.79% C++ 9.81% C 42.90% Makefile 0.17% CMake 0.75% Yacc 0.73% Lex 0.49% M4 0.21% Vim Script 0.68% NASL 0.03% Pawn 0.04% TeX 14.08%

scyther's Introduction

The Scyther tool repository

This README describes the organization of the repository of the Scyther tool for security protocol analysis. Its intended audience are interested users and future developers of the Scyther tool, as well as protocol modelers. For installation, usage instructions, and pre-built binaries of the Scyther tool see: https://cispa.saarland/group/cremers/scyther/index.html.

Installing from source

We use Linux during the development of Scyther, but development on Windows and MAC OS X should be equally feasible. Note that the below instructions are written from a Linux/Ubuntu perspective, and probably need modifications for other platforms.

Scyther is written partly in Python 3 (for the GUI, using wxPython) and partly in C (for the backend).

In order to run the tool from a repository checkout, it is required to compile the C sources into a working binary for the backend. The simplest way to achieve this is to run the build.sh script in the ./src directory. This script compiles a binary version of the tool on the native platform. Thus, in the Linux case, it should produce ./src/scyther-linux. This file is automatically copied to the related directory under ./gui, and if successful you can attempt to run ./gui/scyther-gui.py to use the graphical user interface.

The build process depends on the following (Debian/Ubuntu) packages:

  • cmake
  • build-essential
  • flex
  • bison
  • gcc-multilib
  • python-minimal

If you are using Ubuntu, installing these may be as simple as running

sudo apt-get install cmake build-essential flex bison gcc-multilib python-minimal

In case you also want to be able to compile Windows binaries from Linux, you also need:

  • i686-w64-mingw32

Note that welcome all contributions, e.g., further protocol models. Just send us a pull request.

Problems with wxpython library?

If you have trouble installing wxpython, or scyther-gui.py claims it cannot find the wx library, you can try to run ./gui/scyther-gui-venv.sh instead.

Manual

We are currently rewriting the manual. The current (incomplete) snapshot of the manual can be found in the following location:

Protocol Models

The protocol models have the extension .spdl and can be found in the following directories:

  • ./gui/Protocols, containing the officially released models, and
  • ./testing, containing models currently under development.

License

Currently these Scyther sources are licensed under the GPL 2, as indicated in the source code. Contact Cas Cremers if you have any questions.

scyther's People

Contributors

cascremers avatar issotm avatar samjakob avatar santiagobautista 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

scyther's Issues

Introducing authenticated encryption?

Hi, I am sorry if this is not appropriate here, as it is probably more a question than a feature request. I just did'nt know where else to ask it.

So the language have really easy-to-use terms for things like encrpytion. But I've really been struggling with how to represent other primitives.

If you for example wanted other primitives like authenticated encryption, would the best approach be to create your own equational theory for something like AEAD, like described for diffie hellman in section 10.2 of the user manual?
Does there perhaps exist a list somewhere of examples of how to represent different primitives?

wx.SplashScreen Error

I am using macOS Sierra and installed wxpython-3.0.2.0, graphviz-2.40.1, and python 2.7.
When I run >>python scyther-gui.py, the following error comes up.

Traceback (most recent call last):
File "scyther-gui.py", line 141, in
class MySplashScreen(wx.SplashScreen):
AttributeError: 'module' object has no attribute 'SplashScreen'

Could you help me resolve this problem?

One role per agent does not work

Describe the bug
The backend option --one-role-per-agent does nothing.

To Reproduce
Steps to reproduce the behavior:

  1. Open GUI
  2. Go to settings
  3. Paste in --one-role-per-agent for backend arguments
  4. Run verify on protocol
  5. Attacks still show agents assuming multiple roles

Expected behavior
Use this protocol and verify the claim(I, Commit, R, Kir) https://gist.github.com/Mofo50C/31246287024580ab24283c559f7887fd

Scyther version used:

  • backend version: v1.2-25-g2a698fa
  • GUI version is compiled from master, but it doesn't show which version

Platform information (please complete the following information):

  • OS: Ubuntu 20.04 running on WSL2 on Windows 10
  • Running python 3.8 and wxPython 4.2.1

Debian/Ubuntu package

It would be nice to provide debian packages of Scyther releases. This would simplify the installation for users, as they (in theory) no longer need to worry about the dependencies.

Instructions to build for Windows

MINGW32 is deprecated on Ubuntu, so BuildUnix-Win32.cmake should be updated as follows:

set (CMAKE_C_COMPILER "i686-w64-mingw32-gcc")
set (CMAKE_CXX_COMPILER "i686-w64-mingw32-g++")

Additionally, the dependency would now, naturally, be: i686-w64-mingw32, this will enable the latest version to build on new Ubuntu versions and under WSL. (Also, the platform isn't correctly detected so it is currently necessary to build with cd src; ./subbuild-unix-w32.sh

GUI analysis should be multi-threaded.

Currently, analysis of claims in the GUI is done in a batch. Ideally, we spawn a thread for each claim. This allows partial results to come in quick, and even yield results at all if some claims do not terminate in reasonable time.

Scyther cannot find attack

The following protocol msc.pdf is insecure. Its corresponding Scyther model is shown below:

protocol DY2(I, R) {

	role I {

		fresh ni: Nonce;

		send_1(I, R, {I, {ni}pk(R)}pk(R) );

		recv_2(R, I, {R, {ni}pk(I)}pk(I) );	

		claim_3(I, Secret, ni);

}


	role R {

		var ni: Nonce;
	
		recv_1(I, R, {I, {ni}pk(R)}pk(R) );

		send_2(R, I, {R, {ni}pk(I)}pk(I) );

	}

}

The attack is attack.pdf. It is a type flaw attack, but no matter how I set the options in Scyther, it says the protocol is "Ok".

dot file is error

hi boss,
i use command ,get a dot file is error .xml in file.why??

Scyther tool giving empty window after verification

Describe the bug
HI while working on the scyther on my project using the resource SAPWSN: A Secure Authentication Protocol for Wireless Sensor Networks

I have come across the following issue using the latest version of Scyther code

image

I have tried even using the compromised version of the repository but its showing the same results

So could you please help me?

To Reproduce
Steps to reproduce the behavior:

  1. Go to https://www.sciencedirect.com/science/article/pii/S1389128622005035?fr=RR-2&ref=pdf_download&rr=7fe32db7189f4719
  2. Click on view pdf and navigate to page no 9 and page no 11
  3. I encountered an error its showing donemessage but its not providing the scyther results:verify` details
  4. See error
    image

Please attach any files (with comments) needed to reproduce.

Expected behavior
A clear and concise description of what you expected to happen.

It should show scyther results after verifying the protocols

Screenshots
If applicable, add screenshots to help explain your problem.

image

Scyther version used:

  • Version number, Scyther type [v1.1.3]
  • Compromise-0.9.2
  • Github commit id (if available)

Platform information (please complete the following information):

  • OS: [e.g. iOS/MAC, Windows, Linux]
  • Version [e.g. Windows 10, Ubuntu 20.04, MacOS version]
  • If applicable, version numbers of graphviz, python, wxpython.

Additional context
Add any other context about the problem here.

Error while oening file and viewing attack

I have installed scyther using the method described in https://people.cispa.io/cas.cremers/scyther/index.html. However, if I click on open, under file, I get "'module' object has no attribute 'OPEN'" error. The exact message is: "
File "Gui\Mainwindow.py", line 278, in OnOpen
if self.askUserForFilename(style=wx.OPEN,

AttributeError: 'module' object has no attribute 'OPEN'"
Moreover, I copied the code for "needham-schroeder.spdl" and when I run it, I get the output. But whenevr I try to view the attack I get "'AttackDisplay' object has no attribute 'GetClientSizeTuple'". The exact message is:
"
File "Gui\Scytherthread.py", line 274, in onViewButton
w = Attackwindow.AttackWindow(btn.claim)

File "Gui\Attackwindow.py", line 251, in init
self.CreateInteriorWindowComponents()

File "Gui\Attackwindow.py", line 284, in CreateInteriorWindowComponents
dp = AttackDisplay(self, self, attacks[0])

File "Gui\Attackwindow.py", line 80, in init
self.update(True)

File "Gui\Attackwindow.py", line 96, in update
(framewidth,frameheight) = self.GetClientSizeTuple()

AttributeError: 'AttackDisplay' object has no attribute 'GetClientSizeTuple'"

How to solve these issues?

Mac OS X versions started through the GUI fail to find Graphviz(dot)

(Applies to some, but not all, installs of current Mac OS X versions)

Graphviz is installed and 'dot' can be run from the commandline.
scyther-gui.py can be succesfully run from the commandline.

However, associating '*.py' to Python and clicking scyther-gui.py results in a 'graphviz cannot be found' error.

This seems to be a problem caused by the installation path of the 'dot' executable and a difference in paths being search between gui and commandline.

Ubuntu 16.104 LST compilation Error

cloning the repo and installing the packages required for ubuntu 16.04 (fresh install), still not compiling scynther:

ubuntu@ubuntuFA:/scyther/src$ make clean
ubuntu@ubuntuFA:
/scyther/src$ ./build.sh
/usr/bin/env: “python”: Arquivo ou diretório não encontrado
Linux
-- Found Flex: /usr/bin/flex
-- Found Bison: /usr/bin/bison
-- Locating platform specific file BuildUnix.cmake
-- Building Linux version
-- Configuring done
-- Generating done
-- Build files have been written to: /home/ubuntu/scyther/src
[ 2%] Building scanner.c from scanner.l using flex
[ 5%] Building parser.c from parser.y using bison
Scanning dependencies of target scyther-linux
[ 7%] Building C object CMakeFiles/scyther-linux.dir/arachne.o
[ 10%] Building C object CMakeFiles/scyther-linux.dir/binding.o
[ 12%] Building C object CMakeFiles/scyther-linux.dir/claim.o
[ 15%] Building C object CMakeFiles/scyther-linux.dir/color.o
[ 17%] Building C object CMakeFiles/scyther-linux.dir/compiler.o

you need to include the python-minimal package on requirements:

ubuntu@ubuntuFA:~/scyther/src$ grep -rni python *
describe-version.py:1:#!/usr/bin/env python
find-unused-functions.py:1:#!/usr/bin/python
regression-tests/regression-test.py:1:#!/usr/bin/env python
scantags.py:1:#!/usr/bin/python

after that, it compiles flawlessly

./build.sh
v1.1.3-18-g5103876
Linux
-- Found Flex: /usr/bin/flex
-- Found Bison: /usr/bin/bison
-- Locating platform specific file BuildUnix.cmake
-- Building Linux version
-- Configuring done
-- Generating done
-- Build files have been written to: /home/ubuntu/scyther/src
[ 2%] Building scanner.c from scanner.l using flex
[ 5%] Building parser.c from parser.y using bison
Scanning dependencies of target scyther-linux
[ 7%] Building C object CMakeFiles/scyther-linux.dir/arachne.o
[ 10%] Building C object CMakeFiles/scyther-linux.dir/binding.o
[ 12%] Building C object CMakeFiles/scyther-linux.dir/claim.o
[ 15%] Building C object CMakeFiles/scyther-linux.dir/color.o
[ 17%] Building C object CMakeFiles/scyther-linux.dir/compiler.o
[ 20%] Building C object CMakeFiles/scyther-linux.dir/cost.o
[ 22%] Building C object CMakeFiles/scyther-linux.dir/debug.o
[ 25%] Building C object CMakeFiles/scyther-linux.dir/depend.o
[ 27%] Building C object CMakeFiles/scyther-linux.dir/dotout.o
[ 30%] Building C object CMakeFiles/scyther-linux.dir/error.o
[ 32%] Building C object CMakeFiles/scyther-linux.dir/heuristic.o
[ 35%] Building C object CMakeFiles/scyther-linux.dir/hidelevel.o
[ 37%] Building C object CMakeFiles/scyther-linux.dir/intruderknowledge.o
[ 40%] Building C object CMakeFiles/scyther-linux.dir/knowledge.o
[ 42%] Building C object CMakeFiles/scyther-linux.dir/label.o
[ 45%] Building C object CMakeFiles/scyther-linux.dir/list.o
[ 47%] Building C object CMakeFiles/scyther-linux.dir/main.o
[ 50%] Building C object CMakeFiles/scyther-linux.dir/mgu.o
[ 52%] Building C object CMakeFiles/scyther-linux.dir/prune_bounds.o
[ 55%] Building C object CMakeFiles/scyther-linux.dir/prune_theorems.o
[ 57%] Building C object CMakeFiles/scyther-linux.dir/role.o
[ 60%] Building C object CMakeFiles/scyther-linux.dir/specialterm.o
[ 62%] Building C object CMakeFiles/scyther-linux.dir/states.o
[ 65%] Building C object CMakeFiles/scyther-linux.dir/switches.o
[ 67%] Building C object CMakeFiles/scyther-linux.dir/symbol.o
[ 70%] Building C object CMakeFiles/scyther-linux.dir/system.o
[ 72%] Building C object CMakeFiles/scyther-linux.dir/tac.o
[ 75%] Building C object CMakeFiles/scyther-linux.dir/tempfile.o
[ 77%] Building C object CMakeFiles/scyther-linux.dir/termlist.o
[ 80%] Building C object CMakeFiles/scyther-linux.dir/termmap.o
[ 82%] Building C object CMakeFiles/scyther-linux.dir/term.o
[ 85%] Building C object CMakeFiles/scyther-linux.dir/timer.o
[ 87%] Building C object CMakeFiles/scyther-linux.dir/type.o
[ 90%] Building C object CMakeFiles/scyther-linux.dir/warshall.o
[ 92%] Building C object CMakeFiles/scyther-linux.dir/xmlout.o
[ 95%] Building C object CMakeFiles/scyther-linux.dir/parser.o
[ 97%] Building C object CMakeFiles/scyther-linux.dir/scanner.o
[100%] Linking C executable scyther-linux
[100%] Built target scyther-linux


Built the Linux binary
Copied the file to the gui/Scyther directory and ~/bin

Question on asymmetric keys and digital signatures.

Question 1: Is there a correct way to define a digital signature in Scyther?

Question 2: Is there a possibility to define a pair of asymmetric keys between two roles that are different built in ones (e.g., pk(i) and sk(i) for role I)?

The use-case is at follows. Role I stores a pair of asymmetric keys pk'(I) and sk'(i), different from pk(i) and sk(i). A role R knows pk'(i) because the key was pre-installed. If the protocol contains multiple instances of R, I want each R to know that a message came from I, but I doesn't need to know the identity (e.g., pk(r)) of each R.

The problem is that I do not want in my protocol the pk'(i) to be "too public". Using the built-in pki results in an attacker finding out pk(i) and can easily compromise the protocol.

Thank you for your time!
Teri

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.