Skip to content

Commit 6bb6035

Browse files
Merge pull request #144 from CarterPerez-dev/project/credential-harvester
feat: credential enumeration complete
2 parents fa729e6 + e964201 commit 6bb6035

47 files changed

Lines changed: 6884 additions & 7 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/lint.yml

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,10 @@ jobs:
8888
- name: secrets-scanner
8989
type: go
9090
path: PROJECTS/intermediate/secrets-scanner
91+
# Nim
92+
- name: credential-enumeration
93+
type: nim
94+
path: PROJECTS/intermediate/credential-enumeration
9195

9296
defaults:
9397
run:
@@ -147,6 +151,17 @@ jobs:
147151
if: matrix.type == 'go'
148152
run: go install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@latest
149153

154+
# Nim Setup
155+
- name: Setup Nim
156+
if: matrix.type == 'nim'
157+
uses: jiro4989/setup-nim-action@v2
158+
with:
159+
nim-version: '2.2.x'
160+
161+
- name: Install nph
162+
if: matrix.type == 'nim'
163+
run: nimble install -y nph
164+
150165
# Ruff Linting
151166
- name: Run ruff
152167
if: matrix.type == 'ruff'
@@ -195,6 +210,37 @@ jobs:
195210
cat golangci-output.txt
196211
continue-on-error: true
197212

213+
# Nim Linting
214+
- name: Run nph and nim check
215+
if: matrix.type == 'nim'
216+
id: nim
217+
run: |
218+
echo "Running nph format check..."
219+
NPH_OK=true
220+
NIM_OK=true
221+
if nph --check src/ > nim-output.txt 2>&1; then
222+
echo "nph: no formatting issues"
223+
else
224+
NPH_OK=false
225+
echo "nph: formatting issues found"
226+
fi
227+
echo "Running nim check..."
228+
if nim check src/harvester.nim >> nim-output.txt 2>&1; then
229+
echo "nim check: passed"
230+
else
231+
NIM_OK=false
232+
echo "nim check: failed"
233+
fi
234+
if [[ "$NPH_OK" == "true" && "$NIM_OK" == "true" ]]; then
235+
echo "NIM_PASSED=true" >> $GITHUB_ENV
236+
echo "All Nim checks passed!"
237+
else
238+
echo "NIM_PASSED=false" >> $GITHUB_ENV
239+
echo "Nim checks found issues"
240+
fi
241+
cat nim-output.txt
242+
continue-on-error: true
243+
198244
# Create Summary for Ruff
199245
- name: Create Ruff Lint Summary
200246
if: matrix.type == 'ruff'
@@ -288,6 +334,37 @@ jobs:
288334
fi
289335
} >> $GITHUB_STEP_SUMMARY
290336
337+
# Create Summary for Nim
338+
- name: Create Nim Lint Summary
339+
if: matrix.type == 'nim'
340+
run: |
341+
{
342+
echo "## Lint Results: ${{ matrix.name }}"
343+
echo ''
344+
345+
if [[ "${{ env.NIM_PASSED }}" == "true" ]]; then
346+
echo '### nph + nim check: **Passed**'
347+
echo 'No Nim issues found.'
348+
else
349+
echo '### nph + nim check: **Issues Found**'
350+
echo '<details><summary>View Nim output</summary>'
351+
echo ''
352+
echo '```'
353+
head -100 nim-output.txt
354+
echo '```'
355+
echo '</details>'
356+
fi
357+
echo ''
358+
359+
if [[ "${{ env.NIM_PASSED }}" == "true" ]]; then
360+
echo '---'
361+
echo '### All checks passed!'
362+
else
363+
echo '---'
364+
echo '### Review the issues above'
365+
fi
366+
} >> $GITHUB_STEP_SUMMARY
367+
291368
# Exit with proper status
292369
- name: Check lint status
293370
run: |
@@ -306,5 +383,10 @@ jobs:
306383
echo "Go lint checks failed"
307384
exit 1
308385
fi
386+
elif [[ "${{ matrix.type }}" == "nim" ]]; then
387+
if [[ "${{ env.NIM_PASSED }}" == "false" ]]; then
388+
echo "Nim lint checks failed"
389+
exit 1
390+
fi
309391
fi
310392
echo "All lint checks passed"

.pre-commit-config.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,16 @@ repos:
150150
files: ^PROJECTS/advanced/encrypted-p2p-chat/frontend/src/
151151
pass_filenames: false
152152

153+
# Nim nph Checks
154+
- repo: local
155+
hooks:
156+
- id: nph-credential-enumeration
157+
name: nph check (credential-enumeration)
158+
entry: bash -c 'cd PROJECTS/intermediate/credential-enumeration && nph --check src/'
159+
language: system
160+
files: ^PROJECTS/intermediate/credential-enumeration/src/
161+
pass_filenames: false
162+
153163
- repo: https://github.com/pre-commit/pre-commit-hooks
154164
rev: v6.0.0
155165
hooks:

