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

帮人做网站要怎么赚钱免费换友情链接

帮人做网站要怎么赚钱,免费换友情链接,做网站还挣钱吗,福田庆三鼻子案例一、环境和背景 1.1 环境 OS: Ubuntu 22.04.5 LTS IDE: vscode suricata: suricata 7.0.5 1.2 背景 在添加规则时,为了给规则分类,将不同类别的规则写入不同的文件。 在规则加载时两条不同的规则却被认为是重复的,因此记录一下去重逻辑。…

一、环境和背景

1.1 环境

OS: Ubuntu 22.04.5 LTS
IDE: vscode
suricata: suricata 7.0.5

1.2 背景

在添加规则时,为了给规则分类,将不同类别的规则写入不同的文件。
在规则加载时两条不同的规则却被认为是重复的,因此记录一下去重逻辑。

a.rule

alert ip any any -> any any (msg:"SURICATA Applayer Mismatch protocol both directions"; flow:established; app-layer-event:applayer_mismatch_protocol_both_directions; flowint:applayer.anomaly.count,+,1; classtype:protocol-command-decode; sid:2260000; rev:1;)

b.rule

alert http any any -> any any (msg:"SURICATA HTTP unknown error"; flow:established; app-layer-event:http.unknown_error; flowint:http.anomaly.count,+,1; classtype:protocol-command-decode; sid:2260000; rev:1;)

suricata.yaml

rule-files:- a.rule- b.rule

请添加图片描述

二、 Suricata 规则去重

suricata 规则通过一个hashtable进行去重。

2.1 hashtable 建立

// src/suricata.c
PostConfLoadedDetectSetup// src/detect-engine.c-> DetectEngineCtxInit// src/detect-engine.c-> DetectEngineCtxInitReal// src/detect-parse.c-> DetectParseDupSigHashInit// src/suricata.c-> LoadSignatures
int DetectParseDupSigHashInit(DetectEngineCtx *de_ctx)
{de_ctx->dup_sig_hash_table = HashListTableInit(15000,DetectParseDupSigHashFunc,DetectParseDupSigCompareFunc,DetectParseDupSigFreeFunc);if (de_ctx->dup_sig_hash_table == NULL)return -1;return 0;
}

2.2 检测重复

// src/detect-parse.cSignature *DetectEngineAppendSig(DetectEngineCtx *de_ctx, const ch
{// 1. 解析规则Signature *sig = SigInit(de_ctx, sigstr);if (sig == NULL) {return NULL;}// 2. 检测重复/* checking for the status of duplicate signature */int dup_sig = DetectEngineSignatureIsDuplicate(de_ctx, sig);...
}static inline int DetectEngineSignatureIsDuplicate(DetectEngineCtxSignature *sig)
{/* we won't do any NULL checks on the args *//* return value */int ret = 0;SigDuplWrapper *sw_dup = NULL;SigDuplWrapper *sw = NULL;/* used for making a duplicate_sig_hash_table entry */sw = SCMalloc(sizeof(SigDuplWrapper));if (unlikely(sw == NULL)) {exit(EXIT_FAILURE);}memset(sw, 0, sizeof(SigDuplWrapper));sw->s = sig;/* check if we have a duplicate entry for this signature */sw_dup = HashListTableLookup(de_ctx->dup_sig_hash_table, (void *)sw, 0);/* we don't have a duplicate entry for this sig */if (sw_dup == NULL) {...}...
}

2.3 重复条件

static char DetectParseDupSigCompareFunc(void *data1, uint16_t len1, void *data2,uint16_t len2)
{SigDuplWrapper *sw1 = (SigDuplWrapper *)data1;SigDuplWrapper *sw2 = (SigDuplWrapper *)data2;if (sw1 == NULL || sw2 == NULL ||sw1->s == NULL || sw2->s == NULL)return 0;/* sid and gid match required */if (sw1->s->id == sw2->s->id && sw1->s->gid == sw2->s->gid) return 1;return 0;
}

sidgid作为重复条件,全部相等时则认为重复,不看具体的规则内容。

三、总结

  1. suricata规则通过sidgid进行去重,并不关注规则中的具体内容
  2. 通过sidgid唯一区分规则,整个工程里对规则的处理相较于字符串,整数值处理更简单高效
  3. 如果需要将规则拆分成多个文件时,需要注意sid的值
http://www.dtcms.com/wzjs/509570.html

相关文章:

  • 服务器搭建网站空间产品互联网推广
  • 做网站模块地推团队接单平台
  • 宣讲家网站支部建设惠州seo计费管理
  • 多种大连网站建设推广赚佣金的软件排名
  • 曲阜做网站哪家好福州seo代理计费
  • 做棋牌推广网站违法不百度权重1是什么意思
  • 安徽平台网站建设找哪家长沙网站seo优化排名
  • 2017最佳网站设计百度网站的优化方案
  • 30天网站建设实录素材如何自己免费制作网站
  • wordpress验证密码seo技术好的培训机构
  • 有做学业水平测试的网站武汉百度
  • 绵阳市住房和城乡建设局网站谷歌搜索引擎镜像入口
  • 动态网站开发教程 表单程序公关公司是干嘛的
  • 南涧县城乡建设局网站网站制作开发
  • 学做日本蛋糕网站线下推广都有什么方式
  • 西宁做网站需要多少钱网络公司优化关键词
  • 有没有免费的网站软件建立一个网站需要多少钱
  • 行业查询网站西安百度网站快速优化
  • 做网站蓝色和什么颜色搭配好看推广渠道有哪些平台
  • 安吉做网站免费建网站软件哪个好
  • 网络推广网站培训班网站注册查询官网
  • 网站建设收费标准好么什么是搜索关键词
  • 设计灵感网站整理百度云盘登录入口
  • 网站建设 深圳宝安免费自动推广手机软件
  • 金华住房与城乡建设部网站怎么上百度推广产品
  • 电脑网站怎么做的网络营销实践总结报告
  • 哈尔滨做网站需要多少钱网站建设情况
  • 怎么在网上免费做公司网站四平网络推广
  • vps可以多少wordpressseo的搜索排名影响因素有哪些
  • 用腾讯云做会员网站如何提升百度关键词排名