portfiltering

package
v0.27.0 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2023 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Overview

Package portfiltering implements the portfiltering experiment

Spec: https://github.com/ooni/spec/blob/master/nettests/ts-038-port-filtering.md.

Index

Constants

This section is empty.

Variables

View Source
var Ports = []string{
	"80",
	"631",
	"161",
	"137",
	"123",
	"138",
	"1434",
	"135",
	"67",
	"23",
	"53",
	"443",
	"21",
	"22",
	"500",
	"68",
	"520",
	"1900",
	"25",
	"4500",
	"514",
	"49152",
	"162",
	"69",
	"5353",
	"49154",
	"3389",
	"110",
	"1701",
	"998",
	"996",
	"997",
	"999",
	"3283",
	"49153",
	"445",
	"1812",
	"136",
	"139",
	"143",
	"2222",
	"3306",
	"2049",
	"32768",
	"5060",
	"8080",
	"1433",
	"3456",
	"1723",
	"111",
	"995",
	"993",
	"20031",
	"1026",
	"7",
	"5900",
	"1646",
	"1645",
	"593",
	"1025",
	"518",
	"2048",
	"626",
}

List generated from nmap-services: https://github.com/nmap/nmap/blob/master/nmap-services Note: Using privileged ports like :80 requires elevated permissions

Functions

func NewExperimentMeasurer

func NewExperimentMeasurer(config Config) model.ExperimentMeasurer

NewExperimentMeasurer creates a new ExperimentMeasurer.

Types

type Config

type Config struct {
	// Delay is the delay between each repetition (in milliseconds).
	Delay int64 `ooni:"number of milliseconds to wait before testing each port"`
}

Config contains the experiment configuration.

type Measurer

type Measurer struct {
	// contains filtered or unexported fields
}

Measurer performs the measurement.

func (*Measurer) ExperimentName

func (m *Measurer) ExperimentName() string

ExperimentName implements ExperimentMeasurer.ExperiExperimentName.

func (*Measurer) ExperimentVersion

func (m *Measurer) ExperimentVersion() string

ExperimentVersion implements ExperimentMeasurer.ExperimentVersion.

func (Measurer) GetSummaryKeys

func (m Measurer) GetSummaryKeys(measurement *model.Measurement) (interface{}, error)

GetSummaryKeys implements model.ExperimentMeasurer.GetSummaryKeys.

func (*Measurer) Run

func (m *Measurer) Run(ctx context.Context, args *model.ExperimentArgs) error

Run implements ExperimentMeasurer.Run.

type SummaryKeys

type SummaryKeys struct {
	IsAnomaly bool `json:"-"`
}

SummaryKeys contains summary keys for this experiment.

Note that this structure is part of the ABI contract with ooniprobe therefore we should be careful when changing it.

type TestKeys

type TestKeys struct {
	TCPConnect []*model.ArchivalTCPConnectResult `json:"tcp_connect"`
}

TestKeys contains the experiment results.

Jump to

Keyboard shortcuts

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