# FILE

![](https://4283174472-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MBMYbAUrd33d7L_Vplm%2F-MBRoHxz7NaAh6shYbF3%2F-MBRoVvYWlVjkFg_Wa6_%2Fwebshell-FILE.png?alt=media\&token=9d52c9e7-d926-4e39-9945-fdc3edf7422f)



### 命令

#### c /cat

```
 ​
     cat
 ​
     Read file(s) from target system.
 ​
     eg: cat {web_file_path1} {web_file_path2} ..
 ​
     Command Args:
         --web_file_paths(*)         [?] *web_file_paths
 ​
```

用于在当前webshell的工作目录下查看单（多）个文件。格式为`cat {目标文件路径...}`。

#### w / write

```
 ​
     write
 ​
     Write files directly to the target system by notepad / vi or your own editor.
 ​
     eg: write {web_file_path} {editor=""}
 ​
     Command Args:
         --web_file_path(*)          [str] web_file_path
 
         --editor                    [str] editor (Default: '')
 ​
```

用于在当前webshell的工作目录下写文件。这将会调用notepad/vi编辑新文件，并将编辑好的文件上传至指定工作目录。格式为`write {web文件路径}`。

#### e / edit

```
 ​
     edit
 ​
     edit file from target system (download->edit->upload) by notepad / vi or your own editor.
 ​
     eg: edit {web_file_path}
 ​
     Command Args:
         --web_file_path(*)          [str] web_file_path
 
         --editor                    [str] editor (Default: '')

 ​
```

用于当前webshell的工作目录下编辑文件。这将会下载文件并调用notepad/vi进行编辑，并将编辑好的文件上传至指定工作目录。格式为`write {目标文件路径}`。

#### u / upload

```
 ​
     upload
 ​
     Upload file to target system.
 ​
     eg: upload {file_path} {web_file_path=file_name} {force=False}
 ​
     Command Args:
         --file_path(*)              [str] file_path
 ​
         --web_file_path             [str] web_file_path (Default: '')
 ​
         --force                     [bool] force (Default: False)
 ​
```

用于从当前工作目录中上传文件到webshell的工作目录。格式为`upload {本地文件路径} {目标文件路径} {覆盖选项}`。

#### d / download

```
 ​
     download
 ​
     Download file from target system.
 ​
     eg: download {web_file_path} {local_path=doughnuts/target/site.com/...}
 ​
     Command Args:
         -w,--web_file_path(*)        [str] web_file_path
 ​
         -l,--local_path             [str] local_path (Default: '')
 ​
```

用于从当前webshell的工作目录中下载文件。文件将会被下载到指定目录或默认下载到 doughnuts/target/{域名} 目录下。格式为·download {目标文件路径} {本地保存路径}\`。

#### mv / move

```
 ​
     move
 ​
     Rename file or move it to new_file_path like linux mv command.
 ​
     eg: move {web_file_path} {new_file_path}
 ​
     Command Args:
         --web_file_path(*)          [str] web_file_path
 ​
         --new_file_path(*)          [str] new_file_path
 ​
```

用于移动webshell工作目录中的文件。用法与linux的mv目录类似，格式为`move {源文件路径} {新文件路径}`。

#### rm / remove

```
 ​
     rm
 ​
     Delete target system file(s).
 ​
     eg: remove {web_file_path1} {web_file_path2} ..
 ​
     Command Args:
         --web_file_paths(*)         [?] *web_file_paths
 ​
```

用于在当前webshell的工作目录下删除单（多）个文件。格式为`rm {目标文件路径...}`。

#### chmod

```
 ​
     chmod
 ​
     (Only for *unix) Changes file(s) mode.
 ​
     eg: chmod {mode} {web_file_path}
 ​
     Command Args:
         -m,--mode(*)                [str] mode
 ​
         --web_file_paths(*)         [?] *web_file_paths
 ​
```

（这个命令只用于目标系统为\*unix）用于修改当前webshell的工作目录下文件的权限。格式为`chmod {目标文件路径} {八进制权限}`。

#### touch

```

    touch

    Create an empty file or (Only for *unix) Specify a file whose modification time stamp is the same as a random file in the current directory.

    eg: touch {filename=this_webshell}

    Command Args:
        -f,--filename                    [str] filename (Default: '')

```

创建空文件或者修改一个文件的mtime与当前文件夹中的随机一个php文件相同，用于伪装。

#### dump

```
 ​
     dump
 ​
     Package and compress files in a folder and download it.
 ​
     eg: dump {web_file_path} {local_path=./site.com/...}
 ​
     Command Args:
         -w,--web_file_path(*)        [str] web_file_path
 ​
         -l,--local_path             [str] local_path (Default: '')
 ​
         --_use_raw_php_to_zip        [bool] _use_raw_php_to_zip (Default: True)
 ​
```

用于将指定webshell工作目录下的文件夹整个打包成zip文件，默认使用原始的PHP（无ZipArchive扩展依赖）进行打包。格式为`dump {目标文件夹路径} {本地保存路径} {原生php选项}`。\
