gobysec / Goby

Attack surface mapping
https://gobies.org/
1.36k stars 149 forks source link

goby-linux-x64-2.4.9 scan error #426

Closed PuQiang2020 closed 1 year ago

PuQiang2020 commented 1 year ago

2023/06/07 14:27:07 Successfully raised file descriptor limit to 32000 2023/06/07 14:27:07 read user rule file ok: 0 2023/06/07 14:27:07 Version: v2.0.323 beta 2023/06/07 14:27:10 API Server listen at 127.0.0.1:8361 2023/06/07 14:27:11 127.0.0.1:48986 POST /api/v1/setEnvi 2023/06/07 14:27:11 127.0.0.1:49002 GET /api/v1/getEnvi?field=chromePath,dataIntegrity,datadir,dir,midKey,proxyServer,userRuleSize,vulVersion 2023/06/07 14:27:11 127.0.0.1:49022 POST /api/v1/getPOCList 2023/06/07 14:27:11 127.0.0.1:49014 GET /api/v1/getEnvi?field=gid,key,godserver 2023/06/07 14:27:11 127.0.0.1:49010 GET /api/v1/getEnvi?field=ip 2023/06/07 14:27:11 [DEBUG] get adapter of device wlan0 2023/06/07 14:27:11 [DEBUG] devices: [{wlan0 30 [{10.137.2.201 ffff0000 10.137.255.255 } {fe80::c4a5:8ef9:7de:e99b ffffffffffffffff0000000000000000 }]} {vmnet1 54 [{192.168.178.1 ffffff00 192.168.178.255 } {fe80::250:56ff:fec0:1 ffffffffffffffff0000000000000000 }]} {br-59fa7fa419d3 22 [{172.21.0.1 ffff0000 172.21.255.255 } {fe80::42:3dff:feb8:4de6 ffffffffffffffff0000000000000000 }]} {vmnet8 54 [{192.168.4.1 ffffff00 192.168.4.255 } {fe80::250:56ff:fec0:8 ffffffffffffffff0000000000000000 }]} {veth9845315 22 [{fe80::6c7d:e6ff:fe81:9388 ffffffffffffffff0000000000000000 }]} {lo 55 [{127.0.0.1 ff000000 } {::1 ffffffffffffffffffffffffffffffff }]} {any Pseudo-device that captures on all interfaces 54 []} {docker0 34 [{172.17.0.1 ffff0000 172.17.255.255 }]} {enp0s31f6 34 []} {br-39bfbbdab08f 34 [{172.20.0.1 ffff0000 172.20.255.255 }]} {br-e458abc29671 34 [{172.19.0.1 ffff0000 172.19.255.255 }]} {nflog Linux netfilter log (NFLOG) interface 48 []} {nfqueue Linux netfilter queue (NFQUEUE) interface 48 []}] 2023/06/07 14:27:11 [DEBUG] getGatewayMac: wlan0 0.0.0.0 2023/06/07 14:27:11 wlan0: You don't have permission to capture on that device (socket: Operation not permitted) goroutine 42 [running]: runtime/debug.Stack() runtime/debug/stack.go:24 +0x65 git.gobies.org/goby/goby/api.envField({0x0?, 0x2000000?}, {0xc0003450fa?, 0x2?}) git.gobies.org/goby/goby/api/getEnvi.go:115 +0x33d git.gobies.org/goby/goby/api.getEnviFields({0x0, 0x0}, {0xc0054200a0, 0x1, 0x0?}) git.gobies.org/goby/goby/api/getEnvi.go:180 +0xec git.gobies.org/goby/goby/api.getEnviHandler({0x2b789f0, 0xc00628a000}, 0xc0043ea960?) git.gobies.org/goby/goby/api/getEnvi.go:213 +0x125 net/http.HandlerFunc.ServeHTTP(...) net/http/server.go:2084 git.gobies.org/goby/goby/api.basicAuth.func1({0x2b789f0?, 0xc00628a000?}, 0x88?) git.gobies.org/goby/goby/api/api.go:115 +0x248 net/http.HandlerFunc.ServeHTTP(...) net/http/server.go:2084 git.gobies.org/goby/goby/api.logHttpRequest.func1({0x2b789f0, 0xc00628a000}, 0xc001018100) git.gobies.org/goby/goby/api/api.go:98 +0x1f4 net/http.HandlerFunc.ServeHTTP(0xc001018000?, {0x2b789f0?, 0xc00628a000?}, 0x0?) net/http/server.go:2084 +0x2f github.com/gorilla/mux.(Router).ServeHTTP(0xc00505e240, {0x2b789f0, 0xc00628a000}, 0xc001bcc200) github.com/gorilla/mux@v1.8.0/mux.go:210 +0x1cf net/http.serverHandler.ServeHTTP({0xc0042203c0?}, {0x2b789f0, 0xc00628a000}, 0xc001bcc200) net/http/server.go:2916 +0x43b net/http.(conn).serve(0xc0026c4000, {0x2b798c8, 0xc0041f2570}) net/http/server.go:1966 +0x5d7 created by net/http.(Server).Serve net/http/server.go:3071 +0x4db 2023/06/07 14:27:11 [StartService ERROR] {content:"pcap problem", errCode: 1 } 2023/06/07 14:27:11 127.0.0.1:49032 GET /api/v1/live 2023/06/07 14:27:11 127.0.0.1:49048 GET /api/v1/getEnvi?field=licenseInfo,midKey 2023/06/07 14:27:11 127.0.0.1:49058 POST /api/v1/getTasks 2023/06/07 14:27:17 127.0.0.1:49072 POST /api/v1/getPOCList 2023/06/07 14:27:21 127.0.0.1:44132 POST /api/v1/startScan 2023/06/07 14:27:21 [WARNING] change deep-analysis feature is not included in your current license. 2023/06/07 14:27:22 scan 21,22,23,25,53,U:53,U:69,80,81,U:88,110,111,U:111,123,U:123,135,U:137,139,U:161,U:177,389,U:427,443,445,465,500,515,U:520,U:523,548,623,U:626,636,873,902,1080,1099,1433,U:1434,1521,U:1604,U:1645,U:1701,1883,U:1900,2049,2181,2375,2379,U:2425,3128,3306,3389,4730,U:5060,5222,U:5351,U:5353,5432,5555,5601,5672,U:5683,5900,5938,5984,6000,6379,7001,7077,8080,8081,8443,8545,8686,9000,9001,9042,9092,9100,9200,9418,9999,11211,U:11211,27017,U:33848,37777,50000,50070,61616 192.168.178.1 2023/06/07 14:27:22 start port scanner: totalSize: 91, rate: 100, connectionSize: 100, connectTimeout: 6s, retryTimes: 0, Random: true, Seed: 1686119242003235682, ScanOffset: 0, ScanICMP: false, CheckAliveMode: 2 2023/06/07 14:27:22 pcap version: libpcap version 1.9.1 (with TPACKET_V3) 2023/06/07 14:27:22 found device from route table for 192.168.178.1: vmnet1 2023/06/07 14:27:22 [DEBUG] get adapter of device vmnet1 2023/06/07 14:27:22 [DEBUG] devices: [{wlan0 30 [{10.137.2.201 ffff0000 10.137.255.255 } {fe80::c4a5:8ef9:7de:e99b ffffffffffffffff0000000000000000 }]} {vmnet1 54 [{192.168.178.1 ffffff00 192.168.178.255 } {fe80::250:56ff:fec0:1 ffffffffffffffff0000000000000000 }]} {br-59fa7fa419d3 22 [{172.21.0.1 ffff0000 172.21.255.255 } {fe80::42:3dff:feb8:4de6 ffffffffffffffff0000000000000000 }]} {vmnet8 54 [{192.168.4.1 ffffff00 192.168.4.255 } {fe80::250:56ff:fec0:8 ffffffffffffffff0000000000000000 }]} {veth9845315 22 [{fe80::6c7d:e6ff:fe81:9388 ffffffffffffffff0000000000000000 }]} {lo 55 [{127.0.0.1 ff000000 } {::1 ffffffffffffffffffffffffffffffff }]} {any Pseudo-device that captures on all interfaces 54 []} {docker0 34 [{172.17.0.1 ffff0000 172.17.255.255 }]} {enp0s31f6 34 []} {br-39bfbbdab08f 34 [{172.20.0.1 ffff0000 172.20.255.255 }]} {br-e458abc29671 34 [{172.19.0.1 ffff0000 172.19.255.255 }]} {nflog Linux netfilter log (NFLOG) interface 48 []} {nfqueue Linux netfilter queue (NFQUEUE) interface 48 []}] 2023/06/07 14:27:22 [DEBUG] device name is not match: wlan0 != vmnet1 2023/06/07 14:27:22 [DEBUG] getGatewayMac: vmnet1 192.168.178.1 panic: vmnet1: You don't have permission to capture on that device (socket: Operation not permitted) goroutine 31 [running]: git.gobies.org/goby/portscanner/pcapsend.getGatewayMac({0xc0059d56f4, 0x6}, 0xc0a8b201) git.gobies.org/goby/portscanner@v0.0.0-20230109071226-a0527f010913/pcapsend/send.go:1276 +0x66d git.gobies.org/goby/portscanner/pcapsend.getAdapter({0xc004d332fa, 0x6}, 0x0, 0xc0?, 0x0) git.gobies.org/goby/portscanner@v0.0.0-20230109071226-a0527f010913/pcapsend/device.go:285 +0x54b git.gobies.org/goby/portscanner/pcapsend.NewPcapSender(0xc0000b8a50, 0xc0046fe3c0, 0xc0046fe410) git.gobies.org/goby/portscanner@v0.0.0-20230109071226-a0527f010913/pcapsend/send.go:104 +0x3e5 git.gobies.org/goby/portscanner.(PortScanner).startPcapScan(0xc00247c150, {0x2b79820?, 0xc0026de940}, 0xc004cca0f0?, 0xc000537b00, 0xc0004de000) git.gobies.org/goby/portscanner@v0.0.0-20230109071226-a0527f010913/portscanner.go:194 +0x88 created by git.gobies.org/goby/portscanner.(*PortScanner).Start git.gobies.org/goby/portscanner@v0.0.0-20230109071226-a0527f010913/portscanner.go:243 +0x595

gobysec commented 1 year ago

您好,根据报错内容You don't have permission to capture on that device,此问题是由于权限不足。 参考FAQ https://gobysec.net/faq 热点问题

  1. 执行 sudo setcap 'CAP_NET_RAW+eip CAP_NET_ADMIN+eip' ./golib/goby-cmd-linux
  2. 以非root权限启动./goby