Open
Description
Thanks for this great module.
When I use it, it corrupts the terminal.
I think you need to provide an option to run nmap without runtime interaction.
(There's a not well documented --noninteractive
CLI flag in my version of nmap)
My temporary work around:
diff --git a/nmap.go b/nmap.go
index 206f38a..60d06b7 100644
--- a/nmap.go
+++ b/nmap.go
@@ -15,6 +15,7 @@ func getServerInfo(ctx context.Context, ...) (string, error) {
log := klog.FromContext(ctx)
scanner, err := nmap.NewScanner(
ctx,
+ nmap.WithCustomArguments("--noninteractive"),
nmap.WithTargets(r.CommonName),
nmap.WithPorts("443"),
nmap.WithServiceInfo(),
$ nmap -V
Nmap version 7.80 ( https://nmap.org )
Platform: x86_64-pc-linux-gnu
Compiled with: liblua-5.3.6 openssl-3.0.2 nmap-libssh2-1.8.2 libz-1.2.11 libpcre-8.39 libpcap-1.10.1 nmap-libdnet-1.12 ipv6
Compiled without:
Available nsock engines: epoll poll select
$ cat /etc/os-release
PRETTY_NAME="Ubuntu 22.04.2 LTS"
NAME="Ubuntu"
VERSION_ID="22.04"
VERSION="22.04.2 LTS (Jammy Jellyfish)"
VERSION_CODENAME=jammy
ID=ubuntu
ID_LIKE=debian
See also: