Comments (4)
Many of the libraries break when using Windows. Can you try installing docker and using the docker container? I've never had issues when using Mythril with docker.
You can use:
docker pull mythril/myth
And for running a solidity file:
docker run -v $(pwd):/tmp mythril/myth analyze /tmp/contract.sol
You have to use the -v
arg to mount your current directory onto the container's \tmp
, so the container will have access to your current directory, which has the solidity file. Although I think the syntax for $(pwd)
is slightly different for different Windows shells.
I think its equivalent syntax for Powershell is this:
docker run -v ${PWD}:/tmp mythril/myth analyze /tmp/contract.sol
from mythril.
Actually I still find problems, I write a small contract named contract.sol in E:\codespace\smartcontract, when I use your listed commands in powershell, like
PS E:\CodeSpace\SmartContract> docker run -v ${PWD}:/tmp mythril/myth analyze /tmp/contract.sol
I got this error:
mythril.interfaces.cli [ERROR]: Solc experienced a fatal error.
Cannot import url ("/tmp/contract.sol"): File outside of allowed directories.
I also tried this command after reading the file structure:
docker run mythril/myth a /opt/mythril/solidity_examples
/calls.sol
got this error, seems that the tool can't get access to mount file or /opt sol files?
mythril.interfaces.cli [ERROR]: Solc experienced a fatal error.
Cannot import url ("/opt/mythril/solidity_examples/calls.sol"): File outside of allowed directories.
from mythril.
PS E:\CodeSpace\SmartContract> docker run -v ${PWD}:/tmp mythril/myth analyze /tmp/contract.sol
can you check if the file contract.sol is in the current directory when you run this command?
from mythril.
Thanks for your reply. I ensured that the .sol file is in the current directory. This is the full log of the administrator powershell.
PS E:\CodeSpace\SmartContract> ls
Directory: E:\CodeSpace\SmartContract
Mode LastWriteTime Length Name
d----- 2023/7/25 11:12 ConFuzzius
d----- 2023/7/18 18:29 ContractFuzzer
d----- 2023/8/8 17:34 mythril
d----- 2023/7/19 19:07 smartbugs
-a---- 2023/8/8 17:30 9012 BECToken.sol
PS E:\CodeSpace\SmartContract> docker run -v ${PWD}:/tmp mythril/myth analyze /tmp/BECToken.sol
mythril.interfaces.cli [ERROR]: Solc experienced a fatal error.
Cannot import url ("/tmp/BECToken.sol"): File outside of allowed directories.
By the way, I found it works in my Ubuntu VM, but it will be more convenient if it can directly work on my windows, thanks.
PS E:\CodeSpace\SmartContract> docker run -v ${PWD}:/tmp mythril/myth analyze /tmp/contract.sol
can you check if the file contract.sol is in the current directory when you run this command?
from mythril.
Related Issues (20)
- rlp import error HOT 1
- Integer Vulnerabilities that Mythril can Detect but Fail to Detect HOT 4
- Docker run on file directory using Foundry fails with unclear errors HOT 5
- Overflow analysis not respecting types smaller than `uint256` HOT 1
- mythril install with last web3=6 HOT 2
- Can't run analysis using Docker on M1 Mac HOT 2
- `AttributeError: 'NoneType' object has no attribute 'get'` in `mythril/solidity/features.py` HOT 7
- An incorrect warning result
- Mythril analyze returning AttributeError HOT 2
- How to run custom plugin along with mythril? HOT 1
- Mythril cannot identify imported openzeppelin contracts in foundry project. HOT 5
- DeclarationError: Identifier already declared. HOT 8
- Does mythril have the following features HOT 4
- Mythril 0.24.4 raises an error on macOS HOT 2
- Inconsistency in the results of function seqeunce execution HOT 23
- Mythril is producing one liner success report without details. HOT 1
- External call does not change the storage of the callee contract.
- Solc experienced a fatal error while running myth on a Foundry-based project importing an OpenZeppelin library HOT 2
- Unchecked return value not flagged
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mythril.