Commit 5ba0116e authored by Jaime Arias's avatar Jaime Arias
Browse files

add iot-dev and treasure-hunters adtrees models

parent 1a9f287f
# Created by https://www.gitignore.io/api/latex
# Edit at https://www.gitignore.io/?templates=latex
### LaTeX ###
## Core latex/pdflatex auxiliary files:
*.aux
*.lof
*.log
*.lot
*.fls
*.out
*.toc
*.fmt
*.fot
*.cb
*.cb2
.*.lb
## Intermediate documents:
*.dvi
*.xdv
*-converted-to.*
# these rules might exclude image files for figures etc.
# *.ps
# *.eps
# *.pdf
## Generated if empty string is given at "Please type another file name for output:"
.pdf
## Bibliography auxiliary files (bibtex/biblatex/biber):
*.bbl
*.bcf
*.blg
*-blx.aux
*-blx.bib
*.run.xml
## Build tool auxiliary files:
*.fdb_latexmk
*.synctex
*.synctex(busy)
*.synctex.gz
*.synctex.gz(busy)
*.pdfsync
## Build tool directories for auxiliary files
# latexrun
latex.out/
## Auxiliary and intermediate files from other packages:
# algorithms
*.alg
*.loa
# achemso
acs-*.bib
# amsthm
*.thm
# beamer
*.nav
*.pre
*.snm
*.vrb
# changes
*.soc
# comment
*.cut
# cprotect
*.cpt
# elsarticle (documentclass of Elsevier journals)
*.spl
# endnotes
*.ent
# fixme
*.lox
# feynmf/feynmp
*.mf
*.mp
*.t[1-9]
*.t[1-9][0-9]
*.tfm
#(r)(e)ledmac/(r)(e)ledpar
*.end
*.?end
*.[1-9]
*.[1-9][0-9]
*.[1-9][0-9][0-9]
*.[1-9]R
*.[1-9][0-9]R
*.[1-9][0-9][0-9]R
*.eledsec[1-9]
*.eledsec[1-9]R
*.eledsec[1-9][0-9]
*.eledsec[1-9][0-9]R
*.eledsec[1-9][0-9][0-9]
*.eledsec[1-9][0-9][0-9]R
# glossaries
*.acn
*.acr
*.glg
*.glo
*.gls
*.glsdefs
# uncomment this for glossaries-extra (will ignore makeindex's style files!)
# *.ist
# gnuplottex
*-gnuplottex-*
# gregoriotex
*.gaux
*.gtex
# htlatex
*.4ct
*.4tc
*.idv
*.lg
*.trc
*.xref
# hyperref
*.brf
# knitr
*-concordance.tex
# TODO Comment the next line if you want to keep your tikz graphics files
*.tikz
*-tikzDictionary
# listings
*.lol
# luatexja-ruby
*.ltjruby
# makeidx
*.idx
*.ilg
*.ind
# minitoc
*.maf
*.mlf
*.mlt
*.mtc[0-9]*
*.slf[0-9]*
*.slt[0-9]*
*.stc[0-9]*
# minted
_minted*
*.pyg
# morewrites
*.mw
# nomencl
*.nlg
*.nlo
*.nls
# pax
*.pax
# pdfpcnotes
*.pdfpc
# sagetex
*.sagetex.sage
*.sagetex.py
*.sagetex.scmd
# scrwfile
*.wrt
# sympy
*.sout
*.sympy
sympy-plots-for-*.tex/
# pdfcomment
*.upa
*.upb
# pythontex
*.pytxcode
pythontex-files-*/
# tcolorbox
*.listing
# thmtools
*.loe
# TikZ & PGF
*.dpth
*.md5
*.auxlock
# todonotes
*.tdo
# vhistory
*.hst
*.ver
# easy-todo
*.lod
# xcolor
*.xcp
# xmpincl
*.xmpi
# xindy
*.xdy
# xypic precompiled matrices
*.xyc
# endfloat
*.ttt
*.fff
# Latexian
TSWLatexianTemp*
## Editors:
# WinEdt
*.bak
*.sav
# Texpad
.texpadtmp
# LyX
*.lyx~
# Kile
*.backup
# KBibTeX
*~[0-9]*
# auto folder when using emacs and auctex
./auto/*
*.el
# expex forward references with \gathertags
*-tags.tex
# standalone packages
*.sta
### LaTeX Patch ###
# glossaries
*.glstex
**/build
# End of https://www.gitignore.io/api/latex
\usepackage{amssymb,amsmath}
\usepackage[table,dvipsnames]{xcolor}
\usepackage{xfrac,xspace}
\usepackage{graphicx}
\usepackage{tikz}
\usepackage{eurosym}
\usepackage[normalem]{ulem}
\usetikzlibrary{decorations,fit,arrows,automata,positioning,shapes,shapes.multipart,calc,matrix,backgrounds,shapes.gates.logic,shapes.gates.logic.US,circuits}
\tikzstyle{every node}=[initial text=]
\tikzstyle{final}=[double]
\tikzstyle{sync}=[draw=blue,thick]
\tikzstyle{seq}=[path picture={
\draw[->] ([xshift=#1, yshift=6pt]path picture bounding box.south)
-- ([xshift=#1, yshift=-7pt]path picture bounding box.south);}]
\colorlet{colorAttribute}{PineGreen!75!green!85!black}
\colorlet{colorCondition}{RedOrange}
\colorlet{colorTransition}{Blue}
\newcommand{\leaf}[1]{\ensuremath{\mathtt{#1}}\xspace}
\newcommand{\gate}[1]{\ensuremath{\mathtt{\MakeUppercase{#1}}}\xspace}
\newcommand{\gateAND}{\gate{and}}
\newcommand{\gateOR}{\gate{or}}
\newcommand{\gateCAND}{\gate{cand}}
\newcommand{\gateCOR}{\gate{cor}}
\newcommand{\gateSAND}{\gate{sand}}
\newcommand{\gateSOR}{\gate{sor}}
\newcommand{\gateSCAND}{\gate{scand}}
\newcommand{\gateSCOR}{\gate{scor}}
\newcommand{\initTime}[1]{\ensuremath{\mathit{init\_time}(#1)}}
\newcommand{\Time}[1]{\ensuremath{\mathit{time}(#1)}}
\renewcommand{\EUR}[1]{\euro\,{\ensuremath{\mathrm{#1}}}\xspace}
\def\ADT/{ADTree}
\def\EAMAS/{EAMAS}
\newcommand{\loc}{\ensuremath{l}}
\newcommand{\nok}{\ensuremath{\mathit{nok}}}
\newcommand{\ok}{\ensuremath{\mathit{ok}}}
\newcommand{\receive}{\ensuremath{?}}
\newcommand{\send}{\ensuremath{!}}
\newcommand{\styleSync}[1]{\textcolor{colorTransition}{\ensuremath{#1}}}
\newcommand{\casestudy}[1]{\textnormal{\small\textsf{\mdseries #1}}\xspace}
\newcommand{\csfs}{\casestudy{forestall}}
\newcommand{\csiot}{\casestudy{iot-dev}}
\newcommand{\csadmin}{\casestudy{gain-admin}}
\newcommand{\leafAgent}[4][(0,0)]{%
\node[state,initial] (l0) at #1 {$\loc_0$};
\node[state,right of=l0] (l1) {$\loc_1$};
\node[state,below of=l1, node distance=1cm] (l'1) {$\loc'_1$};
\draw (l0) -- node[above] (action) {$#2$} (l1);
\ifstrempty{#4}{}{
\node[above of=action,node distance=0.4cm,
text=colorAttribute] (time) {$#4$};
}
\ifstrempty{#3}{}{
\node[above of=time,node distance=0.4cm,
text=colorAttribute] (cost) {$#3$};
}
\draw[sync] (l1) to [loop right]
node[above,yshift=0.1cm] {$\styleSync{\send{}#2\_\ok}$} (l1);
\draw[sync] (l0) --
node[below,sloped] {$\styleSync{\send{}#2\_\nok}$} (l'1);
\draw[sync] (l'1) to [loop right]
node[below,yshift=-1.5mm,pos=0.5] {$\styleSync{\send{}#2\_\nok}$} (l'1);
}
\newcommand{\andAgent}[6][(0,0)]{%
\node[state,initial] (l0) at #1 {$\loc_0$};
\node[state,right of=l0] (l1) {$\loc_1$};
\node[state,right of=l1] (l2) {$\loc_2$};
\node[state,right of=l2] (l4) {$\loc_{#2}$};
\node[state,below of=l1] (l'1) {$\loc'_1$};
\draw[sync] (l0) --
node[above] {$\styleSync{\receive{}#3\_\ok}$} (l1);
\draw[sync] (l1) --
node[above] {$\styleSync{\receive{}#4\_\ok}$} (l2);
\draw (l2) -- node[above] (action) {$#2$} (l4);
\ifstrempty{#6}{}{
\node[above of=action,node distance=0.4cm,
text=colorAttribute] (time) {$#6$};
}
\ifstrempty{#5}{}{
\node[above of=time,node distance=0.4cm,
text=colorAttribute] (cost) {$#5$};
}
\draw[sync] (l4) to [loop right]
node[above,yshift=0.1cm] {$\styleSync{\send{}#2\_\ok}$} (l4);
\draw[sync] (l0) --
node[above,sloped] {$\styleSync{\receive{}#3\_\nok}$} (l'1);
\draw[sync] (l0) to [bend right=30]
node[above,sloped] {$\styleSync{\receive{}#4\_\nok}$} (l'1);
\draw[sync] (l'1) to [loop right]
node[below,yshift=-1.5mm,pos=0.5] {$\styleSync{\send{}#2\_\nok}$} (l'1);
}
\newcommand{\orAgent}[8][(0,0)]{%
\node[state,initial] (l0) at #1 {$\loc_0$};
\node[state,right of=l0] (l1) {$\loc_1$};
\node[state,right of=l1] (l2) {$\loc_{#2}$};
\node[state,below of=l1] (l'1) {$\loc'_1$};
\node[state,right of=l'1] (l'2) {$\loc'_2$};
\draw[sync] (l0) to [bend left]
node[above] (action1) {$\styleSync{\receive{}#3\_\ok}$} (l1);
\ifstrempty{#6}{}{
\node[above of=action1,node distance=0.4cm,
text=colorAttribute] (time1) {$#6$};
}
\ifstrempty{#5}{}{
\node[above of=time1,node distance=0.4cm,
text=colorAttribute] (cost1) {$#5$};
}
\draw[sync] (l0) to [bend right]
node[below] (action2) {$\styleSync{\receive{}#4\_\ok}$} (l1);
\ifstrempty{#8}{}{
\node[below of=action2,node distance=0.4cm,
text=colorAttribute] (time2) {$#8$};
}
\ifstrempty{#7}{}{
\node[below of=time2,node distance=0.4cm,
text=colorAttribute] (cost2) {$#7$};
}
\draw (l1) -- node[above] {$#2$} (l2);
\draw[sync] (l2) to [loop right]
node[above,yshift=0.1cm] {$\styleSync{\send{}#2\_\ok}$} (l2);
\draw[sync] (l0) to [bend right=30] node[below,sloped,very near end]
{$\styleSync{\hspace{-3.5em}\receive{}#3\_\nok}$} (l'1);
\draw[sync] (l'1) -- node[above]
{$\styleSync{\receive{}#4\_\nok}$} (l'2);
\draw[sync] (l'2) to [loop right]
node[below,yshift=-1.5mm,pos=0.5] {$\styleSync{\send{}#2\_\nok}$} (l'2);
}
\newcommand{\nandAgent}[7][(0,0)]{%
\node[state,initial] (l0) at #1 {$\loc_0$};
\node[state,right of=l0] (l1) {$\loc_1$};
\node[state,below of=l1] (l'1) {$\loc'_1$};
\node[state,right of=l1] (l2) {$\loc_2$};
\node[state,right of=l2] (lA) {$\loc_{#2}$};
\draw[sync] (l0) --
node[above] {$\styleSync{\receive{}#3\_\ok}$} (l1);
\draw[sync] (l1) --
node[above] {$\styleSync{\receive{}#4\_\nok}$} (l2);
\draw[sync] (l0) -- node[above,sloped]
{$\styleSync{\receive{}#3\_\nok}$} (l'1);
\draw[sync] (l0) to [bend right] node[below,sloped]
{$\styleSync{\receive{}#4\_\ok}$} (l'1);
\draw (l2) -- node[above] (action) {$#2$} (lA);
\ifstrempty{#5}{}{
\node[below of=action,node distance=0.8cm,
text=colorAttribute] (cost) {$#5$};
}
\ifstrempty{#6}{}{
\node[below of=cost,node distance=0.4cm,
text=colorAttribute] (time) {$#6$};
}
\ifstrempty{#7}{}{
\node[above of=action,node distance=0.4cm,
text=RedOrange] (condition) {$#7$};
}
\draw[sync] (lA) to [loop right]
node[above,yshift=0.1cm] {$\styleSync{\send{}#2\_\ok}$} (lA);
\draw[sync] (l'1) to [loop right]
node[below,yshift=-1.5mm,pos=0.5] {$\styleSync{\send{}#2\_\nok}$} (l'1);
}
\newcommand{\sandAgent}[6][(0,0)]{%
\node[state,initial] (l0) at #1 {$\loc_0$};
\node[state,right of=l0] (l1) {$\loc_1$};
\node[state,below of=l1,node distance=2cm] (l'1) {$\loc'_1$};
\node[state,right of=l1] (l2) {$\loc_2$};
\node[state,right of=l2] (lA) {$\loc_{#2}$};
\draw[sync] (l0) --
node[above] {$\styleSync{\receive{}#3\_\ok}$} (l1);
\draw[sync] (l1) --
node[above] {$\styleSync{\receive{}#4\_\ok}$} (l2);
\draw[sync] (l0) -- node[above,sloped]
{$\styleSync{\receive{}#3\_\nok}$} (l'1);
\draw[sync] (l1) to node[above,sloped]
{$\styleSync{\receive{}#4\_\nok}$} (l'1);
\draw (l2) -- node[above] (action) {$#2$} (lA);
\ifstrempty{#6}{}{
\node[above of=action,node distance=0.4cm,
text=colorAttribute] (time) {$#6$};
}
\ifstrempty{#5}{}{
\node[above of=time,node distance=0.4cm,
text=colorAttribute] (cost) {$#5$};
}
\draw[sync] (lA) to [loop right]
node[above,yshift=0.1cm] {$\styleSync{\send{}#2\_\ok}$} (lA);
\draw[sync] (l'1) to [loop right]
node[below,yshift=-1.5mm,pos=0.5] {$\styleSync{\send{}#2\_\nok}$} (l'1);
}
\documentclass[preview]{standalone}
\input{../base.tex}
\begin{document}
\begin{figure}
\begin{minipage}[c]{0.45\textwidth}%
% ADT
\centering
\scalebox{.75}{
\begin{tikzpicture}
[every node/.style={ultra thick,draw=red,minimum size=6mm},
node distance=1.5cm]
% Sequential And node (Compromise IOT device)
\node[and gate US,point up,logic gate inputs=nnn, seq=8pt] (CIoTD)
{\rotatebox{-90}{\gate{CIoTD}}};
% Exploit software vulnerability
\node[state, below = 3mm of CIoTD.west] (esv) {\leaf{esv}};
\draw (esv.north) -- (CIoTD.input 2);
% Run lalicious script
\node[state, right of = esv] (rms) {\leaf{rms}};
\draw (rms.north) -- ([yshift=0.15cm]rms.north) -| (CIoTD.input 3);
% Sequential NAnd node (Gain access to private network succesful)
\node[and gate US,point up,logic gate inputs=ni, seq=12pt,
above of = esv, xshift=-2mm] (GAPNS)
{\rotatebox{-90}{\gate{APNS}}};
\draw (GAPNS.east) -- ([yshift=0.15cm]GAPNS.east) -| (CIoTD.input 1);
% And node (Gain access to private network)
\node[and gate US,point up,logic gate inputs=nn,
left = 8mm of GAPNS.input 1,xshift=-4mm]
(GAPN) {\rotatebox{-90}{\gate{APN}}};
\draw (GAPN.east) -- ([yshift=0.15cm]GAPN.east) -| (GAPNS.input 1);
% Or Gate (Connect to private network)
\node[or gate US,point up,logic gate inputs=nn,
below = 1cm of GAPN.input 1,yshift=14mm] (CPN)
{\rotatebox{-90}{\gate{CPN}}};
\draw (CPN.east) -- ([yshift=0.15cm]CPN.east) -| (GAPN.input 1);
% Sequential And node (Access LAN)
\node[and gate US,point up,logic gate inputs=nn, seq=5pt,
below = 9mm of CPN.input 1, yshift=12mm] (AL)
{\rotatebox{-90}{\gate{AL}}};
\draw (AL.east) -- ([yshift=0.15cm]AL.east) -| (CPN.input 1);
% Find LAN port
\node[state, below = 4mm of AL.input 1, xshift=-8mm]
(flp) {\leaf{flp}};
\draw (flp.north) -- ([yshift=0.15cm]flp.north) -| (AL.input 1);
% Spoof MAC address
\node[state, below = 4mm of AL.input 2] (sma) {\leaf{sma}};
\draw (sma.north) -- ([yshift=0.15cm]sma.north) -| (AL.input 2);
% Sequential And node (Access WLAN)
\node[and gate US,point up,logic gate inputs=nn, seq=5pt,
below = 9mm of CPN.input 2, yshift=-4mm] (AW)
{\rotatebox{-90}{\gate{AW}}};
\draw (AW.east) -- ([yshift=0.15cm]AW.east) -| (CPN.input 2);
% Find WLAN
\node[state, below = 4mm of AW.input 1] (fw) {\leaf{fw}};
\draw (fw.north) -- ([yshift=0.15cm]fw.north) -| (AW.input 1);
% Break WPA keys
\node[state, below = 4mm of AW.input 2, xshift=8mm]
(bwk) {\leaf{bwk}};
\draw (bwk.north) -- ([yshift=0.15cm]bwk.north) -| (AW.input 2);
% NAnd node (Get valid credentials)
\node[and gate US,point up,logic gate inputs=ni,
below = 9mm of GAPN.input 2, yshift=-6mm]
(GVC) {\rotatebox{-90}{\gate{GVC}}};
\draw (GVC.east) -- ([yshift=0.15cm]GVC.east) -| (GAPN.input 2);
% Get credentials
\node[state, below = 4mm of GVC.input 1] (gc) {\leaf{gc}};
\draw (gc.north) -- ([yshift=0.15cm]gc.north) -| (GVC.input 1);
% defence node (tow-level authentication)
\node[rectangle,draw=Green,minimum size=8mm,
below = 4mm of GVC.west, xshift=10mm]
(tla) {\leaf{tla}};
\draw (tla.north) -- ([yshift=0.15cm]tla.north) -| (GVC.input 2);
% defence node (Inform new connections)
\node[rectangle,draw=Green,minimum size=8mm,
below = 4mm of GAPNS.west, xshift=10mm]
(inc) {\leaf{inc}};
\draw (inc.north) -- ([yshift=0.15cm]inc.north) -| (GAPNS.input 2);
\end{tikzpicture}
}
\end{minipage}
\begin{minipage}[c]{0.55\textwidth}%
\centering
% information
\scalebox{.75}{\parbox{\linewidth}{%
\begin{tabular}{l@{$\,:\;$}l@{~}l@{~}r}
\multicolumn{2}{l}{\textbf{Name}} & \textbf{Cost} & \textbf{Time} \\
\hline
\gate{CIoTD} & compromise IoT device & \EUR{0} & 0~h \\
\gate{APNS} & access private net.\ succ. & \EUR{0} & 1~m \\
\gate{APN} & access private net. & \EUR{0} & 3~m \\
\gate{GVC} & get valid credentials & \EUR{0} & 0~h \\
\gate{CPN} & connect to private net. & \EUR{0} & 0~h \\
\gate{AW} & access WLAN & \EUR{0} & 0~h \\
\gate{AL} & access LAN & \EUR{0} & 0~h \\
\leaf{rms} & run malicious script & \EUR{100} & 30~m \\
\leaf{esv} & exploit soft.\ vulnerab. & \EUR{10} & 1~h \\
\leaf{inc} & inform of new connect. & \EUR{5} & 1~m \\
\leaf{tla} & two-level authentic. & \EUR{5} & 1~m \\
\leaf{gc} & get credentials & \EUR{100} & 10~h \\
\leaf{bwk} & break WPA keys & \EUR{100} & 2~h \\
\leaf{fw} & find WLAN & \EUR{10} & 5~h \\
\leaf{sma} & spoof MAC address & \EUR{50} & 30~m \\
\leaf{flp} & find LAN port & \EUR{10} & 1~h \\
\end{tabular}
}}
\end{minipage}
\end{figure}
\end{document}
\documentclass[preview]{standalone}
\input{../base.tex}
\begin{document}
\begin{figure}
\begin{minipage}[c]{0.4\textwidth}%
% ADT
\centering
\scalebox{.75}{
\begin{tikzpicture}
[every node/.style={ultra thick,draw=red,minimum size=6mm}]
% Counter defence (Vol du trésor effectué)
\node[and gate US,point up,logic gate inputs=ni] (ca)
{\rotatebox{-90}{\gate{TS}}};
% defense node (police)
\node[rectangle,draw=Green,minimum size=8mm, below = 5mm of ca.west, xshift=10mm] (d) {\leaf{p}};