models

package
v0.0.0-...-7a11031 Latest Latest
Warning

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

Go to latest
Published: Feb 2, 2018 License: GPL-3.0 Imports: 18 Imported by: 0

Documentation

Overview

cSploit - a simple penetration testing suite * Copyright (C) 2016 Massimo Dragano aka tux_mind <tux_mind@csploit.org> * * cSploit is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * cSploit is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with cSploit. If not, see <http://www.gnu.org/licenses/\>. *

cSploit - a simple penetration testing suite * Copyright (C) 2016 Massimo Dragano aka tux_mind <tux_mind@csploit.org> * * cSploit is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * cSploit is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with cSploit. If not, see <http://www.gnu.org/licenses/\>. *

cSploit - a simple penetration testing suite * Copyright (C) 2016 Massimo Dragano aka tux_mind <tux_mind@csploit.org> * * cSploit is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * cSploit is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with cSploit. If not, see <http://www.gnu.org/licenses/\>. *

cSploit - a simple penetration testing suite * Copyright (C) 2016 Massimo Dragano aka tux_mind <tux_mind@csploit.org> * * cSploit is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * cSploit is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with cSploit. If not, see <http://www.gnu.org/licenses/\>. *

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetDbInstance

func GetDbInstance() *gorm.DB

func NotifyHostSeen

func NotifyHostSeen(hwAddr net.HardwareAddr, ipAddr net.IP, name *string)

func Setup

func Setup() error

Types

type AP

type AP struct {
	internal.Base
	Bssid   string    `json:"bssid"`
	First   time.Time `json:"first_seen"`
	Last    time.Time `json:"last_seen"`
	Channel int       `json:"channel"`
	Speed   int       `json:"speed"`
	Privacy string    `json:"privacy"`
	Cipher  string    `json:"cipher"`
	Auth    string    `json:"auth"`
	Power   int       `json:"power"`
	Beacons int       `json:"beacons"`
	IVs     int       `json:"ivs"`
	Lan     string    `json:"lan_ip"`
	IdLen   int       `json:"id_len"`
	Essid   string    `json:"essid"`
	Key     string    `json:"key"`

	// Does the fake auth succeed?
	FakeAuthed bool `json:"fake_auth"`

	Iface   Iface `json:"-"`
	IfaceId uint  `json:"-"`
	Jobs    []Job `json:"-" gorm:"many2many:job_aps;"`
}

Access Point ( courtesy of aircrack )

func FindAp

func FindAp(id uint) (a *AP, e error)

func FindApByBssid

func FindApByBssid(bssid string) (a *AP, e error)

func (*AP) ArpReplay

func (a *AP) ArpReplay(iface string) (j Job, e error)

ARP replay!!

func (*AP) Capture

func (a *AP) Capture() (j Job, e error)

Start a capture process

func (*AP) Deauth

func (a *AP) Deauth() (j Job, e error)

DEAUTH infinitely the AP using broadcast address

func (*AP) FakeAuth

func (a *AP) FakeAuth() (j Job, e error)

Try a fake auth on the ap

type Capture

type Capture struct {
	internal.Base

	Key       string `json:"key"`
	Handshake bool   `json:"has_handshake"`
	Cracking  bool   `json:"cracking"`
	File      string `json:"-"`

	Dict string `json:"dict"`

	Ap   AP   `json:"-"`
	ApId uint `json:"ap_id"`
}

an airodump capture file

func (*Capture) CheckForHandshake

func (c *Capture) CheckForHandshake() (j Job, e error)

func (*Capture) Crack

func (c *Capture) Crack() (j Job, e error)

Return ascii key; if cracking WEP dict can be null

type Client

type Client struct {
	internal.Base
	// MAC address
	First   time.Time `json:"first_seen"`
	Last    time.Time `json:"last_seen"`
	Station string    `json:"station"`
	Power   int       `json:"power"`
	Packets int       `json:"packets"`
	Bssid   string    `json:"bssid"`
	Probed  string    `json:"probed_essids"`

	Iface   Iface `json:"-"`
	IfaceId uint  `json:"-"`
	Jobs    []Job `json:"-" gorm:"many2many:job_clients"`
}

A wifi client ( courtesy of aircrack )

func FindClient

func FindClient(id uint) (c *Client, e error)

func FindClientByMac

func FindClientByMac(mac_addr string) (c *Client, e error)

func (*Client) Deauth

func (c *Client) Deauth() (j Job, e error)

DEAUTH infinitely the Client

type DiscoveryJob

type DiscoveryJob struct {
	internal.Base

	Dir string `json:"-"`

	Job   Job
	JobId uint
}

func (*DiscoveryJob) Parse

func (d *DiscoveryJob) Parse() error

type Host

