Skip to content

Commit 13a7543

Browse files
committed
del -ip
1 parent f61eb05 commit 13a7543

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

main.go

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import (
1212
"github.com/miekg/dns"
1313
"github.com/sirupsen/logrus"
1414
"gorm.io/gorm"
15+
"log"
1516
"net"
1617
"net/http"
1718
"regexp"
@@ -377,12 +378,26 @@ func HttpApiServer() {
377378
}
378379
}
379380

381+
func GetOutboundIP() net.IP {
382+
conn, err := net.Dial("udp", "8.8.8.8:80")
383+
if err != nil {
384+
log.Fatal(err)
385+
}
386+
defer conn.Close()
387+
388+
localAddr := conn.LocalAddr().(*net.UDPAddr)
389+
390+
return localAddr.IP
391+
}
392+
380393
func main() {
381394
var ExpiresAt uint64
382395
flag.StringVar(&httpHost, "httpHost", "127.0.0.1:55555", "set ACME http Server ip:port,handle ACME DNS challenges easily,default: 127.0.0.1:55555")
383396
flag.StringVar(&key, "key", "", "use ACME http API Key")
384397
flag.StringVar(&domain, "domain", "51pwn.com,exploit-poc.com", "set domain eg: 51pwn.com")
385-
flag.StringVar(&ip, "ip", "144.34.164.150", "set domain server ip, eg: 222.44.11.3")
398+
//flag.StringVar(&ip, "ip", "144.34.164.150", "set domain server ip, eg: 222.44.11.3")
399+
ip = GetOutboundIP().String()
400+
log.Println("ip == ", ip)
386401
flag.StringVar(&resUrl, "resUrl", "", "Set the Elasticsearch url that accepts dns parsing logs, eg: http://127.0.0.1/dnsRecode")
387402
flag.StringVar(&logLevel, "level", "WARN", "set loglevel, option")
388403
flag.Uint64Var(&ExpiresAt, "ExpiresAt", 120000, "default 120s = 120000")

0 commit comments

Comments
 (0)