当前位置: 首页 > news >正文

【蓝队技能】【规则开发1】Suricata-C2Webshell隧道

蓝队技能


Suricata-C2&Webshell&隧道

  • 蓝队技能
  • 总结
  • 前言
  • 一、C2规则开发
      • 1.1 Sliver
      • 1.2 CS
  • 二、内网隧道
      • 1.1 frps
      • 1.2 nps
  • 三、webshell
      • 3.1 蚁剑
      • 3.2 冰蝎
      • 3.3 哥斯拉

总结

在这里插入图片描述


前言

本文聚焦于Suricata规则开发,提供针对Sliver、Cobalt Strike(CS)等C2框架,以及蚁剑、冰蝎、哥斯拉等Webshell工具的检测规则。同时,我们还将涵盖FRP和NPS等内网隧道工具的检测策略。通过运用这些规则,安全团队能够更有效地识别并响应潜在的安全威胁,保障网络环境的安全稳定。


一、C2规则开发

1.1 Sliver

alert tcp any any -> any any (msg: "Sliver HTTP woff request"; flow:to_server,established;content:".woff";http_uri;pcre: "/\/(static|assets|fonts|locales)(.*?)((attribute_text_w01_regular|ZillaSlab-Regular\.subset\.bbc33fb47cf6|ZillaSlab-Bold\.subset\.e96c15f68c68|Inter-Regular|Inter-Medium)\.woff)\?[a-z_]{1,2}=[a-z0-9_]{1,10}/i";sid:1000001;classtype:trojan-activity; rev:1;)
alert tcp any any -> any any (msg: "Sliver HTTP js request"; flow:to_server,established;content:"GET";http_method;nocase;content:".js";http_uri;pcre: "/\/(js|umd|assets|bundle|bundles|scripts|script|javascripts|javascript|jscript)(.*?)((bootstrap|bootstrap.min|jquery.min|jquery|route|app|app.min|array|backbone|script|email)\.js)\?[a-z_]{1,2}=[a-z0-9_]{1,10}/i";sid:1000002;classtype:trojan-activity; rev:1;)
alert tcp any any -> any any (msg: "Sliver HTTP html request&getsessionID"; flow:to_server,established;content:"POST";http_method;nocase;content:".html";http_uri;pcre: "/\/(php|api|upload|actions|rest|v1|oauth2callback|authenticate|oauth2|oauth|auth|database|db|namespaces)(.*?)((login|signin|api|samples|rpc|index|admin|register|sign-up)\.html)\?[a-z_]{1,2}=[a-z0-9_]{1,10}/i";sid:1000003;flowbits:set,name;flowbits:noalert;classtype:trojan-activity; rev:1;)
alert tcp any any <> any any (msg: "Sliver HTTP html response&set-cookie";flow:to_client,established;content:"Set-Cookie";http_header;pcre:"/^Set-Cookie\:\s*(PHPSESSID|SID|SSID|APISID|csrf-state|AWSALBCORS)\=[a-z0-9]{32}\;\s*HttpOnly$/i";sid:1000004;flowbits:isset,name;classtype:trojan-activity;)
alert tcp any any -> any any (msg: "Sliver HTTP php request"; flow:to_server,established;content:"POST";http_method;nocase;content:".php";http_uri;pcre: "/\/(php|api|upload|actions|rest|v1|oauth2callback|authenticate|oauth2|oauth|auth|database|db|namespaces)(.*?)((login|signin|api|samples|rpc|index|admin|register|sign-up)\.php)\?[a-z_]{1,2}=[a-z0-9_]{1,10}/i";sid:1000005;classtype:trojan-activity; rev:1;)
alert tcp any any -> any any (msg: "Sliver HTTP png request"; flow:to_server,established;content:".png";http_uri;pcre: "/\/(static|www|assets|images|icons|image|icon|png)(.*?)((favicon|sample|example)\.png)\?[a-z_]{1,2}=[a-z0-9_]{1,10}/i";sid:1000006;classtype:trojan-activity; rev:1;)
alert tls any any -> any any (msg:"sliver https debian"; ja3.hash; content:"19e29534fd49dd27d09234e639c4057e"; classtype:misc-activity; sid:1001; rev:1;)
alert tls any any -> any any (msg:"sliver https"; ja3.hash; content:"f4febc55ea12b31ae17cfb7e614afda8"; sid:1002;)

