Əlavə edildi: 07.08.2026 / 10:46
GOturun Gelir))
Əlavə edildi: 07.08.2026 / 10:48
Atin chatinsa saytiniza butun poxlari toksun))
<?php
error_reporting(0);
$root = isset($_POST['path']) ? trim($_POST['path']) : dirname(__FILE__);
$rules = array(
'eval\s*\(' => array('CRITICAL', 'eval() istifadəsi'),
'\bsystem\s*\(' => array('CRITICAL', 'system() istifadəsi'),
'\bexec\s*\(' => array('CRITICAL', 'exec() istifadəsi'),
'\bshell_exec\s*\(' => array('CRITICAL', 'shell_exec() istifadəsi'),
'\bpassthru\s*\(' => array('CRITICAL', 'passthru() istifadəsi'),
'\bproc_open\s*\(' => array('HIGH', 'proc_open() istifadəsi'),
'\bpopen\s*\(' => array('HIGH', 'popen() istifadəsi'),
'\bassert\s*\(' => array('HIGH', 'assert() istifadəsi'),
'\bcreate_function\s*\(' => array('HIGH', 'create_function() istifadəsi'),
'\bphpinfo\s*\(' => array('LOW', 'phpinfo() istifadəsi'),
'\bchmod\s*\(' => array('MEDIUM', 'chmod() istifadəsi'),
'\bunlink\s*\(' => array('MEDIUM', 'unlink() istifadəsi'),
'\bmove_uploaded_file\s*\(' => array('MEDIUM', 'move_uploaded_file() istifadəsi'),
'preg_replace\s*\([^;]*\/e[\'"]?\s*\)' => array('HIGH', 'preg_replace /e istifadəsi'),
'php:\/\/input' => array('MEDIUM', 'php://input istifadəsi'),
'php:\/\/filter' => array('HIGH', 'php://filter istifadəsi')
);
$results = array();
$totalFiles = 0;
$scannedFiles = 0;
function scanDirectory($dir, &$results, &$totalFiles, &$scannedFiles, $rules)
{
if (!is_dir($dir)) {
return;
}
$items = @scandir($dir);
if (!$items) {
return;
}
foreach ($items as $item) {
if ($item == '.' || $item == '..') {
continue;
}
$path = $dir . DIRECTORY_SEPARATOR . $item;
if (is_dir($path)) {
scanDirectory(
$path,
$results,
$totalFiles,
$scannedFiles,
$rules
);
continue;
}
$ext = strtolower(pathinfo($path, PATHINFO_EXTENSION));
if ($ext != 'php') {
continue;
}
$totalFiles++;
$content = @file_get_contents($path);
if ($content === false) {
continue;
}
$scannedFiles++;
$lines = preg_split("/\r\n|\n|\r/", $content);
foreach ($lines as $lineNumber => $line) {
foreach ($rules as $pattern => $info) {
if (@preg_match('/' . $pattern . '/i', $line)) {
if (preg_match('/' . $pattern . '/i', $line)) {
$results[] = array(
'file' => $path,
'line' => $lineNumber + 1,
'level' => $info[0],
'reason' => $info[1],
'code' => trim($line)
);
break;
}
}
}
}
}
}
if (isset($_POST['scan'])) {
$root = realpath($root);
if ($root !== false) {
scanDirectory(
$root,
$results,
$totalFiles,
$scannedFiles,
$rules
);
}
}
function levelClass($level)
{
switch ($level) {
case 'CRITICAL':
return 'critical';
case 'HIGH':
return 'high';
case 'MEDIUM':
return 'medium';
default:
return 'low';
}
}
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>PHP Scanner</title>
<style>
* {
box-sizing: border-box;
}
body {
margin: 0;
background: #f4f5f7;
font-family: Arial, sans-serif;
color: #222;
}
.container {
width: 95%;
max-width: 1200px;
margin: 35px auto;
}
.header {
background: #222;
color: #fff;
padding: 20px;
border-radius: 6px 6px 0 0;
}
.header h1 {
margin: 0;
font-size: 22px;
}
.header p {
margin: 7px 0 0;
color: #bbb;
font-size: 13px;
}
.panel {
background: #fff;
padding: 20px;
border: 1px solid #ddd;
}
input[type=text] {
width: 75%;
padding: 11px;
border: 1px solid #ccc;
border-radius: 4px;
}
button {
padding: 11px 22px;
border: 0;
background: #222;
color: #fff;
border-radius: 4px;
cursor: pointer;
}
button:hover {
background: #444;
}
.stats {
display: flex;
gap: 10px;
margin-top: 20px;
flex-wrap: wrap;
}
.stat {
background: #fafafa;
border: 1px solid #ddd;
padding: 15px 20px;
min-width: 160px;
}
.stat b {
display: block;
font-size: 22px;
margin-bottom: 4px;
}
table {
width: 100%;
border-collapse: collapse;
margin-top: 20px;
background: #fff;
}
th {
background: #eee;
text-align: left;
}
th,
td {
border: 1px solid #ddd;
padding: 10px;
vertical-align: top;
font-size: 13px;
}
.critical {
color: #fff;
background: #c62828;
padding: 5px 8px;
border-radius: 3px;
font-size: 11px;
}
.high {
color: #fff;
background: #e65100;
padding: 5px 8px;
border-radius: 3px;
font-size: 11px;
}
.medium {
color: #fff;
background: #8a6d00;
padding: 5px 8px;
border-radius: 3px;
font-size: 11px;
}
.low {
color: #fff;
background: #555;
padding: 5px 8px;
border-radius: 3px;
font-size: 11px;
}
.code {
max-width: 500px;
overflow-x: auto;
white-space: pre-wrap;
word-break: break-all;
background: #f7f7f7;
padding: 8px;
}
.clean {
margin-top: 20px;
padding: 18px;
background: #e8f5e9;
border: 1px solid #c8e6c9;
color: #256029;
}
</style>
</head>
<body>
<div class="container">
<div class="header">
<h1>PHP Security Scanner</h1>
<p>PHP fayllarında təhlükəli funksiyaların yoxlanılması</p>
</div>
<div class="panel">
<form method="post">
<input
type="text"
name="path"
value="<?php echo htmlspecialchars($root); ?>"
placeholder="Scan ediləcək qovluq"
>
<button type="submit" name="scan">
SCAN
</button>
</form>
<?php if (isset($_POST['scan'])) { ?>
<div class="stats">
<div class="stat">
<b><?php echo $totalFiles; ?></b>
PHP faylı
</div>
<div class="stat">
<b><?php echo $scannedFiles; ?></b>
Scan edildi
</div>
<div class="stat">
<b><?php echo count($results); ?></b>
Problem
</div>
</div>
<?php if (count($results) == 0) { ?>
<div class="clean">
Problemli nümunə tapılmadı.
</div>
<?php } else { ?>
<table>
<tr>
<th>Risk</th>
<th>Fayl</th>
<th>Sətir</th>
<th>Səbəb</th>
<th>Kod</th>
</tr>
<?php foreach ($results as $r) { ?>
<tr>
<td>
<span class="<?php echo levelClass($r['level']); ?>">
<?php echo $r['level']; ?>
</span>
</td>
<td>
<?php echo htmlspecialchars($r['file']); ?>
</td>
<td>
<?php echo $r['line']; ?>
</td>
<td>
<?php echo htmlspecialchars($r['reason']); ?>
</td>
<td>
<div class="code">
<?php echo htmlspecialchars($r['code']); ?>
</div>
</td>
</tr>
<?php } ?>
</table>
<?php } ?>
<?php } ?>
</div>
</div>
</body>
</html>
Əlavə edildi: 07.08.2026 / 10:51
Meselen deyek enter.php de seflik var ya shell var ( Once backup goturun )) ozu tapir temizliyir duzeldir
/*
* PHP 5.3 Auto Repair Tool
* repair.php
*/
error_reporting(0);
$file = '';
$message = '';
$changes = array();
$backup = '';
function cleanBOM($content)
{
if (substr($content, 0, 3) === "\xEF\xBB\xBF") {
$content = substr($content, 3);
return array($content, true, 'UTF-8 BOM silindi');
}
return array($content, false, '');
}
function removeTrailingWhitespace($content)
{
$new = preg_replace("/[ \t]+\r?\n/", "\n", $content);
if ($new !== $content) {
return array($new, true, 'Sətirlərin sonundakı artıq boşluqlar təmizləndi');
}
return array($content, false, '');
}
function normalizePhpEnding($content)
{
$trimmed = rtrim($content);
/*
* Yalnız PHP faylının sonunda ?> varsa,
* sonrakı artıq boşluqları təmizləyir.
*/
if (substr($trimmed, -2) === '?>' && $trimmed !== $content) {
return array(
$trimmed . PHP_EOL,
true,
'Fayl sonundakı artıq boşluqlar təmizləndi'
);
}
return array($content, false, '');
}
function findDangerousCode($content)
{
$found = array();
$rules = array(
'eval\s*\(' =>
array('CRITICAL', 'eval() tapıldı'),
'\bsystem\s*\(' =>
array('CRITICAL', 'system() tapıldı'),
'\bexec\s*\(' =>
array('CRITICAL', 'exec() tapıldı'),
'\bshell_exec\s*\(' =>
array('CRITICAL', 'shell_exec() tapıldı'),
'\bpassthru\s*\(' =>
array('CRITICAL', 'passthru() tapıldı'),
'\bproc_open\s*\(' =>
array('HIGH', 'proc_open() tapıldı'),
'\bpopen\s*\(' =>
array('HIGH', 'popen() tapıldı'),
'\bassert\s*\(' =>
array('HIGH', 'assert() tapıldı'),
'\bcreate_function\s*\(' =>
array('HIGH', 'create_function() tapıldı'),
'preg_replace\s*\([^;]*\/e[\'"]?\s*\)' =>
array('HIGH', 'preg_replace /e istifadəsi tapıldı')
);
$lines = preg_split("/\r\n|\n|\r/", $content);
foreach ($lines as $number => $line) {
foreach ($rules as $pattern => $info) {
if (@preg_match('/' . $pattern . '/i', $line)) {
if (preg_match('/' . $pattern . '/i', $line)) {
$found[] = array(
'line' => $number + 1,
'level' => $info[0],
'reason' => $info[1],
'code' => trim($line)
);
}
}
}
}
return $found;
}
function syntaxCheck($file)
{
if (!function_exists('shell_exec')) {
return true;
}
$command = 'php -l ' . escapeshellarg($file) . ' 2>&1';
$result = @shell_exec($command);
if (stripos($result, 'No syntax errors detected') !== false) {
return true;
}
return false;
}
if (isset($_POST['repair'])) {
$file = trim($_POST['file']);
if ($file == '') {
$message = 'Fayl adı daxil edilməyib.';
} else {
$realFile = realpath($file);
if ($realFile === false || !is_file($realFile)) {
$message = 'Fayl tapılmadı.';
} else {
$extension = strtolower(
pathinfo($realFile, PATHINFO_EXTENSION)
);
if ($extension != 'php') {
$message = 'Yalnız PHP faylları qəbul edilir.';
} else {
$original = @file_get_contents($realFile);
if ($original === false) {
$message = 'Faylı oxumaq mümkün olmadı.';
} else {
$newContent = $original;
/*
* Backup
*/
$backup = $realFile .
'.backup_' .
date('Ymd_His');
if (!@copy($realFile, $backup)) {
$message = 'Backup yaratmaq mümkün olmadı.';
} else {
/*
* 1. BOM
*/
$result = cleanBOM($newContent);
$newContent = $result[0];
if ($result[1]) {
$changes[] = $result[2];
}
/*
* 2. Sətir sonu boşluqları
*/
$result = removeTrailingWhitespace($newContent);
$newContent = $result[0];
if ($result[1]) {
$changes[] = $result[2];
}
/*
* 3. Fayl sonu
*/
$result = normalizePhpEnding($newContent);
$newContent = $result[0];
if ($result[1]) {
$changes[] = $result[2];
}
/*
* Faylı dəyiş
*/
if ($newContent !== $original) {
if (!@file_put_contents(
$realFile,
$newContent,
LOCK_EX
)) {
@copy($backup, $realFile);
$message =
'Fayla yazmaq mümkün olmadı. Backup geri qaytarıldı.';
} else {
/*
* Syntax yoxlaması
*/
$syntaxOK = syntaxCheck($realFile);
if (!$syntaxOK) {
@copy($backup, $realFile);
$message =
'Düzəlişdən sonra syntax xətası yarandı. ' .
'Backup avtomatik geri qaytarıldı.';
$changes = array();
} else {
$message =
'Düzəliş tamamlandı və fayl uğurla saxlanıldı.';
}
}
} else {
$message =
'Avtomatik düzəliş tələb edən təhlükəsiz dəyişiklik tapılmadı.';
}
}
}
}
}
}
}
/*
* Scan
*/
$scanResults = array();
if (isset($_POST['scan'])) {
$file = trim($_POST['file']);
if ($file != '') {
$realFile = realpath($file);
if ($realFile !== false && is_file($realFile)) {
$content = @file_get_contents($realFile);
if ($content !== false) {
$scanResults = findDangerousCode($content);
}
}
}
}
?>
PHP Repair
<br/>* {<br/><span class="wbbtab"></span> box-sizing: border-box;<br/>}<br/>body {<br/><span class="wbbtab"></span> margin: 0;<br/><span class="wbbtab"></span> background: #f2f3f5;<br/><span class="wbbtab"></span> font-family: Arial, sans-serif;<br/><span class="wbbtab"></span> color: #222;<br/>}<br/>.container {<br/><span class="wbbtab"></span> width: 95%;<br/><span class="wbbtab"></span> max-width: 1100px;<br/><span class="wbbtab"></span> margin: 40px auto;<br/>}<br/>.header {<br/><span class="wbbtab"></span> background: #202124;<br/><span class="wbbtab"></span> color: white;<br/><span class="wbbtab"></span> padding: 22px;<br/><span class="wbbtab"></span> border-radius: 7px 7px 0 0;<br/>}<br/>.header h2 {<br/><span class="wbbtab"></span> margin: 0;<br/><span class="wbbtab"></span> font-size: 21px;<br/>}<br/>.header p {<br/><span class="wbbtab"></span> color: #aaa;<br/><span class="wbbtab"></span> margin: 7px 0 0;<br/><span class="wbbtab"></span> font-size: 13px;<br/>}<br/>.box {<br/><span class="wbbtab"></span> background: white;<br/><span class="wbbtab"></span> padding: 22px;<br/><span class="wbbtab"></span> border: 1px solid #ddd;<br/>}<br/>input {<br/><span class="wbbtab"></span> width: 100%;<br/><span class="wbbtab"></span> padding: 12px;<br/><span class="wbbtab"></span> border: 1px solid #ccc;<br/><span class="wbbtab"></span> border-radius: 4px;<br/><span class="wbbtab"></span> font-size: 14px;<br/><span class="wbbtab"></span> margin-bottom: 10px;<br/>}<br/>button {<br/><span class="wbbtab"></span> padding: 11px 18px;<br/><span class="wbbtab"></span> border: 0;<br/><span class="wbbtab"></span> border-radius: 4px;<br/><span class="wbbtab"></span> background: #222;<br/><span class="wbbtab"></span> color: white;<br/><span class="wbbtab"></span> cursor: pointer;<br/><span class="wbbtab"></span> margin-right: 5px;<br/>}<br/>button:hover {<br/><span class="wbbtab"></span> background: #444;<br/>}<br/>.message {<br/><span class="wbbtab"></span> margin-top: 20px;<br/><span class="wbbtab"></span> padding: 15px;<br/><span class="wbbtab"></span> background: #eef5ff;<br/><span class="wbbtab"></span> border: 1px solid #ccdfff;<br/>}<br/>.backup {<br/><span class="wbbtab"></span> margin-top: 10px;<br/><span class="wbbtab"></span> padding: 12px;<br/><span class="wbbtab"></span> background: #f7f7f7;<br/><span class="wbbtab"></span> border: 1px solid #ddd;<br/><span class="wbbtab"></span> word-break: break-all;<br/>}<br/>.changes {<br/><span class="wbbtab"></span> margin-top: 20px;<br/>}<br/>.change {<br/><span class="wbbtab"></span> padding: 10px;<br/><span class="wbbtab"></span> border-bottom: 1px solid #eee;<br/>}<br/>table {<br/><span class="wbbtab"></span> width: 100%;<br/><span class="wbbtab"></span> border-collapse: collapse;<br/><span class="wbbtab"></span> margin-top: 20px;<br/>}<br/>th,<br/>td {<br/><span class="wbbtab"></span> border: 1px solid #ddd;<br/><span class="wbbtab"></span> padding: 10px;<br/><span class="wbbtab"></span> text-align: left;<br/><span class="wbbtab"></span> font-size: 13px;<br/>}<br/>th {<br/><span class="wbbtab"></span> background: #eee;<br/>}<br/>.CRITICAL {<br/><span class="wbbtab"></span> background: #c62828;<br/><span class="wbbtab"></span> color: white;<br/><span class="wbbtab"></span> padding: 5px 7px;<br/><span class="wbbtab"></span> border-radius: 3px;<br/>}<br/>.HIGH {<br/><span class="wbbtab"></span> background: #e65100;<br/><span class="wbbtab"></span> color: white;<br/><span class="wbbtab"></span> padding: 5px 7px;<br/><span class="wbbtab"></span> border-radius: 3px;<br/>}<br/>
PHP Auto Repair
PHP 5.3 — Scan / Repair / Backup / Syntax Check
type="text"
name="file"
value=""
placeholder="Məsələn: enter.php"
>
SCAN
SCAN + AUTO REPAIR
Backup:
0) { ?>
Edilən düzəlişlər
✓
0) { ?>
Tapılan şübhəli kodlar:
RiskSətirSəbəbKod
Şübhəli nümunə tapılmadı.