Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

shellcode过大时,栈溢出和内存不足的问题 #17

Open
fdx-xdf opened this issue Jun 16, 2024 · 1 comment
Open

shellcode过大时,栈溢出和内存不足的问题 #17

fdx-xdf opened this issue Jun 16, 2024 · 1 comment

Comments

@fdx-xdf
Copy link
Owner

fdx-xdf commented Jun 16, 2024

          > > > 目前测试 国内基本上都能过, 就只有 Windows Defender 的 上线就被杀。能加入可以过 Windows Defender 的吗?

测试了下,确实上线杀,但最主要的原因 WD 检测到 stager 的行为特征,用 meterpreter 生成的 shell_reverse_tcp 能过

师傅测试的服务器版的wd,还是个人机的wd呀

个人机的 wd。也试了下 15MB 大小的 sliver beacon 的 shellcode,能过 wd,但 360 现在能静态杀了。顺便一提,用 15 MB 的
shellcode 生成很慢,原因是 uuids 和 words 的拼接,生成出 C 模板编译后执行会栈溢出,Rust 模板编译会报错内存不足。uuidsString 拼接用 strings.builder 解决了,words 那先在列表那构造好,然后用 join 一次拼接。

var sb strings.Builder
var uuidsString string
var i int  = 1
for _, uuid := range uuids {
		//uuidsString += "\"" + uuid + "\","
		sb.WriteString("\""+uuid+"\",")

		if i%100000==0{
			fmt.Println(i)
		}
		i+=1
	}
	uuidsString = sb.String()
	return uuidsString, "", ""
for c in payload:
    if c < length:
        final[iterator] = '"'+dataset[c]+'",'
    iterator += 1

output = "".join(final)

C 模板栈溢出问题通过将函数内用来存放混淆字符串的变量放到函数外就解决了,words 那还要把 xpp 变量改用 malloc 分配解决。但是只有 uuid 能运行起来。

Originally posted by @Scbisui in #12 (comment)

@fdx-xdf
Copy link
Owner Author

fdx-xdf commented Jun 16, 2024

感谢师傅反馈,忙完这段时间我再改改

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant