Skip to content

Commit 4942425

Browse files
committed
docs: add comprehensive documentation and fix github actions
- add docs/ with installation, usage, modules, scans, and api docs - add docs link to main readme - fix release.yml to bundle modules directory with releases - add module system tests to runtest.yml - standardize go version to 1.23 across workflows
1 parent c7598a1 commit 4942425

12 files changed

Lines changed: 1330 additions & 16 deletions

File tree

.github/workflows/go.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
- name: Set up Go
1313
uses: actions/setup-go@v4
1414
with:
15-
go-version: "1.24"
15+
go-version: "1.23"
1616
- name: Build
1717
run: make
1818
- name: Run tests with coverage

.github/workflows/release.yml

Lines changed: 40 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,21 @@ jobs:
4040
GOOS=linux GOARCH=386 go build -o sif-linux-386 ./cmd/sif
4141
GOOS=linux GOARCH=arm64 go build -o sif-linux-arm64 ./cmd/sif
4242
43+
- name: Package releases with modules
44+
run: |
45+
for binary in sif-linux-amd64 sif-linux-386 sif-linux-arm64 sif-macos-amd64 sif-macos-arm64; do
46+
mkdir -p "dist/${binary}"
47+
cp "${binary}" "dist/${binary}/sif"
48+
cp -r modules "dist/${binary}/"
49+
tar -czf "${binary}.tar.gz" -C dist "${binary}"
50+
done
51+
for binary in sif-windows-amd64 sif-windows-386; do
52+
mkdir -p "dist/${binary}"
53+
cp "${binary}.exe" "dist/${binary}/sif.exe"
54+
cp -r modules "dist/${binary}/"
55+
cd dist && zip -r "../${binary}.zip" "${binary}" && cd ..
56+
done
57+
4358
- name: Set release version
4459
run: echo "RELEASE_VERSION=$(git rev-parse --short HEAD)" >> $GITHUB_ENV
4560

