We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 6e3cec1 commit 31f679cCopy full SHA for 31f679c
net.go
@@ -239,6 +239,14 @@ func PortscanSingle(target string, port int) bool {
239
return len(opened_ports) != 0
240
}
241
242
+// PortscanSingleTimeout checks if a specific port is open in a given target.
243
+// Connection timeout as well as no. of threads can be adjusted
244
+func PortscanSingleTimeout(target string, port, timeout, threads int) bool {
245
+ ps := portscanner.NewPortScanner(target, time.Duration(timeout)*time.Second, threads)
246
+ opened_ports := ps.GetOpenedPort(port-1, port+1)
247
+ return len(opened_ports) != 0
248
+}
249
+
250
// Returns true if host is alive
251
func Ping(target string) bool {
252
open_counter := 0
0 commit comments