Skip to content

Commit bdc7fae

Browse files
committed
Added version information
1 parent 0a4a529 commit bdc7fae

File tree

4 files changed

+32
-5
lines changed

4 files changed

+32
-5
lines changed

.gitignore

+3-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1-
binaries/*
1+
binaries
2+
build
3+
.vscode

build.ps1

+13-2
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,18 @@ function BuildVariants {
4242

4343
Set-Location $PSScriptRoot
4444

45+
$COMMIT = git rev-parse --short HEAD
46+
$VERSION = git describe --tags --exclude latest --exclude devbuild
47+
$DIRTYFILES = git status --porcelain
48+
$BUILDER = "go"
49+
50+
if ("$DIRTYFILES" -ne "") {
51+
$VERSION = "$VERSION-local-changes"
52+
}
53+
54+
Write-Output "Building $VERSION"
55+
56+
$LDFLAGS = "-X main.Version=$VERSION"
57+
4558
# Release
4659
BuildVariants -ldflags "$LDFLAGS -s" -prefix ldapnomnom -path . -arch @("386", "amd64", "arm64") -os @("windows", "darwin", "linux")
47-
48-
$env:GOGARBLE="github.com/lkarlslund"

main.go

+10-2
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ const banner = ` __ ____ _____ _____
4444
| |__| | | | __| | . | | | . | |
4545
|_____|____/|__|__|__| |_|_|___|_|_|_|_|_|___|_|_|_|`
4646

47+
var Version string
48+
4749
func main() {
4850
server := flag.String("server", "", "Comma separated list of DCs to connect to, use IP or full hostname - will try autodection if not supplied")
4951
dnsdomain := flag.String("dnsdomain", "", "Domain to connect to in DNS suffix format - will try autodection if not supplied")
@@ -70,13 +72,19 @@ func main() {
7072
maxstrategy := flag.String("maxstrategy", "fastest", "How to select servers if more are found than wanted (fastest, random)")
7173
parallel := flag.Int("parallel", 8, "How many connections per server to run in parallel")
7274

75+
flag.Parse()
76+
77+
if flag.Arg(0) == "version" {
78+
fmt.Printf("LDAP Nom Nom %v\n", Version)
79+
os.Exit(0)
80+
}
81+
7382
fmt.Println(banner)
83+
fmt.Printf("%v\n", Version)
7484
fmt.Println()
7585
fmt.Println("IN SPACE NO ONE CAN HEAR YOU NOM NOM USERNAMES")
7686
fmt.Println()
7787

78-
flag.Parse()
79-
8088
tlsmode, err := TLSmodeString(*tlsmodeString)
8189
if err != nil {
8290
log.Fatalf("unknown TLS mode %v", tlsmode)

readme.MD

+6
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,12 @@ go install github.com/lkarlslund/ldapnomnom@latest
2828
ldapnomnom [--server dc1.domain.suffix[,dc2.domain.suffix] | --dnsdomain domain.suffix] [--port number] [--tlsmode notls|tls|starttls] [--input filename] [--output filename] [--parallel number-of-connections] [--maxservers number-of-servers] [--maxstrategy fastest|random] [--throttle n] [--maxrequests n]
2929
```
3030

31+
### Show version
32+
33+
```bash
34+
ldapnomnom version
35+
```
36+
3137
### Bruteforcing examples
3238

3339
Connect to up to 32 servers from contoso.local with 16 connections to each - FAAAAAAAST

0 commit comments

Comments
 (0)