2022-5-21 myluzh
NOTE
netsh advfirewall firewall add rule name="VNC Server" dir=in program="C:\Program Files\RealVNC\VNC Server\vncserver.exe" security=authenticate action=allow
阅读全文>>
标签: vncserver.vnc
评论(0)
(463)
2022-5-18 myluzh
Windows
0x01 常用命令
查看当前防火墙状态:netsh advfirewall show allprofiles
关闭防火墙:netsh advfirewall set allprofiles state off
开启防火墙:netsh advfirewall set allprofiles state on
恢复初始防火墙设置:netsh advfirewall reset
设置默认输入和输出策略:netsh advfirewall set allprofiles firewallpolicy allowinbound,allowoutbound
以上是设置为允许,如果设置为拒绝使用blockinbound,blockoutbound
0x02 常用参数解释
dir=in|out
必备参数,指定进站方向还是出站方向
action=allow|block|bypass
必备参数,设定这个规则是允许还是阻断或者是跳过
program=]
可选参数,为某应用程序设定规则
[service=|any]
可选参数,为某系统服务设定规则
[description=]
可选参数,为这个规则加一个说明描述...
阅读全文>>
标签: 防火墙 windows cmd
评论(0)
(526)
2022-5-13 myluzh
Python
import re
subject = '080045000106309140003F2F7D100A01'
if (len(subject) % 2) == 0:
result = re.sub(r"(?<=\w)(?=(?:\w\w)+$)", "-", subject)
elif (len(subject) % 2) != 0:
a_subject = subject[:-1]
b_subject = subject[-1]
result = re.sub(r"(?<=\w)(?=(?:\w\w)+$)", "-", a_subject) + "-" + b_subject
print(result)
输出内容 08-00-45-00-01-06-30-91-40-00-3F-2F-7D-10-0A-01
阅读全文>>
标签: python
评论(0)
(517)
2022-4-24 myluzh
Python
def get_mac():
macList = list(net_if_addrs().items())
macI = 0
macAll = ""
while True:
try:
macName = macList[macI][0]
macAdders = macList[macI][1][0][1]
# macInfo = str(macName + " " + macAdders + " ")
if validate_mac(macAdders):
macAdders=macAdders.replace('-', ':')
print(macName, macAdders)
# macAll = macAll + macInfo
macI = macI + 1
except:
break
...
阅读全文>>
标签: python
评论(0)
(506)
2022-4-19 myluzh
MySQL
1、进入数据库
mysql -u root -p ‘原来的密码’ //进入数据库中
2、切换数据库
use mysql;
3、使用以下命令开启root用户远程访问权限:
CREATE USER 'root'@'%' IDENTIFIED BY '你的密码';
GRANT ALL ON *.* TO 'root'@'%';
ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY '你的密码';
4、刷新权限
FLUSH PRIVILEGES;
阅读全文>>
标签: mysql8 远程访问
评论(0)
(549)
2022-4-14 myluzh
VMware
VMware Workstation 7.0以上版本中有自带一个OVFTool.exe的工具
在VM安装路径下的\VMware\VMware OVF Tool\ovftool.exe
cmd运行以下命令即可转换成ovf
C:\Program Files\VMware\VMware OVF Tool\ovftool.exe "原文件路径\xxx.vmx" "目标路径\xxx.ovf"
阅读全文>>
标签: vmx转ovf
评论(0)
(973)