mirror of
https://github.com/shadow1ng/fscan.git
synced 2026-09-25 20:51:52 +08:00
feat: v2.1.0 核心重构与功能增强
## 架构重构
- 全局变量消除,迁移至 Config/State 对象
- SMB 插件融合(smb/smb2/smbghost/smbinfo)
- 服务探测重构,实现 Nmap 风格 fallback 机制
- 输出系统重构,TXT 实时刷盘 + 双写机制
- i18n 框架升级至 go-i18n
## 性能优化
- 正则表达式预编译
- 内存优化 map[string]struct{}
- 并发指纹匹配
- SOCKS5 连接复用
- 滑动窗口调度 + 自适应线程池
## 新功能
- Web 管理界面
- 多格式 POC 适配(xray/afrog)
- 增强指纹库(3139条)
- Favicon hash 指纹识别
- 插件选择性编译(Build Tags)
- fscan-lab 靶场环境
- 默认端口扩展(62→133)
## 构建系统
- 添加 no_local tag 支持排除本地插件
- 多版本构建:fscan/fscan-nolocal/fscan-web
- CI 添加 snapshot 模式支持仅测试构建
## Bug 修复
- 修复 120+ 个问题,包括 RDP panic、批量扫描漏报、
JSON 输出格式、Redis 检测、Context 超时等
## 测试增强
- 单元测试覆盖率 74-100%
- 并发安全测试
- 集成测试(Web/端口/服务/SSH/ICMP)
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
FROM rmohr/activemq:5.15.9
|
||||
|
||||
# 复制STOMP专用配置文件
|
||||
COPY activemq.xml /opt/activemq/conf/activemq.xml
|
||||
|
||||
# 仅暴露STOMP协议端口
|
||||
EXPOSE 61613 61614
|
||||
|
||||
# 设置环境变量
|
||||
ENV ACTIVEMQ_OPTS_MEMORY="-Xms64M -Xmx512M"
|
||||
ENV ACTIVEMQ_OPTS="-Djava.util.logging.config.file=logging.properties -Djava.security.auth.login.config=/opt/activemq/conf/login.config"
|
||||
|
||||
# 启动ActiveMQ
|
||||
CMD ["/opt/activemq/bin/activemq", "console"]
|
||||
@@ -0,0 +1,2 @@
|
||||
docker build -t activemq-weak .
|
||||
docker run -d --name activemq-test -p 61616:61616 -p 8161:8161 -p 61613:61613 activemq-weak
|
||||
@@ -0,0 +1,55 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<beans xmlns="http://www.springframework.org/schema/beans"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns:amq="http://activemq.apache.org/schema/core"
|
||||
xsi:schemaLocation="
|
||||
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
|
||||
http://activemq.apache.org/schema/core http://activemq.apache.org/schema/core/activemq-core.xsd">
|
||||
|
||||
<!-- 专注于STOMP协议的ActiveMQ配置 -->
|
||||
<broker xmlns="http://activemq.apache.org/schema/core" useJmx="false" persistent="false">
|
||||
<!-- 安全认证配置 -->
|
||||
<plugins>
|
||||
<simpleAuthenticationPlugin>
|
||||
<users>
|
||||
<!-- 主要测试账户 -->
|
||||
<authenticationUser username="admin" password="Aa123456789" groups="admins,publishers,consumers"/>
|
||||
<authenticationUser username="admin" password="admin" groups="admins,publishers,consumers"/>
|
||||
<authenticationUser username="test" password="test123" groups="publishers,consumers"/>
|
||||
<authenticationUser username="root" password="root123" groups="admins"/>
|
||||
<authenticationUser username="system" password="admin123" groups="admins"/>
|
||||
<authenticationUser username="guest" password="guest" groups="consumers"/>
|
||||
<authenticationUser username="activemq" password="activemq" groups="publishers,consumers"/>
|
||||
</users>
|
||||
</simpleAuthenticationPlugin>
|
||||
|
||||
<!-- 简化的授权配置 -->
|
||||
<authorizationPlugin>
|
||||
<map>
|
||||
<authorizationMap>
|
||||
<authorizationEntries>
|
||||
<authorizationEntry queue=">" read="consumers,admins" write="publishers,admins" admin="admins"/>
|
||||
<authorizationEntry topic=">" read="consumers,admins" write="publishers,admins" admin="admins"/>
|
||||
</authorizationEntries>
|
||||
</authorizationMap>
|
||||
</map>
|
||||
</authorizationPlugin>
|
||||
</plugins>
|
||||
|
||||
<!-- 仅启用STOMP传输连接器 -->
|
||||
<transportConnectors>
|
||||
<transportConnector name="stomp" uri="stomp://0.0.0.0:61613?maximumConnections=500&wireFormat.maxFrameSize=104857600"/>
|
||||
<transportConnector name="stomp+ssl" uri="stomp+ssl://0.0.0.0:61614?maximumConnections=500&wireFormat.maxFrameSize=104857600"/>
|
||||
</transportConnectors>
|
||||
|
||||
<!-- 禁用JMX和Web控制台以简化配置 -->
|
||||
<managementContext>
|
||||
<managementContext createConnector="false"/>
|
||||
</managementContext>
|
||||
|
||||
<!-- 简化的持久化配置 -->
|
||||
<persistenceAdapter>
|
||||
<memoryPersistenceAdapter/>
|
||||
</persistenceAdapter>
|
||||
</broker>
|
||||
</beans>
|
||||
@@ -0,0 +1,15 @@
|
||||
version: '3.8'
|
||||
|
||||
services:
|
||||
activemq:
|
||||
build: .
|
||||
ports:
|
||||
- "61613:61613" # STOMP
|
||||
- "61616:61616" # OpenWire
|
||||
- "8162:8161" # Web Console (mapped to host port 8162)
|
||||
environment:
|
||||
- ACTIVEMQ_ADMIN_LOGIN=admin
|
||||
- ACTIVEMQ_ADMIN_PASSWORD=Aa123456789
|
||||
volumes:
|
||||
- ./activemq.xml:/opt/activemq/conf/activemq.xml
|
||||
- ./users.properties:/opt/activemq/conf/users.properties
|
||||
@@ -0,0 +1,12 @@
|
||||
# ActiveMQ Web Console用户认证配置
|
||||
# 格式: username: password [,role1,role2,...]
|
||||
|
||||
# 管理员用户
|
||||
admin: Aa123456789,admin,user
|
||||
test: test123,user
|
||||
root: root123,admin,user
|
||||
system: admin123,admin,user
|
||||
|
||||
# 默认测试用户
|
||||
user: user,user
|
||||
guest: guest,user
|
||||
@@ -0,0 +1,112 @@
|
||||
<!--
|
||||
Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
contributor license agreements. See the NOTICE file distributed with
|
||||
this work for additional information regarding copyright ownership.
|
||||
The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
(the "License"); you may not use this file except in compliance with
|
||||
the License. You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
-->
|
||||
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
|
||||
|
||||
<bean id="securityConstraint" class="org.eclipse.jetty.util.security.Constraint">
|
||||
<property name="name" value="BASIC" />
|
||||
<property name="roles" value="user,admin" />
|
||||
<property name="authenticate" value="true" />
|
||||
</bean>
|
||||
|
||||
<bean id="adminSecurityConstraint" class="org.eclipse.jetty.util.security.Constraint">
|
||||
<property name="name" value="BASIC" />
|
||||
<property name="roles" value="admin" />
|
||||
<property name="authenticate" value="true" />
|
||||
</bean>
|
||||
|
||||
<bean id="securityConstraintMapping" class="org.eclipse.jetty.security.ConstraintMapping">
|
||||
<property name="constraint" ref="securityConstraint" />
|
||||
<property name="pathSpec" value="/admin/*,/api/*" />
|
||||
</bean>
|
||||
|
||||
<bean id="realmSecurityHandler" class="org.eclipse.jetty.security.ConstraintSecurityHandler">
|
||||
<property name="authenticator">
|
||||
<bean class="org.eclipse.jetty.security.authentication.BasicAuthenticator" />
|
||||
</property>
|
||||
<property name="constraintMappings">
|
||||
<list>
|
||||
<ref bean="securityConstraintMapping" />
|
||||
</list>
|
||||
</property>
|
||||
<property name="loginService">
|
||||
<bean class="org.eclipse.jetty.security.HashLoginService">
|
||||
<property name="name" value="ActiveMQRealm" />
|
||||
<property name="config" value="${activemq.conf}/jetty-realm.properties" />
|
||||
</bean>
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
<bean id="contexts" class="org.eclipse.jetty.server.handler.ContextHandlerCollection">
|
||||
</bean>
|
||||
|
||||
<bean id="jettyPort" class="org.apache.activemq.web.config.SystemPropertiesConfiguration" init-method="configure">
|
||||
<property name="properties">
|
||||
<map>
|
||||
<entry key="jetty.port" value="8161" />
|
||||
<entry key="jetty.host" value="0.0.0.0" />
|
||||
</map>
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
<bean id="Server" class="org.eclipse.jetty.server.Server"
|
||||
depends-on="jettyPort"
|
||||
init-method="start" destroy-method="stop">
|
||||
|
||||
<property name="connectors">
|
||||
<list>
|
||||
<bean id="Connector" class="org.eclipse.jetty.server.ServerConnector">
|
||||
<constructor-arg ref="Server" />
|
||||
<property name="host" value="#{systemProperties['jetty.host']}" />
|
||||
<property name="port" value="#{systemProperties['jetty.port']}" />
|
||||
</bean>
|
||||
</list>
|
||||
</property>
|
||||
|
||||
<property name="handler">
|
||||
<bean id="handlers" class="org.eclipse.jetty.server.handler.HandlerCollection">
|
||||
<property name="handlers">
|
||||
<list>
|
||||
<ref bean="contexts" />
|
||||
<bean class="org.eclipse.jetty.server.handler.DefaultHandler" />
|
||||
</list>
|
||||
</property>
|
||||
</bean>
|
||||
</property>
|
||||
|
||||
</bean>
|
||||
|
||||
<bean id="invokeStart" class="org.springframework.beans.factory.config.MethodInvokingBean">
|
||||
<property name="targetObject" ref="Server" />
|
||||
<property name="targetMethod" value="start" />
|
||||
</bean>
|
||||
|
||||
<bean class="org.eclipse.jetty.webapp.WebAppContext">
|
||||
<property name="contextPath" value="/admin" />
|
||||
<property name="resourceBase" value="${activemq.home}/webapps/admin" />
|
||||
<property name="server" ref="Server" />
|
||||
<property name="securityHandler" ref="realmSecurityHandler" />
|
||||
</bean>
|
||||
|
||||
<bean class="org.eclipse.jetty.webapp.WebAppContext">
|
||||
<property name="contextPath" value="/api" />
|
||||
<property name="resourceBase" value="${activemq.home}/webapps/api" />
|
||||
<property name="server" ref="Server" />
|
||||
<property name="securityHandler" ref="realmSecurityHandler" />
|
||||
</bean>
|
||||
|
||||
</beans>
|
||||
@@ -0,0 +1,4 @@
|
||||
admin=Aa123456789
|
||||
test=test123
|
||||
root=root123
|
||||
system=admin123
|
||||
Reference in New Issue
Block a user