Skip to content

Commit

Permalink
3.0.35
Browse files Browse the repository at this point in the history
  • Loading branch information
rev1si0n committed Oct 23, 2022
1 parent 498abe7 commit 7ae397d
Show file tree
Hide file tree
Showing 5 changed files with 194 additions and 7 deletions.
160 changes: 160 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,160 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/
cover/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
.pybuilder/
target/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# pyenv
# For a library or package, you might want to ignore these files since the code is
# intended to run in multiple environments; otherwise, check them in:
# .python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock

# poetry
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
# This is especially recommended for binary packages to ensure reproducibility, and is more
# commonly ignored for libraries.
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
#poetry.lock

# pdm
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
#pdm.lock
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
# in version control.
# https://pdm.fming.dev/#use-with-ide
.pdm.toml

# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
__pypackages__/

# Celery stuff
celerybeat-schedule
celerybeat.pid

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/

# pytype static type analyzer
.pytype/

# Cython debug symbols
cython_debug/

# PyCharm
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
# and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
#.idea/
21 changes: 15 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@

## 超完备一键中间人流量分析

支持常规以及国际APP流量分析,DNS流量分析,得益于 [mitmproxy flow hook](https://docs.mitmproxy.org/stable/api/events.html),你可以对任何请求做到最大限度的掌控,mitmproxy 功能足够丰富,你可以通过其 `Export` 选项导出特定请求的 `curl` 命令或者 `HTTPie` 命令,对标你用过的任何此类商业/非商业软件,一条命令即完成所有流程
支持常规以及国际APP流量分析,DNS流量分析,得益于 [mitmproxy flow hook](https://docs.mitmproxy.org/stable/api/events.html),你可以对任何请求做到最大限度的掌控,mitmproxy 功能足够丰富,你可以通过其 `Export` 选项导出特定请求的 `curl` 命令或者 `HTTPie` 命令,分析重放、拦截修改、功能组合足以替代你用过的任何此类商业/非商业软件。如果你仍不清楚 mitmproxy 是什么以及其具有的能力,请务必先查找相关文档,因为 lamda 将会使用 mitmproxy 为你展现应用请求

通过 tools/ 目录下的 `globalmitm``startmitm.py` 实现,使用方法请看其同目录 README。

Expand All @@ -64,19 +64,23 @@

![远程桌面动图演示](image/lamda.gif)

## 拖拽上传/目录索引
## 拖拽上传

可直接在远程桌面拖拽上传文件,最大支持 256MB 的文件上传,文件将始终被上传到 `/data/local/tmp` 目录下。

![拖拽上传动图演示](image/upload.gif)

# 目录索引

你可以在浏览器浏览设备上的文件,同时你也可以点击文件名来下载所需的文件,对于安卓系统数据库 (sqlite),可以点击文件名后方的小箭头来在线浏览。

![目录索引动图演示](image/listing.gif)

如果你希望继续看下去,请先确保:手边有一台已经 root 且运行内存 **>= 3GB**,可用存储空间 **>= 1GB** 的安卓设备或者安卓模拟器(推荐使用最新版**夜神****雷电****逍遥**模拟器,或者 AVD [Android Studio Virtual Device])。**不完全支持** 网易 Mumu,**不支持**腾讯手游助手,蓝叠以及任何安卓内虚拟如 VMOS,等),对于真机,推荐运行最接近原生系统的设备如谷歌系、一加、安卓开发板等,或系统仅经过轻度改造的设备。目前**可能不能**在蓝绿厂/华为/小米类高度改造的安卓系统上正常运行,如果你只有此类品牌设备,如果经过尝试无法正常运行,建议使用模拟器。

**文档中部分内容太杂可能劝退一些人,为什么文档写了这么多奇怪无关的东西,因为这个文档连大部分你可能遇到的相关问题都写了进来。**

> 如果您决定使用,建议一字一句读下去,因为其中会有一些问题及提示
> 建议速读浏览一遍,然后一字一句看下去,其中会包含有一些问题及提示
## 免责声明及条款

Expand Down Expand Up @@ -366,6 +370,9 @@ reboot
在浏览器中打开 `http://192.168.0.2:65000` 可进入 web 远程桌面,你可以在此操作设备以及通过该界面的root模拟终端执行命令。
不支持多人访问,不保证兼容所有浏览器,建议使用 Chrome。

web 端的远程桌面在复杂局域网下可能不太流畅,如果需要更加流畅的操作体验,请先看下面的章节 `无线连接内置 root 权限的 WIFI ADB`
完成 adb connect 到 lamda 后,安装使用 [Genymobile/scrcpy](https://github.com/Genymobile/scrcpy) 或者 [barry-ran/QtScrcpy](https://github.com/barry-ran/QtScrcpy) 来获得更加流畅的操作体验,具体使用方法请查看其使用文档。

### 文件上传

你可以在此页面直接**拖动文件到左侧终端**上来上传文件到设备,不支持同时拖动多个或者文件夹,单个文件最大不得超过 256MB,
Expand All @@ -375,7 +382,7 @@ reboot

lamda 允许你通过浏览器浏览设备上的目录及下载文件,只需要在浏览器打开链接 `http://192.168.0.2:65000/fs/` 即可(注意最后面的 `/`)。

注:如果启动服务端时指定了证书,打开页面时会要求输入密码,你可以在证书最后一行找到这个32位的密码
注:如果启动服务端时指定了证书 `--certificate`,打开任何页面将会显示 `401 未授权`,此时必须先打开首页(远程桌面)输入密码来完成登录操作后才能继续访问,你可以在证书最后一行找到这个32位的固定密码

## 连接设备

Expand Down Expand Up @@ -672,7 +679,9 @@ print (res.status_code, res.json()["result"])
有时候你可能遇到这种情况:你的手机在家里而你不在家该怎么使用呢。
开始前,你可能需要先准备一台公网服务器。为了安全考虑,这里使用的是最保守的配置,最后会说明如何做到完整介绍的功能。

tools 文件夹内提供了一个 docker 镜像,如果你熟悉 docker,请转到 tools 查看。
因为有了公网服务器,lamda 有很多方法可以做到这个要求,使用 OpenVPN 来实现更加优雅。当然最方便的还是使用 frp。

tools 文件夹内都提供了相关服务的 docker 镜像,请转到 tools 查看。

本服务使用了较为成熟的端口转发程序 [fatedier/frp](https://github.com/fatedier/frp),关于如何配置服务端,请在此项目中自行探索。注意:请勿将转发后的端口绑定到公网地址,请确保你的公网服务器关闭了所有不必要的端口。
这里给你一个最简单安全的配置,可以直接使用如下命令启动服务端(请自行修改密码及端口)
Expand Down Expand Up @@ -1589,5 +1598,5 @@ d._release_lock()
* msgpack_python (msgpack)
* jmespath (jmespath)

以及其相关依赖库,因为可能随着更新被移除,请不要使用不在上述列表的库。
因为可能随着更新被移除,请不要使用不在上述列表的库。
这里不会介绍如何使用这些命令或库。
2 changes: 1 addition & 1 deletion lamda/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
# Distributed under MIT license.
# See file LICENSE for detail or copy at https://opensource.org/licenses/MIT
__version__ = "3.0"
__build__ = 25
__build__ = 35
2 changes: 2 additions & 0 deletions lamda/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
"Keys",
"KeyCode",
"KeyCodes",
"OpenVPNAuth",
"OpenVPNEncryption",
"OpenVPNKeyDirection",
"OpenVPNCipher",
Expand Down Expand Up @@ -153,6 +154,7 @@ def corner(b, position):
KeyCode = protos.KeyCode
KeyCodes = protos.KeyCode # make an alias

OpenVPNAuth = protos.OpenVPNAuth
OpenVPNEncryption = protos.OpenVPNEncryption
OpenVPNKeyDirection = protos.OpenVPNKeyDirection
OpenVPNCipher = protos.OpenVPNCipher
Expand Down
16 changes: 16 additions & 0 deletions lamda/rpc/proxy.proto
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,21 @@ enum OpenVPNProto {
UDP = 1;
}

enum OpenVPNAuth {
SHA1 = 0;
SHA224 = 1;
SHA256 = 2;
SHA384 = 3;
SHA512 = 4;
RIPEMD160 = 5;
RSA_SHA1 = 6;
RSA_SHA224 = 7;
RSA_SHA256 = 8;
RSA_SHA384 = 9;
RSA_SHA512 = 10;
RSA_RIPEMD160 = 11;
}

enum OpenVPNCipher {
AES_128_GCM = 0;
AES_256_GCM = 1;
Expand Down Expand Up @@ -66,4 +81,5 @@ message OpenVPNConfigRequest {
OpenVPNEncryption tls_encryption = 9;
OpenVPNKeyDirection tls_key_direction = 10;
string tls_key = 11;
OpenVPNAuth auth = 12;
}

0 comments on commit 7ae397d

Please sign in to comment.