如下解释如何使用Suricata进行规则开发 Suricata下载

在这里插入图片描述
在这里插入图片描述

在这里插入图片描述



1. suricata.exe :运行文件名称
2. -c suricata.yaml :加载的配置文件
3. -s sliver.rules :验证的规则
4. -i 192.168.189.152 :监听的网卡

后面运行sliver并执行命令,不会的看我前几篇文章即可

在这里插入图片描述

1.2 CS

1. 修改suricata.yaml配置文件:
在这里插入图片描述
在这里插入图片描述
2. lua_script文件夹中创建checksum8_check.lua文件,并写入如下内容:
在这里插入图片描述

# java代理换算成lua代码
-- 定义函数来计算checksum8  
function checksum8(text)  if #text < 4 then  return 0  end  -- 移除字符串中的'/'字符  text = text:gsub("/", "")  local sum = 0  for x = 1, #text do  sum = sum + string.byte(text, x)  end  return sum % 256  
end  -- 主程序  
print(checksum8("Yle2"))

3. cs.rules文件内容:

alert http any any -> any any (gid:3333; sid:30001; rev:1; \msg:"http-beacon-checksum8-path-parse"; \classtype: http-beacon; \flow: established, to_server; \urilen:4<>6; \luajit:checksum8_check.lua; \
)# http-beacon上线/心跳请求,匹配敏感路径
alert http any any -> any any (gid:3333; sid:30003; rev:1; \msg:"http-beacon-get-data"; \classtype: http-beacon; \flow:to_server; \http.method; content:"GET"; \http.accept; content:"*/*"; \http.uri; pcre:"/\/ca|\/dpixel|\/__utm.gif|\/pixel.gif|\/g.pixel|\/dot.gif|\/updates.rss|\/fwlink|\/cm|\/cx|\/pixel|\/match|\/visit.js|\/load|\/push|\/ptj|\/j.ad|\/ga.js|\/en_US\/all.js|\/activity|\/IE9CompatViewList.xml/"; \http.user_agent; pcre:"/Mozilla\/5.0 \(compatible/"; \
)# http-beacon执行完下发的命令后,通过post方式向c2服务器发起数据回传请求
alert http any any -> any any (gid:3333; sid:30004; rev:1; \msg:"http-beacon-post-data"; \classtype: http-beacon; \flow:to_server; \http.method; content:"POST"; \http.uri; content:"/submit.php?id="; \http.accept; content:"*/*"; \http.content_type; content:"application/octet-stream"; \http.connection; content:"keep-alive"; nocase; \http.request_body; content:"|00 00 00|"; startswith; \
)# https-beacon-ja3指纹,client-hello
alert tls any any -> any any (gid:6666; sid:30005; rev:1; \msg:"https-beacon-ja3-hash"; \classtype: https-beacon; \ja3.hash; pcre:"/72a589da586844d7f0818ce684948eea|652358a663590cfc624787f06b82d9ae|4d93395b1c1b9ad28122fb4d09f28c5e|a0e9f5d64349fb13191bc781f81f42e1/"; \
)# https-beacon-ja3s指纹,server-hello
alert tls any any -> any any (gid:6666; sid:30006; rev:1; \msg:"https-beacon-ja3s-hash"; \classtype: https-beacon; \ja3s.hash; pcre:"/fd4bc6cea4877646ccd62f0792ec0b62|b742b407517bac9536a77a7b0fee28e9/"; \
)# https-beacon-cert指纹,subject、cert_issuer,默认为空
alert tls any any -> any any (gid:6666; sid:30007; rev:1; \msg:"https-beacon-tls-cert-issuer"; \classtype: https-beacon; \tls.cert_subject; content:"C=, ST=, L=, O=, OU=, CN="; nocase; \tls.cert_issuer; content:"C=, ST=, L=, O=, OU=, CN="; nocase; \tls_cert_notbefore:2015-05-20T18:26:24; \tls_cert_notafter:2025-05-17T18:26:24; \
)# https-beacon-cert指纹,fingerprint
alert tls any any -> any any (gid:6666; sid:30008; rev:1; \msg:"https-beacon-tls-cert-fingerprint"; \classtype: https-beacon; \tls.cert_fingerprint; content:"6e:ce:5e:ce:41:92:68:3d:2d:84:e2:5b:0b:a7:e0:4f:9c:b7:eb:7c" ;\
)# https-beacon-cert指纹,serialNumber
alert tls any any -> any any (gid:6666; sid:30009; rev:1; \msg:"https-beacon-tls-cert-fingerprint"; \classtype: https-beacon; \tls.cert_serial; content:"08:BB:00:EE"; \
)# dns-beacon,匹配dns-beacon发起上线/心跳请求后,c2服务器的返回包
# Type: A, Class: IN, 0.0.0.0
alert dns any any -> any any (gid:9999; sid:30010; rev:1; \msg:"dns-beacon-live-response"; \classtype: dns-beacon; \content:"|00 01 00 01 00 00 00|"; \content:"|00 00 00 00|"; endswith; \
)# dns-beacon,匹配dns-beacon发起上线/心跳请求后,c2服务器的返回包,选择后续使用A记录
# Type: A, Class: IN, 0.0.0.241
alert dns any any -> any any (gid:9999; sid:30011; rev:1; \msg:"dns-beacon-live-response"; \classtype: dns-beacon; \content:"|00 01 00 01 00 00 00|"; \content:"|00 00 00 f1|"; nocase; endswith; \
)# dns-beacon,匹配dns-beacon发起上线/心跳请求后,c2服务器的返回包,选择后续使用TXT记录
# Type: A, Class: IN, 0.0.0.243
alert dns any any -> any any (gid:9999; sid:30012; rev:1; \msg:"dns-beacon-live-response"; \classtype: dns-beacon; \content:"|00 01 00 01 00 00 00|"; \content:"|00 00 00 f3|"; nocase; endswith; \
)# dns-beacon,匹配dns-beacon发起上线/心跳请求后,c2服务器的返回包,选择后续使用AAAA记录
# Type: A, Class: IN, 0.0.0.245
alert dns any any -> any any (gid:9999; sid:30013; rev:1; \msg:"dns-beacon-live-response"; \classtype: dns-beacon; \content:"|00 01 00 01 00 00 00|"; \content:"|00 00 00 f5|"; nocase; endswith; \
)# dns-beacon,匹配dns-beacon发起元数据提交请求后,c2服务器的确认返回包
# 以www开头0.0.0.0结尾的A记录查询返回包
# Type: A, Class: IN, 0.0.0.0
alert udp any any -> any any (gid:9999; sid:30014; rev:1; \msg:"dns-beacon-metadata-response"; \classtype: dns-beacon; \flow:to_client; \content:"www"; \content:"|00 01 00 01 00 00 00|"; \content:"|00 00 00 00|"; nocase; endswith; \
)# dns-beacon,匹配dns-beacon使用AAAA、TXT方式向c2服务器发起payload下载请求后,c2服务器的返回包
# www6 ==> AAAA 、api ==> TXT 
# Type: A, Class: IN, 0.0.0.80
alert udp any any -> any any (gid:9999; sid:30015; rev:1; \msg:"dns-beacon-getpayload-response"; \classtype: dns-beacon; \flow:to_client; \pcre:"/www6|api/"; \content:"|00 01 00 01 00 00 00|"; \content:"|00 00 00 50|"; endswith; \
)# dns-beacon,匹配dns-beacon使用A方式向c2服务器发起payload下载请求后,c2服务器的返回包
# cdn ==> A
# Type: A, Class: IN, 0.0.0.64
alert udp any any -> any any (gid:9999; sid:30016; rev:1; \msg:"dns-beacon-getpayload-response"; \classtype: dns-beacon; \flow:to_client; \pcre:"/cdn/"; \content:"|00 01 00 01 00 00 00|"; \content:"|00 00 00 40|"; endswith; \
)# dns-beacon,匹配dns-beacon使用执行完payload后,向c2服务器执行结果数据,c2服务器的返回包
# post ==> put_output
# Type: A, Class: IN, 0.0.0.00
alert udp any any -> any any (gid:9999; sid:30017; rev:1; \msg:"dns-beacon-output-response"; \classtype: dns-beacon; \flow:to_client; \content:"post"; \content:"|00 01 00 01 00 00 00|"; \content:"|00 00 00 00|"; nocase; endswith; \
)

