db

package
v1.33.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 2, 2025 License: Apache-2.0 Imports: 4 Imported by: 1

Documentation

Overview

SQLite Caching and Cross-Exploit Database

The db package contains the logic to handle a user provided SQLite DB in order to store results and cache HTTP responses. This has a few useful benefits:

  1. When scanning with hundreds of go-exploit implementations, the user significantly cuts down on network requests (therefore speeding up scanning), both from the verified results being cached (you only have to verify a target is Confluence once) and from the cached HTTP responses.
  2. The result is a useful asset database containing IP, port, installed software, and versions.
  3. The database can be reused with a go-exploit and generate no network traffic (assuming you aren't doing the exploitation stage). That is very interesting when, for example, you wrote a version scanner for CVE-2024-31982, scanned a customer host that was patched, but then CVE-2024-31983 is released the next day. You can essentially rescan the cached version of their system with your new CVE scanner.

Mostly this package should be totally transparent to users of the framework. The only direct interface, currently, should be calls to HTTPGetCache.

Index

Constants

This section is empty.

Variables

View Source
var GlobalHTTPRespCacheLimit int

GlobalHTTPRespCacheLimit is the maximum size of an HTTP body that we will attempt to cache.

View Source
var GlobalSQLHandle *sql.DB

GlobalSQLHandle is a handle to the SQLite DB for handling cross-exploit data sharing.

Functions

func CacheHTTPResponse

func CacheHTTPResponse(rhost string, rport int, path string, httpResp []byte)

Attempt to cache the provided HTTP httpResp in the database.

func GetHTTPResponse

func GetHTTPResponse(rhost string, rport int, path string) (string, bool)

Look for an HTTP response in the db cache.

func GetVerified

func GetVerified(product string, rhost string, rport int) (bool, bool)

Check the database to see if the target has been scanned for specific software. If so, return the result (so we don't do it again) Return is <db-value>,<ok>.

func InitializeDB

func InitializeDB(name string) bool

func UpdateVerified

func UpdateVerified(software string, installed bool, version string, rhost string, rport int) bool

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL