mirror of
https://github.com/yunginnanet/HellPot
synced 2024-06-25 15:28:01 +00:00
Web: Serve only the exact path
This commit is contained in:
parent
186d672aa2
commit
b612c1fb98
12
heffalump.go
12
heffalump.go
@ -28,10 +28,14 @@ func main() {
|
||||
port = "8080"
|
||||
}
|
||||
|
||||
path := flag.String("path", "/", `Path to serve from. Path ending in / serves sub-paths.`)
|
||||
flag.Parse()
|
||||
|
||||
http.HandleFunc(*path, heff.DefaultHoneypot)
|
||||
http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
|
||||
if r.URL.Path != "/" {
|
||||
http.NotFound(w, r)
|
||||
return
|
||||
}
|
||||
log.Printf("serving %v", r)
|
||||
heff.DefaultHoneypot(w, r)
|
||||
})
|
||||
|
||||
log.Fatal(http.ListenAndServe(":"+port, nil))
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user