@@ -52,24 +67,35 @@ jobs:
5267
Automated release v${{ env.RELEASE_VERSION }}
5368
5469
## Assets
55-
- Windows (64-bit): `sif-windows-amd64.exe`
56-
- Windows (32-bit): `sif-windows-386.exe`
57-
- macOS (64-bit Intel): `sif-macos-amd64`
58-
- macOS (64-bit ARM): `sif-macos-arm64`
59-
- Linux (64-bit): `sif-linux-amd64`
60-
- Linux (32-bit): `sif-linux-386`
61-
- Linux (64-bit ARM): `sif-linux-arm64`
70+
71+
Each archive contains the sif binary and built-in modules.
72+
73+
- Windows (64-bit): `sif-windows-amd64.zip`
74+
- Windows (32-bit): `sif-windows-386.zip`
75+
- macOS (64-bit Intel): `sif-macos-amd64.tar.gz`
76+
- macOS (64-bit ARM): `sif-macos-arm64.tar.gz`
77+
- Linux (64-bit): `sif-linux-amd64.tar.gz`
78+
- Linux (32-bit): `sif-linux-386.tar.gz`
79+
- Linux (64-bit ARM): `sif-linux-arm64.tar.gz`
80+
81+
## Installation
82+
83+
```bash
84+
tar -xzf sif-linux-amd64.tar.gz
85+
cd sif-linux-amd64
86+
./sif -h
87+
```
6288
6389
For more details, check the [commit history](https://github.com/${{ github.repository }}/commits/main).
6490
draft: false
6591
prerelease: false
6692
files: |
67-
sif-windows-amd64.exe
68-
sif-windows-386.exe
69-
sif-macos-amd64
70-
sif-macos-arm64
71-
sif-linux-amd64
72-
sif-linux-386
73-
sif-linux-arm64
93+
sif-windows-amd64.zip
94+
sif-windows-386.zip
95+
sif-macos-amd64.tar.gz
96+
sif-macos-arm64.tar.gz
97+
sif-linux-amd64.tar.gz
98+
sif-linux-386.tar.gz
99+
sif-linux-arm64.tar.gz
74100
env:
75101
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/runtest.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,16 @@ jobs:
2727
echo "Sif exited with an error"
2828
exit 1
2929
fi
30+
31+
- name: Test module system
32+
run: |
33+
echo "Listing modules..."
34+
./sif -lm
35+
echo "Running all modules..."
36+
./sif -u https://example.com -am
37+
if [ $? -eq 0 ]; then
38+
echo "Module system working"
39+
else
40+
echo "Module system failed"
41+
exit 1
42+
fi

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
[![license](https://img.shields.io/badge/license-BSD--3--Clause-blue?style=flat-square)](LICENSE)
1010
[![discord](https://img.shields.io/badge/discord-join-5865F2?style=flat-square&logo=discord&logoColor=white)](https://discord.gg/sifcli)
1111

12-
**[install](#install) · [usage](#usage) · [modules](#modules) · [contribute](#contribute)**
12+
**[install](#install) · [usage](#usage) · [modules](#modules) · [docs](docs/) · [contribute](#contribute)**
1313

1414
</div>
1515

docs/README.md

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# sif documentation
2+
3+
welcome to the sif documentation. sif is a modular pentesting toolkit designed to be fast, concurrent, and extensible.
4+
5+
## table of contents
6+
7+
### getting started
8+
9+
- [installation](installation.md) - how to install sif
10+
- [quickstart](quickstart.md) - get up and running in minutes
11+
- [usage](usage.md) - command line options and examples
12+
13+
### features
14+
15+
- [scans](scans.md) - built-in security scans
16+
- [modules](modules.md) - yaml module system and custom modules
17+
18+
### reference
19+
20+
- [configuration](configuration.md) - runtime configuration options
21+
- [api mode](api-mode.md) - json output for automation
22+
23+
### contributing
24+
25+
- [development](development.md) - setting up a dev environment
26+
- [writing modules](modules.md#writing-modules) - create your own modules
27+
28+
---
29+
30+
## quick links
31+
32+
```bash
33+
# install
34+
git clone https://github.com/dropalldatabases/sif.git && cd sif && make
35+
36+
# basic scan
37+
./sif -u https://example.com
38+
39+
# list modules
40+
./sif -lm
41+
42+
# run all modules
43+
./sif -u https://example.com -am
44+
45+
# help
46+
./sif -h
47+
```
48+
49+
## support
50+
51+
- [github issues](https://github.com/vmfunc/sif/issues) - bug reports and feature requests
52+
- [discord](https://discord.gg/sifcli) - community chat

docs/api-mode.md

Lines changed: 160 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,160 @@
1+
# api mode
2+
3+
use sif's json output for automation and integration.
4+
5+
## enabling api mode
6+
7+
```bash
8+
./sif -u https://example.com -api
9+
```
10+
11+
## output format
12+
13+
api mode outputs json to stdout:
14+
15+
```json
16+
{
17+
"url": "https://example.com",
18+
"results": [
19+
{
20+
"id": "module-id",
21+
"data": {
22+
"module_id": "module-id",
23+
"target": "https://example.com",
24+
"findings": [
25+
{
26+
"url": "https://example.com/.git/HEAD",
27+
"severity": "high",
28+
"evidence": "ref: refs/heads/main",
29+
"extracted": {
30+
"branch": "main"
31+
}
32+
}
33+
]
34+
}
35+
}
36+
]
37+
}
38+
```
39+
40+
## fields
41+
42+
### url
43+
44+
the target url that was scanned.
45+
46+
### results
47+
48+
array of module results.
49+
50+
### results[].id
51+
52+
module identifier.
53+
54+
### results[].data.findings
55+
56+
array of security findings from the module.
57+
58+
### findings[].url
59+
60+
the specific url where the finding was detected.
61+
62+
### findings[].severity
63+
64+
severity level: `info`, `low`, `medium`, `high`, `critical`
65+
66+
### findings[].evidence
67+
68+
evidence that triggered the finding (matched content, etc).
69+
70+
### findings[].extracted
71+
72+
extracted data from the response (versions, keys, etc).
73+
74+
## examples
75+
76+
### save to file
77+
78+
```bash
79+
./sif -u https://example.com -api -am > results.json
80+
```
81+
82+
### pipe to jq
83+
84+
```bash
85+
./sif -u https://example.com -api -am | jq '.results[].data.findings[]'
86+
```
87+
88+
### filter high severity
89+
90+
```bash
91+
./sif -u https://example.com -api -am | jq '.results[].data.findings[] | select(.severity == "high")'
92+
```
93+
94+
### extract urls
95+
96+
```bash
97+
./sif -u https://example.com -api -am | jq -r '.results[].data.findings[].url'
98+
```
99+
100+
## ci/cd integration
101+
102+
### github actions
103+
104+
```yaml
105+
- name: run sif scan
106+
run: |
107+
./sif -u ${{ env.TARGET_URL }} -api -am > sif-results.json
108+
109+
- name: check for high severity findings
110+
run: |
111+
HIGH_COUNT=$(jq '[.results[].data.findings[] | select(.severity == "high" or .severity == "critical")] | length' sif-results.json)
112+
if [ "$HIGH_COUNT" -gt 0 ]; then
113+
echo "Found $HIGH_COUNT high/critical severity findings"
114+
exit 1
115+
fi
116+
```
117+
118+
### gitlab ci
119+
120+
```yaml
121+
security_scan:
122+
script:
123+
- ./sif -u $TARGET_URL -api -am > sif-results.json
124+
- |
125+
if jq -e '.results[].data.findings[] | select(.severity == "critical")' sif-results.json > /dev/null; then
126+
echo "Critical findings detected"
127+
exit 1
128+
fi
129+
artifacts:
130+
paths:
131+
- sif-results.json
132+
```
133+
134+
## multiple targets
135+
136+
when scanning multiple urls, each target outputs a separate json object:
137+
138+
```bash
139+
./sif -u https://site1.com,https://site2.com -api
140+
```
141+
142+
outputs:
143+
144+
```json
145+
{"url":"https://site1.com","results":[...]}
146+
{"url":"https://site2.com","results":[...]}
147+
```
148+
149+
use `jq -s` to combine into an array:
150+
151+
```bash
152+
./sif -u https://site1.com,https://site2.com -api | jq -s '.'
153+
```
154+
155+
## notes
156+
157+
- api mode suppresses banner and interactive output
158+
- all output goes to stdout
159+
- errors and warnings still go to stderr
160+
- combine with `-l` flag to also save detailed logs

0 commit comments

Comments
 (0)