BTC
ETH
HTX
SOL
BNB
View Market
简中
繁中
English
日本語
한국어
ภาษาไทย
Tiếng Việt

How to defeat the Ethereum "scavenger", here are three solutions

区块律动BlockBeats
特邀专栏作者
This article is about 4131 words, reading the full article takes about 6 minutes
3 Ways to Save Funds That Haven't Been Eaten!
AI Summary
Expand
3 Ways to Save Funds That Haven't Been Eaten!

Have you ever had the experience of sending a sum of money to an account only to have it disappear? You may have been poisoned by the "scavenger". We are here to help you out of the crisis.

If your private key is stolen, the perpetrator will usually arrange a "scavenger" program to monitor your account, and then wait for an opportunity to eat the assets in your account-whether you deposit ETH or other tokens in this account , or received an airdrop, or anything like that.

This article outlines how "scavenger" eats user assets, and provides three methods to save funds that have not been eaten (such as deposits).

How is the user's private key leaked?

We've recently seen a lot of users posing as admins of Telegram groups and then offering "help" to users in the main channels of these legitimate groups (although they're not real admins, they're copying the real admin's profile, only slightly Username changed). Fake administrators often use professional language to confuse users, sharing links to users that appear to be legitimate websites (because of brand endorsements). These sites ask users for private keys or seed phrases.

Then your tokens are gone, and there will be "scavengers" who will start monitoring your account.

Here is an example of a phishing site:

Thanks to researcher @dubstard for uncovering a lot of activity pretending to be WalletConnect

How does "Scavenger" work?

A "scavenger" is a piece of code that monitors the blockchain (including the transaction pool, which is technically off-chain). It has a faster reaction speed than humans, and it is programmed to sign specific transactions that meet the rules.

In other words, the "scavenger" cannot see you, it does not know that you are viewing your address on a blockchain browser, or "connecting" your address to a dApp's user interface. It only sees your activity when you sign a transaction and broadcast it to the network.

"Scavenger" and the phishing scams that use "scavenger" have evolved over time.

The Evolution of "Scavenger"

One type of scam that was very popular in 2017 took advantage of tokens that had a lock function [i.e., the inability to call transfer() successfully] and a price feed. Dave Appleton posted a post exposing this type of scam.

In this type of scam, the crooks will first acquire the tokens that can be locked, but the block explorer will still provide the price of such tokens [the most popular of which is Minerum (MNE)]. Then, the scammer will (pretend to be unintentional) publish the private key of the address where such tokens are stored, and lure the victim to take the tokens in the address. In order to withdraw tokens, the victim will transfer ETH to this address as a gas fee. However, the scammers have already arranged for a "scavenger" to transfer the ETH transferred by the victim to their own account in a flash. In theory, locked tokens are considered worthless, so scammers try to recover some of the locked value from unsuspecting greedy users.

Today, the hacked address has been placed on a large scale with the underlying ETH "scavenger". There are also some fraudulent groups that adopt logically more advanced "scavengers" and will eat ERC 20 tokens based on the price feed.

Some time ago, I conducted research on a hacked address and found that these "scavengers" are still evolving:

1) "Scavengers" like to eat high-value assets, even if it means more transaction fees.

2) "Scavenger" will use all available ETH to steal as much value as possible, and its transaction has a high probability of winning on the same nonce.

3) "Scavenger" has a matching engine that pairs its native tokens with pledged tokens (ie, xKNCa = KNC) in order to get a price feed for pledged tokens.

4) "Scavenger" has its own internal nonce counter, if its highest nonce is not confirmed (or discarded/replaced) for a period of time, it will periodically reset the nonce to

eth.getTransactionCount()

Output.

5) We can see through some activities on the chain that if a high-value asset becomes the prey in the eyes of the "scavenger", the "scavenger" will even transfer some ETH to the relevant account as a gas fee, so that the Assets are transferred out of the account.

6) Some "scavengers" will set a minimum threshold for asset value. "Scavenger" will not eat assets below this threshold. This means that you may not be aware that there are "scavengers" in your account. Think carefully.

Given that we first wrote about “scavengers” in 2017, today’s “scavengers” are not what they used to be, helping operators maximize their gains while maximizing their victims’ losses.

stop it! Scavenger!

How to defeat "Scavenger"?

First of all, you as a human are not faster than code, so our solution will involve code. Here are several different solutions for you. Although it cannot be guaranteed to be 100% effective, there is always one that suits you.

You need to create a list of coins you want to salvage (in order of priority) so that you can easily plan. This list needs to include the following:

Token contract address

Whether the token has been used for pledge (whether there is a time limit for unlocking)

Can tokens be transferred

Token value (determined by user subjective judgment or USD value for prioritization)

Most importantly, you must be methodical in order to execute the program quickly and efficiently. As the famous saying goes: "Anything is forewarned, and nothing is forewarned."

