https://github.com/trailofbits/manticore

sort by:
Revision Author Date Message Commit Date
e2b16d2 Added new asserts, reformatted comments 01 November 2018, 20:55:56 UTC
4b0f086 Update comment 01 November 2018, 18:07:34 UTC
195e9d4 Added unit test for unaligned mappings 01 November 2018, 14:02:58 UTC
cd9a0f8 Fixed the size passed to unmap 01 November 2018, 13:04:44 UTC
f2313ae Fixed the size passed to mmap and added comments 01 November 2018, 12:55:34 UTC
269d09a Allow file offsets not aligned on page size When mapping into memory uncommon ELF executables having their segments file offsets not aligned on the system page size, the call to mmap_function() will fail silently. It will actually return 0xffffffff, which isn't checked anywhere and will only be detected when trying to read/write/free the memory area. Because this ELF files triggering this issue are programmatically crafted from binaries into a proprietary format, it won't be happening for all other executables. But Manticore should support binaries as generic as possible. This commit allows mapping into memory files having offsets not aligned on the system page size by simply aligning the file offset when mmap'ing, and returning a pointer shifted from the necessary correction. When munmap'ing the memory, the address is aligned again to recovery the initial one given when mmap'ing. 31 October 2018, 19:13:23 UTC
4365bc0 Manticore 0.2.2 (#1229) * Bump version numbers, changelog skeleton * Initial changelog writeup * Add contributors * fix contributors * Updated `CHANGELOG.md` to reflect the new features in #1054 * Update `CHANGELOG.md` to reflect new feature from #1138 31 October 2018, 02:13:44 UTC
3a7857f Add RaceConditionDetector (#1138) * Add RaceCondition detector * Review fixes * Add RaceConditionDetector test * Fix codeclimate issue * RaceConditionDetector: fixes and 2nd test * Remove pc from detector testcases As it is not used in there and may change between solc versions * Fix codeclimate and tests * Cache is_in_function in RaceCondDetector * Better is_in_function cache for RaceCondDetector * Fix parser -> eth_flags 30 October 2018, 16:59:45 UTC
bd094dd Make account address provider more yellow (#1054) * DAO detector + bugfixes * The actual benchmark tests * The actual benchmark tests * CC * Experiment reporting the finding at a JUMPI * Fix taint. Detect returned overflowded data * DAO -> Reentrancy * DAO -> reentrancy, C -> Benchmark * DAO -> reentrancy, C -> Benchmark * Allow function names to have numbers * Fix contract names in benchmark * Fix contract names in benchmark * Move default plugin registration * Better regexp * Fix minimal_bytecode example * Fix Array Slice and test * add tests * correct other bug * implement bytesM * BROKEN partial progress * need bytearray here * rm cmt * add basic tests for bytesM and bytes symbolic * correct bytes symbolic test * Refactor, clean bytesM handling * Add initial symbolic 'bytes' handling * refactor tests * Unify symbolic/concrete bytes handling in bytesM/bytes * Rm import * Rm debug assert * cc * Visitor/migrate/simplify fixes to make the seth refactor pass * Fix concolic? * Fix concolic? * CC * bytesM fix * Fix address and caller concretization on symb tx * Fix/refactor symbolic address/caller concretization * Fix caller concretization * Fix expression visiting * Fix account policy refactor * Accept numbers in function names abitypes * Simplify installation instructions to recommend install manticore only for the current user * Simple recursive length prefix encoding implementation * Contracts created by other contracts have correct addresses (#966) * Increment caller's nonce on transaction * Handle more nonce incrementing edge cases * merge new master * merge * Workaround for a name collision in pysha3 * Removed duplicate code and improved error reporting * Fix a syntax error related to the use of `+=` * `create_address` -> `new_address` * Updated the rlp encoding library to support py3 unicode and byte strings * Remove sha3 workaround since it was fixed in pysha3 1.0.2 Also relevant: https://github.com/tiran/pysha3/issues/12 * Fix comment indentation * Added comments and fixed a bug related to py3 refactor * added doctests for RLP encoding * Simplify the nonce assignment * Simplify nonce increment * Simplify an isinstance * Simplify another isinstance * No more `long` in Python3 * Yellow paper "ish" account addresses * More support for Yellow paper "ish" addressing * Remove unnecessary whitespace * Temporary solution for human generated account nonce tracking * Use `EVMWorld` for nonce accounting instead of `EVMAccount` * No need for `_get_nonce` to be private anymore * Added a missing import that's also missing in master * Allow `create_account` to be called without `address` * Simplify `get_nonce` to avoid keeping all states in memory * Change an error type because it's not an EVM problem * Fix nonce incrementing semantics * Raise an error if a contract with a contract with a symbolic address creates another contract * Don't fail catestrophically if Manticore isn't run from the main thread * Fixes an issue (also extant in master) where local variables were being overwritten in a loop See https://github.com/trailofbits/manticore/pull/1054#pullrequestreview-161804134 * Switch to using Py3 f-Strings * Raise an error if a contract with a symbolic address tries to create another contract See https://github.com/trailofbits/manticore/pull/1054#pullrequestreview-161783324 * Syntax tweaks to satisfy Code Climate * Whitespace tweaks to satisfy Code Climate * Clean up nonce initialization and incrementing See https://github.com/trailofbits/manticore/pull/1054#discussion_r223547433 * Added missing object name * Fix address calculation in 'CREATE' transactions * Fix `pyevmasm` to version 0.1.0 until we update unit tests to match the new gas cost calculations in 0.1.1 * Add a unit test for RLP that delegates to the doctests in `utils/rlp.py` 30 October 2018, 15:24:34 UTC
b1c7f10 don't show misleading msg if state count is 0 (#1228) 30 October 2018, 13:08:07 UTC
4340322 Fix warning logic (#1227) 30 October 2018, 09:51:07 UTC
4005bfc Improve exceptions and errors (#1218) * Fix vague EthereumErrors * errors * Revert some changes 29 October 2018, 09:00:51 UTC
a7bf228 Fix all ResourceWarnings triggered by the test suite (#1224) * Prevent ResourceWarnings in Z3Solver._stop_proc * Wrap temporary uses of open in with statement * Close program file in platforms.linux.Linux destructor * Close files opened in tests This commit also ensures that the tempdir created in _create_openat_state in test_linux.py is deleted at the end of the test. * Fix binary file open modes * Enable ResourceWarnings in Travis build * Fix codeclimate issue: bad indent * Suppress harmless ResourceWarning emitted during the initial abitypes parser table generation 26 October 2018, 23:18:48 UTC
de81323 Add AbandonState Exception (Fixes #1222) (#1226) * add AbandonState exception class * check instanceof exception when state is terminating 26 October 2018, 23:17:37 UTC
815c33c Revert "Add AbandonState exception" (#1225) * Revert "Add AbandonState exception (#1222)" This reverts commit cd0a91a0fc7583e0ca6210fbada775c49812b645. 26 October 2018, 20:49:51 UTC
22ab330 Fixes issue #170: Cannot control input size from cli (#1192) * add new argument for input_size and change function calls to include this argument * * Update - variable name to `stdin_size` - symbolic input size doc * default stdin_size global constant * Update __main__.py * Update __main__.py * update __init__.py to import STDIN_INPUT_DEFAULT_SIZE 26 October 2018, 19:09:02 UTC
cd0a91a Add AbandonState exception (#1222) * add AbandonState exception class * check instanceof exception when state is terminating 26 October 2018, 18:34:09 UTC
ae992ab Add convenience assertion & generate API (#1221) * add condition param * invert API, rename to only_if * Fully doc * return bool if testcase was generated * add a unit test 24 October 2018, 18:20:46 UTC
2a634b7 Eth updates (#1195) * Add offset param to interface for extract a uint of variable with * add leniency for g * Rename attr * other change * bugs * Automatically truncate sym vars that are too big This is opinionated. Users use m.make_symbolic_value() to pass symbolic arguments to contract functions. this creates a 256 bitvec by default. if they do this for an argument that is not 256 bits, an `address` for example, this would previously cause an AssertionError in ZEXTEND because we're trying to ZEXTEND down to a smaller size (160 bits). Manticore has all the information it needs to do the right thing here, and automatically truncate the symbolic variable, so this implements that. * Fix logic bug in _readBE * make padding default False because it's never used? * h tx * clean comment * clearer comment * fix bug, size should always be nbytes * move type forgiveness up to the serialize() level * fix logic bug - correctly loop * update callsites correctly * better err msg * fix * add tests for str args to ctor 24 October 2018, 05:58:28 UTC
75bbd8a Fix handling of overloaded functions and some other issues in SolidityMetadata (#1212) * Fix constructor and fallback function handling in Solidity metadata import Also adds a tuple length check to ABI._serialize_tuple. Fixes issue #1209. * Fix handling of overloaded functions and some other issues in SolidityMetadata Fixes issue #1210. This commit - rewrites SolidityMetadata.__init__ to fix the handling of overloaded functions, - separates the abi items for functions, events, constructor and fallback function into separate properties (though the event items are not yet publicly exposed), - removes the `abi` property, - removes the `add_function` method, - adds a decorator for deprecating functions, - deprecates the `functions` and `hashes` properties due to their problematic handling of the fallback function and adds `function_signatures` and `function_selectors` as replacements, - deprecates the `get_hash` method, which seems redundant in its current form, - adds static methods for constructing function and tuple type signatures that can handle ABIv2 tuple arguments, - adds the `constructor_abi`, `has_non_default_constructor` and `has_non_default_fallback_function` properties, and - adds some docstrings and type annotations. * Don't pass sym arg if one is not declared * Fix SolidityMetada.get_func_argument_types * Add type checks for the selector arguments to the SolidityMetadata.get_* methods * Add tests for the new and changed methods in SolidityMetadata * Fix the eth_detectors.py tests None of the test contracts actually has a constructor that accepts arguments. * Replace ValueError with TypeError in SolidityMetadata method argument type checks 24 October 2018, 03:28:57 UTC
72dc3ec Implements some missing X86 XMM instructions (#1120) * Adds X86 instructions (like pcmpgtd) * Unimplemented instructions egt logges as warnings * Adds tests for SSE instructions such as pmaxub xmm4, xmm3 * Coding style * Tests corrections * test_PMAXUB_symbolic * Update manticore/core/cpu/x86.py Co-Authored-By: catenacyber <contact@catenacyber.fr> * Adds docstrings * Update x86.py 22 October 2018, 18:32:40 UTC
d161243 Properly split z3 command (#1208) 22 October 2018, 14:02:37 UTC
18b829b Fix fallback function matching in ethereum.FilterFunctions (#1197) * Fix fallback function matching in ethereum.FilterFunctions.will_open_transaction_callback and add test Fixes issue #1196. * Update eth_general.py 22 October 2018, 14:01:10 UTC
98190d8 Remove ethereum.py (#1198) 20 October 2018, 11:25:49 UTC
5c44a34 Convert format strings to literal string interpolation [rebased] (#1194) * Convert format strings to literal string interpolation This commit converts most (only a couple of exceptions) of the formatted strings in Manticore to follow PEP-0498, literal string interpolation. * Converted most format strings to f-strings, except for some in tests * Fixing codeclimate issues * Updated the new format strings that appeared after merging, fixed a flipped set of parameters * Fixed another incorrect quote typo * fixed extra quote typo 18 October 2018, 09:03:19 UTC
217634a String representation for Manticore EVM (#1188) * __str__ and __repr__ for ManticoreEVM * make __repr__ call __str__ 17 October 2018, 20:22:29 UTC
79851a4 Issue 1071 --> Global lock held for a bit long (#1187) - Problem: * Global lock need to be held until the required variables are fetched * Lock should be released further while processing further - Fix: * Scope the lock loop until the variables are set - Uncertain: * A similar scenario in `choice` function, should it be fixed as well? * Do we have to explicitly unlock? * Should there be any error handle for failures in lock loop? 17 October 2018, 13:44:27 UTC
3074e34 Fix logic (#1190) 16 October 2018, 22:22:00 UTC
efc8325 Fix logic in warning check (#1191) It used to falsely warn if there were 0 declared arguments, and 0 were given. 15 October 2018, 07:04:58 UTC
444c3d2 Delete ethereum.py (#1185) it was accidentally added back 11 October 2018, 05:34:12 UTC
e153ded Fix detect reentrancy adv. cli (#1183) * Fix detect reentrancy adv. cli * Update __main__.py 10 October 2018, 12:58:05 UTC
d23adfa Change selfdestruct list to a set to avoid dups (#1180) * Change selfdestruct list to a set to avoid dups * Fix for selfdestruct decoupled account deletion and test for it added * Remove comment 10 October 2018, 12:57:14 UTC
d3fc20e Introduce a configuration system (#1139) This PR introduces a config/globals management system that addresses a few concerns about manticore: 1. The lack of a method to update certain configuration constants from Manticore's environment (such as solver timeout). 2. The ability to maintain a configuration file with a set of persistent flags and settings to simplify manticore invocation. (i.e. always enable all EVM detectors) 3. Make a central global place for configuration constants. ## Implementation This PR adds the `manticore.utils.config` module. It implements a way to create and set configuration groups. Manticore's `main` tries loading all groups/values from yaml files in `$PWD` (file can be `.manticore.yml`, `manticore.yml`, `.mcore.yml`, or `mcore.yml`). A `manticore.yml` is also now produced in workspace directory upon a run's completion. Variable values take the following precedence, lowest to highest: 1. The default value declared in the top of a module. 2. The configuration file read 3. The CLI if the variable is also a command line argument. (All command line arguments can be set in the yml under the key `cli`) New flag, `--config` has been added to specify a config file if it's not one of the files that are automatically discovered. `--config-print` dumps all declared constants that can be set. Declaring a configuration group is pretty straightforward. The following is a snippet from the top of `solver.py`: ``` consts = config.get_group('smt') consts.add('timeout', default=240, description='Timeout, in seconds, for each Z3 invocation') consts.add('memory', default=16384, description='Max memory for Z3 to use (in Megabytes)') consts.add('maxsolutions', default=10000, description='Maximum solutions to provide when solving for all values') ``` Then using it later is as simple as referring to `consts.memory` or `consts.timeout`. Fixes #372 <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/trailofbits/manticore/1139) <!-- Reviewable:end --> 10 October 2018, 02:31:55 UTC
fb70047 Add specific ad-hoc delegatecall test and fix (#1179) 09 October 2018, 17:10:15 UTC
12d783a Colored Output (#1177) * colored output implemented; command line option for the same still pending * command line option for disabling colors added * adjusted coding style as per pull request comments 09 October 2018, 16:58:55 UTC
d3d8175 Add check and warning for mismatched args (#1181) * Port code to namedtuple to make more readable self._hashes[0][0][0][0][0][0][0] X_x * fmt * Port * rm * hack to make logging work :( * add check and warn * rm prints * better msg 09 October 2018, 16:55:11 UTC
53bf99c Add optional param to apply constraint to state (#1182) * Add optional param to apply constraint to state * Add symmetric API for solve_buffer 09 October 2018, 16:54:53 UTC
2a4d62a Fix Consensus-errors.1 & 2 (#1172) * Fix Consensus-errors.1 * jumpdest after a JUMPI must be checked only if condition (that could be symbolic) holds * handle create bytecode arguments vs. jumpdests * Update evm.py * revwed * revwed * revwed * revwed * Add test docstring 05 October 2018, 19:18:04 UTC
5b14177 Extra verbose debug trace generator plugin (#1126) * Extra verbose debug trace generator plugin * CC * Reviewed * typo * reviewd 04 October 2018, 21:24:22 UTC
6b1241b Fix sha3 symbolic (#1176) 04 October 2018, 17:34:37 UTC
98b9d36 Emit tx data in machine readable format (#1162) * initial * move dict transform out * docstr 01 October 2018, 21:24:22 UTC
2f3f382 Refactor eth state summary generation (#1161) * move summary out * move tx out * add Transaction.concretize() - initial port * little cleanup * port everything over * more clean * support conc_tx arg * move back in, since it's small now * clean * fill out docstring * refactor flagged - move into module scope * reduce complexity, we'll add it back when it's needed * dang * initial * clean * rm unnecessary * move back into _generate_testcase_callback * rm unused * move to bottom 01 October 2018, 18:29:25 UTC
6317009 Move transaction testcase generation code into transaction (#1159) * move summary out * move tx out * add Transaction.concretize() - initial port * little cleanup * port everything over * more clean * support conc_tx arg * move back in, since it's small now * clean * fill out docstring * refactor flagged - move into module scope * reduce complexity, we'll add it back when it's needed * dang 01 October 2018, 17:01:08 UTC
b700239 Refactor _generate_testcase_callback (#1155) * move summary out * move tx out 28 September 2018, 22:01:59 UTC
c5f8e04 Add missing TerminateState (#1156) 27 September 2018, 21:26:32 UTC
17ec659 Continue cleanup of ethereum package (#1154) * move ABI into separate module * move accounts out * fix circular import * add account * mv solidity stuff out add solidity file 27 September 2018, 19:30:24 UTC
c16fd11 small ethleak improvement (#1153) also check if dest can solve to > 1 21 September 2018, 21:42:10 UTC
f9b663c Explicit smtlib imports in memory (#1152) * Explicit imports Previously pycharm would mark the `from abc` line as redundant. but this is brittle because ABCMeta etc only happened to be imported as a result of modules inside .smtlib importing ABCMeta. if we followed pycharm's advice, and remove this abc import, and if solver.py decided not to import ABCMeta anymore, this could would break. so this makes it less brittle. * final unresolved refs * fix imports 21 September 2018, 19:05:38 UTC
e28a5a7 raise error instead of silently fail (#1149) * raise error instead of silently fail * Fix import * Global exceptions file (#1151) * initial exceptions.py * Rename SolverException * smtlib error * smt error refactoring * misc * SolverError properly inherit * revert solvererror rename to make pr simpler 21 September 2018, 18:39:02 UTC
32fce8a more descriptive err (#1148) 20 September 2018, 21:51:28 UTC
dd66de4 Rm obsolete asciinema (#1147) 20 September 2018, 19:01:42 UTC
5582a08 Fix b (#1117) * alleged fix to issue prepending b' to lines in .tx file * convert binaries to string before removing b' * also removing ' from end of binary output. used to read b'some_hex' now will only read some_hex without single quotes. empty output will be nothing as opposed to '' * using str.format and .decode('utf-8') for tx files * 0x to docstring * Small simplifications 20 September 2018, 19:01:10 UTC
b86395e Make ethereum a package (#1142) * convert to package * move things over * Fix imports * fix lingering import 20 September 2018, 01:54:11 UTC
836bd9a DetectReentrancyAdvanced from cli (#1132) * Fix commandline access so DetectReentrancyAdvanced is accessible * Fix cli arguments to support advanced reentrancy detector 19 September 2018, 14:37:28 UTC
23a86a6 Simplify taint_with (#1133) * Simplify taint_with * Fix in-place tainting 19 September 2018, 14:37:08 UTC
cab7a7f A massive amount of spellchecking (#1141) 18 September 2018, 23:14:44 UTC
ef63b9d fix building the examples in the docker container (#1137) An unfortunate interaction between the locale, python3, and unicode characters present in crackme.py led to an obtuse failure. Setting the locale to UTF-8 fixes it. 13 September 2018, 17:43:24 UTC
aba757a Fix err message if file doesn't exist (#1134) 13 September 2018, 15:14:41 UTC
09e646d license phrasing uniformity (#1131) * Update README.md * Update README.md 12 September 2018, 15:09:08 UTC
5ddc34a Fix typos in help (#1129) 08 September 2018, 16:16:12 UTC
21ef434 Inform users they installed solc through snap (#1124) TLDR: If you install solc from snap universal Linux packages, it breaks Manticore API as it uses temporary files. Also Manticore won't work when fired on files in `/tmp` (because `solc` doesn't). Below you can see it in action for a file located in `/tmp`: ```bash ➜ manticore s.sol 2018-09-07 11:39:03,268: [19239] m.main:INFO: Beginning analysis 2018-09-07 11:39:03,269: [19239] m.ethereum:INFO: Starting symbolic create contract Traceback (most recent call last): File "/home/dc/projects/manticore/manticore/ethereum.py", line 1542, in _run_solc return json.loads(stdout.decode()), stderr.decode() File "/usr/lib/python3.6/json/__init__.py", line 354, in loads return _default_decoder.decode(s) File "/usr/lib/python3.6/json/decoder.py", line 339, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) File "/usr/lib/python3.6/json/decoder.py", line 357, in raw_decode raise JSONDecodeError("Expecting value", s, err.value) from None json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0) During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/home/dc/.venv/manticore/bin/manticore", line 11, in <module> load_entry_point('manticore', 'console_scripts', 'manticore')() File "/home/dc/projects/manticore/manticore/__main__.py", line 191, in main ethereum_cli(args) File "/home/dc/projects/manticore/manticore/__main__.py", line 173, in ethereum_cli m.multi_tx_analysis(args.argv[0], contract_name=args.contract, tx_limit=args.txlimit, tx_use_coverage=not args.txnocoverage, tx_send_ether=not args.txnoether, tx_account=args.txaccount) File "/home/dc/projects/manticore/manticore/ethereum.py", line 2125, in multi_tx_analysis contract_account = self.solidity_create_contract(f, contract_name=contract_name, owner=owner_account, args=args) File "/home/dc/projects/manticore/manticore/ethereum.py", line 1835, in solidity_create_contract compile_results = self._compile(source_code, contract_name_i, libraries=deps, solc_bin=solc_bin, solc_remaps=solc_remaps) File "/home/dc/projects/manticore/manticore/ethereum.py", line 1565, in _compile output, warnings = ManticoreEVM._run_solc(source_code, solc_bin, solc_remaps) File "/home/dc/projects/manticore/manticore/ethereum.py", line 1544, in _run_solc raise EthereumError('Solidity compilation error:\n\n{}'.format(stderr.decode())) manticore.ethereum.EthereumError: Solidity compilation error: ""s.sol"" is not found ``` And so that's how it looks in action after this commit: ``` ➜ manticore s.sol 2018-09-07 11:38:09,841: [18695] m.main:INFO: Beginning analysis 2018-09-07 11:38:09,842: [18695] m.ethereum:INFO: Starting symbolic create contract Traceback (most recent call last): File "/home/dc/.venv/manticore/bin/manticore", line 11, in <module> load_entry_point('manticore', 'console_scripts', 'manticore')() File "/home/dc/projects/manticore/manticore/__main__.py", line 191, in main ethereum_cli(args) File "/home/dc/projects/manticore/manticore/__main__.py", line 173, in ethereum_cli m.multi_tx_analysis(args.argv[0], contract_name=args.contract, tx_limit=args.txlimit, tx_use_coverage=not args.txnocoverage, tx_send_ether=not args.txnoether, tx_account=args.txaccount) File "/home/dc/projects/manticore/manticore/ethereum.py", line 2139, in multi_tx_analysis contract_account = self.solidity_create_contract(f, contract_name=contract_name, owner=owner_account, args=args) File "/home/dc/projects/manticore/manticore/ethereum.py", line 1849, in solidity_create_contract compile_results = self._compile(source_code, contract_name_i, libraries=deps, solc_bin=solc_bin, solc_remaps=solc_remaps) File "/home/dc/projects/manticore/manticore/ethereum.py", line 1579, in _compile output, warnings = ManticoreEVM._run_solc(source_code, solc_bin, solc_remaps) File "/home/dc/projects/manticore/manticore/ethereum.py", line 1552, in _run_solc "send us a PR so we could add it here!".format(stderr) manticore.ethereum.EthereumError: Solidity compilation failed with error: ""s.sol"" is not found Did you install solc from snap Linux universal packages? If so, the problem is likely due to snap's sandbox restricting access to /tmp Here are some potential solutions: 1) Remove solc from snap and install it different way 2) Reinstall solc from snap in developer mode, so there is no sandbox 3) Find a way to add /tmp to the solc's sandbox. If you do, send us a PR so we could add it here! ``` 07 September 2018, 09:41:09 UTC
12b4c84 Fixes missing is_return_symbolic value (#1125) Fixes the issue presented below: ``` ➜ cat manticore_ex.py from manticore.ethereum import ManticoreEVM, evm, Operators m = ManticoreEVM() source_code = ''' pragma solidity ^0.4.24; contract Foo { function foo() {} } ''' user_account = m.create_account(balance=1000, name='user_account') contract_account = m.solidity_create_contract(source_code, owner=user_account, name='contract_account') contract_account.foo(1) print("[+] Now the symbolic values") symbolic_data = m.make_symbolic_buffer(320) symbolic_value = m.make_symbolic_value(name="VALUE") symbolic_address = m.make_symbolic_value(name="ADDRESS") symbolic_caller = m.make_symbolic_value(name="CALLER") m.transaction( caller=symbolic_caller, address=symbolic_address, data=symbolic_data, value=symbolic_value ) m.finalize() print("[+] Look for results in %s " % m.workspace) ➜ python manticore_ex.py [+] Now the symbolic values Traceback (most recent call last): File "manticore_ex.py", line 30, in <module> m.finalize() File "/home/dc/projects/manticore/manticore/ethereum.py", line 2715, in finalize finalizer(-1) File "/home/dc/projects/manticore/manticore/ethereum.py", line 2702, in finalizer self._generate_testcase_callback(st, 'test', '') File "/home/dc/projects/manticore/manticore/ethereum.py", line 2635, in _generate_testcase_callback is_something_symbolic = is_calldata_symbolic or is_return_symbolic UnboundLocalError: local variable 'is_return_symbolic' referenced before assignment ``` 06 September 2018, 04:39:45 UTC
501da0d python3 update to linux example makefile (#1122) Ubuntu 18.04 doesn't alias python to python3 05 September 2018, 10:01:14 UTC
fd09e72 Changed instances of Concretice to Concretize (#1118) 04 September 2018, 21:05:34 UTC
41bad1e manticore 0.2.1.1 (#1116) 01 September 2018, 19:17:06 UTC
70817fb Manticore 0.2.1-b (#1115) 01 September 2018, 19:11:07 UTC
3c639b7 Manticore 0.2.1-berlin (#1114) 01 September 2018, 18:53:41 UTC
53b3fce Fix version number / release (#1113) 01 September 2018, 18:11:43 UTC
5005529 Fix the versioning hell (#1112) 01 September 2018, 17:27:46 UTC
c07ada2 Release 0.2.1c (#1111) 01 September 2018, 17:00:14 UTC
5160416 Manticore 0.2.1 (#1106) * Bump version num * changelog skeleton * Switch to agpl * readme license update * update * gas * Add dc * Date update * Add last minute contributions 01 September 2018, 15:28:22 UTC
a21150e Updates to README.md relating to Python 3 migration and sudo within virtualenv setup (#1109) * updated README.md to use python3 commands * updated README.md to add sudo to system pip3 install commands Line 186 uses a path to the specific pip3 binary (as per https://stackoverflow.com/questions/41429988/inside-virtual-env-sudo-pip-links-to-the-global-python-pip ). 01 September 2018, 13:50:24 UTC
aa1ae09 Detect the odd delegatecall instruction (#1108) * DAO detector + bugfixes * The actual benchmark tests * The actual benchmark tests * CC * Experiment reporting the finding at a JUMPI * Fix taint. Detect returned overflowded data * DAO -> Reentrancy * DAO -> reentrancy, C -> Benchmark * DAO -> reentrancy, C -> Benchmark * Allow function names to have numbers * Fix contract names in benchmark * Fix contract names in benchmark * Move default plugin registration * Better regexp * Fix minimal_bytecode example * Fix Array Slice and test * add tests * correct other bug * implement bytesM * BROKEN partial progress * need bytearray here * rm cmt * add basic tests for bytesM and bytes symbolic * correct bytes symbolic test * Refactor, clean bytesM handling * Add initial symbolic 'bytes' handling * refactor tests * Unify symbolic/concrete bytes handling in bytesM/bytes * Rm import * Rm debug assert * cc * Visitor/migrate/simplify fixes to make the seth refactor pass * Fix concolic? * Fix concolic? * CC * bytesM fix * Fix address and caller concretization on symb tx * Fix/refactor symbolic address/caller concretization * Fix caller concretization * Fix expression visiting * Fix account policy refactor * Accept numbers in function names abitypes * Simplify installation instructions to recommend install manticore only for the current user * Run some tests in parallel (#970) This PR splits the current test runner into three environments: 1. Linux examples 2. Ethereum tests 3. Remaining tests to faster complete each testing run. Ethereum tests include a number of integration tests that execute scripts to completion, which takes a while. We run them concurrently with other tests to save on execution time. The split is done by naming Ethereum tests differently (`eth_*.py` vs `test_*.py`) and updating what pattern unittest's `discover` uses. This change also updates the installation script and chooses to forego installing Keystone for EVM tests as it takes a while, and it adds a `setup.cfg` config file so that Nose finds the eth tests as well by default. * Be less verbose when testing * Fix slicing wrongly reference to proxyArray. Fix #912 * Only export human/external tx in the testcase (#972) * Make ManticoreEVM.make_symbolic_value size adjustable (#974) * Make size adjustable * Default to 256 * Dev evm yolo fix gas (#975) * Fix gas stipend on CALL and check dao * Add order dependence 1 * Going linter. Report/Detect that thing when code does not check returned value * cleaner example of fail * Update retval_crazy.sol * new solc for travis * CC * Remove duplicated ReentrancyDetector * POrt to py3 * POrt to py3 * P0rt to py3 * CC * Be mega forgiving on global expression usage - EVM * Tests doc * Refactor new_bitvector api * function id to binary * Fix neW_bool * CC * rename avoid_collisions collision * rename avoid_collisions collision * migrate on state.constraint too.. * Migration bugfixes * CC bugfixes * invalid assert removed * move rep code to method * unittets fixes and CC * CC * Refactor result_ref out in favor of change_last_result() * CC * reviewing the codes * CC * Change variable names * typo * Basic refactors and output enhancements * Some minid docstrings and a unittest * Some mini docstrings and a unittest * Add migration integration testion * Keep fuzz-refactoring it * CC * Bugfixfixfixfix * CC * re refactor mig algorithm * better cleaner stronger. (reviewing) * CC * Small refactor and Fix strange strcmp test. * CC * funtion selector abinary * bugfix.. waiting for migreation PR * convenient tx abi parsing func * convenient tx abi parsing func * convenient tx abi parsing func * convenient tx abi parsing func * re re refactor for readability * CC * rev * CC * forgoten var * CC * CC * Delete duplicated detector * WIP delegatecall. Lot of fixes. Recursion fix. * review * typo * CC * Sha3 random concre example when none. Concretize SIZE/OFFSET more. Initial calldata size management * remove debug print * Add check in constraints.add * review * Adding single example to sha3 trick when there are not know examples * CC * review * CC * about to merge sha3 * cleanups * make gas budget configurable by user * cleanups * cleanups * CC: * CC * Fix typo in tests * Fix import typo * pump some gas * typo in skipping slow/big test * skipping more test to make travis happy * skipping more test to make travis happy * debugging travis like a caveman * dbg * dbg * dbg * undbg * undbg * undbg * undbg * undbg and fixed * undbg and fixed * CC 01 September 2018, 13:37:38 UTC
1907968 Sha3 rework and performance enhancements (#1031) * DAO detector + bugfixes * The actual benchmark tests * The actual benchmark tests * CC * Experiment reporting the finding at a JUMPI * Fix taint. Detect returned overflowded data * DAO -> Reentrancy * DAO -> reentrancy, C -> Benchmark * DAO -> reentrancy, C -> Benchmark * Allow function names to have numbers * Fix contract names in benchmark * Fix contract names in benchmark * Move default plugin registration * Better regexp * Fix minimal_bytecode example * Fix Array Slice and test * add tests * correct other bug * implement bytesM * BROKEN partial progress * need bytearray here * rm cmt * add basic tests for bytesM and bytes symbolic * correct bytes symbolic test * Refactor, clean bytesM handling * Add initial symbolic 'bytes' handling * refactor tests * Unify symbolic/concrete bytes handling in bytesM/bytes * Rm import * Rm debug assert * cc * Visitor/migrate/simplify fixes to make the seth refactor pass * Fix concolic? * Fix concolic? * CC * bytesM fix * Fix address and caller concretization on symb tx * Fix/refactor symbolic address/caller concretization * Fix caller concretization * Fix expression visiting * Fix account policy refactor * Accept numbers in function names abitypes * Simplify installation instructions to recommend install manticore only for the current user * Run some tests in parallel (#970) This PR splits the current test runner into three environments: 1. Linux examples 2. Ethereum tests 3. Remaining tests to faster complete each testing run. Ethereum tests include a number of integration tests that execute scripts to completion, which takes a while. We run them concurrently with other tests to save on execution time. The split is done by naming Ethereum tests differently (`eth_*.py` vs `test_*.py`) and updating what pattern unittest's `discover` uses. This change also updates the installation script and chooses to forego installing Keystone for EVM tests as it takes a while, and it adds a `setup.cfg` config file so that Nose finds the eth tests as well by default. * Be less verbose when testing * Fix slicing wrongly reference to proxyArray. Fix #912 * Only export human/external tx in the testcase (#972) * Make ManticoreEVM.make_symbolic_value size adjustable (#974) * Make size adjustable * Default to 256 * Dev evm yolo fix gas (#975) * Fix gas stipend on CALL and check dao * Add order dependence 1 * Going linter. Report/Detect that thing when code does not check returned value * cleaner example of fail * Update retval_crazy.sol * new solc for travis * CC * Remove duplicated ReentrancyDetector * POrt to py3 * POrt to py3 * P0rt to py3 * CC * Be mega forgiving on global expression usage - EVM * Tests doc * Refactor new_bitvector api * function id to binary * Fix neW_bool * CC * rename avoid_collisions collision * rename avoid_collisions collision * migrate on state.constraint too.. * Migration bugfixes * CC bugfixes * invalid assert removed * move rep code to method * unittets fixes and CC * CC * Refactor result_ref out in favor of change_last_result() * CC * reviewing the codes * CC * Change variable names * typo * Basic refactors and output enhancements * Some minid docstrings and a unittest * Some mini docstrings and a unittest * Add migration integration testion * Keep fuzz-refactoring it * CC * Bugfixfixfixfix * CC * re refactor mig algorithm * better cleaner stronger. (reviewing) * CC * Small refactor and Fix strange strcmp test. * CC * funtion selector abinary * bugfix.. waiting for migreation PR * convenient tx abi parsing func * convenient tx abi parsing func * convenient tx abi parsing func * convenient tx abi parsing func * re re refactor for readability * CC * rev * CC * forgoten var * CC * CC * review * typo * CC * review * Adding single example to sha3 trick when there are not know examples * CC * review * CC * Forgotten rollback * CC 31 August 2018, 20:42:02 UTC
3d937ae Add env instruction detector to cli (#1105) 31 August 2018, 19:38:03 UTC
cf72c12 eth: new/alternative reentrancy detector (#1082) * initial second one * update * polish * correct * Correctly check gas * Record gas constraint and save in finding * simplify logic * Check if destination is a contract * Revert "Check if destination is a contract" 901be37ce6e49bff455db52c71d5cf17c5b0a3d4 * better context key * Be lenient with Constants * Add new simpler/less input required reentrancy detector, use in the cli * Fix bad merge import * Fix import * Add final missing import 31 August 2018, 13:23:31 UTC
55c1ede Detection of environmental and potentially manipulable instruction/data (#1096) * unittest * CC * import fix * typo * forgotten test 30 August 2018, 20:37:53 UTC
4fbf273 Add detector for plain external call (#1087) * initial refactor etherleak to also do general external call * refactor * Update users * Update tests * Update * Fix tests * Don't use signed operator, check != 0 * Record constraint * Record constraint * Use did_evm_execute So we don't falsely report if the CALL were to fail * Revert "Use did_evm_execute" 96a84f266d234667376ce6ad005d8190aba1a863 29 August 2018, 22:58:59 UTC
15b2257 Update the README (#1064) <!-- Reviewable:start --> This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/trailofbits/manticore/1064) <!-- Reviewable:end --> 28 August 2018, 18:56:44 UTC
14815ac Add --no-testcases flag (#1083) 28 August 2018, 17:01:39 UTC
e64eda1 Improved printing of constructor call with decoded constructor arguments and transaction result (#1080) * added printing of decoded constructor arguments * Fixed test 28 August 2018, 14:57:55 UTC
1d806ba Fix rtd (#1086) * test * wrong number * sorry Popen :( * mocking * x * clean * better explain this arcane stuff * don't need io 24 August 2018, 22:44:43 UTC
6aaa8fd Create readthedocs.yml (#1085) 24 August 2018, 21:16:58 UTC
81296f9 eth: add ether leak detector (#1077) * Add initial ether leak detector * Initial test * correct * Add another neg * rm stray print * initial tests refactoring + ether leak tests * finding name * initial refactor * clean comment * correct this test * update tests * Add fp comment * add other test * remove unnecessary payable function * make LoopDepthLimiter configurable * Use real pc * cc * Add other test * Add cli interface 24 August 2018, 14:41:11 UTC
ece72fe Added --txnoether option to avoid sending ether to contracts (#1078) * added --txnoether option * Improved command line description 24 August 2018, 13:43:27 UTC
8142472 eth: add selfdestruct detector & misc bug fixes (#1068) * Don't keep selfdestruct states alive * Use avoid_collisions=True for internal uses of the .new_ methods * Better err msgs * Output pc in hex * Fix ignored workspace cli flag * hex pc * hex pc one last time * add selfdestruct detector * Add cli support * Add ok selfdestruct test * Add selfdestruct not ok - true positive * Add selfdestruct crazy - true negative * Reorganize plugin/detectors. Add LoopDepthLimiter plugin + cli flag * rename files * add another test * Add initial selfdestruct tests * Move integer overflow detector test into eth_detectors * cc * add missing import * add other missing import 23 August 2018, 19:04:41 UTC
3f305c4 Fix typo mistake in multi-million word (#1073) 23 August 2018, 12:57:35 UTC
38ecc25 Implements support for function overloading in ethereum (#1049) * implements `signature` kwarg for overloaded functions - resolves #810 22 August 2018, 02:37:17 UTC
8247dc6 Fix for #1008 (#1063) * Fix for #1008 * add test for funcall output 21 August 2018, 19:51:46 UTC
ec28281 evm: aggressively check & migrate expressions into current ConstraintSet in case they are global/external (#1009) * Be mega forgiving on global expression usage - EVM * Refactor new_bitvector api * Fix neW_bool * CC * rename avoid_collisions collision * rename avoid_collisions collision * migrate on state.constraint too.. * Migration bugfixes * CC bugfixes * invalid assert removed * move rep code to method * reviewing the codes * CC * Change variable names * typo * Some mini docstrings and a unittest * Add migration integration testion * Keep fuzz-refactoring it * CC * Bugfixfixfixfix * CC * re refactor mig algorithm * better cleaner stronger. (reviewing) * CC * Small refactor and Fix strange strcmp test. * CC * re re refactor for readability * CC * rev * forgoten var 17 August 2018, 16:47:44 UTC
1119814 Serialization cleanup (#1048) * refactor serialization / recursion limit handling 17 August 2018, 13:34:45 UTC
5684bdd Code cleanup and coverage (#1035) * dead code elimination, __init__ cleanup * `binary.Elf` bugfix, add `binary` package tests 15 August 2018, 20:49:40 UTC
e6833ab Fix missing profiling data (#1057) * fix missing profiling data - resolves #982 * unit test 15 August 2018, 17:26:08 UTC
e53b499 Add logo to readme (#1046) * add logo to README 13 August 2018, 18:41:30 UTC
0ad15c7 Manticore 0.2.0 (#1043) * Bump version * Initial changelog changes * Bump version in setup.py * Add skeleton and externals * Fill in 0.2.0 readme * Updates 10 August 2018, 20:07:39 UTC
a0c2f76 Port remaining examples to py3 (#1042) * port use_def * port some scripts, cleanup * ported `scripts/gdb.py` - untested * misc 10 August 2018, 19:28:41 UTC
399a2ef Emphasize new python requirement (#1041) * Emphasize new python requirement * Consistent formatting 10 August 2018, 19:03:02 UTC
7b66bec Readme updates (#1037) * add some more heft to the Ethereum section * no longer needed * Integrate requirements into installation * Update README.md * Update README.md * Update README.md * Update README.md * Duplicate commands for docker quick start * Rm --process-dependency-links note, moved into the faq on the wiki * Small tweaks * pedantic formatting 10 August 2018, 17:57:50 UTC
9f73308 Fix gast (#1039) 09 August 2018, 22:27:34 UTC
5710716 Test manticore on MacOS (#1032) * Test manticore on MacOS like test_binaries.py for path to binary to test * MacOS compatibility achieved Replacement of /bin/ls in tests Use of basename in test_load_maps 09 August 2018, 18:47:57 UTC
back to top