|
@@ -3,9 +3,11 @@ package main
|
|
import (
|
|
import (
|
|
"encoding/json"
|
|
"encoding/json"
|
|
"fmt"
|
|
"fmt"
|
|
|
|
+ "log"
|
|
"net/http"
|
|
"net/http"
|
|
"time"
|
|
"time"
|
|
|
|
|
|
|
|
+ "github.com/bcurren/go-ssdp"
|
|
"imuslab.com/zoraxy/mod/dynamicproxy"
|
|
"imuslab.com/zoraxy/mod/dynamicproxy"
|
|
"imuslab.com/zoraxy/mod/ipscan"
|
|
"imuslab.com/zoraxy/mod/ipscan"
|
|
"imuslab.com/zoraxy/mod/mdns"
|
|
"imuslab.com/zoraxy/mod/mdns"
|
|
@@ -156,7 +158,7 @@ func HandleMdnsScanning(w http.ResponseWriter, r *http.Request) {
|
|
utils.SendJSONResponse(w, string(js))
|
|
utils.SendJSONResponse(w, string(js))
|
|
}
|
|
}
|
|
|
|
|
|
-//handle traceroute tools
|
|
|
|
|
|
+//handle ip scanning
|
|
func HandleIpScan(w http.ResponseWriter, r *http.Request) {
|
|
func HandleIpScan(w http.ResponseWriter, r *http.Request) {
|
|
cidr, err := utils.PostPara(r, "cidr")
|
|
cidr, err := utils.PostPara(r, "cidr")
|
|
if err != nil {
|
|
if err != nil {
|
|
@@ -193,3 +195,17 @@ func HandleIpScan(w http.ResponseWriter, r *http.Request) {
|
|
utils.SendJSONResponse(w, string(js))
|
|
utils.SendJSONResponse(w, string(js))
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+//Handle SSDP discovery
|
|
|
|
+func HandleSsdpDiscovery(w http.ResponseWriter, r *http.Request) {
|
|
|
|
+ responses, err := ssdp.Search("ssdp:discover", 10*time.Second)
|
|
|
|
+ log.Println(responses, err)
|
|
|
|
+ if err != nil {
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ for _, response := range responses {
|
|
|
|
+ // Do something with the response you discover
|
|
|
|
+ fmt.Println(response)
|
|
|
|
+ }
|
|
|
|
+}
|