Slither is a Python-based static analysis tool developed by Trail of Bits that analyzes Ethereum smart contracts by compiling them into EVM bytecode and translating it to an intermediate representation (Slither IR) to detect security vulnerabilities such as arbitrary Ether sends, reentrancy attacks, and constructor-related issues; the tool provides detailed reports with line numbers, vulnerability severity levels (impact and confidence), and links to explanatory documentation, making it essential for smart contract security audits.
Ethereum Smart Contract Auditing with Slither: Solidity Security Analysis
Added:hi guys so today i would like to discuss about a slider it's a static analysis tool uh developed by uh three of bits it's uh one of the most famous one in addition to material that we already discussed pre in a previous video so my main goal today is really to show you that it's really basic and really simple to use i'll show you one or two examples and also to show you uh what you can do to learn more about solidity security in general just by analyzing this kind of tool and the kind of behavior that these two have so that's later it's the main developer of slitter is jocelyn that is actually one of my friends so i'm i'm really happy that he is able to provide this tool uh to the public there is really a lot that you can learn from it for the installation part as usual uh you you have all the sheets it directly on the link below but um that's uh the main part first one you install slitter it's written in python really simple to install pip3 install slider analyzer and that's all you you're good to go then we can use slider so there is multiple features that are really interesting the main goal the way it works it's static analysis tool so that's mean he will take your smart contract he will basically compile it using the solidity compiler he will in that case compile that into uh evm and in that case this evm by code will be translated to an intermediate representation that's the slit slide ir and then using this intermediate representation they will be able to detect some pattern that um are maybe weird or maybe specific and um really interesting in point of security so there is plenty of them uh it's working really well uh it's pretty fast as well you can even integrate that into github action so i really invite you to do that uh i mean it's it's definitely a go-to and then uh in terms of vulnerability and stuff that he will be able to detect there is plenty of detectors so uh we're gonna mention them right after so uh let's give it a try um one thing you the one thing you will need to do is maybe change the 3d compiler that you are using for that i invite you to use the sulci select tool so pip screen type select and then you can just install an old version of the solidity compiler and you can force the usage of this solidity compiler directly using this command line so in that case we are using an old one the for and then we're gonna run a slit slider sorry french accent we're gonna run slider directly on one of the examples that is provided so in that case we are launching that against uh reentrancy um on this specific version and it's real transient bin in dots so the file is right there let me show you so that's select also created by um so uh critic critique that is the blockchain related part of trade of bits and then we have um ranchonsi benin so as you can see there is multiple function implementing multiple kind of free entrances just to be able to detect multiple kind of pattern okay so we are running that and you will get something like that as you can see we have some warning perfectly fine and then we have multiple colors so what you can see right there is um slider actually detect um that it's possible to send some eth to an arbitrary user using a specific call so it will actually give you which which line which value can actually trigger that so in that case we are on line 32 so let's take a look at the 32 this one so that's this line of call of code address target call value so we are sending um money directly to this target and it seems that the target is not verified at all so that's why he's able to to tell you okay this function is actually sending money to a user without verifying the user okay so you can send that to an arbitrary user so of course i mean really bad you basically have no authorization needed to get some money out of the contract so pretty really bad there is plenty of other one uh against an eth to arbitrary user again and again then you have the yellow one where you have less critical venability some some written values that are not checked so some of them and then you have the green one so the green is a bit particular because um in my experience it will basically not just be low importance venability it could be also high importance vulnerability but it's always depending of the context so in that case you can see it detects some reentrancy and it will actually give you the external cores and so on but you will need to have some some particularities and you will need to verify that maybe it's it could be an external code that is legit so it it can be fine um you have plenty of them in that case reaction c ran francie again and again so as you can see we also have a bunch of details so that's something really interesting for us you have the exact name like the also the sequence of calls and functions that will be called so that's pretty pretty nice and you also have which state variable will be written after that so particularly useful also something that i found really nice is you have a bunch of link to an internal wikipedia of slider that will actually give you some extra information so in that case for example this function should be declared external and you have a reference and if you go on this link you will see that you will get a description of what is the issue what are the configurations that actually trigger this bug and or you can fix that like the recommendation and so on the wiki is actually uh enormous so let me show you that more in detail that was what i was looking for previously it's the detectors so you have a list of detectors that are particularly interesting you have the impact and the confidence the confidence will basically be can you get any false positive with that so if if it's a high confidence that means it's pretty sure this issue is happening and you have the impact so is it critical or not so as you can see i impact iconfinance are at the beginning and so on and so on until um like optimization informal and so on so you have a bunch of them you can see um i don't know multiple constructor name reused an initialized state arbitrary send so this kind of stuff are particularly interesting i think the one we triggered previously was um let me check this one was uh arbitrary send it h to arbitrary user so we have the reference functions that send ether to arbitrary user so we can click on the link and see a bit more in detail so we have the staff we have the description we have an exploit example so in that case it's possible to withdraw without being i mean you can set the destination so you can become the own the address that will be the destination the destination sorry and then you can withdraw to this destination so you basically have control of who gonna receive the the money you're gonna be able to take control of that so particularly interesting and so on so to be honest um it's so simple to use that you should absolutely use it and put that in your ci or at least give a try on some um on some other contract that's really something i'm inviting you to do also i really invite you to take a look at the wiki and basically maybe discover some kind of logic bugs that are not really easy to understand and to be honest you have plenty of examples and plasti plenty of stuff that can help you to to learn more about that so something i also want to show you to finish is that inside the testes um [Music] you have the detectors folder and inside this one you have a bunch of examples for almost all the textures that they have as you can see you also have like re reentrancy for let's say this version you also have some well-known smart contract that was vulnerable in the past so that's that's really nice um let's also show you that the guy from trail of bits are actually testing um this tool and trying to detect some real-life vulnerability so it's not just so theoretical stuff it's also some some real one so particularly uh particularly good just to to finish on that i also um if you remember my last video about fuzzing um a smart contract i was using this tiny missing.soul that is basically nulled i mean a smart contract that is vulnerable to the fact that there is no um a constructor so basically by calling i am missing it's basically similar to the vulnerability in um oh what was the name um well i i don't remember the the name um like dynamic pyramid and and so on um this kind of smart contract um rubik's e sorry so rubik's rubexy rubix i smart contract that was basically a copy past of a smart contract like that was named differently and basically the developer forgot to change the name of the constructor meaning that at the end you get this function i am missing that with actually was actually a constructor but it's not a constructor anymore since the smart contract is named missing meaning that this function if you call this function you will basically become the owner of the smart contract and then you you will be able to withdraw directly so that's the kind of basically smart contract uh that is uh really interesting and that's similar to to the venability we we saw so i will let you give a try to this one but yeah basically your goal will be to maybe try uh and and yeah try to to to find something with a slitter so i will let you give a try um this stuff can be fun using fuzzing and so on of course and i will let you check if you can detect that with a slider in that case so as usual if you want to get all the resources i'm providing you can directly unroll on this on my free uh training about introduction to uh security and you will get also access to all the other stuff like fuzzing with achina static analysis using material um also a tiny video not so tiny but or evm is working internally and what you can do in terms of reversing and disassembly of evm by code and so on so basically each time i got some new video i'm basically uploading that on on that so i hope you appreciate don't forget to like and subscribe and let me know what you would like to see in the next video thank you
Up Next

Smart Contract Auditing: A Practical Security Review Guide
@MuditGuptaBlockchain
20.7K views•2021-08-23

Torrent File Format & Bencoding: A Technical Deep Dive
@AsliEngineering
12.5K views•2022-08-08

Fuzzing Solidity Smart Contracts Using Foundry: A Practical Guide
@fuzzinglabs
4.7K views•2023-02-10

Understanding Ethereum: A Comprehensive Beginner's Overview
@99Bitcoins
3.1M views•2018-06-26
Related Study Plans & Knowledge Roadmaps
Structured learning paths in Blockchain & Crypto















![How to install Xcode tools on Mac OSX [SCREENCAST]](https://i.ytimg.com/vi/2I-jVqhSSS8/maxresdefault.jpg)












![(풀영상) 현장에서 듣는 의료기기 소프트웨어 테스트와 보안의 궁금증, 여기서 답하다! [소프트플로우]](https://i.ytimg.com/vi/Sbn_HfAE-vs/maxresdefault.jpg)














