mirror of
https://github.com/shadow1ng/fscan.git
synced 2026-02-09 02:09:17 +08:00
refactor(core,grdp): 删除未使用的死代码
- 移除 BaseScanStrategy.LogPluginInfoWithPort 方法(无调用者) - 移除 mcs.go 中被注释的旧 connect 函数实现
This commit is contained in:
@@ -194,38 +194,6 @@ func formatPluginList(plugins []string) string {
|
||||
return fmt.Sprintf("%s ... 等%d个", strings.Join(plugins[:5], ", "), len(plugins))
|
||||
}
|
||||
|
||||
// LogPluginInfoWithPort 带端口信息的插件显示
|
||||
func (b *BaseScanStrategy) LogPluginInfoWithPort(targetHost string, targetPort int, config *common.Config) {
|
||||
allPlugins, isCustomMode := b.GetPlugins(config)
|
||||
|
||||
var prefix string
|
||||
switch b.filterType {
|
||||
case FilterLocal:
|
||||
prefix = i18n.GetText("concurrency_local_plugin")
|
||||
case FilterService:
|
||||
prefix = i18n.GetText("concurrency_service_plugin")
|
||||
case FilterWeb:
|
||||
prefix = i18n.GetText("concurrency_web_plugin")
|
||||
default:
|
||||
prefix = i18n.GetText("concurrency_plugin")
|
||||
}
|
||||
|
||||
// 过滤适用的插件
|
||||
var applicablePlugins []string
|
||||
for _, pluginName := range allPlugins {
|
||||
if b.pluginExists(pluginName) {
|
||||
if b.IsPluginApplicableByName(pluginName, targetHost, targetPort, isCustomMode, config) {
|
||||
applicablePlugins = append(applicablePlugins, pluginName)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 插件信息不再输出,减少干扰
|
||||
_ = applicablePlugins
|
||||
_ = isCustomMode
|
||||
_ = prefix
|
||||
}
|
||||
|
||||
// ValidateConfiguration 验证扫描配置
|
||||
func (b *BaseScanStrategy) ValidateConfiguration() error {
|
||||
return nil
|
||||
|
||||
@@ -277,33 +277,6 @@ func (c *MCSClient) SetClientCoreData(width, height uint16) {
|
||||
c.clientCoreData.DesktopHeight = height
|
||||
}
|
||||
|
||||
//func (c *MCSClient) connect(selectedProtocol uint32) {
|
||||
// glog.Debug("mcs client on connect", selectedProtocol)
|
||||
// c.clientCoreData.ServerSelectedProtocol = selectedProtocol
|
||||
//
|
||||
// // sendConnectInitial
|
||||
// userDataBuff := bytes.Buffer{}
|
||||
// userDataBuff.Write(c.clientCoreData.Pack())
|
||||
// userDataBuff.Write(c.clientNetworkData.Pack())
|
||||
// userDataBuff.Write(c.clientSecurityData.Pack())
|
||||
//
|
||||
// ccReq := gcc.MakeConferenceCreateRequest(userDataBuff.Bytes())
|
||||
// connectInitial := NewConnectInitial(ccReq)
|
||||
// connectInitialBerEncoded := connectInitial.BER()
|
||||
//
|
||||
// dataBuff := &bytes.Buffer{}
|
||||
// ber.WriteApplicationTag(uint8(MCS_TYPE_CONNECT_INITIAL), len(connectInitialBerEncoded), dataBuff)
|
||||
// dataBuff.Write(connectInitialBerEncoded)
|
||||
//
|
||||
// _, err := c.transport.Write(dataBuff.Bytes())
|
||||
// if err != nil {
|
||||
// c.Emit("error", errors.New(fmt.Sprintf("mcs sendConnectInitial write error %v", err)))
|
||||
// return
|
||||
// }
|
||||
// glog.Debug("mcs wait for data event")
|
||||
// c.transport.Once("data", c.recvConnectResponse)
|
||||
//}
|
||||
|
||||
func (c *MCSClient) connect(selectedProtocol uint32) {
|
||||
glog.Debug("mcs client on connect", selectedProtocol)
|
||||
c.clientCoreData.ServerSelectedProtocol = selectedProtocol
|
||||
|
||||
Reference in New Issue
Block a user