new: dns.spoof now supports a hosts file with multiple mappings (closes #344)

This commit is contained in:
evilsocket 2018-09-20 14:42:10 +02:00
parent 3ed4db132c
commit d16b0c7cf5
No known key found for this signature in database
GPG key ID: 1564D7F30393A456
4 changed files with 131 additions and 43 deletions

View file

@ -2,6 +2,7 @@ package session
import (
"fmt"
"net"
"strings"
"sync"
"time"
@ -86,6 +87,14 @@ func (m SessionModule) StringParam(name string) (error, string) {
}
}
func (m SessionModule) IPParam(name string) (error, net.IP) {
if err, v := m.StringParam(name); err != nil {
return err, nil
} else {
return nil, net.ParseIP(v)
}
}
func (m SessionModule) IntParam(name string) (error, int) {
if p, found := m.params[name]; found {
if err, v := p.Get(m.Session); err != nil {