-
Notifications
You must be signed in to change notification settings - Fork 5
152 lines (135 loc) · 5.13 KB
/
generate_update_wordlists.yaml
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
name: 💾 Fetch || ⏫ Update Wordlists 📙
#MAX_RUNTIME: ~ 05-10 mins
on:
workflow_dispatch:
schedule:
- cron: "15 23 * * *" # ( 11:15 PM UTC --> 05:00 AM Morning )
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
path: main
- name: Install Coreutils
run: |
# Presets
set -x ; set +e
#--------------#
sudo apt update -y
sudo apt install coreutils curl dos2unix git jq moreutils wget -y
# Do again, sometimes fails
sudo apt install coreutils curl dos2unix git jq moreutils wget -y
pip install ansi2txt
continue-on-error: true
- name: Install eget
run: |
# Presets
set -x ; set +e
#--------------#
# eget for bins
sudo wget "https://raw.githubusercontent.com/Azathothas/Toolpacks/main/x86_64/eget" -O "/usr/local/bin/eget"
sudo chmod +xwr "/usr/local/bin/eget"
- name: Install Deps for Wordium
run: |
# Presets
set -x ; set +e
#--------------#
#anew
sudo eget "https://raw.githubusercontent.com/Azathothas/Toolpacks/main/x86_64/anew" --to "/usr/local/bin/anew"
anew -h
continue-on-error: true
- name: Clean Cloned Repos (I)
run: |
# Presets
set -x ; set +e
#--------------#
# Del all Dirs
find "$GITHUB_WORKSPACE/main" -maxdepth 1 -type d ! -name '.git*' ! -name 'main' ! -name '*Logs*' ! -name '*Misc*' -exec rm -rf {} \; 2>/dev/null
continue-on-error: true
- name: Setup Env
run: |
# Presets
set -x ; set +e
#--------------#
# Create Output Dir
mkdir -p "$GITHUB_WORKSPACE/main/Logs"
continue-on-error: true
- name: Run Wordium
run: |
# Presets
set -x ; set +e
#--------------#
#Install
sudo curl -qflSL "https://raw.githubusercontent.com/Azathothas/Arsenal/main/wordium/wordium.sh" -o "/usr/local/bin/wordium"
sudo chmod +xwr "/usr/local/bin/wordium"
#Run , (DO NOT SPECIFY /Wordlists)
wordium --wordlist-dir $GITHUB_WORKSPACE/main/ | tee "/tmp/wordium.log"
cat "/tmp/wordium.log" | ansi2txt > "$GITHUB_WORKSPACE/main/Logs/wordium.log"
cat "/tmp/wordium.log" | ansi2txt | grep -A999999 "➼Updated Wordlists:" > "/tmp/wordium_stat.txt"
continue-on-error: true
- name: Clean Cloned Repos (II)
run: |
# Presets
set -x ; set +e
#--------------#
# Del all Dirs
find "$GITHUB_WORKSPACE/main" -maxdepth 1 -type d ! -name '.git*' ! -name 'main' ! -name '*Logs*' ! -name '*Misc*' -exec rm -rf {} \; 2>/dev/null
continue-on-error: true
- name: Anew || Sort Misc
run: |
# Presets
set -x ; set +e
#--------------#
#anew things
cat "$GITHUB_WORKSPACE/main/Misc/ports_sussy.txt" | anew -q "$GITHUB_WORKSPACE/main/Misc/ports_top_20k.txt"
#Sort
cd "$GITHUB_WORKSPACE/main"
find ./Misc -type f -name '*.txt' -exec sort -u {} -o {} \;
- name: Dos2Unix Everything
run: |
# Presets
set -x ; set +e
#--------------#
cd "$GITHUB_WORKSPACE/main"
find . -type f -name '*.txt' -exec dos2unix {} \;
continue-on-error: true
- name: Update README.md
run: |
# Presets
set -x ; set +e
#--------------#
cd "$GITHUB_WORKSPACE/main"
cat ./INFO.md > ./README.md
echo -e "" >> ./README.md
echo '---' >> ./README.md
echo '```console' >> ./README.md
echo -e "" >> ./README.md
echo -e "--> METADATA" >> ./README.md
/bin/bash -c 'PS4="$ "; cat /tmp/wordium_stat.txt '&>> ./README.md
echo -e "" >> ./README.md
echo -e '```\n' >> ./README.md
echo -e "" >> ./README.md
echo '---' >> ./README.md
echo -e "" >> ./README.md
working-directory: main
continue-on-error: true
- name: Get DateTime
run: |
# Date Time
NEPALI_TIME=$(TZ='Asia/Kathmandu' date +'%Y-%m-%d (%I:%M:%S %p)')
echo "NEPALI_TIME=$NEPALI_TIME" >> $GITHUB_ENV
- name: Git Pull
run: |
cd "$GITHUB_WORKSPACE/main" && git pull origin main
continue-on-error: true
- uses: stefanzweifel/git-auto-commit-action@v4
with:
repository: ./main
commit_user_name: Azathothas # defaults to "github-actions[bot]"
commit_user_email: [email protected] # defaults to "41898282+github-actions[bot]@users.noreply.github.com"
commit_message: "✅ Fetch latest Wordlists 📙 <-- ${{ env.NEPALI_TIME }} ⌚"
#push_options: '--force'