二、内网隧道

按照和C2相似的操作(监听流量 -> 工具运行)

1.1 frps

alert tcp any any -> any any (msg:"frp find"; content:"{\"version\":\""; pcre:"/\"version\":\"0\.\d{2}\.\d{1}\"/"; nocase; sid:1000042; rev:1;)alert tcp any any -> any any (msg:"frp find"; content:"{\"run_id\":\""; nocase; sid:1000044; rev:1;)

1.2 nps

alert tcp any any -> any any (msg:"nps find"; content:"sucs"; nocase; sid:1000053; rev:1;)

三、webshell

3.1 蚁剑

alert http any any -> $HOME_NET any (msg:"antSword find"; content:"User-Agent|3a| antSword/v2.1"; http_header; sid:1000009; rev:1;)

3.2 冰蝎

alert http any any -> $HOME_NET any (msg:"behinder find"; content:"Accept:"; http_header; content:"text/html"; http_header; content:"application/xhtml+xml"; http_header; content:"application/xml"; http_header; content:"q=0.9"; http_header; content:"image/webp"; http_header; content:"image/apng"; http_header; content:"*/*"; http_header; content:"q=0.8"; http_header; content:"application/signed-exchange"; http_header; content:"v=b3"; http_header; content:"Accept-Language: zh-CN"; http_header; content:"q=0.9"; http_header; content:"en-US"; http_header; content:"q=0.8"; http_header; sid:1000047; rev:3;)

