fscan icon indicating copy to clipboard operation
fscan copied to clipboard

在内网扫描时-np命令会报错

Open Chinakentgao opened this issue 2 years ago • 7 comments

F:\fscan20220615>sql.exe -h 192.168.1.1/16 -np -nopoc -nobr -p 1-65535 -t 1000


/ _ \ ___ ___ _ __ __ _ | | __ / /// |/ | '/ ` |/ __| |/ / / /\____ \ (__| | | (| | (| < _/ |/_|| _,|___||_
fscan version: 1.7.1 start infoscan runtime: VirtualAlloc of 103077642240 bytes failed with errno=1455 fatal error: out of memory

runtime stack: runtime.throw({0x12f25c0?, 0xc282d84000?}) runtime/panic.go:992 +0x76 runtime.sysUsed(0xc0011e0000, 0x17ffe80000) runtime/mem_windows.go:83 +0x1c9 runtime.(*mheap).allocSpan(0x1fd5ea0, 0xbfff40, 0x0, 0x0) runtime/mheap.go:1279 +0x428 runtime.(*mheap).alloc.func1() runtime/mheap.go:912 +0x65 runtime.systemstack() runtime/asm_amd64.s:469 +0x4e

goroutine 1 [running]: runtime.systemstack_switch() runtime/asm_amd64.s:436 fp=0xc00008d800 sp=0xc00008d7f8 pc=0xae1680 runtime.(*mheap).alloc(0x17ffe80000?, 0xbfff40?, 0x10?) runtime/mheap.go:906 +0x65 fp=0xc00008d848 sp=0xc00008d800 pc=0xaa6fe5 runtime.(*mcache).allocLarge(0x111c2900cc8?, 0x17ffe80000, 0x0) runtime/mcache.go:213 +0x85 fp=0xc00008d898 sp=0xc00008d848 pc=0xa97285 runtime.mallocgc(0x17ffe80000, 0x1236dc0, 0x1) runtime/malloc.go:1096 +0x5a5 fp=0xc00008d910 sp=0xc00008d898 pc=0xa8d6e5 runtime.makechan(0x0?, 0xffff0000) runtime/chan.go:107 +0xe5 fp=0xc00008d950 sp=0xc00008d910 pc=0xa858e5 github.com/shadow1ng/fscan/Plugins.PortScan({0xc000580000, 0x10000, 0x5?}, {0xc00002a120, 0x7}, 0x3) github.com/shadow1ng/fscan/Plugins/portscan.go:39 +0x2e7 fp=0xc00008db40 sp=0xc00008d950 pc=0x115d5a7 github.com/shadow1ng/fscan/Plugins.Scan({{0xc00002a0d0, 0xe}, {0xc00002a120, 0x7}, {0x0, 0x0}, {0x0, 0x0}, {0x0, 0x0}, ...}) github.com/shadow1ng/fscan/Plugins/scanner.go:37 +0x2dc fp=0xc00008de40 sp=0xc00008db40 pc=0x11637bc main.main() github.com/shadow1ng/fscan/main.go:15 +0x98 fp=0xc00008df80 sp=0xc00008de40 pc=0x1169b18 runtime.main() runtime/proc.go:250 +0x1fe fp=0xc00008dfe0 sp=0xc00008df80 pc=0xab913e runtime.goexit() runtime/asm_amd64.s:1571 +0x1 fp=0xc00008dfe8 sp=0xc00008dfe0 pc=0xae39e1

goroutine 6 [chan receive]: github.com/shadow1ng/fscan/common.SaveLog() github.com/shadow1ng/fscan/common/log.go:32 +0x54 created by github.com/shadow1ng/fscan/common.init.0 github.com/shadow1ng/fscan/common/log.go:22 +0x25

Chinakentgao avatar Jun 15 '22 06:06 Chinakentgao

out of memory ?内存炸了?

shadow1ng avatar Jun 16 '22 12:06 shadow1ng

out of memory ?内存炸了?

都还是-np -nopoc -nobr 莫名其妙的炸了。要是全开不是得炸的刚刚的 我也不知道什么情况好几次了 不加np的话很多资产会遗漏掉 刚才测试了下-np -p 1-65535出现必然会炸 你得优化一下了 不然我没办法全面探测资产了

Chinakentgao avatar Jun 21 '22 14:06 Chinakentgao

可能扫到的ip太多后,积累了比较多的端口信息,内存撑不住了,得看看有什么好方法解决一下

shadow1ng avatar Jun 26 '22 09:06 shadow1ng

可能扫到的ip太多后,积累了比较多的端口信息,内存撑不住了,得看看有什么好方法解决一下

前两周市HW碰到个新的问题当时扫描的是一个A段10.0.0.1/8 -t 3000 使用ping扫描结果其中有几个网段的资产直接遗漏了,最后手动才发现的。不知道是不是线程太高的问题。B段一点问题没有,特别是半夜睡觉挂着扫就是想白天出个详细结果。这么搞得累半死一个一个手动改

Chinakentgao avatar Jul 05 '22 07:07 Chinakentgao

-t 3000 线程有点高。 -h xxxx/8,默认是发现网段模式,只扫网关和随机IP,避免扫描过多IP. 需要-h 10.0.0.1 - 10.255.255.255才硬扫A段

shadow1ng avatar Jul 05 '22 07:07 shadow1ng

-t 3000 线程有点高。 -h xxxx/8,默认是发现网段模式,只扫网关和随机IP,避免扫描过多IP. 需要-h 10.0.0.1 - 10.255.255.255才硬扫A段

以后就用这个命令扫 内网我才设置3000的而且为了能够不遗漏经常是全端口扫。就差NP扫了,但是你内存不足的问题没修复现在都没这么用。

Chinakentgao avatar Jul 05 '22 07:07 Chinakentgao

内存这问题,我还得分析、测试是什么原因才行。新版本我也较少了 hostinfo字段,试着节省开销

shadow1ng avatar Jul 05 '22 07:07 shadow1ng