type Host struct {
	ID        uint      `json:"id"`
	CreatedAt time.Time `json:"first_seen"`
	UpdatedAt time.Time `json:"last_seen"`
	Name      *string   `json:"name,omitempty"`
	IpAddr    string    `gorm:"index" json:"ip_addr"`
	HwAddr    *string   `json:"hw_addr,omitempty"`
	HwAddrId  *uint64   `gorm:"index" json:"-"`
	Ports     []Port    `json:"ports"`
	Network   *Network  `json:"-"`
	NetworkID uint      `json:"network_id,omitempty"`
	Jobs      []Job     `json:"jobs" gorm:"many2many:job_hosts"`
}

func NewHost

func NewHost(h nmap.Host) *Host

type Iface

type Iface struct {
	internal.Base
	Name string `json:"name"`

	Aps     []AP     `json:"-"`
	Clients []Client `json:"-"`
	Jobs    []Job    `json:"-" gorm:"many2many:job_ifaces"`
}

A network interface

func CreateIface

func CreateIface(iface net.Interface) (i *Iface, e error)

func FindIface

func FindIface(id uint) (i *Iface, e error)

func FindIfaceByName

func FindIfaceByName(name string) (i *Iface, e error)

func (*Iface) StartDiscovery

func (iface *Iface) StartDiscovery() (d *DiscoveryJob, e error)

type Job

type Job struct {
	internal.Base
	FinishedAt *time.Time `json:"finished_at"`
	Name       string     `json:"name"`
	Type       JobKind    `json:"type"`

	// affected entities
	Aps      []AP      `json:"-" gorm:"many2many:job_aps"`
	Clients  []Client  `json:"-" gorm:"many2many:job_clients"`
	Hosts    []Host    `json:"-" gorm:"many2many:job_hosts"`
	Networks []Network `json:"-" gorm:"many2many:job_networks"`
	Ifaces   []Iface   `json:"-" gorm:"many2many:job_ifaces"`

	// concrete jobs
	Radar   *RadarJob   `json:"-"`
	Process *ProcessJob `json:"-"`
}

A running task

func FindJob

func FindJob(id uint) (j *Job, e error)

func (*Job) Is

func (j *Job) Is(kind JobKind) bool

type JobKind

type JobKind int64
const ProcessJobKind JobKind = 1
const RadarJobKind JobKind = 2

func (JobKind) MarshalText

func (k JobKind) MarshalText() ([]byte, error)

used for json serialization

func (*JobKind) Scan

func (k *JobKind) Scan(value interface{}) error

DB deserialization

func (JobKind) String

func (k JobKind) String() string

func (JobKind) Value

func (k JobKind) Value() (driver.Value, error)

DB serialization

type Network

type Network struct {
	ID        uint   `gorm:"primary_key" json:"id"`
	IfaceName string `json:"iface_name"`
	IpAddr    string `json:"ip_addr"`
	Hosts     []Host `json:"hosts"`
}

func CreateNetwork

func CreateNetwork(ipNet *net.IPNet) *Network

func FindNetwork

func FindNetwork(ipNet *net.IPNet) *Network

func FindOrCreateNetwork

func FindOrCreateNetwork(ipNet *net.IPNet) *Network

func NewNetwork

func NewNetwork(ifName, ipAddr string) *Network

func (*Network) GetHosts

func (n *Network) GetHosts() []Host

type Port

type Port struct {
	ID       uint     `json:"id"`
	HostId   uint     `json:"host_id"`
	Protocol string   `json:"protocol"` // (ip|tcp|udp|sctp)
	Number   int      `json:"number"`
	State    string   `json:"state"` // "open","filtered","unfiltered","closed","open|filtered","closed|filtered","unknown"
	Service  *Service `json:"-"`
}

func NewPort

func NewPort(p nmap.Port) *Port

type ProcessJob

type ProcessJob struct {
	//TODO: hide job
	Job   Job
	JobId uint `gorm:"primary_key"`

	Command string `json:"command"`
	Args    string `json:"args"`

	//TODO: OutputHolder
	Output string `json:"output"`

	ExitStatus *int `json:"exit_status"`
}

func CreateProcessJob

func CreateProcessJob(command string, args ...string) (*ProcessJob, error)

func FindProcessJob

func FindProcessJob(id uint) (*ProcessJob, error)

func (*ProcessJob) CloseInput

func (pj *ProcessJob) CloseInput()

close process stdin

func (*ProcessJob) Write

func (pj *ProcessJob) Write(p []byte) (int, error)

write to process stdin

type RadarJob

type RadarJob struct {
	internal.Base
	Job   Job
	JobId uint
}

type Service

type Service struct {
	ID      uint   `json:"id" gorm:"primary_key"`
	Name    string `json:"name"`
	Product string `json:"product,omitempty"`
	Version string `json:"version,omitempty"`
	PortID  uint   `json:"-"`
}

func NewService

func NewService(s nmap.Service) *Service

func (*Service) FormatName

func (s *Service) FormatName() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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