Crypto入门-离散对数相关入门
Crypto入门-离散对数相关入门基础知识ElGamal密钥生成方法:选择一个$p\in\mathbb P$和$\mathbb Zp^*$,且$p-1$有很大的素因子,选取$\mathbb Zp^*$的生成元$g$,选择随机的$k$,其中$0<k<p-1,k\in\mathbb Z$,计算$y=g^k \bmod p$,即得到公钥为$(p,g,y)$,私钥为$k$。
加密:选择随机的$r$,其中$0<r<p-1,r\in\mathbb Z$,得到密文$(y_1,y_2)$为$(g^r\bmod p,my^r\bmod p)$,其中$m$为明文。
解密:通过私钥$k$计算:
$$\begin{align*} \displaylines{ &\left(y_1^k\right)^{-1}y_2\bmod p\\ =&(g^{rk})^{-1}my^r\bmod p\\ =&m }\end{align*}$$
ECC圆锥曲线公钥密码使用形如$y^2=x ...
Crypto入门-分组密码初探
Crypto入门-分组密码初探基础知识工作模式设明文为$P$,密文为$C$,加密算法为$F$,解密算法为$D$。
ECB电子密码本。
$$\displaylines{ C_i=E(P_i)\\ P_i=D(C_i)}$$
CBC密码分组链接。
$$\displaylines{ C_0=IV\cdots C_i=E(P_i\oplus C_{i-1})\\ C_0=IV\cdots P_i=D(C_i)\oplus C_{i-1}}$$
OFB输出反馈模式。
$$\displaylines{ O_0=IV\\ O_i=E(O_{i-1})\\ C_i=P_i\oplus O_i\\ P_i=C_i\oplus O_i}$$
CFB密文反馈。
$$\displaylines{ C_0=IV\\ C_i=P_i\oplus E(C_{i-1})\\ P_i=C_i\oplus E(C_{i-1})} ...
Bootstrap5基础应用
Bootstrap5基础应用图标https://feathericons.com/
https://github.com/danklammer/bytesize-icons
https://coreui.io/icons/
https://ionic.io/ionicons
http://demo.amitjakhu.com/dripicons/
https://ikons.piotrkwiatkowski.co.uk/
https://icofont.com/
https://tabler.io/icons
https://primer.style/foundations/icons
布局
靶机渗透实战-Vulnhub-Driftingblues7
靶机渗透实战-Vulnhub-Driftingblues7主机发现不需要主机发现,IP为222.24.6.94。
信息收集1nmap -sV -A -p- -T4 222.24.6.94
回显如下:
1234567891011121314151617181920212223242526272829303132333435363738Starting Nmap 7.94SVN ( https://nmap.org ) at 2024-03-19 17:34 CSTNmap scan report for 222.24.6.94Host is up (0.000029s latency).Not shown: 65527 closed tcp ports (conn-refused)PORT STATE SERVICE VERSION22/tcp open ssh OpenSSH 7.4 (protocol 2.0)| ssh-hostkey: | 2048 c4:fa:e5:5f:88:c1:a1:f0:51:8b:ae:e3: ...
靶机渗透实战-Vulnhub-Driftingblues6
靶机渗透实战-Vulnhub-Driftingblues6主机发现1nmap 222.24.6.0/24
发现IP为222.24.6.219,回显如下:
123456Starting Nmap 7.94SVN ( https://nmap.org ) at 2024-03-19 16:43 CST Nmap scan report for 222.24.6.219Host is up (0.00024s latency).Not shown: 999 closed tcp ports (conn-refused) PORT STATE SERVICE80/tcp open http
详细扫一遍端口:
1nmap -sV -A -p- -T4 222.24.6.219
发现就只有80端口:
12345678910111213Starting Nmap 7.94SVN ( https://nmap.org ) at 2024-03-19 16:48 CSTNmap scan report for 222.24.6.219Host is up (0.000042s latency ...
靶机渗透实战-Vulnhub-Driftingblues5
靶机渗透实战-Vulnhub-Driftingblues5主机发现1nmap 222.24.6.0/24
回显:
123456Nmap scan report for 222.24.6.173Host is up (0.00084s latency).Not shown: 998 closed tcp ports (conn-refused)PORT STATE SERVICE22/tcp open ssh80/tcp open http
详细端口扫描:
1nmap -sV -A -p- -T4 222.24.6.173
回显:
12345678910111213141516171819Starting Nmap 7.94SVN ( https://nmap.org ) at 2024-03-19 15:31 CSTNmap scan report for 222.24.6.173Host is up (0.0041s latency).Not shown: 65533 closed tcp ports (conn-refused)PORT STATE SERVICE ...
靶机渗透实战-Vulnhub-Driftingblues3
靶机渗透实战-Vulnhub-Driftingblues3主机发现1nmap 222.24.6.0/24
回显如下,无关信息略:
1234567Starting Nmap 7.94SVN ( https://nmap.org ) at 2024-03-19 14:18 CSTNmap scan report for 222.24.6.185Host is up (0.000053s latency).Not shown: 998 closed tcp ports (conn-refused)PORT STATE SERVICE22/tcp open ssh80/tcp open http
确认IP为222.24.6.185,只有个22端口的SSH和80端口的HTTP。详细扫描端口:
1nmap -sV -A -p- -T4 222.24.6.185
回显如下:
12345678910111213141516171819Starting Nmap 7.94SVN ( https://nmap.org ) at 2024-03-19 14:25 CSTNmap scan re ...
Python技巧随笔
Python技巧随笔Magic识别文件类型。
12345import magicm=magic.Magic()file_path="example.txt"file_type=m.from_file(file_path)print(file_type) #ASCII text
检查远程文件类型:
123url="http://example.com/file.zip"mime_type=m.from_url(url)print(mime_type)
自定义数据库:
12345import magicm=magic.Magic(magic_file="path/to/magic.mgc")file_path="example.txt"file_type=m.from_file(file_path)print(file_type)
在magic.mgc数据库中,每一行这样写:
1>0 string PK\003\004 Zip archive data
“>0”表示从文件开始处偏移量为0。
...
常用Bootstrap方法
常用Bootstrap方法开始12345678910111213141516171819202122<!DOCTYPE html><html lang="en"> <head> <meta charset="UTF-8" /> <meta http-equiv="Content-Security-Policy" content="default-src 'self'; script-src 'self'" /> <meta http-equiv="X-Content-Security-Policy" content="default-src 'self'; script-src 'self ...
Electron入门
Electron入门换源淘宝今年刚刚换源了,结果怎么设置都报错,所以干脆使用官方源。
Windows下输入:
1npm config edit
添加:
123disturl=https://registry.npmmirror.com/-/binary/nodeelectron_mirror=https://registry.npmmirror.com/-/binary/electron/registry=https://registry.npmmirror.com
运行Hello World新建一个项目文件夹,在该文件夹下:
1npm init
“package.json”文件中写了一些该工程的基本信息,入口点默认“index.js”,如果看着别扭可以自己改成“main.js”。
然后开始在该工程文件夹下下载Electron组件:
1npm install electron --save-dev
打开“package.json”的“scripts”字段下加上:
1"start":"electron .",
在该工程文件夹下新建“ind ...