-
Notifications
You must be signed in to change notification settings - Fork 5
49 lines (48 loc) · 1.53 KB
/
build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
on:
push:
branches:
- "main"
paths:
- ".github/workflows/build.yml"
schedule:
- cron: "0 0 * * 0"
name: build
jobs:
build:
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install Requirements
run: |
sudo apt update
sudo apt install -y curl jq
- name: Generate get-last-error.cna
run: |-
bash <<CC > get-last-error.cna
# Header
cat <<EOF
beacon_command_register(
"get-last-error",
"Resolve GetLastError message numbers to text on CS client side",
"Use: get-last-error error-number" .
"\n\n" .
"Resolve GetLastError message numbers to text on CS client side. Does not execute anything on a beacon."
)
alias get-last-error {
local('%msg');
EOF
# Generate message hash table
curl https://raw.githubusercontent.com/Henkru/windows-lasterror-json/main/all.json | jq -r '.[]|(" %msg[" + (.code|tostring) + "] = %(title =>\"" + .title + "\", msg => \"" + (.msg|gsub("[\\\\n\\\\t]"; "")|gsub("[$]"; "\\\\$")) + "\");")'
# Footer
cat <<EOF
btask(\\\$1, %msg[\\\$2]['title'] . "\n\n" . %msg[\\\$2]['msg']);
}
EOF
CC
- name: commit
uses: EndBug/add-and-commit@v7
with:
add: get-last-error.cna
default_author: github_actions
message: Update error messages