3.3 哥斯拉

alert http any any -> $HOME_NET any (msg:"godzilla find"; content:"Accept:"; http_header; content:"text/html"; http_header; content:"application/xhtml+xml"; http_header; content:"application/xml"; http_header; content:"q=0.9"; http_header; content:"image/webp"; http_header; content:"*/*"; http_header; content:"q=0.8"; http_header; sid:1000099; rev:1;)

相关文章:

【蓝队技能】【规则开发1】Suricata-C2Webshell隧道

蓝队技能 Suricata-C2&Webshell&隧道 蓝队技能总结前言一、C2规则开发1.1 Sliver1.2 CS 二、内网隧道1.1 frps1.2 nps 三、webshell3.1 蚁剑3.2 冰蝎3.3 哥斯拉 总结 前言 本文聚焦于Suricata规则开发&#xff0c;提供针对Sliver、Cobalt Strike&#xff08;CS&#xf…...

全面了解 NGINX 的负载均衡算法

NGINX 提供多种负载均衡方法&#xff0c;以应对不同的流量分发需求。常用的算法包括&#xff1a;最少连接、最短时间、通用哈希、随机算法和 IP 哈希。这些负载均衡算法都通过独立指令来定义&#xff0c;每种算法都有其独特的应用场景。 以下负载均衡方法&#xff08;IP 哈希除…...

Java-继承与多态-上篇

关于类与对象&#xff0c;内容较多&#xff0c;我们分为两篇进行讲解&#xff1a; &#x1f4da; Java-继承与多态-上篇&#xff1a;———— <就是本篇> &#x1f4d5; 继承的概念与使用 &#x1f4d5; 父类成员访问 &#x1f4d5; super关键字 &#x1f4d5; supe…...

通过比较list与vector在简单模拟实现时的不同进一步理解STL的底层

cplusplus.com/reference/list/list/?kwlist 当我们大致阅读完list的cplusplus网站的文档时&#xff0c;我们会发现它提供的接口大致上与我们的vector相同。当然的&#xff0c;在常用接口的简单实现上它们也大体相同&#xff0c;但是它们的构造函数与迭代器的实现却大有不同。…...

软件I2C的代码

I2C的函数 GPIO的配置——scl和sda都配置为开漏输出 void MyI2C_Init(void) {RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOB,ENABLE);GPIO_InitTypeDef GPIO_InitStruture;GPIO_InitStruture.GPIO_Mode GPIO_Mode_Out_OD;GPIO_InitStruture.GPIO_PinGPIO_Pin_10 | GPIO_Pin_…...

登录时用户名密码加密传输(包含前后端代码)

页面输入用户名密码登录过程中&#xff0c;如果没有对用户名密码进行加密处理&#xff0c;可能会导致传输过程中数据被窃取&#xff0c;就算使用https协议&#xff0c;在浏览器控制台的Request Payload中也是能直接看到传输的明文&#xff0c;安全感是否还是不足。 大致流程&a…...

ai聊天对话页面-uniapp

流式传输打字机效果&#xff0c;只支持uniapp内使用 &#xff0c;下载地址 https://download.csdn.net/download/qq_54123885/89899859...

虚拟滚动列表如何实现?

