最近测试某产品,nmap发现该产品开放了110和25,但是没有特征字符串,很奇怪。
然后产品线说,我们测试没有这俩端口啊。
然后,我就装上终端模拟器,直接在设备上netstat也没发现开启110和25,这就奇怪了。
在我本机电脑,先telnet IP 110,然后查看netstat -ano| findstr "110",
根据PID找到进程名,tasklist | findstr "PID",
发现进程为“HipsDaemon.exe”
是火绒的进程。
奇怪了。火绒为啥本地开个110和25端口呢。
往上搜了下,原来是邮件监控功能搞的鬼,应该是防止本地中木马,
本地的邮件客户端外发垃圾邮件,所以火绒给过滤一遍的意思吧。

仅此记录一下。

道德三皇五帝,功名夏侯商周。七雄五霸闹春秋,顷刻兴亡过手。春史几行名姓,北邙无数荒丘。前人田地后人收,说甚龙争虎斗。

杨慎作有《西江月》一首,“落日西飞滚滚,大江东去滔滔。夜来今日又明朝,蓦地青春过了。千古风流人物,一时多少英豪。龙争虎斗,茫劬劳,落得一场谈笑。” 冯梦龙在这里唱和一下,遂有这首词:“道德三皇五帝,功名夏侯商周。七雄五霸闹春秋,秦汉兴亡过乎。春史几行名姓,北邙无数荒丘。前人田地后人收,说甚龙争虎斗”。文字略有出入。

#Cloudflare
set_real_ip_from 173.245.48.0/20;
set_real_ip_from 103.21.244.0/22;
set_real_ip_from 103.22.200.0/22;
set_real_ip_from 103.31.4.0/22;
set_real_ip_from 141.101.64.0/18;
set_real_ip_from 108.162.192.0/18;
set_real_ip_from 190.93.240.0/20;
set_real_ip_from 188.114.96.0/20;
set_real_ip_from 197.234.240.0/22;
set_real_ip_from 198.41.128.0/17;
set_real_ip_from 162.158.0.0/15;
set_real_ip_from 172.64.0.0/13;
set_real_ip_from 131.0.72.0/22;
set_real_ip_from 104.16.0.0/13;
set_real_ip_from 104.24.0.0/14;
set_real_ip_from 2400:cb00::/32;
set_real_ip_from 2606:4700::/32;
set_real_ip_from 2803:f800::/32;
set_real_ip_from 2405:b500::/32;
set_real_ip_from 2405:8100::/32;
set_real_ip_from 2a06:98c0::/29;
set_real_ip_from 2c0f:f248::/32;

# use any of the following two
real_ip_header CF-Connecting-IP;
#real_ip_header X-Forwarded-For;

容器端口映射,还是有点复杂的。
1,要么在一开始就设置好,
2,要么把这个容器停止,打包成新容器,用新的容器名运行的时候重新设置端口映射,

docker stop container-name
docker commit container-name new-image-name
docker run -it -d --name container-name -p p1:p1 -p p2:p2 new-image-name

3,要么就用下面这个方法。

先查看容器状况

docker ps 

把容器名字(CONTAINER NAMES)记下来。
比如说:kele

先停止现有容器

docker stop kele
service docker stop

# 停止 docker 服务
sudo systemctl stop docker.socket
sudo systemctl stop docker.service

# 启动 docker 服务
sudo systemctl daemon-reload
sudo systemctl restart docker.service

根据名字查询ID

为什么要这么做,docker ps看不到么。是的,看不全。这ID很长的。

docker inspect kele | grep Id
 "Id": "7ce41cc8d56559939391f1ddd90408fe936fb37de776ab9ddb6358f0a3c36f36",

修改配置文件

cd /var/lib/docker/containers/{Id}/
比如
cd /var/lib/docker/containers/7ce41cc8d56559939391f1ddd90408fe936fb37de776ab9ddb6358f0a3c36f36/

修改config.v2.json和hostconfig.json
照葫芦画瓢就行了,在原有的端口后面追加即可。

重新启动docker和容器

service start docker
docker start kele

来源:https://jasonkayzk.github.io/2020/01/16/%E4%BD%BF%E7%94%A8Docker%E5%AE%B9%E5%99%A8%E6%97%B6%E6%B7%BB%E5%8A%A0%E5%AF%B9%E5%A4%96%E6%98%A0%E5%B0%84%E7%AB%AF%E5%8F%A3%E7%9A%84%E6%96%B9%E6%B3%95%E6%80%BB%E7%BB%93/
https://www.huaweicloud.com/articles/2f77258d9743af7269285e1bf10ef58e.html