我的GitHub
0%

Centos

安装docker

1
2
3
4
5
6
7
8
sudo yum check-update
sudo yum install -y yum-utils
yum-config-manager --add-repo https://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
#sudo yum install docker -y
sudo yum install -y docker-ce
sudo systemctl start docker
sudo systemctl enable docker
docker --version

设置镜像

1
2
3
4
5
6
7
8
9
10
11
12
13
14
# 不存在就创建
vim /etc/docker/daemon.json
# 设置内容
{"registry-mirrors": [
"https://docker.1panel.dev",
"https://docker.fxxk.dedyn.io",
"https://docker.xn--6oq72ry9d5zx.cn",
"https://docker.m.daocloud.io",
"https://a.ussh.net",
"https://docker.zhai.cm"]}
#重载systemd管理守护进程配置文件
sudo systemctl daemon-reload
#重启 Docker 服务
sudo systemctl restart docker

一些镜像地址:

https://dockerproxy.cn/

查看日志

1
2
# dstserver 是容器名字
docker logs -f dstserver

我常用的一些docker

阅读全文 »

方式一 docker安装

1
2
3
4
5
6
7
8
9
10
# 设置docker加速
vim /etc/docker/daemon.json
# 填写内容
{"registry-mirrors": ["https://dockerproxy.cn"]}
# 重启docker
sudo systemctl daemon-reload
sudo systemctl restart docker

# 安装clash镜像
docker run -d --name=clash -v "$PWD/clash:/root/.config/clash/" -p "7890:7890" -p "7891:7891" -p "9090:9090" --restart=unless-stopped dreamacro/clash

镜像安装完成,就会在当前目录下生成clash文件夹,打开文件夹,将文件夹下的config.yaml 替换成上面我们从机场购买的配置,就好了

阅读全文 »

背景

需要监听某个网络请求

并根据body信息做出判断

将结果展示到插件页面

manifest.json

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
{
"manifest_version": 2,
"name": "xxx",
"version": "0.0.1",
"description": "xxx",
"permissions": [
"contextMenus",
"cookies",
"storage",
"history",
"webRequest",
"webRequestBlocking",
"*://*/*",
"http://www.baidu.com/*",
"tabs"
],

"content_scripts": [
{
"matches": [
"http://www.baidu.com/*"
],
"js": [
"content.js"
],
"run_at": "document_start",
"all_frames": true
}
],
"browser_action": {
"default_title": "xxx",
"default_popup": "popup.html"
},
"icons": {
"16": "icons/icon.png",
"32": "icons/icon.png",
"48": "icons/icon.png",
"128": "icons/icon.png"
},
"web_accessible_resources": [
"injected.js"
]
}

injected.js

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
(function () {
let origFetch = window.fetch;
window.fetch = async function (...args) {
const response = await origFetch(...args);
// console.log('fetch request:', args);

const [url] = args

const data = await response
.clone()
.json() // 此处需要根据不同数据调用不同方法
.catch(err => console.error(err));

// 对于二进制大文件可以创建为URL(blob:开头),供其它脚本访问
//sessionStorage['wave'] = URL.createObjectURL(data); // 插件需要添加'storage'权限
// // 只监听某些地址
if (url === './xx/xx/xx' && data.respData.corpOther.includes('xxxx')) {
window.postMessage({ type: 'type', data: data.respData }, '*'); // send to content script
}

return response;
}
})();
// 下面为xhr,需要则打开
(function (xhr) {

var XHR = XMLHttpRequest.prototype;

var open = XHR.open;
var send = XHR.send;

XHR.open = function (method, url) {
this._method = method;
this._url = url;
return open.apply(this, arguments);
};

XHR.send = function (postData) {
// console.log('xhr request:', this._method, this._url, postData);
this.addEventListener('load', function () {
// sessionStorage['key'] = JSON.stringify(response); // 插件需要添加'storage'权限
// document.cookie
// localStorage['key']
// console.log('xhr监听完成');
window.postMessage({ type: 'xhr', data: this.response }, '*'); // 将响应发送到 content script
});
return send.apply(this, arguments);
};
})(XMLHttpRequest);

content.js

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
console.log('编号查询插件注入成功');

// inject injected script
let s = document.createElement('script');
s.src = chrome.runtime.getURL('injected.js');
s.onload = function () {
this.remove();
};
(document.head || document.documentElement).appendChild(s);

// receive message from injected script
window.addEventListener('message', function (e) {
// 判断类型
const type = e.data.type
if (type === 'ocr') {
chrome.storage.local.get(["result"], function (result) {
console.log(123);
const data = result.result ?? ''
const tmp = data + e.data.data + '\n'
chrome.storage.local.set({ result: tmp })
})
}
});
阅读全文 »

背景

这其实是件很扯淡的事

因为VSCode的插件市场

一没有被墙

二支持离线安装

那还有这个需求吗?

但确实有。。。

我这里是完全的内网环境

离线安装虽然可以

但是多少有点麻烦。。。

阅读全文 »

1.有提示看提示,没提示看网络连接

看网络进程

1
netstat -antup

看系统进程

1
ps aux

2.看用户

1
cat /etc/passwd

3.看定时任务

1
2
crontab -l
crontab -u 用户

4.查看某个时间段文件改动内容

阅读全文 »

背景

最近同事给我发了一张“电子名片”

照片上有一个二维码

名片

大伙可以用微信扫这个二维码看看

看看是不是很有意思

其实非常简单

大家只要搜索vCard

就能找到这个标准格式

不过标准都有点麻烦

阅读全文 »

SQL注入

1
2
3
4
5
select password from users where id = "xiaoming"

select password from users where id = "" or 1=1#"

information_schema
schemata tables columns
数据库名 schema_name
表名 table_schema table_name
字段名 table_schema table_name column_name

nianji

liuyi

name

1
select name from nianji.liuyi;

联合注入

1
select id,username,password from users union select 1,2,3;
1 xiaoming xiaoming
1 2 3
阅读全文 »