From 48fe560120a341978c5435cbcc9b72e1b99b6826 Mon Sep 17 00:00:00 2001 From: Mzack9999 Date: Wed, 3 Jun 2020 18:01:36 +0200 Subject: [PATCH 1/6] socket only --- pkg/scan/{scan.go => scan_pcap.go.old} | 2 + pkg/scan/scan_socket.go | 243 +++++++++++++++++++++++++ 2 files changed, 245 insertions(+) rename pkg/scan/{scan.go => scan_pcap.go.old} (99%) create mode 100644 pkg/scan/scan_socket.go diff --git a/pkg/scan/scan.go b/pkg/scan/scan_pcap.go.old similarity index 99% rename from pkg/scan/scan.go rename to pkg/scan/scan_pcap.go.old index e25eb42c..7bb605be 100644 --- a/pkg/scan/scan.go +++ b/pkg/scan/scan_pcap.go.old @@ -1,3 +1,5 @@ +// +build linux darwin + package scan import ( diff --git a/pkg/scan/scan_socket.go b/pkg/scan/scan_socket.go new file mode 100644 index 00000000..6cc0bfe8 --- /dev/null +++ b/pkg/scan/scan_socket.go @@ -0,0 +1,243 @@ +// +build linux darwin + +package scan + +import ( + "fmt" + "log" + "math" + "math/rand" + "net" + "strings" + "sync" + "time" + + "github.com/google/gopacket" + "github.com/google/gopacket/layers" + "github.com/phayes/freeport" + "github.com/projectdiscovery/gologger" +) + +// Scanner is a scanner that scans for ports using SYN packets. +type Scanner struct { + timeout time.Duration + serializeOptions gopacket.SerializeOptions + retries int + rate int + + networkInterface *net.Interface + host net.IP + srcIP net.IP +} + +// NewScanner creates a new full port scanner that scans all ports using SYN packets. +func NewScanner(host net.IP, timeout time.Duration, retries, rate int) (*Scanner, error) { + rand.Seed(time.Now().UnixNano()) + + scanner := &Scanner{ + serializeOptions: gopacket.SerializeOptions{ + FixLengths: true, + ComputeChecksums: true, + }, + timeout: timeout, + retries: retries, + rate: rate, + + host: host, + } + + // Get the source IP and the network interface packets will be sent from + var err error + scanner.srcIP, err = getSourceIP(host) + if err != nil { + return nil, err + } + + scanner.networkInterface, err = getInterfaceFromIP(scanner.srcIP) + if err != nil { + return nil, err + } + + return scanner, nil +} + +// send sends the given layers as a single packet on the network. +func (s *Scanner) send(conn net.PacketConn, l ...gopacket.SerializableLayer) (int, error) { + buf := gopacket.NewSerializeBuffer() + if err := gopacket.SerializeLayers(buf, s.serializeOptions, l...); err != nil { + return 0, err + } + return conn.WriteTo(buf.Bytes(), &net.IPAddr{IP: s.host}) +} + +// Scan scans a single host and returns the results +func (s *Scanner) Scan(wordlist map[int]struct{}) (map[int]struct{}, error) { + conn, err := net.ListenPacket("ip4:tcp", "0.0.0.0") + if err != nil { + return nil, err + } + defer conn.Close() + + rawPort, err := freeport.GetFreePort() + if err != nil { + return nil, err + } + + openChan := make(chan int) + results := make(map[int]struct{}) + resultsWg := &sync.WaitGroup{} + resultsWg.Add(1) + + go func() { + for open := range openChan { + gologger.Debugf("Found active port %d on %s\n", open, s.host.String()) + + results[open] = struct{}{} + } + resultsWg.Done() + }() + + // Construct all the network layers we need. + ip4 := layers.IPv4{ + SrcIP: s.srcIP, + DstIP: s.host, + Version: 4, + TTL: 255, + Protocol: layers.IPProtocolTCP, + } + tcpOption := layers.TCPOption{ + OptionType: layers.TCPOptionKindMSS, + OptionLength: 4, + OptionData: []byte{0x12, 0x34}, + } + randSeq := 1000000000 + rand.Intn(math.MaxInt32) + + tcp := layers.TCP{ + SrcPort: layers.TCPPort(rawPort), + DstPort: 0, + SYN: true, + Window: 1024, + Seq: uint32(randSeq), + Options: []layers.TCPOption{tcpOption}, + } + tcp.SetNetworkLayerForChecksum(&ip4) + + tasksWg := &sync.WaitGroup{} + tasksWg.Add(1) + + go func() { + defer tasksWg.Done() + data := make([]byte, 4096) + for { + n, addr, err := conn.ReadFrom(data) + if err != nil { + break + } + + // not matching ip + if addr.String() != s.host.String() { + continue + } + + packet := gopacket.NewPacket(data[:n], layers.LayerTypeTCP, gopacket.Default) + if tcpLayer := packet.Layer(layers.LayerTypeTCP); tcpLayer != nil { + tcp, ok := tcpLayer.(*layers.TCP) + if !ok { + continue + } + log.Println(addr.String(), s.host.String(), rawPort, tcp.DstPort, tcp.SrcPort, "syn", tcp.SYN, "ack", tcp.ACK) + // We consider only incoming packets + if tcp.DstPort != layers.TCPPort(rawPort) { + continue + } else if tcp.SYN && tcp.ACK { + openChan <- int(tcp.SrcPort) + } + } + } + }() + + limiter := time.Tick(time.Second / time.Duration(s.rate)) + + ports := make(chan int) + go func() { + for port := range ports { + // Increment sequence number from initial seed. + // Some firewalls drop requests if Sequence values + // are not incremental. + randSeq += 1 + rand.Intn(5) + tcp.Seq = uint32(randSeq) + tcp.DstPort = layers.TCPPort(port) + for i := 0; i < s.retries; i++ { + <-limiter + n, err := s.send(conn, &tcp) + if n > 0 && err == nil { + break + } + } + } + }() + + for port := range wordlist { + ports <- port + } + close(ports) + + // Just like masscan, wait for 10 seconds for further packets + if s.timeout > 0 { + timer := time.AfterFunc(10*time.Second, func() { + conn.Close() + }) + defer timer.Stop() + } else { + conn.Close() + } + + tasksWg.Wait() + close(openChan) + resultsWg.Wait() + + return results, nil +} + +// getSourceIP gets the local ip based on our destination ip +func getSourceIP(dstip net.IP) (net.IP, error) { + serverAddr, err := net.ResolveUDPAddr("udp", dstip.String()+":12345") + if err != nil { + return nil, err + } + + if con, err := net.DialUDP("udp", nil, serverAddr); err == nil { + defer con.Close() + if udpaddr, ok := con.LocalAddr().(*net.UDPAddr); ok { + return udpaddr.IP, nil + } + } + return nil, err +} + +// getInterfaceFromIP gets the name of the network interface from local ip address +func getInterfaceFromIP(ip net.IP) (*net.Interface, error) { + address := ip.String() + + interfaces, err := net.Interfaces() + if err != nil { + return nil, err + } + + for _, i := range interfaces { + byNameInterface, err := net.InterfaceByName(i.Name) + if err != nil { + return nil, err + } + addresses, err := byNameInterface.Addrs() + for _, v := range addresses { + // Check if the IP for the current interface is our + // source IP. If yes, return the interface + if strings.HasPrefix(v.String(), address+"/") { + return byNameInterface, nil + } + } + } + + return nil, fmt.Errorf("no interface found for ip %s", address) +} From c97768e4395ae160bd2fa4d61977ceb0bbb8fa9f Mon Sep 17 00:00:00 2001 From: Mzack9999 Date: Wed, 3 Jun 2020 18:56:13 +0200 Subject: [PATCH 2/6] connect fallback --- cmd/naabu/main.go | 6 - pkg/runner/enumerate.go | 10 +- pkg/scan/{scan_socket.go => scan.go} | 60 +++++- pkg/scan/scan_pcap.go.old | 297 --------------------------- 4 files changed, 65 insertions(+), 308 deletions(-) rename pkg/scan/{scan_socket.go => scan.go} (82%) delete mode 100644 pkg/scan/scan_pcap.go.old diff --git a/cmd/naabu/main.go b/cmd/naabu/main.go index 4c85b4d4..19989fb6 100644 --- a/cmd/naabu/main.go +++ b/cmd/naabu/main.go @@ -1,8 +1,6 @@ package main import ( - "os" - "github.com/projectdiscovery/gologger" "github.com/projectdiscovery/naabu/pkg/runner" ) @@ -11,10 +9,6 @@ func main() { // Parse the command line flags and read config files options := runner.ParseOptions() - if os.Geteuid() > 0 { - gologger.Fatalf("Exiting, You must be a privileged user to run this scan\n") - } - runner, err := runner.NewRunner(options) if err != nil { gologger.Fatalf("Could not create runner: %s\n", err) diff --git a/pkg/runner/enumerate.go b/pkg/runner/enumerate.go index fcd029a0..5e3c8df2 100644 --- a/pkg/runner/enumerate.go +++ b/pkg/runner/enumerate.go @@ -75,7 +75,15 @@ func (r *Runner) EnumerateSingleHost(host string, ports map[int]struct{}, output gologger.Warningf("Could not start scan on host %s (%s): %s\n", host, hostIP, err) return } - results, err := scanner.Scan(ports) + + var results map[int]struct{} + + if os.Geteuid() > 0 { + results, err = scanner.ScanConnect(ports) + } else { + results, err = scanner.ScanSyn(ports) + } + if err != nil { gologger.Warningf("Could not scan on host %s (%s): %s\n", host, hostIP, err) return diff --git a/pkg/scan/scan_socket.go b/pkg/scan/scan.go similarity index 82% rename from pkg/scan/scan_socket.go rename to pkg/scan/scan.go index 6cc0bfe8..9d87715a 100644 --- a/pkg/scan/scan_socket.go +++ b/pkg/scan/scan.go @@ -1,5 +1,3 @@ -// +build linux darwin - package scan import ( @@ -16,6 +14,7 @@ import ( "github.com/google/gopacket/layers" "github.com/phayes/freeport" "github.com/projectdiscovery/gologger" + "github.com/remeh/sizedwaitgroup" ) // Scanner is a scanner that scans for ports using SYN packets. @@ -70,8 +69,8 @@ func (s *Scanner) send(conn net.PacketConn, l ...gopacket.SerializableLayer) (in return conn.WriteTo(buf.Bytes(), &net.IPAddr{IP: s.host}) } -// Scan scans a single host and returns the results -func (s *Scanner) Scan(wordlist map[int]struct{}) (map[int]struct{}, error) { +// ScanSyn scans a single host and returns the results +func (s *Scanner) ScanSyn(wordlist map[int]struct{}) (map[int]struct{}, error) { conn, err := net.ListenPacket("ip4:tcp", "0.0.0.0") if err != nil { return nil, err @@ -199,6 +198,59 @@ func (s *Scanner) Scan(wordlist map[int]struct{}) (map[int]struct{}, error) { return results, nil } +// ScanConnect a single host and returns the results +func (s *Scanner) ScanConnect(wordlist map[int]struct{}) (map[int]struct{}, error) { + openChan := make(chan int) + results := make(map[int]struct{}) + resultsWg := &sync.WaitGroup{} + resultsWg.Add(1) + + go func() { + for open := range openChan { + gologger.Debugf("Found active port %d on %s\n", open, s.host.String()) + + results[open] = struct{}{} + } + resultsWg.Done() + }() + + tasksWg := &sync.WaitGroup{} + tasksWg.Add(1) + + ports := make(chan int) + go func() { + defer tasksWg.Done() + + swgscan := sizedwaitgroup.New(s.rate) + for port := range ports { + swgscan.Add() + go func(port int) { + defer swgscan.Done() + + conn, err := net.DialTimeout("tcp", fmt.Sprintf("%s:%d", s.host, port), s.timeout) + if err != nil { + return + } + defer conn.Close() + + openChan <- port + }(port) + } + swgscan.Wait() + }() + + for port := range wordlist { + ports <- port + } + close(ports) + + tasksWg.Wait() + close(openChan) + resultsWg.Wait() + + return results, nil +} + // getSourceIP gets the local ip based on our destination ip func getSourceIP(dstip net.IP) (net.IP, error) { serverAddr, err := net.ResolveUDPAddr("udp", dstip.String()+":12345") diff --git a/pkg/scan/scan_pcap.go.old b/pkg/scan/scan_pcap.go.old deleted file mode 100644 index 7bb605be..00000000 --- a/pkg/scan/scan_pcap.go.old +++ /dev/null @@ -1,297 +0,0 @@ -// +build linux darwin - -package scan - -import ( - "fmt" - "io" - "math" - "math/rand" - "net" - "strings" - "sync" - "time" - - "github.com/google/gopacket" - "github.com/google/gopacket/layers" - "github.com/google/gopacket/pcap" - "github.com/phayes/freeport" - "github.com/projectdiscovery/gologger" -) - -// Scanner is a scanner that scans for ports using SYN packets. -type Scanner struct { - timeout time.Duration - serializeOptions gopacket.SerializeOptions - retries int - rate int - - networkInterface *net.Interface - host net.IP - srcIP net.IP -} - -// NewScanner creates a new full port scanner that scans all ports using SYN packets. -func NewScanner(host net.IP, timeout time.Duration, retries, rate int) (*Scanner, error) { - rand.Seed(time.Now().UnixNano()) - - scanner := &Scanner{ - serializeOptions: gopacket.SerializeOptions{ - FixLengths: true, - ComputeChecksums: true, - }, - timeout: timeout, - retries: retries, - rate: rate, - - host: host, - } - - // Get the source IP and the network interface packets will be sent from - var err error - scanner.srcIP, err = getSourceIP(host) - if err != nil { - return nil, err - } - - scanner.networkInterface, err = getInterfaceFromIP(scanner.srcIP) - if err != nil { - return nil, err - } - - return scanner, nil -} - -// send sends the given layers as a single packet on the network. -func (s *Scanner) send(conn net.PacketConn, l ...gopacket.SerializableLayer) (int, error) { - buf := gopacket.NewSerializeBuffer() - if err := gopacket.SerializeLayers(buf, s.serializeOptions, l...); err != nil { - return 0, err - } - return conn.WriteTo(buf.Bytes(), &net.IPAddr{IP: s.host}) -} - -// Scan scans a single host and returns the results -func (s *Scanner) Scan(wordlist map[int]struct{}) (map[int]struct{}, error) { - inactive, err := pcap.NewInactiveHandle(s.networkInterface.Name) - if err != nil { - return nil, err - } - inactive.SetSnapLen(65536) - - readTimeout := time.Duration(1500) * time.Millisecond - if err = inactive.SetTimeout(readTimeout); err != nil { - inactive.CleanUp() - return nil, err - } - inactive.SetImmediateMode(true) - - handle, err := inactive.Activate() - if err != nil { - inactive.CleanUp() - return nil, err - } - - rawPort, err := freeport.GetFreePort() - if err != nil { - handle.Close() - inactive.CleanUp() - return nil, err - } - - // Strict BPF filter - // + Packets coming from target ip - // + Destination port equals to sender socket source port - err = handle.SetBPFFilter(fmt.Sprintf("tcp and port %d and ip host %s", rawPort, s.host)) - if err != nil { - handle.Close() - inactive.CleanUp() - return nil, err - } - - conn, err := net.ListenPacket("ip4:tcp", "0.0.0.0") - if err != nil { - handle.Close() - inactive.CleanUp() - return nil, err - } - - openChan := make(chan int) - results := make(map[int]struct{}) - resultsWg := &sync.WaitGroup{} - resultsWg.Add(1) - - go func() { - for open := range openChan { - gologger.Debugf("Found active port %d on %s\n", open, s.host.String()) - - results[open] = struct{}{} - } - resultsWg.Done() - }() - - // Construct all the network layers we need. - ip4 := layers.IPv4{ - SrcIP: s.srcIP, - DstIP: s.host, - Version: 4, - TTL: 255, - Protocol: layers.IPProtocolTCP, - } - tcpOption := layers.TCPOption{ - OptionType: layers.TCPOptionKindMSS, - OptionLength: 4, - OptionData: []byte{0x12, 0x34}, - } - randSeq := 1000000000 + rand.Intn(math.MaxInt32) - - tcp := layers.TCP{ - SrcPort: layers.TCPPort(rawPort), - DstPort: 0, - SYN: true, - Window: 1024, - Seq: uint32(randSeq), - Options: []layers.TCPOption{tcpOption}, - } - tcp.SetNetworkLayerForChecksum(&ip4) - - tasksWg := &sync.WaitGroup{} - tasksWg.Add(1) - ipFlow := gopacket.NewFlow(layers.EndpointIPv4, s.host, s.srcIP) - - go func() { - var ( - eth layers.Ethernet - ip4 layers.IPv4 - tcp layers.TCP - parser *gopacket.DecodingLayerParser - ) - - if s.networkInterface.HardwareAddr != nil { - // Interfaces with MAC (Physical + Virtualized) - parser = gopacket.NewDecodingLayerParser(layers.LayerTypeEthernet, ð, &ip4, &tcp) - } else { - // Interfaces without MAC (TUN/TAP) - parser = gopacket.NewDecodingLayerParser(layers.LayerTypeIPv4, &ip4, &tcp) - } - - decoded := []gopacket.LayerType{} - for { - data, _, err := handle.ReadPacketData() - if err == io.EOF { - break - } else if err != nil { - continue - } - - if err := parser.DecodeLayers(data, &decoded); err != nil { - continue - } - for _, layerType := range decoded { - switch layerType { - case layers.LayerTypeIPv4: - if ip4.NetworkFlow() != ipFlow { - continue - } - case layers.LayerTypeTCP: - // We consider only incoming packets - if tcp.DstPort != layers.TCPPort(rawPort) { - continue - } else if tcp.SYN && tcp.ACK { - openChan <- int(tcp.SrcPort) - } - } - } - } - tasksWg.Done() - }() - - limiter := time.Tick(time.Second / time.Duration(s.rate)) - - ports := make(chan int) - go func() { - for port := range ports { - // Increment sequence number from initial seed. - // Some firewalls drop requests if Sequence values - // are not incremental. - randSeq += 1 + rand.Intn(5) - tcp.Seq = uint32(randSeq) - tcp.DstPort = layers.TCPPort(port) - for i := 0; i < s.retries; i++ { - <-limiter - n, err := s.send(conn, &tcp) - if n > 0 && err == nil { - break - } - } - } - }() - - for port := range wordlist { - ports <- port - } - close(ports) - - // Just like masscan, wait for 10 seconds for further packets - if s.timeout > 0 { - timer := time.AfterFunc(10*time.Second, func() { - handle.Close() - conn.Close() - }) - defer timer.Stop() - } else { - handle.Close() - conn.Close() - } - - tasksWg.Wait() - close(openChan) - resultsWg.Wait() - - inactive.CleanUp() - - return results, nil -} - -// getSourceIP gets the local ip based on our destination ip -func getSourceIP(dstip net.IP) (net.IP, error) { - serverAddr, err := net.ResolveUDPAddr("udp", dstip.String()+":12345") - if err != nil { - return nil, err - } - - if con, err := net.DialUDP("udp", nil, serverAddr); err == nil { - defer con.Close() - if udpaddr, ok := con.LocalAddr().(*net.UDPAddr); ok { - return udpaddr.IP, nil - } - } - return nil, err -} - -// getInterfaceFromIP gets the name of the network interface from local ip address -func getInterfaceFromIP(ip net.IP) (*net.Interface, error) { - address := ip.String() - - interfaces, err := net.Interfaces() - if err != nil { - return nil, err - } - - for _, i := range interfaces { - byNameInterface, err := net.InterfaceByName(i.Name) - if err != nil { - return nil, err - } - addresses, err := byNameInterface.Addrs() - for _, v := range addresses { - // Check if the IP for the current interface is our - // source IP. If yes, return the interface - if strings.HasPrefix(v.String(), address+"/") { - return byNameInterface, nil - } - } - } - - return nil, fmt.Errorf("no interface found for ip %s", address) -} From e457fa4eec9f08c58384bd0e9922099888e9d029 Mon Sep 17 00:00:00 2001 From: Mzack9999 Date: Wed, 3 Jun 2020 19:03:03 +0200 Subject: [PATCH 3/6] removed libpcap --- .github/workflows/build.yaml | 7 +------ go.mod | 2 +- go.sum | 4 ++-- 3 files changed, 4 insertions(+), 9 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 27b87a00..a0c18ea5 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -16,12 +16,7 @@ jobs: go-version: 1.13 - name: Check out code - uses: actions/checkout@v2 - - - name: Install libpcap - run: | - sudo apt-get update - sudo apt install libpcap-dev + uses: actions/checkout@v2W - name: Test run: go test . diff --git a/go.mod b/go.mod index ba92c1d7..e8cb2a2a 100644 --- a/go.mod +++ b/go.mod @@ -7,5 +7,5 @@ require ( github.com/phayes/freeport v0.0.0-20180830031419-95f893ade6f2 github.com/projectdiscovery/gologger v1.0.0 github.com/remeh/sizedwaitgroup v1.0.0 - golang.org/x/net v0.0.0-20200528225125-3c3fba18258b + golang.org/x/net v0.0.0-20200602114024-627f9648deb9 ) diff --git a/go.sum b/go.sum index 6da9e75a..d05fd0f4 100644 --- a/go.sum +++ b/go.sum @@ -14,8 +14,8 @@ github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+ github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20200528225125-3c3fba18258b h1:IYiJPiJfzktmDAO1HQiwjMjwjlYKHAL7KzeD544RJPs= -golang.org/x/net v0.0.0-20200528225125-3c3fba18258b/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200602114024-627f9648deb9 h1:pNX+40auqi2JqRfOP1akLGtYcn15TUbkhwuCO3foqqM= +golang.org/x/net v0.0.0-20200602114024-627f9648deb9/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190405154228-4b34438f7a67/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd h1:xhmwyvizuTgC2qz7ZlMluP20uW+C3Rm0FD/WLDX8884= From 41158560c642769407c3109e9465d427a3a44b5a Mon Sep 17 00:00:00 2001 From: Mzack9999 Date: Wed, 3 Jun 2020 19:05:26 +0200 Subject: [PATCH 4/6] adding release --- .github/workflows/release.yml | 25 +++++++++++++++++++++++++ .goreleaser.yml | 21 +++++++++++++++++++++ 2 files changed, 46 insertions(+) create mode 100644 .github/workflows/release.yml create mode 100644 .goreleaser.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 00000000..d9c4eafd --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,25 @@ +name: Release +on: + create: + tags: + - v* + +jobs: + release: + name: Release on GitHub + runs-on: ubuntu-latest + steps: + - name: Check out code + uses: actions/checkout@v1 + + - name: Validates GO releaser config + uses: docker://goreleaser/goreleaser:latest + with: + args: check + + - name: Create release on GitHub + uses: docker://goreleaser/goreleaser:latest + with: + args: release + env: + GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} \ No newline at end of file diff --git a/.goreleaser.yml b/.goreleaser.yml new file mode 100644 index 00000000..00719366 --- /dev/null +++ b/.goreleaser.yml @@ -0,0 +1,21 @@ +builds: + - binary: nuclei + main: cmd/naabu/main.go + goos: + - linux + - windows + - darwin + goarch: + - amd64 + - 386 + - arm + - arm64 + +archives: + - id: tgz + format: tar.gz + replacements: + darwin: macOS + format_overrides: + - goos: windows + format: zip \ No newline at end of file From f378a624ae1dc5987dee1a457f38a7748ecca01a Mon Sep 17 00:00:00 2001 From: Mzack9999 Date: Wed, 3 Jun 2020 19:06:45 +0200 Subject: [PATCH 5/6] corrected typo --- .github/workflows/build.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index a0c18ea5..ee5c6763 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -16,7 +16,7 @@ jobs: go-version: 1.13 - name: Check out code - uses: actions/checkout@v2W + uses: actions/checkout@v2 - name: Test run: go test . From 8a6ffb007515417512d92175bd5dd0f1489fb380 Mon Sep 17 00:00:00 2001 From: Mzack9999 Date: Sat, 6 Jun 2020 20:08:48 +0200 Subject: [PATCH 6/6] removed debug instruction --- pkg/scan/scan.go | 2 -- 1 file changed, 2 deletions(-) diff --git a/pkg/scan/scan.go b/pkg/scan/scan.go index 9d87715a..400f5431 100644 --- a/pkg/scan/scan.go +++ b/pkg/scan/scan.go @@ -2,7 +2,6 @@ package scan import ( "fmt" - "log" "math" "math/rand" "net" @@ -144,7 +143,6 @@ func (s *Scanner) ScanSyn(wordlist map[int]struct{}) (map[int]struct{}, error) { if !ok { continue } - log.Println(addr.String(), s.host.String(), rawPort, tcp.DstPort, tcp.SrcPort, "syn", tcp.SYN, "ack", tcp.ACK) // We consider only incoming packets if tcp.DstPort != layers.TCPPort(rawPort) { continue