Skip to content

Commit

Permalink
Added version information
Browse files Browse the repository at this point in the history
  • Loading branch information
lkarlslund committed Nov 9, 2024
1 parent 0a4a529 commit bdc7fae
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 5 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
binaries/*
binaries
build
.vscode
15 changes: 13 additions & 2 deletions build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,18 @@ function BuildVariants {

Set-Location $PSScriptRoot

$COMMIT = git rev-parse --short HEAD
$VERSION = git describe --tags --exclude latest --exclude devbuild
$DIRTYFILES = git status --porcelain
$BUILDER = "go"

if ("$DIRTYFILES" -ne "") {
$VERSION = "$VERSION-local-changes"
}

Write-Output "Building $VERSION"

$LDFLAGS = "-X main.Version=$VERSION"

# Release
BuildVariants -ldflags "$LDFLAGS -s" -prefix ldapnomnom -path . -arch @("386", "amd64", "arm64") -os @("windows", "darwin", "linux")

$env:GOGARBLE="github.com/lkarlslund"
12 changes: 10 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ const banner = ` __ ____ _____ _____
| |__| | | | __| | . | | | . | |
|_____|____/|__|__|__| |_|_|___|_|_|_|_|_|___|_|_|_|`

var Version string

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

flag.Parse()

if flag.Arg(0) == "version" {
fmt.Printf("LDAP Nom Nom %v\n", Version)
os.Exit(0)
}

fmt.Println(banner)
fmt.Printf("%v\n", Version)
fmt.Println()
fmt.Println("IN SPACE NO ONE CAN HEAR YOU NOM NOM USERNAMES")
fmt.Println()

flag.Parse()

tlsmode, err := TLSmodeString(*tlsmodeString)
if err != nil {
log.Fatalf("unknown TLS mode %v", tlsmode)
Expand Down
6 changes: 6 additions & 0 deletions readme.MD
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,12 @@ go install github.com/lkarlslund/ldapnomnom@latest
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]
```

### Show version

```bash
ldapnomnom version
```

### Bruteforcing examples

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

0 comments on commit bdc7fae

Please sign in to comment.