Documentation
¶
Index ¶
- Variables
- func BufferFromFile(inputfile *os.File) (*bufio.Reader, error)
- func BuildThreatDB(arguments map[string]any, logger zerolog.Logger) error
- func CheckIPinTI(ip string, isDataCenter bool, db *sql.DB) (string, string, string, bool, error)
- func CloseChannelWhenDone(c chan []string, wg *lbtypes.WaitGroupCount)
- func CombineOutputs(arguments map[string]any, logger zerolog.Logger) error
- func CopyFile(src, dst string) error
- func CreateOutput(outputFile string) (*os.File, error)
- func DoDNSEnrichment(ipaddress string) (string, string)
- func DoDomainWhoisenrichment(domain string) []string
- func DoIDBEnrichment(ipaddress string) []string
- func DoIPWhoisEnrichment(ipaddress string) []string
- func DoesFileExist(filename string) bool
- func DownloadAuthenticatedFile(logger zerolog.Logger, url string, filepath string, key string, user string, ...) (err error)
- func DownloadFile(logger zerolog.Logger, url string, filepath string, key string) (err error)
- func ExtractTarGz(gzipStream io.Reader, logger zerolog.Logger, dir string) error
- func FileToSlice(filename string, logger zerolog.Logger) []string
- func FindOrGetDBs(arguments map[string]any, logger zerolog.Logger, apikey string) error
- func FindTargetIndexInSlice(headers []string, targetCol string) int
- func GetFeedIDIfExist(feed_name string, db *sql.DB) int
- func GetHeaders(tempArgs map[string]any, headers []string) []string
- func GetNewPW(logger zerolog.Logger, inputFile string, outputFile string) (*csv.Reader, *csv.Writer, *os.File, *os.File, error)
- func Increment(ip net.IP)
- func IngestFile(inputFile string, categories string, feedid int, db *sql.DB, ...) error
- func IngestIPNetLists(url string, name string, file string, listtype string, category string, ...)
- func InsertCategory(category string, db *sql.DB) error
- func InsertFeed(feed_name string, feed_url string, db *sql.DB) (error, int)
- func IntSlicetoStringSlice(s []int) []string
- func IsASN(s string) bool
- func IsPrivateIP(ip net.IP, ipstring string) bool
- func ListenOnWriteChannel(c chan []string, w *csv.Writer, logger zerolog.Logger, outputF *os.File, ...)
- func LookupIPRecords(ip string) []string
- func OpenDBConnection(logger zerolog.Logger) (*sql.DB, error)
- func OpenInput(inputFile string) (*os.File, error)
- func ProcessRecords(logger zerolog.Logger, records [][]string, asnDB maxminddb.Reader, ...)
- func RegexFirstPublicIPFromString(input string) (string, bool)
- func RemoveSpace(s string) string
- func ScannerFromFile(reader io.Reader) (*bufio.Scanner, error)
- func SetAPIUrls(arguments map[string]any, logger zerolog.Logger) (error, string)
- func SetupLogger() zerolog.Logger
- func SetupPrivateNetworks() error
- func SummarizeThreatDB(logger zerolog.Logger)
- func SummarizeThreatFeeds(logger zerolog.Logger)
- func UpdateDCList(logger zerolog.Logger)
- func UpdateVPNList(logger zerolog.Logger)
- func Whois(domain string, servers ...string) (result string, err error)
- type Client
- type Feed
- type Feeds
- type IPNetGenerator
- type IPWhoisResult
Constants ¶
This section is empty.
Variables ¶
var CategoryMap = make(map[string]int) // Maps Intel Category string to corresponding RowID in DB
var DefaultClient = NewClient()
var PrivateIPBlocks []*net.IPNet
var ThreatDBFile = "threats.db"
var UseIntel = false
Functions ¶
func CheckIPinTI ¶
func CloseChannelWhenDone ¶
func CloseChannelWhenDone(c chan []string, wg *lbtypes.WaitGroupCount)
CloseChannelWhenDone is a helper function for handling channel closure with a wait-group.
func CombineOutputs ¶
CombineOutputs works to combine all CSV outputs on a per-directory level, trying to match header columns if possible
func DoDNSEnrichment ¶
DoDNSEnrichment provides all current hostname records associated with a Domain along with the base hostname+tld, if any exist
func DoDomainWhoisenrichment ¶
DoDomainWhoisenrichment returns a slice representing enrichments from a Domain-based WhoIS lookup.
func DoIDBEnrichment ¶
DoIDBEnrichment returns a slice representing enrichments from Shodan's InternetDB project using the provided IP Address as the enrichment target.
func DoIPWhoisEnrichment ¶
DoIPWhoisEnrichment returns a slice representing enrichments from an IP-based WhoIS lookup.
func DoesFileExist ¶
func DownloadFile ¶
func ExtractTarGz ¶
func FileToSlice ¶
FileToSlice reads a file and returns a slice representing lines in the file
func FindOrGetDBs ¶
func FindTargetIndexInSlice ¶
FindTargetIndexInSlice receives a string-slice and attempts to locate a specific value, returning the index of said value if it exists of -1 if not.
func Increment ¶
Increment increments the given net.IP by one bit. Incrementing the last IP in an IP space (IPv4, IPV6) is undefined.
func IngestFile ¶
func IngestIPNetLists ¶
func IntSlicetoStringSlice ¶
IntSlicetoStringSlice converts a slice of ints to a slice of the same length but of type string
func ListenOnWriteChannel ¶
func LookupIPRecords ¶
func ProcessRecords ¶
func ProcessRecords(logger zerolog.Logger, records [][]string, asnDB maxminddb.Reader, cityDB maxminddb.Reader, countryDB maxminddb.Reader, domainDB maxminddb.Reader, ipAddressColumn int, jsonColumn int, useRegex bool, useDNS bool, channel chan []string, waitGroup *lbtypes.WaitGroupCount, tracker *lbtypes.RunningJobs, tempArgs map[string]any, dateindex int)
func RegexFirstPublicIPFromString ¶
RegexFirstPublicIPFromString attempts to use regex patterns to extract the first-identified non-private IP address from a string
func RemoveSpace ¶
func SetupLogger ¶
func SetupPrivateNetworks ¶
func SetupPrivateNetworks() error
func SummarizeThreatDB ¶
func SummarizeThreatFeeds ¶
func UpdateDCList ¶
func UpdateVPNList ¶
Types ¶
type IPNetGenerator ¶
IPNetGenerator is a net.IPnet wrapper that you can iterate over
func NewFromIPNet ¶
func NewFromIPNet(ipNet *net.IPNet) *IPNetGenerator
NewFromIPNet creates a new IPNetGenerator from a *net.IPNet
func NewIPNetGenerator ¶
func NewIPNetGenerator(cidr string) (*IPNetGenerator, error)
NewIPNetGenerator creates a new IPNetGenerator from a CIDR string, or an error if the CIDR is invalid.
func (*IPNetGenerator) Next ¶
func (g *IPNetGenerator) Next() net.IP
Next returns the next net.IP in the subnet
type IPWhoisResult ¶
type IPWhoisResult struct { NetRange string CIDR string NetName string NetHandle string Parent string NetType string OriginAS string Customer string RegistrationDate string RegistrationUpdated string ReferenceURL string CustomerName string Address string City string StateProv string PostalCode string Country string AddressUpdated string EntityReferenceURL string OrgNOCName string OrgNOCEmail string OrgTechName string OrgTechEmail string OrgAbuseName string OrgAbuseEmail string }
func ParseIPWhoisLookup ¶
func ParseIPWhoisLookup(data string) (IPWhoisResult, error)
ParseIPWhoisLookup parses the raw results of a Whois lookup against an IP Address