shadow1ng/fscan · error

%s [ldpreload_shell_config_modify_none]

Error message

%s [ldpreload_shell_config_modify_none]

What it means

Raised in addToShellConfigs when no shell config file (~/.bashrc, ~/.profile, etc.) could be modified — none existed/were writable, or every candidate already failed the write — so the LD_PRELOAD export line was not persisted anywhere.

Source

Thrown at plugins/local/ldpreload.go:255

		// 检查是否已存在
		if strings.Contains(content, libPath) {
			continue
		}

		// 添加新行
		if !strings.HasSuffix(content, "\n") && content != "" {
			content += "\n"
		}
		content += ldPreloadLine + "\n"

		// 写入文件
		if err := os.WriteFile(configFile, []byte(content), 0644); err == nil {
			modified = append(modified, configFile)
		}
	}

	if len(modified) == 0 {
		return nil, fmt.Errorf("%s", i18n.GetText("ldpreload_shell_config_modify_none"))
	}

	return modified, nil
}

// createLdConfig 创建ld预加载配置
func (p *LDPreloadPlugin) createLdConfig(libPath string) error {
	configFile := "/etc/ld.so.preload"

	// 读取现有内容
	content := ""
	if data, err := os.ReadFile(configFile); err == nil {
		content = string(data)
	}

	// 检查是否已存在
	if strings.Contains(content, libPath) {
		return nil

View on GitHub (pinned to 95cc12e753)

Solutions

  1. Check write permissions on the target user's shell rc files
  2. Create a shell rc file if none exists
  3. Use /etc/ld.so.preload (createLdConfig) as the persistence channel instead
Defensive patterns

Strategy: fallback

When it happens

Trigger: Thrown at plugins/local/ldpreload.go:255 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of shadow1ng/fscan@95cc12e753 (2026-09-06). Data as JSON: /api/errors/324846eb0a0837b1. Report an issue: GitHub.