Skip to content
Snippets Groups Projects
Commit 3f846b9f authored by Pratik Lagaskar's avatar Pratik Lagaskar
Browse files

few edits

parent c89fb412
No related branches found
No related tags found
No related merge requests found
WIP
<p align="center">
<img width="285" height="285" src="https://0xacab.org/warlordsam/assets/-/raw/no-masters/vpn-hole-mascot.png">
<img width="285" height="285" src="https://0xacab.org/warlordsam/assets/-/raw/no-masters/vpn-hole_mascot.png">
</p>
# **VPN-Hole**
......
......@@ -40,7 +40,7 @@ func (b *Blacklist) updateList(ctx context.Context, blacklistURL, sum string) ([
b.subscriptions[blacklistURL] = newSum
b.subscriptionsMu.Unlock()
log.Println("blacklist subscription updated", blacklistURL, newSum)
log.Println("\033[32m[+] blacklist subscription updated\033[0m", blacklistURL, newSum)
return hosts, nil
}
......@@ -42,10 +42,21 @@ func Handler(rw dns.ResponseWriter, req *dns.Msg) {
return
}
// To debug what is causing the i/o timeout error
// pretty.Println(resp)
if err = rw.WriteMsg(resp); err != nil {
log.Println(fmt.Errorf("failed to reply: %w", err))
}
// To prevent the i/o timeout error from causing a panic that crashes vpnhole
// validate that the response is not nil before trying to access it
if resp.Answer == nil {
fmt.Println("\033[31m", "[-] Issue resolving DNS Name.", "\033[0m")
} else {
fmt.Println(resp.Answer)
}
}
func Block(rw dns.ResponseWriter, req *dns.Msg) error {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment