engine

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2020 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Overview

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

View Source
const (
	IPV4 = "ipv4"

	TCP  = "tcp"
	UDP  = "udp"
	SCTP = "sctp"
)
View Source
const (
	MainEventOuterMsg         = "mole"
	MainEventInnerMsg         = "event"
	MainEventInitCompletedMsg = "starting mole ids engine"
	StartMsg                  = "engine is listening for packages"
	NoMatchFoundMsg           = "unable to find yara rule for proto:%s src:%s sport:%s dst:%s dport:%s"
	ScannerScanMemFaildMsg    = "error while scanning payload: %s"
	UnableToDecodePacketMsg   = "unable to fully decode packet. Error in layer: %d"
	ConfigInitFailedMsg       = "while configuring the engine"
	RulesManagerInitFailMsg   = "while initialating rules manager got"
	CreateTreeFailMsg         = "while generating the Decision tree got"
	InterfacesInitFailMsg     = "while initialating interfaces got"
	LoadingRulesFailedMsg     = "while loading rules got"
	GettingHandlerFailMsg     = "while getting the snffer handler got"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
}

Config engine internal configuration

func InitConfig

func InitConfig() (*Config, error)

InitConfig initializes engine package

type Engine

type Engine struct {
	// Config engine's configuration most of its values come from the arguments
	// or configuration file
	Config *Config

	// Iface is the interface where Mole reads packets
	Iface *interfaces.Interfaces

	// RulesManager handles everything related with rules
	RulesManager *rules.Manager

	// RuleMap used to fire Yara rules based on the identifier token return by
	// the look up query
	RuleMap types.RuleMapScanner

	// Handle is the interface handeler that allow Mole to capture traffic
	Handle gopacket.PacketDataSource
}

Engine is in charge to handle the mole core functionalities

func New

func New() (motor *Engine, err error)

New builds a new Engine

func (*Engine) Start

func (motor *Engine) Start()

Start read packages and fire Yara rules against those packets

type PacketExtractor

type PacketExtractor struct {
	Packet   gopacket.Packet
	Metadata *gopacket.PacketMetadata

	NetworkLayer     string
	TransportLayer   string
	ApplicationLayer string

	Network     gopacket.Layer
	Transport   gopacket.Layer
	Application gopacket.Layer
	// contains filtered or unexported fields
}

func NewPacketExtractor

func NewPacketExtractor(pkt gopacket.Packet) *PacketExtractor

func (*PacketExtractor) AddApplicationLayer

func (pe *PacketExtractor) AddApplicationLayer(typ string, layer gopacket.Layer) error

func (*PacketExtractor) AddNetworkLayer

func (pe *PacketExtractor) AddNetworkLayer(typ string, layer gopacket.Layer) error

func (*PacketExtractor) AddTransportLayer

func (pe *PacketExtractor) AddTransportLayer(typ string, layer gopacket.Layer) error

func (*PacketExtractor) GetIPv4

func (pe *PacketExtractor) GetIPv4() *layers.IPv4

func (*PacketExtractor) GetIfaceName

func (pe *PacketExtractor) GetIfaceName() string

func (*PacketExtractor) GetMetadata

func (pe *PacketExtractor) GetMetadata() (meta types.MetaRule)

func (*PacketExtractor) GetPacketMetadata

func (pe *PacketExtractor) GetPacketMetadata() *gopacket.PacketMetadata

func (*PacketExtractor) GetPacketPayload

func (pe *PacketExtractor) GetPacketPayload() []byte

func (*PacketExtractor) GetSCTP

func (pe *PacketExtractor) GetSCTP() *layers.SCTP

func (*PacketExtractor) GetTCP

func (pe *PacketExtractor) GetTCP() *layers.TCP

func (*PacketExtractor) GetUDP

func (pe *PacketExtractor) GetUDP() *layers.UDP

Jump to

Keyboard shortcuts

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