Skip to content

Commit

Permalink
saved results now contain a timestamp
Browse files Browse the repository at this point in the history
  • Loading branch information
nullt3r committed Feb 1, 2023
1 parent ae63011 commit bfb75e2
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 7 deletions.
14 changes: 11 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ Fast and lightweight, UDPX is a single-packet UDP scanner written in Go that sup
* You don't need to instal libpcap or any other dependencies.
* Can run on Linux, Mac Os, Windows. Or your Nethunter if you built it for Arm.
* Customizable. You can add your probes and test for even more protocols.
* Stores results in JSONL format.
* Scans also domain names.

## How it works
Scanning UDP ports is very different than scanning TCP - you may, or may not get any result back from probing an UDP port as UDP is a connectionless protocol. UDPX implements a single-packet based approach. A protocol-specific packet is sent to the defined service (port) and waits for a response. The limit is set to 500 ms by default and can be changed by `-w` flag. If the service sends a packet back within this time, it is certain that it is indeed listening on that port and is reported as open.
Expand Down Expand Up @@ -41,6 +43,12 @@ Target can be:

IPv6 is supported.

If you want to store the results, use flag `-o [filename]`. Output is in JSONL format, as can be seen bellow:

```jsonl
{"address":"45.33.32.156","hostname":"scanme.nmap.org","port":123,"service":"ntp","response_data":"JAME6QAAAEoAAA56LU9vp+d2ZPwOYIyDxU8jS3GxUvM="}
```

## Options
```
Expand Down Expand Up @@ -154,9 +162,9 @@ Please send a feature request with protocol name and port and I will make it hap

```go
{
Name: "ike",
Data: "5b5e64c03e99b51100000000000000000110020000000000000001500000013400000001000000010000012801010008030000240101",
Port: 500,
Name: "ike",
Payloads: []string{"5b5e64c03e99b51100000000000000000110020000000000000001500000013400000001000000010000012801010008030000240101"},
Port: []int{500, 4500},
},
```

Expand Down
7 changes: 3 additions & 4 deletions cmd/udpx/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,12 +113,12 @@ func main() {
if len(opts.Arg_o) != 0 {
f, err := os.Create(opts.Arg_o)

defer f.Close()

if err != nil {
log.Fatalf("%s[!]%s Error creating output file: %s", colors.SetColor().Red, colors.SetColor().Reset, err)
}

defer f.Close()

log.Printf("[+] Results will be written to: %s", opts.Arg_o)
}

Expand All @@ -142,11 +142,10 @@ func main() {
log.Fatalf("%s[!]%s Error opening output file: %s", colors.SetColor().Red, colors.SetColor().Reset, err)
}

defer f.Close()

if _, err = f.WriteString(string(json) + "\n"); err != nil {
log.Fatalf("%s[!]%s Error writing output file: %s", colors.SetColor().Red, colors.SetColor().Reset, err)
}

}
}

Expand Down

0 comments on commit bfb75e2

Please sign in to comment.