Okay, so good morning and thank you for coming to, taking your time to come and see us today. My name is Rod Soto and I am here with Victor Phan from Radiant Chain. I'm a security researcher. I co-founded Hack Miami and the Pacific Hackers on the West Coast. Some of the companies I work for, Akamai, Canon, Toshiba, Splunk, and one that is quite related to the crypto scene, Prolexic. I was actually part of the team that protected Mt. Goth. Remember Mt. Goth? They were a pain in the ass. If you actually go on Twitter, you'll see how they would tweet like, we're down because of Prolexic. Like, they weren't an easy client and we don't know what happened afterwards. But I come from the crypto, like 2009, 2010, we were actually buying whoppers for 20 bitcoins. So what we're going to talk today is about smart security, smart contract security. And I'm just going to go quick on an introduction on some of the blockchain security aspects, which obviously this is what this village is. This is an effort to bring security into the blockchain scene. And it's a good effort. Do you want to... Just a quick intro of myself. I am Victor Fang. So I used to work at FireMendian and the company I founded last year. Oh, who's from Mendian? Oh, cool. Hey, we should talk. Okay. And by the way, that's my face, as you realize. And so we graduated from the UC Berkeley, the Blockchain Accelerator. And yeah, it's very proud to be here presenting, sharing some of our research. All right. So we're a little short, so I may go a little faster than this. Some background on the blockchain, basically implemented around, effectively implemented around 2008, believed to be immutable, public ledger. It's like a DV technology that you can check, it's exposed, it's public. Full tolerant for the most part. It has been popularized by cryptocurrencies. There are some interesting implementations right now on financial video games, web video content, social media. And some countries are actually doing it in agriculture. The most successful of all the cryptocurrencies, and you can check it right now, is obviously VTC. It was close to 12,000 yesterday. And according to John McAfee, we hit 500,000. I hope he's right, at least on that. I know John, by the way. Obviously, we have a development of blockchain frameworks. And I would say the second most popular is Ethereum, and it's highly traded. And with Ethereum, the concept of a smart contract was introduced. So what is a smart contract? A smart contract is basically a framework that facilitates negotiation without the need of third parties. So what this does is aims to reduce transaction costs and enforces the contract under the blockchain framework. The transactions are trackable and irreversible. And I put that in quotation marks because we're going to see some sort of an example of how this irreversible, sort of like a flexible term, has been implemented in several cryptocurrencies, including blockchain and Ethereum. The most popular standard right now is ERC20. So at one point, you saw a bunch of people selling you the framework to create a new cryptocurrency. Basically what it is, they copy the Ethereum blockchain, use ERC20, and then they'll sell it to you for $250,000. So you just had to name a new currency. As we all know, at this point, smart contracts can be exploited. So we had BAO, that was $3.6 million of either. And the amount of losses was so huge that it was basically easier to hard fork, continue with that. So that's an example of how smart contracts can be hacked. And today, you're going to see actual examples of how that happens and how to audit smart contracts. They are a powerful tool. And in my opinion, the smart contract is the bridge that can enable blockchain to widespread in many other areas. I think it's important to see blockchain, it's just not only crypto. Crypto has driven it. But there are other areas that we can definitely implement this and doesn't have to scare the banks and the powers that be, which is usually my opinion why crypto has been held back. And among other reasons, but basically, things such as the smart contracts and several new standards will help to advance the cost of implementing blockchain technologies. And we can use smart contracts for, like I said before, we can use it for records, supply chain, digital identities, mortgage, insurance. So here's one of the main problems of the blockchain scene, right? So which is the hacking history is displayed with fraud, fraudsters, and people that, for some reason, can explain mysterious hacks. So we have some of the relevant hacks here, the Mt. Gox one. Again, I had experience with Mt. Gox, because we protected Mt. Gox. And Mt. Gox was basically a trading site for cards. And then they turn it into a cryptocurrency exchange. And they will get hit all the time with DDoS, all the time. So in case you wonder if we knew how the Bitcoins were lost, we didn't. Because we were only protecting the actual perimeter. So basically, they will get a lot of UDP floods, or TCP floods, or even Layer 7 attacks. So basically, we protected their perimeter. They lost 750 BTC. Then we had the DAO, which I just talked about. It's around $50 million in Ether. Then we had a coin check hack in 2018, $130 million. And then we have some of the exchanges that were compromised around the world, $1.5 billion in losses. So here's a number that I want you to see before you see this number. It's 2019, you have compromises at Binance, Cryptopia, DragonX, GateHub, BitDom and CoinMana. And here's a number that is very shocking. Around $1,800 in average were stolen per minute in 2018. If that is not enough to drive a security industry within the blockchain, I don't know what else it is. Right? So that was the average, $1,800 per minute stolen in cryptocurrency. So before I switch it to Victor, one of our messages is we had to come up with security standards. Openness and exposure does not mean security. The fact that you can see it and it's out there somehow. And I remember this from the beginning, from 2009, 2010. We believe that basically by having the ledger exposed and seeing what everybody was doing and then protecting the identities by just looking at anonymized addresses was going to be enough. And we had this libertarian dream of eliminating fiat and self-regulating by basically being open and transparent. We now know that's not possible. I mean, if that number doesn't prove it, I don't know what else. It's hard to balance at times, basically, the anonymity with the transaction levels. So at one point there will be a regulation. I know many people would not like to hear that, yes, we had to come up with standards and eventually regulation. And then sometimes when we put all our X into one basket, we just saw an example, a major exchange was attacked and breached. They got in. Hopefully nothing else happened. But my coins are there. So I'm looking at this and I'm thinking, oh, wait, my coins are there. If they got to my wallet, that's it. So when we put our stuff at one exchange, then this is sort of like a single point of attack. And one of the points that Victor's going to touch on, how these attacks have affected a majority of sites, including exchanges. And of course, the cryptocurrency, because of the regulated environment and the level of anonymity is solved by organized crime in Asian states. So I'm not sure if you heard about the whole wave of ransomware that's happening, at least in Florida. I mean, one city is OK, two cities, three cities, four cities. I mean, at one point you had to wonder, are they targeting all the schools, all these municipalities, low budget, outdated systems? And then where is the payment being sought? It's cryptocurrency. It's hard. Then they go and launder it. And that's another point that he's going to touch on. Smart contracts with flaws are immutable. And once they're deployed in the blockchain, well, the immutability helps the exploitability. And that's one of the things that he's going to touch on today. So again, before I pass it to Victor, we need to come up with some Infosec standards, just like we apply. We have PCI, we have SOX, many of all these standards. A compliance is sometimes not worth much, but at least it's an attempt to get somewhere instead of just thinking, no, this by itself will regulate. So here's something that may happen to you. So we have some adult site that got spanked. And I bring this up because they didn't audit the smart contract and they lost almost $40,000 in one day. So with that, I'm going to bring it to Victor. Thank you. Thank you. And yeah, right before this talk, I had a chance to talk to two very smart gentlemen, also from San Francisco, me and Phil. I asked them, have you heard about blockchain APD? They said, what? There's an APD on blockchain? I'm very proud to be here sharing something new today. So, and this is the original title was how to pound smart contract and make $4 million in weeks. To give a feeling, how much money is it? That's about $4 million. But we're not talking about cash, okay? We're talking about exeriums. It's also like a silver of the cryptos, okay? And this is the latest MIT tech review article on blockchain security. The title is sort of sad, right? Once held as unhackable, blockchains are now getting hacked, right? And it's very proud that our company HAI was mentioned three times. And so APD, how many of you heard about APD? That's great. Right place, guys. And just a little bit warning, I have some source code here and the slides. So for those of you who like smart contract or JavaScript, there's a puzzle there for you, okay? So what's APD, right? It's basically the worst nightmare of cybersecurity and the definition, stealthy and continuous computer hacking process orchestrated by person targeting a specific entities, okay? And I'm very proud that we work as part of the team that are mainly fine, mainly who are defining all these APD groups. And I will also contribute some of the research, how to use machine learning to actually detect those, like PowerShell in APD32. Okay, let's talk about the target, okay? How many of you heard about FOMO3D? Okay, what does FOMO mean? Fear of missing out. Fear of missing out, exactly. So you guys are not missing out today. I'm talking about something serious. This guy's $10 million worth of crypto assets sitting there, it's a website, it looks funny, but the money is real, okay? How do you play this? It's basically like a Ponzi scheme game, but people just play it, okay? And the nice thing about it is, okay, this Ponzi scheme game is actually a piece of code executed on the blockchain, so there's no centralized governance and all that, okay? Everything is mandated by a piece of code, 2,000 lines only, okay? And how you play, right? So you buy the key, and by the way, there's a screenshot of how I participate in this, you buy a key there, so the last guy who bought the key, when the clock hits zero, he will win the jackpot, which is usually millions of dollars, worth of Ethereum, okay? And the developers, right, the very smart developers at FOMO3D, right, they actually, to increase the interactivity, right, they add a little lottery mechanism. Whenever you participate, you buy a key, you have a small chance of winning a lottery, otherwise, this game, if you think about it, right, just simulate it, when the clock goes to zero, what's going to happen? When the clock almost hits zero, what's going to happen? Yeah, exactly, right, so this game should never stop, right, theoretically, right, if it operates right, but, well, it actually stopped, so, but that's not something we're going to talk about. I'm going to talk about how the blockchain APT hacker group would identify, actually, how they exploit that lottery bug. Okay, here's a piece of code. So, actually, yeah, it's pretty hard to see, so there's really, like, the first section of the code, okay, and it's actually a function called isHuman. What does that do? Why do you put this human function in a smart contract? Yeah, make sure it's a human interacting that. Unfortunately, it's written by human, a bug, and then that can lead to the second, which is that airdrop, a random airdrop, and it says, do we have a winner in the comment? And what does that function do? Generating a random number, right, and that's the piece of code, and again, it's all transparent. It's sitting there on the blockchain, right there, and how much time would it take to run all those whole bunch of addition hashes on your computer? Take a guess. What? How many milliseconds? Usually, like, 15 milliseconds or so, right? But for those of you, it's Xenium, right? How long does it take to set our transaction? Usually, like, 10 seconds and stuff like that. So keep that numbers in mind, okay? So if you are going to exploit stuff like this, what you can do, right? Yeah, hold it. I think you got the answer already. But now, yeah, again, $10 million on this 2,000 lines of code. Okay, so based on our research, right, we actually kind of detected the lucky hackers, okay? They only contributed to, like, half of the only 10% of the transactions, okay? But this guy took half of the entire airdrop pool. Super lucky, right? Yeah, this should actually be here in casinos. And if you look deeper, right, into the exact transaction, that's another nice thing that Rob mentioned about, right? All the transaction, no matter good or bad, right, is recorded in the ledger on the public blockchain. And this is the exact transaction, one of the many, right? And yeah, just look at, I mean, it's kind of, there's a lot of, like, sub-function calls, smart contract calls out there. But really, this function, right, this transaction recorded, like, 0.1 is in, and how much they get out of it? 0.19, right? So they get, they make 90% of ROI, okay? And this is, again, one of the many transactions they're doing, okay? And just to demystify, right? So actually using our engines and all that, right? So the target is on the top, okay? That $10 million asset sitting right there, big target, everybody can see it. And the guy, there's a little guy down there, we call it a captain. I want to showcase why we call it a captain. And then in the middle of them, right, there's about, like, 50,000 smart contracts or addresses that are interacting with that guy. Okay, just think, remember the code I just showed you? What's the problem with this? If you see a graph like that, what's the problem? Connected to the source code I just showed you. You remember the first function, right? Yeah, I'm sorry. All bots, yes. So that actually means that his human function was bypassed, totally. And that's why this guy can launch a huge campaign of bots to actually interact with that. And each of them gonna win, okay? Because what this guy ended up doing is, they took that piece of code, right, that random number generator, it's transparent there, they simulate it in their smart contract, and they only play with this poor little target up there when they are going to win, when they know they're going to win. That's why they're always hitting, like, 90% profits, right? And when we look at it, like, last August, right, this guy already made, like, $150,000 sitting there in their wallet. And, yeah, and advanced persistence threat, right, in terms of advance, what happened to this guy when they run the transaction? Self-destruct. So they don't leave any bytecode on the blockchain. So, but the transaction will still be there. But the bytecode that they use to attack that smart contract is removed, self-destruct. And why is that? Why do you do that? You don't want to share your profit with some other hackers, right? And, yeah, and so this is what led to our, like, definition of blockchain APT, right? So it's basically a very similar tactics and all that, right? So very similar to what Mendian has been defining, right? The only difference is now this whole attack hacker group actually is running on decentralized world, which is actually, in our mind, is actually harder to defend than even cloud security. This whole thing, you don't even know where, which miner, in which country is running that smart contract bytecode to verify and then reach the consensus. And to give you the full visual, right, this is all the millions of addresses being interacting with that little guy sitting there, the $10 million target. And to prove that we actually know this, some of the address, we have highlighted some of the address, and this guy sitting in the middle, right, is the target and the captain and all that sitting there, that actually only converged to five addresses, wallets, the real wallets. But this guy launched hundreds of thousands of smart contracts to drain money from the pool. Is that the end? Of course not. We actually found there's very funny app in China that is actually a copycat of Formos 3D. And it runs on Android, by the way. And see the pool they're showing is like, what, 100,000 externum? That's a lot of money. And this guy actually ranked the top five, the app, in the externum last summer. And this guy also has $9 million of jackpot pool, right? And yeah, when we look at it, right, it's actually like very similar byte codes. And including the bugs, they just copy everything from the Formos 3D. The only thing that probably changed is the dividend, the account that received the dividends, the developers account. That's probably the only thing that changed, right? You don't want to send money to the Formos 3D team. You want to take the money, right? But they just take everything because Formos 3D is basically open source. It's on GitHub, right? And yeah, so it doesn't, the hackers never sleep, especially in the blockchain world. And so the Qt chain, let's talk, let's dig a little bit deeper into what's going on here, right? So to recap, I mean, some of you may have already taken the Mendian training or whatever, APT training, right? This is the attack life cycle, right? Usually initial compromise, establish full hold and prevarious escalation, right? Internal recon, complete them and then move laterally, right? And then maintain presence until they hit the jackpot, complete the mission. And just to highlight a little bit, right? Most of the APT, what's the goal of most of the APT attack? Is to? Yeah, no, that's it. All hackers want to do that. But what exactly is that? What was the step before that? Probably steal data, right? Steal data, right? Breaches. That's like why these guys are so patient, right? The average time that they can stay in the enterprise without detecting is like, what, 200 days? Yeah, what's the latest number? We have a Mendian guy on the audience. Is that 150 days now? The rest during the days? Have you read the latest M-chain report? All right, let me send a copy to you. So anyways, so but this blockchain ABD Q-chain, right? It's actually a very similar kind of Q-chain, right? So similar steps. The only difference is the actual tactics, right? Now, again, right? You are not targeting the enterprise. You are not targeting a cloud security vendor, right? You are targeting something that is a clear target sitting there in the decentralized blockchain, right? So usually they do a recon using like Web3, the Web3.js, right? To kind of scan what's going on there, right? And then when they found the vulnerability, right? This actually, we have the entire life cycle of that, those, that captains and those few accounts, right? So actually, they're super hardworking. They actually have been doing like days and nights and trying to exploit that smart contract, right? And then when they found a bug, found a vulnerability like that one, it's a random number generator problem, right? And then there's a is human function can be bypassed, right? When they figure out those, they start building weaponized smart contract that can interact with it, right? And then they're actually like that smart contract I told you, that transaction, actually that transaction interact with 10 other smart contracts, right? Like a vault and all that, right? And then they start probing, right? What are the interacting smart contract, right? And then they try to exploit those. It's actually quite easy to find a vault, right? There's a vault taking money in, right? Of course, you don't want to put your hot wallet or the dApp smart contract storing that much money. You probably want to move money into the vault, right? And then, yeah, and then when they found it, right, they're going to launch those automatic bug armies, right? To kind of drain money in an automatic way, not like by a human running the script, right? And at the end, like we just showed you, this guy actually made $2 million from the foremost 3D. And then they make another $2 million from the copycat. Let's keep going. This guy make a few million dollars from each of those smart contracts. And that's actually, they sold the persistencies of this APD hacker group, right? That smart contract launched in July last year, okay? And what's the first box about? There's three red boxes there. What's the first box about? The recon, exactly. Yeah, he's listening. That's great. I'll give you a sticker. And what happened in the middle? Yeah, he found it, man. He found it, and then now he weaponized all the bug armies and launched like 100,000 smart contracts to actually hack it. And that's probably one of the reasons that why the entire Xenium was jammed, okay? This guy paid a lot of money, but they make a lot more profit out of it. And then why did they stop? Why did they stop at the end? What? Because the money is gone, they drain it. It's gone, right? And to kind of like summarize a little bit, right? So yeah, I mean, really, this is a very tough game in the blockchain. Blockchain security is opening up a new dimension of complexity, right? So in our mind, right, three internal themes for this emerging blockchain security industry. First one is the transaction, right? How we dig into all this massive number of transactions? How do we identify those suspicious accounts? How do we find out the tactics? How do they attack the smart contract and all that, right? Based on the transaction sitting on the ledger. Another angle is the cold security, right? So you're putting that piece of smart contract, which is a piece of like a source code, a JavaScript like kind of source code, like Ethereum. And yeah, but that one is actually operating on a totally open and transparent platform, right? And if you have a vulnerability in that smart contract, I just told you what's the consequence, right? And each of those are representation of crypto assets. They're money in those, right? They're not like a dump of a database in the hospitals and all that, right? So those you're dealing with directly currencies, okay? And the next one is infrastructure security. The blockchain right now, like Bitcoin, how old is Bitcoin? How old? 10 years, exactly. How old is Ethereum? Only four years, right? And it takes the internet, right? About 20 or 30 years to evolve, to get to the maturity that we're seeing today. But again, you're still seeing this entire cybersecurity industry, right? So the hacker never stop innovating, right? And so in terms of the blockchain, infrastructure is still very early, right? So there's a lot of opportunities there that we can put our talents into this field, right? To make it grow and make it more secure. And yeah, some of our latest research, right? We feel like we need more transparency into all these different blockchain ecosystem. Now we have those Bitcoin, Ethereum, EOS, Trunks and all that, but like this research you just published in Coindesk, right? Actually, half of the EOS accounts are actually run, operated by bots. And they look like this, okay? Could that be a human? No, right? And there's economics reasons behind those, right? And yeah, so I mean, we are publishing a book, right? So we're in the process of publishing a book on the blockchain apps. I'm contributing a chapter on smart contract security and best practice, right? So we are talking to the publisher house, right? We want to make this chapter, at least this chapter, free on our website. So yeah, so follow our Twitter. It's going to go out this year, right? So yeah, to get your free copy of the chapter and we're hiring. So yeah, that's the end of the show and questions. Yeah, go ahead. When do they know when they win? When they receive their money, they know they win. Simple. And it's money. It's not a piece of data that you have to spend more effort on dark web to sell it. You are getting the crypto. Yeah, go ahead. So I had a question regarding the attack. I'm guessing that the attack is not based on, it's based on the lottery part as well, right? And this is only one of them. Yes, but there's another one targeting on the jackpot. That's another research. But this one we're talking about is... The only airdrop, yeah, the lottery, exactly. Is that the part of the game where it's like, so there's two parts of the game. The first part is that if you're the last person standing, you get the jackpot, but there's also this other lottery system where... Yeah, and this is the airdrop. The one we're talking about is the airdrop mechanism. So whenever you buy a ticket, you have a small chance. It's one out of 1,000 or less than that. Then you can win a small chance. You win a proportion of that. Like this guy was making 90%, right? But it varies. So that's the vulnerability this hacker group exploited. Oh, I see. So the fact that he basically took the random generated seed... Yes. And then calculated and made sure it was matching the same one as the same one. Exactly. And isn't this a smart idea? They only play with the casino when they know they're going to win. Will you do that here? I don't think you'll last long playing. You just keep playing. Yeah, you may be blacklisted if you do it here. Yeah. This is a quick one. So this seed that was part of that airdrop, was that something that was set by the XR contract? Yes. It's right here. It's right here. That 15 lines of code. That defines exactly how we will win the lottery. And that's why people love smart contracts. Because the house is open to you. It's transparent. All the policy, how they dispute their funds, is written in a smart contract. Isn't that amazing? It's totally transparent. Yeah, go ahead. It seems like this would have been easy to detect. There was nobody watching. It happened over the course of weeks. Actually, yes. But we're the first one detecting those. So you see that timeline that we find out. We actually start watching them when they start experimenting. It took them actually two weeks to figure out their vulnerabilities. About two weeks. So it was noticed. Why wasn't some action taken? Aha. That's what you talk about. In Xerion, there's literally no way. I mean, it's very hard to change your bytecode unless you do those upgradables and whatever, those fancy stuff. But that's exactly why people trust Xerion and those blockchains. Because that piece of code is your promise to the public, right? All your logic is recorded there. You're not supposed to change it. That's the immutability of the blockchain smart contract. But then there's a new version of it. You can actually upgrade the bytecode and all that. But actually that brings in a new attack surface, if you think about it. This problem comes. And that's why we feel like this field is fascinating. It's always evolving. Yeah? Yeah? Well, this is like a bigger problem in software engineering. Even off the blockchain, the code we write every day is inherently vulnerable. Like, our field is nascent, and we kind of suck at it. How do we... I mean, is there work in software engineering or in the application of blockchain to create proof systems or provably correct code? If we're going to do smart contract... Yeah, so actually, yeah, that's part of the mission we're doing. We have a free smart contract auditing sandbox out there that all developers can just go and submit their code there and run it. We're going to scan for about 30 vulnerabilities. That's already known, right? But your question actually touches a very good point of what's going on in this blockchain, emerging blockchain security, because literally, there's no standard, like you just mentioned, there's no standard. So right now, Nchain Air is actively participating in OWASP. So we're adding, we're helping the company defining the blockchain standards and all that, right? I mean, and this is going to be a community effort, right? We love this technology, it's totally transparent. We feel like this is going to be the future of all the software that you're going to like, like public facing kind of software, right? You have to put your source code and all that in a decentralized and totally trustable platform. But now we are suffering from those vulnerabilities. Some of them are in the source code they write, right? Because they don't have the right auditing code and like we have in this software industry, right? The other one is the infrastructure, right? It's super immature. Like one of the vulnerability we found last year in EOS blockchain was actually called the callback or the rollback vulnerability. That means if you know how the EOS supernodes are dealing with the transaction producing the blocks, you can actually exploit that to make sure your transaction won't be recorded in the blockchain. But they fixed it in December. They're very quick. They fixed it in two weeks. But I mean, that is kind of like a zero day for EOS blockchain, right? But yeah, it takes a community effort, right? And this is a very new field, right? It awaits a lot of standards and bodies and all that. And the good news is like, as you guys are following, right? Like JP Morgan Chase, right? They have those stable coins rolling out in February. Facebook Libra, they are launching a new blockchain, right? The Libra blockchain, right? So when these big guys from the internet industry or the banking, right, they come in, they're going to help this industry grow. But right now, it's like still very premature. That means a lot of opportunities, right? Yeah. Very quick point for you. There are companies that will do things like Ocam to do that. Yeah, question for you. You mentioned JPMC, you mentioned Facebook, whatever. One of the common features with them and everybody else running things that are not bullshit Ponzi scheme games on the internet is that they have trust structures, governance and off-chain components. So what do you see in leaping out to old-fashioned governance, key shares and backroom boards versus actually trying to solve this problem? Yeah, so really, his question is about what do we think about this emerging enterprise blockchain, right? Like the stuff I just talked about, JP Morgan Chase and Fidelity and Facebook, right? They are launching their chain. Most blockchain is probably falling to the private blockchain or the consortium blockchain. It's not totally open to everybody. Like the JPMorgan Chase blockchain, they're only open to the banks that interact with the inside the JPMorgan Chase banking ecosystem, right? So that's actually, if you think about it, isn't that like the intranet? Isn't it? 2000, right? Isn't that? But that's just our take, right? I mean, with that consortium blockchain, yeah, definitely it's more secure because you have a much smaller risk exposure than the stuff we're talking about here, right? But I mean, I feel like, yeah, I mean, eventually this should be an open system, right? So that's our take. I think about the intranet and internet, right? At the end, nobody's using intranet, right? Maybe only a few of you may remember the term, if you are as old as me, but yeah, that's what we believe. Any other questions? All right. Thank you very much. Thank you.