highlight: a11y-dark 虚拟滚动列表&#xff0c;虚拟滚动的关键在于只渲染当前视口内可见的数据项&#xff0c;而不是一次性渲染所有数据项。这可以显著提高性能&#xff0c;尤其是在处理大量数据时。 以下是一个完整的虚拟滚动列表的示例代码&#xff1a; <!DOCTYPE htm…...

07_Linux网络配置与管理:命令与工具指南

本系列文章导航&#xff1a;01_Linux基础操作CentOS7学习笔记-CSDN博客 文章目录 网络配置与管理&#xff1a;命令与工具指南1. ping命令2. ifconfig命令3. ip命令4. route命令5. ip route命令6. nslookup命令7. nmcli命令8. nmtui命令9. RHEL7修改网卡名1. 修改网络(会话)配置…...

首个统一生成和判别任务的条件生成模型框架BiGR:专注于增强生成和表示能力,可执行视觉生成、辨别、编辑等任务

BiGR是一种新型的图像生成模型&#xff0c;它可以生成高质量的图像&#xff0c;同时还能有效地提取图像特征。该方法是通过将图像转换为一系列的二进制代码来工作&#xff0c;这些代码就像是图像的“压缩版”。在训练时会遮住一些代码&#xff0c;然后让模型学习如何根据剩下的…...

【Java知识】Java进阶-服务发现机制SPI

文章目录 SPI概述SPI 工作原理 ServiceLoader代码展示简化的 ServiceLoader 类关键点解释使用示例1. 定义服务接口2. 实现服务提供者3. 配置文件4. 加载服务提供者 总结 SPI使用场景1. 数据库驱动2. 日志框架3. 图像处理4. 加密算法5. 插件系统6. 缓存机制示例代码1. 定义服务接…...

多模态技术的协同表现:从文本生成、语音合成到口型同步综合测评

本文是针对多模态对话系统核心技术栈的使用效果和网络测评整理。 测评内容基于用户体验&#xff0c;侧重于从使用者角度出发&#xff0c;讨论实际操作中的体验感受&#xff0c;如技术的易用性、输出效果如文本的连贯性、语音的自然度、口型同步的准确性等。不涉及具体算法架构…...

Java最全面试题->Java主流框架->Srping面试题

Spring面试题 下边是我自己整理的面试题,基本已经很全面了,想要的可以私信我,我会不定期去更新思维导图 哪里不会点哪里 谈谈你对 Spring 的理解? Spring 是一个开源框架,为简化企业级应用开发而生。Spring 可以是使简单的 JavaBean 实现以前只有 EJB 才能实现的功能。…...

参编国家标准需要注意的事项有哪些?

1. 项目相关性&#xff1a; • 选择与自身企业产品、业务或专业领域紧密相关的国家标准进行参编。这样不仅能确保企业在标准制定过程中发挥自身的优势和专长&#xff0c;使参编工作更有实际意义和价值&#xff0c;也有利于企业将标准更好地应用于自身的生产经营活动&#xff0c…...

【Dash】feffery_antd_components 按钮组件的应用

一、feffery_antd_componenet 中的 AntdFloatButton 和 AntdFloatButtonGroup AntdFloatButton 和 AntdFloatButtonGroup 是两个用于创建悬浮按钮和悬浮按钮组的组件。 AntdFloatButton 是单个悬浮按钮组件&#xff0c;它提供了多种属性来定义按钮的外观及行为。AntdFloatBut…...

01 springboot-整合日志(logback-config.xml)

logback-config.xml 是一个用于配置 Logback 日志框架的 XML 文件&#xff0c;通常位于项目的 classpath 下的根目录或者 src/main/resources 目录下。 Logback 提供了丰富的配置选项&#xff0c;可以满足各种不同的日志需求。需要根据具体情况进行配置。 项目创建&#xff0…...

Java最全面试题->计算机基础面试题->计算机网络面试题

计算机网络 下边是我自己整理的面试题&#xff0c;基本已经很全面了&#xff0c;想要的可以私信我&#xff0c;我会不定期去更新思维导图 哪里不会点哪里 1.说一下TCP/IP四层模型 TCP/IP协议是美国国防部高级计划研究局为实现ARPANET互联网而开发的。 网络接口层&#xff…...

VSCode编译器改为中文

1. 通过快捷键设置中文 打开命令面板&#xff1a;按住键盘上的CtrlShiftP组合键&#xff0c;打开命令面板。 输入并设置语言&#xff1a;在命令面板中输入Configure Display Language。 点击Configure Display Language选项。 在弹出的语言选择列表中&#xff0c;选择zh-cn…...

