Skip to content

Use as library #8

@charles-d-burton

Description

@charles-d-burton

I'm attempting to reference your project as a library, it seems like a really well thought out project. I'm currently running into an issue I don't understand. When I try to reference your code from a different project I get the response of:

Scan results for host 192.168.3.5
	Host is down

Where if I run the furious tool:

sudo ./furious -s connect 192.168.3.5

Starting scan at 2019-12-17 20:55:56.545097688 +0000 UTC m=+0.026920458

Scan results for host 192.168.3.5
	Host is up with 56.66663ms latency
	PORT	STATE	SERVICE
	22/tcp    	OPEN      	ssh

Scan complete in 2.418170027s.

It seems to work fine. The code I'm using looks like this and semantically doesn't seem any different what what your project is running.

if os.Getuid() > 0 {
		fmt.Println("Access Denied: You must be a priviliged user to run this type of scan.")
		os.Exit(1)
	}
	targetIterator := scan.NewTargetIterator("192.168.3.5")
	scanner := scan.NewConnectScanner(targetIterator, 6000, 1000)
	if err := scanner.Start(); err != nil {
		fmt.Println(err)
		os.Exit(1)
	}
	ctx, _ := context.WithCancel(context.Background())
	results, err := scanner.Scan(ctx, scan.DefaultPorts)
	if err != nil {
		fmt.Println(err)
		os.Exit(1)
	}

	for _, result := range results {
		scanner.OutputResult(result)
	}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions