-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rewrite intro + methodology, more detailed sections, improve template
- Loading branch information
Showing
34 changed files
with
253 additions
and
129 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
% CONTRACTS | ||
\newcommand{\urlcontractfakeweth}{https://polygonscan.com/address/0x15391A813d255e76de9b6b6d60df75c73f91121a} | ||
% CODE | ||
\newcommand{\urlcodesmartbugs}{https://github.com/smartbugs/smartbugs} | ||
\newcommand{\urlcodehoneybadger}{https://github.com/christoftorres/HoneyBadger} | ||
% IMAGES | ||
\newcommand{\urldiagrambytecode}{https://gists.rawgit.com/ajsantander/23c032ec7a722890feed94d93dff574a/raw/a453b28077e9669d5b51f2dc6d93b539a76834b8/BasicToken.svg} | ||
% VIDEOS | ||
\newcommand{\urlvideohackertraps}{https://www.youtube.com/watch?v=4bSQWoy5a_k} | ||
\newcommand{\urlvideomasqueradingcode}{https://www.youtube.com/watch?v=l1wjRy2BYPg} | ||
% CHANGELOGS | ||
\newcommand{\urlchangelogsoliditybugs}{https://github.com/ethereum/solidity/blob/develop/docs/bugs.json} | ||
% STANDARDS | ||
\newcommand{\urlstandardeipproxy}{https://eips.ethereum.org/EIPS/eip-1967} | ||
% ARTICLES | ||
\newcommand{\urlarticleredpill}{https://zengo.com/zengo-uncovers-security-vulnerabilities-in-popular-web3-transaction-simulation-solutions-the-red-pill-attack/} | ||
\newcommand{\urlarticledeconstructingcontract}{https://blog.openzeppelin.com/deconstructing-a-solidity-contract-part-i-introduction-832efd2d7737} | ||
% PAPERS | ||
\newcommand{\urlpaperartofthescam}{https://arxiv.org/pdf/1902.06976.pdf} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
In this section, we'll consider each the parts and processes of the detection tools. | ||
This serves both the purpose of imagining how they can fail as well as designing the next tools. | ||
\setpartintro{We'll transpose the traditional malware analysis to the smart contracts.\\ | ||
This serves both the purpose of designing detection tools as anticipating their failure, e.g. the avenues for evasion.} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
When a transaction is committed to the blockchain, the targeted smart contract is executed. | ||
This process generates trace data. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
\section{Metadata} \label{sec:static-metadata} | ||
|
||
\subsection{Transaction Sender} | ||
|
||
the global variables \lstinline[language=Solidity]{block}, \lstinline[language=Solidity]{tx} and \lstinline[language=Solidity]{msg} hold valuable informations | ||
|
||
\subsection{Transaction Metadata} | ||
|
||
\subsection{Events (Topics)} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
\section{Execution Traces} \label{sec:dynamic-traces} | ||
|
||
Execution traces can be obtained either by replaying locally a transaction or by querying a RPC node with tracing enabled. | ||
|
||
\subsection{State Changes} | ||
|
||
storage slots | ||
|
||
balance may change | ||
|
||
\subsection{External Function Calls} | ||
|
||
identify if the contract interacts with other contracts or addresses | ||
|
||
\subsection{Internal Function Calls} | ||
|
||
this can be insightful in determining the contract's behavior |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
Zooming out from the perspective of a single smart contract, the blockchain can be considered as a whole. | ||
This is a mix of the static data over all addresses and the dynamic data generated over time and addresses. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
\section{Graph Theory} \label{sec:hybrid-graph} | ||
|
||
The blockchain archive can be seen as a temporal graph. | ||
While the exact structure can vary depending on the application, generally the nodes are the addresses and the vertices are transactions. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
\section{Statistics} \label{sec:hybrid-stats} | ||
|
||
the activity of a single address over time can be broken-down with statistics |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
\section{Code} \label{sec:static-code} | ||
|
||
\subsection{Bytecode} | ||
|
||
Similarly to the traditional binaries, smart contracts are compiled into bytecode which can be parsed: headers | ||
|
||
\subsection{Opcode Sequence} | ||
|
||
Bytecode can be interpreted as a language, giving a level of abstraction to the analysis. | ||
|
||
\subsection{Function Signatures} | ||
|
||
More specifically, functions can be extracted and compared to the reference implementations of the standards for example | ||
|
||
\subsection{Source code} | ||
|
||
When available, this layer can hold deceptive measures for the human reader; hence, it is very informative + creation code (not in bytecode) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
The data available for analysis depends on the execution stage. | ||
For smart contracts, there are three main contexts. | ||
|
||
Outside of execution, the blockchain acts as a cold storage. | ||
In this first context, the detection methods are called "static analysis". |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
\section{Metadata} \label{sec:static-metadata} | ||
|
||
\subsection{Contract's creator} | ||
|
||
\subsection{Transaction Metadata} | ||
|
||
Details like the contract's creator, the balance, the creation timestamp and associated Ether provide a context to the whole analysis |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
Having looked over all the sources of data available, many techniques for detection and evasion emerged. | ||
By analogy with the malware space, these techniques can be sorted as follows. |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
\setpartintro{} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Poisoning techniques hijack legitimate contracts to take advantage of their authority and appear trustworthy. |
19 changes: 19 additions & 0 deletions
19
report/sections/evasion/foreseen/poisoning/living-off-the-land.tex
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
\section{Living Off The Land} | ||
|
||
\subsection{Overview} | ||
|
||
Living off the land means surviving on what you can forage, hunt, or grow in nature. | ||
For malware, it means using | ||
|
||
- callbacks (flashloans) | ||
- special contract | ||
|
||
\subsection{Evasion Targets} | ||
|
||
Pattern matching on the bytecode. | ||
|
||
\subsection{Samples} | ||
|
||
\subsubsection{Executing Raw Bytecode} | ||
|
||
\subsection{Detection \& Countermeasures} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
\section{Sybils} \label{sec:sybils} | ||
|
||
\subsection{Overview} | ||
|
||
Much like social networks, the blockchain is made of interconnected users. | ||
Their activity in and out of the blockchain gives weight to a project. | ||
|
||
So scammers could: | ||
- creates bots and enroll people to build a legitimate history on their contracts. | ||
- create a legitimitae service to hijack it later | ||
|
||
\subsection{Evasion Targets} | ||
|
||
\subsection{Samples} | ||
|
||
\subsection{Detection \& Countermeasures} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
\setpartintro{} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.