PROJECTS/beginner/c2-beacon/backend/README.md

Whitespace-only changes.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# ©AngelaMos | 2026
2+
# .gitignore
3+
4+
docs/
5+
bin/
6+
nimcache/
7+
credenum
8+
*.exe
9+
*.out
10+
tests/docker/planted/
Lines changed: 124 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,124 @@
1+
# =============================================================================
2+
# ©AngelaMos | 2026
3+
# Justfile
4+
# =============================================================================
5+
# credenum — Post-access credential exposure detection for Linux systems
6+
# =============================================================================
7+
8+
set export
9+
set shell := ["bash", "-uc"]
10+
11+
bin := "bin/credenum"
12+
src := "src/harvester.nim"
13+
version := `git describe --tags --always 2>/dev/null || echo "dev"`
14+
15+
# =============================================================================
16+
# Default
17+
# =============================================================================
18+
19+
default:
20+
@just --list --unsorted
21+
22+
# =============================================================================
23+
# Development
24+
# =============================================================================
25+
26+
[group('dev')]
27+
build:
28+
@mkdir -p bin
29+
nim c -o:{{bin}} {{src}}
30+
@echo "Built: {{bin}} ($(du -h {{bin}} | cut -f1))"
31+
32+
[group('dev')]
33+
run *ARGS: build
34+
./{{bin}} {{ARGS}}
35+
36+
[group('dev')]
37+
scan *ARGS: build
38+
./{{bin}} --target $HOME {{ARGS}}
39+
40+
[group('dev')]
41+
check:
42+
nim check {{src}}
43+
44+
# =============================================================================
45+
# Build (Production)
46+
# =============================================================================
47+
48+
[group('prod')]
49+
release:
50+
@mkdir -p bin
51+
nim c -d:release -d:lto --opt:size -o:{{bin}} {{src}}
52+
strip -s {{bin}} 2>/dev/null || true
53+
@echo "Release: {{bin}} ($(du -h {{bin}} | cut -f1))"
54+
55+
[group('prod')]
56+
release-static:
57+
@mkdir -p bin
58+
nim c -d:release -d:musl -d:lto --opt:size -o:{{bin}} {{src}}
59+
strip -s {{bin}} 2>/dev/null || true
60+
@echo "Static release: {{bin}} ($(du -h {{bin}} | cut -f1))"
61+
62+
[group('prod')]
63+
release-small: release-static
64+
upx --best {{bin}}
65+
@echo "Compressed: {{bin}} ($(du -h {{bin}} | cut -f1))"
66+
67+
[group('prod')]
68+
build-x86:
69+
@mkdir -p bin
70+
nim c -d:release -d:zigcc -d:crossX86 -d:lto --opt:size -o:bin/credenum-x86_64 {{src}}
71+
@echo "Cross-compiled: bin/credenum-x86_64"
72+
73+
[group('prod')]
74+
build-arm64:
75+
@mkdir -p bin
76+
nim c -d:release -d:zigcc -d:crossArm64 -d:lto --opt:size -o:bin/credenum-aarch64 {{src}}
77+
@echo "Cross-compiled: bin/credenum-aarch64"
78+
79+
# =============================================================================
80+
# Testing
81+
# =============================================================================
82+
83+
[group('test')]
84+
test:
85+
nim c -r --path:src tests/test_all.nim
86+
87+
[group('test')]
88+
docker-build:
89+
docker build -t credenum-test -f tests/docker/Dockerfile .
90+
91+
[group('test')]
92+
docker-test: docker-build
93+
docker run --rm credenum-test
94+
95+
# =============================================================================
96+
# Formatting
97+
# =============================================================================
98+
99+
[group('lint')]
100+
fmt:
101+
nph src/
102+
103+
[group('lint')]
104+
fmt-check:
105+
nph --check src/
106+
107+
# =============================================================================
108+
# Utilities
109+
# =============================================================================
110+
111+
[group('util')]
112+
info:
113+
@echo "Project: credential-enumeration"
114+
@echo "Version: {{version}}"
115+
@echo "Nim: $(nim --version | head -1)"
116+
@echo "OS: {{os()}} ({{arch()}})"
117+
@echo "Binary: {{bin}}"
118+
@test -f {{bin}} && echo "Size: $(du -h {{bin}} | cut -f1)" || echo "Size: (not built)"
119+
120+
[group('util')]
121+
clean:
122+
-rm -rf bin/ nimcache/
123+
-find . -name "nimcache" -type d -exec rm -rf {} + 2>/dev/null
124+
@echo "Cleaned build artifacts."

0 commit comments

Comments
 (0)