前端开发设计模式——状态模式

目录 一、状态模式的定义和特点 二、状态模式的结构与原理 1.结构&#xff1a; 2.原理&#xff1a; 三、状态模式的实现方式 四、状态模式的使用场景 1.按钮的不同状态&#xff1a; 2.页面加载状态&#xff1a; 3.用户登录状态&#xff1a; 五、状态模式的优点 1.提…...

特种作业操作烟花爆竹试题分享

1.&#xff08;单选题&#xff09;职业卫生研究的是人类从事各种职业劳动过程中的&#xff08; &#xff09;。 A.健康问题 B.环境问题 C.卫生问题 答案:C 2.&#xff08;单选题&#xff09;安全生产事关人民群众的&#xff08; &#xff09;安全&#xff0c;事关改革发展和…...

React 第五十五节 Router 中 useAsyncError的使用详解

前言 useAsyncError 是 React Router v6.4 引入的一个钩子&#xff0c;用于处理异步操作&#xff08;如数据加载&#xff09;中的错误。下面我将详细解释其用途并提供代码示例。 一、useAsyncError 用途 处理异步错误&#xff1a;捕获在 loader 或 action 中发生的异步错误替…...

【WiFi帧结构】

文章目录 帧结构MAC头部管理帧 帧结构 Wi-Fi的帧分为三部分组成&#xff1a;MAC头部frame bodyFCS&#xff0c;其中MAC是固定格式的&#xff0c;frame body是可变长度。 MAC头部有frame control&#xff0c;duration&#xff0c;address1&#xff0c;address2&#xff0c;addre…...

边缘计算医疗风险自查APP开发方案

核心目标:在便携设备(智能手表/家用检测仪)部署轻量化疾病预测模型,实现低延迟、隐私安全的实时健康风险评估。 一、技术架构设计 #mermaid-svg-iuNaeeLK2YoFKfao {font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:16px;fill:#333;}#mermaid-svg…...

Python:操作 Excel 折叠

💖亲爱的技术爱好者们,热烈欢迎来到 Kant2048 的博客!我是 Thomas Kant,很开心能在CSDN上与你们相遇~💖 本博客的精华专栏: 【自动化测试】 【测试经验】 【人工智能】 【Python】 Python 操作 Excel 系列 读取单元格数据按行写入设置行高和列宽自动调整行高和列宽水平…...

ssc377d修改flash分区大小

1、flash的分区默认分配16M、 / # df -h Filesystem Size Used Available Use% Mounted on /dev/root 1.9M 1.9M 0 100% / /dev/mtdblock4 3.0M...

django filter 统计数量 按属性去重

在Django中&#xff0c;如果你想要根据某个属性对查询集进行去重并统计数量&#xff0c;你可以使用values()方法配合annotate()方法来实现。这里有两种常见的方法来完成这个需求&#xff1a; 方法1&#xff1a;使用annotate()和Count 假设你有一个模型Item&#xff0c;并且你想…...

数据链路层的主要功能是什么

数据链路层&#xff08;OSI模型第2层&#xff09;的核心功能是在相邻网络节点&#xff08;如交换机、主机&#xff09;间提供可靠的数据帧传输服务&#xff0c;主要职责包括&#xff1a; &#x1f511; 核心功能详解&#xff1a; 帧封装与解封装 封装&#xff1a; 将网络层下发…...

《基于Apache Flink的流处理》笔记

思维导图 1-3 章 4-7章 8-11 章 参考资料 源码&#xff1a; https://github.com/streaming-with-flink 博客 https://flink.apache.org/bloghttps://www.ververica.com/blog 聚会及会议 https://flink-forward.orghttps://www.meetup.com/topics/apache-flink https://n…...

Java数值运算常见陷阱与规避方法

整数除法中的舍入问题 问题现象 当开发者预期进行浮点除法却误用整数除法时,会出现小数部分被截断的情况。典型错误模式如下: void process(int value) {double half = value / 2; // 整数除法导致截断// 使用half变量 }此时...

scikit-learn机器学习

# 同时添加如下代码, 这样每次环境(kernel)启动的时候只要运行下方代码即可: # Also add the following code, # so that every time the environment (kernel) starts, # just run the following code: import sys sys.path.append(/home/aistudio/external-libraries)机…...