Using Taichi Network

The "scavenger" works by monitoring transactions in the transaction pool for transfers to "prey" addresses. In this way, the "scavenger" can sign another transaction and broadcast the transaction before the transaction is confirmed, thereby taking the transferred funds.

Taichi Network allows you to submit signed transactions directly to miners (i.e. Spark Pool) without broadcasting them to the public transaction pool. This means that your transaction will enter the blind spot of the "scavenger" and will not be preempted by the "scavenger" robot (at least in my experience).


Source: TAICHI.NETWORK

The specific method is to pre-sign all your transactions in nonce order and submit them to Taiji Network programmatically. Most "scavengers" only monitor the public transaction pool for Ethereum transactions waiting to be included, and do not call eth_getBalance for each new block (this is to save CPU cycles and RPC calls). In other words, the "scavenger" cannot see the ETH sent to the "prey" account through the private transaction pool, and will not eat it.

You need to do some calculations to ensure that the ETH sent to the account as a gas fee can be fully utilized for each signed transaction. "Scavenger" may miss the early run if you count correctly! (Usually, I will default to setting the gas fee a few percent higher than the "Rapid" reference value on GasNow, so as to increase the probability of the transaction being included in the next block.)

You can use MyCrypto offline to generate transaction signatures and send them to the Taichi network when ready, or use ethers.js (or other code libraries) to write code to create signed transactions.

Use a smart contract with self-destruct function

This method is similar to using Tai Chi Network. We can use the smart contract to transfer ETH to the account without exposing the transaction in the public transaction pool. To do this, we can deploy the smart contract through a secure address and send ETH to the hacked address through its constructor (this will be an inside transaction).

pragma sopdity >=0.7.0 <0.9.0;  contract MoveETH {    constructor(address sendToAddress) payable {        address payable addr = payable(address(sendToAddress));        selfdestruct(addr);    }}
example:

example:

https://goerp.etherscan.io/tx/0x82ccb222eae55aaea73dd0efee1ea6ed7320f880889f280d4a343b8823f86692

Please note that this method, although effective, will add additional costs, because we are doing more than transferring ETH from one account to another. This method requires a cost of about 70,000 gas. When the gas price is high, the gas cost alone is as high as 0.0112 ETH.

Next, we will broadcast the pre-signed transaction from the hacked address through the Taiji network (public nodes can also be used here, please set the entire ETH balance in the account as gas fee, so as not to be preempted by "scavenger" ( At least try to reduce this possibility), because in this case, the "scavenger" must send more ETH to the hacked account to win the gas fee auction).

Using Flashbots

Generally speaking, we need to pay ETH to put the transaction on the chain (because the transaction fee is paid by the transaction sender). However, with Flashbots, we can put transactions from external accounts on-chain without paying gas fees (i.e. transaction fees), simply by "bribing" the miner with funds from another account. In other words, we don't need to transfer a sum of ETH to the hacked address as a handling fee, and we can take away the tokens on this address. That's right, that's it!

This scheme requires the use of two accounts - the hacked account and the account used to bribe the miners.

The Flashbots team has released a project called Flashbots/searcher-sponsored-tx, which introduces the basic principles of how to put transactions on the chain through this scheme.

We will use funds from another account to pay transaction fees, so there is no need for ETH in the hacked account. In fact, we wish there was no ETH in the hacked account. After all, the last thing we want is for the scammer/"scavenger" to realize that we want to withdraw funds and use the original ETH in the account to run us away.

To make sure there is no ETH in the hacked account, we highly recommend running a burner bot.

We generally recommend running burner-bot on more than one machine and using a different RPC node for each instance. For example, use Infura to run a burner locally and another provider such as Quiknode to run a burner on a remote server. This allows for redundancy in case of issues such as high network latency or node failures (e.g. rate limiting, synchronization issues, etc.).

The code in Flashbots/searcher-sponsored-tx needs to be modified according to your specific needs, but there is an engine here that can help you save tokens in hacked addresses. The Flashbots engine is highly flexible and can support a single transfer() call, or unstake() and transfer() calls.

If you don't understand code, you can also try the Flashbots functional UI provided by @kendricktan/flashbots.tools website:https://flashbots.tools/。

How to fundamentally avoid "scavenger"?

The best preventive measure is of course to protect your own address from being hacked by "scavengers", so you don't need to fight wits with "scavengers".

In recent years, we've seen the reverse in some app UIs - allowing users to use raw confidential information on the dapp interface. This is very unsafe practice and should not be encouraged.

Never enter your original confidential information (private key, key store file, and seed phrase) on an internet-connected device or any web page.

We recommend using a hardware wallet to ensure private keys are stored on a separate device - if you use MetaMask to interact with dApps, MetaMask recently released an update that allows users to use multiple hardware wallet addresses.


ETH
Welcome to Join Odaily Official Community