{"id":16227884,"url":"https://github.com/d0x2f/ethereum-sniper","last_synced_at":"2026-01-24T22:32:32.274Z","repository":{"id":118797587,"uuid":"435231522","full_name":"d0x2f/ethereum-sniper","owner":"d0x2f","description":"Monitoring script to plunder eth sent to addresses with known private keys","archived":false,"fork":false,"pushed_at":"2021-12-13T17:28:53.000Z","size":140,"stargazers_count":12,"open_issues_count":1,"forks_count":6,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-03T03:11:38.616Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/d0x2f.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-12-05T17:20:43.000Z","updated_at":"2024-04-26T04:17:01.000Z","dependencies_parsed_at":"2023-04-24T21:18:33.438Z","dependency_job_id":null,"html_url":"https://github.com/d0x2f/ethereum-sniper","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/d0x2f/ethereum-sniper","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/d0x2f%2Fethereum-sniper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/d0x2f%2Fethereum-sniper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/d0x2f%2Fethereum-sniper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/d0x2f%2Fethereum-sniper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/d0x2f","download_url":"https://codeload.github.com/d0x2f/ethereum-sniper/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/d0x2f%2Fethereum-sniper/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28738968,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-24T22:12:27.248Z","status":"ssl_error","status_checked_at":"2026-01-24T22:12:10.529Z","response_time":89,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-10T12:54:04.700Z","updated_at":"2026-01-24T22:32:32.248Z","avatar_url":"https://github.com/d0x2f.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Ethereum Sniper\n\nThis project watches the ethereum blockchain for deposits into addresses with a\nknown private key.\n\nIt then submits a transaction to withdraw that balance immediately.\n\nIt works by connecting to a web3 service (such as openethereum or geth) and\nsubscribing to 'new block' and 'new pending transaction' events.\n\nIt will then examine all transactions for transfers into plunderable addresses.\n\nAs soon as such a transaction is included in a block, it will submit a\nnew transaction to transfer the funds to a configured user-controlled address.\n\nNote that there are evidently a lot of bots out there doing the same thing and\nprobably doing it in a much better way than this.\n\nThere are also front-running bots that will notice your profitable transaction\nand duplicate it with a higher fee set so as to be mined in place of yours.\n\nI've also noticed that a lot of these kind of sniper transactions aren't\npublished to the mempool, probably to avoid being front-run, but I suspect it's\nalso the miners doing this so they can plunder the eth within the same block.\n\n# Quick Start\n\nIt is assumed you have access to a suitable web3 provider and a websocket\nconnection.\n\nI strongly recommend a local fully synced openethereum or geth node because you\nreally want the lowest latency to the network as possible. You will need to\nstart geth with the following arguments `--ws --ws.api eth,net,web3`,\nopenethereum enables the right apis by default.\n\n1. Install dependencies.\n\n```\nnpm install\n```\n\n2. Create a new key database and populate it with some example keys.\n\n```\nnpm run populate-db\n```\n\n3. Set your target address and web3 provider in `src/main.js`\n\n```\nconst PILFER_ADDRESS = \"YOUR_ADDRESS\";\nconst WEB3_WEBSOCKET_ADDRESS = \"ws://127.0.0.1:8546\";\n```\n\n4. Start monitoring!\n\n```\nnpm run start\n```\n\n# Key Database\n\nAddress and key pairs are stored in an sqlite database with the table schema:\n\n```\nCREATE TABLE pairs (\n    address TEXT primary key collate nocase,\n    key TEXT unique not null collate nocase\n);\n```\n\nYou can create a new database with the included scripts:\n\n - `npm run create-db` will create a new empty database.\n - `npm run populate-db` will populate the database with an example set of keys.\n    - See `scripts/popluate-db.js` for ideas on creating keys.\n\n# Output\n\nThe script will output processing times for each block that looks like this:\n\n```\n[2021-12-05T02:38:50.280Z] Received block #13743449 at T+3.28s\n[2021-12-05T02:38:50.326Z] Processed block #13743449 in 46ms (w4b: 0)\n```\n\n- `[2021-12-05T02:38:50.280Z]`: The time of the log entry\n- `Received block #13743449`: The block number being received and processed.\n- `T+3.28s`: The amount of time between receiving the block and the timestamp\n  the block was mined.\n- `in 46ms`: The amount of time taken to process the block, including sending\n  pilfer transactions.\n- `(w4b: 0)`: The number of pilfer transactions waiting for a pending\n  transaction to be included in a block.\n  - If there are transactions waiting for a block, you may want to wait before\n    quitting the script.\n  - Pilfer transactions are automatically pruned after waiting for over 10\n    minutes.\n\nEvery time a wallet with a known private key is funded and the script notices it\nin the mempool, it will output a log showing the address and value like so. A\nsigned pilfer transaction is made immediately and sent as soon as this\ntransaction is included in a block.\n\n```\n[2021-12-04T19:20:23.811Z] Found mempool candidate 0x2b5ad5c4795c026514f8317c7a215e218dccd6cf, value: 0.003411872 eth\n```\n\nSimilarly for plunderable transactions found within a block there is this log.\nTransactions discovered this way are pilfered immediately.\n\n```\n[2021-12-04T19:49:46.430Z] Found block candidate 0x2b5ad5c4795c026514f8317c7a215e218dccd6cf, value: 0.0003961294087008 eth\n```\n\nIf the wallet is not able to meet your configured minimum gas threshold (200\ngwei by default), then the following will be logged and the opportunity ignored.\nSee the configuration section of `src/main.js` for options.\n\n```\n[2021-12-04T19:49:46.430Z] Not enough eth to cover fees, ignoring transaction to 0x2b5ad5c4795c026514f8317c7a215e218dccd6cf\n```\n\nWhen a pilfer transaction is sent you will see a large log entry like this.\n\n```\n[2021-12-04T22:40:25.925Z] Attempting pilfer:\nlink: https://etherscan.io/tx/0xdead...beef\nmanual: https://etherscan.io/pushTx?hex=0xabcd...abcd\n{\n  \"to\": \"0x1337...cafe\",\n  \"gasLimit\": \"21000\",\n  \"gasPrice\": \"186.679136833 gwei\",\n  \"value\": \"0.000980065468373437 eth\",\n  \"nonce\": 1281\n}\n```\n\n- `link: https://etherscan.io/tx/0xdead...beef`: A link to the transaction on\netherscan\n- `manual: https://etherscan.io/pushTx?hex=0xabcd...abcd`: A link to a\npre-filled manual submission page on etherscan.\n- Also shown are the transaction parameters with nicely formatted values.\n\nThis will be logged upon a successful pilfer.\n\n```\n[2021-12-04T16:03:55.684Z] Pilfer of 1.958eth successful!\ntx:0x43315e89b8b7f8eea44b21a54f44c91bc4cd3a903285e23a1fc1f89abaceecb7 (39ms).\n```\n\nGood luck :)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fd0x2f%2Fethereum-sniper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fd0x2f%2Fethereum-sniper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fd0x2f%2Fethereum-sniper/lists"}