分类 默认分类 下的文章

1.创建docker macvlan类型网络

docker network create -d macvlan --subnet=192.168.10.0/24 --gateway=192.168.10.1 -o parent=enp2s0 macnet
注意:macvlan类型网络在无线网卡中可能有故障

容器与宿主主机不能通信

查看docker网络
docker network ls

2.拉取openwrt镜像

docker pull openwrt:latest

3.创建并启动容器

docker run --restart always --name openwrt -d --network macnet --privileged openwrt:latest /sbin/init

4.进入容器并修改相关参数

docker exec -it openwrt bash

5.修改网络

vim /etc/config/network
config interface 'lan'

    option ifname 'eth0'
    option proto 'static'
    option netmask '255.255.255.0'
    option gateway '192.168.10.1'
    option dns '192.168.10.1'
    option ipaddr '192.168.10.254'

6.重启网络

/etc/init.d/network restart

用户名:root
密码:password

openwrt官方镜像下载

https://downloads.openwrt.org/releases/
http://mirrors.ustc.edu.cn/openwrt/releases

openwrt-x86-generic-rootfs.tar.gz是docker镜像
可以通过以下命令导入
docker import openwrt-x86-generic-rootfs.tar.gz

在线CTF平台
XCTF攻防世界
https://adworld.xctf.org.cn/

BUUCTF 北京联合大学CTF
https://buuoj.cn/

ctfhub
https://www.ctfhub.com/#/index

hacker101 CTF(英文)
https://ctf.hacker101.com/

广东省红帽杯网络安全攻防大赛 CTF - Write Up
https://imlonghao.com/48.html

2018 XJNU CTF Web Writeup
https://imlonghao.com/54.html

USTC Hackergame 2020 - Writeup
https://imlonghao.com/58.html

CTF4靶机训练
https://blog.csdn.net/weixin_44132032/article/details/99755928

漏洞利用、实战练习平台、CTF比赛资源库
http://www.dufengvip.cn/post-395.html

CTFd线上平台搭建

方法1:直接运行docker
https://github.com/CTFd/CTFd
安装docker后直接执行下面,即可安装
docker run -p 8000:8000 -it ctfd/ctfd

方法2:手工安装
http://www.manongjc.com/detail/8-ngfrwxtuqdhyuzs.html

搭建CTF-AWD训练平台(在ubuntu18.04环境中搭建成功)

https://blog.csdn.net/huanghelouzi/article/details/90204325

AWD平台搭建
http://www.manongjc.com/detail/22-stvakhmxmkspbpf.html

CTF实战题目
https://github.com/CTFTraining/CTFTraining

CTF线下AWD攻防步骤总结
https://blog.csdn.net/qq_43442524/article/details/102652029

新增规则:
netsh advfirewall firewall add rule name= "TCP80" dir=in action=allow protocol=TCP localport=80

删除规则:
netsh advfirewall firewall delete rule name= "TCP80"

https://cloud.tencent.com/developer/article/1462776

1.Powershell对app pool管理
1.1 查看:
Get-ChildItem –Path IIS:\AppPools

1.2 新建:
New-Item –Path IIS:\AppPools\MyAppPool

1.3 停止:
Stop-WebAppPool -Name MyAppPool

1.4 运行:
Start-WebAppPool -Name MyAppPool

1.5 重启:
ReStart-WebAppPool -Name MyAppPool

1.6 编辑属性:
Get-ItemProperty –Path IIS:\AppPools\MyAppPool | select *
Set-ItemProperty -Path IIS:\AppPools\MyAppPool -Name managedRuntimeVersion -Value v4.0

2.Powershell对web sites管理

2.1 查看
Get-Website

2.2 新建:

New-Website –Name MyWebApp –PhysicalPath D:\apidd
2.3 停止:

Stop-Website –Name MyWebApp
2.4 运行:

Start-Website –Name MyWebApp
2.5 重启:

Stop-Website –Name MyWebApp
Start-Website –Name MyWebApp

2.6 绑定:
Get-Website -Name MyWebApp
Get-WebBinding -Name MyWebApp
(Get-Website -Name MyWebApp).bindings.Collection
Set-WebBinding -Name 'MyWebApp' -BindingInformation "*:80:" -PropertyName Port -Value 81
New-WebBinding -Name MyWebApp -Protocol http -Port 82
//SSL bindings ??不确定
get-childItem IIS:SslBindings
$cert = Get-ChildItem cert:\localmachine\my
$bindingInfo = "IIS:\SSLBindings*!445"
$cert | Set-Item -Path $bindingInfo

2.9 移除:
Remove-WebSite -Name MyWebApp2

https://www.cnblogs.com/luokakale/p/11384838.html

<?php
require_once 'GoogleAuthenticator.php';

$ga = new PHPGangsta_GoogleAuthenticator();

//创建一个新的"安全密匙SecretKey"
//把本次的"安全密匙SecretKey" 入库,和账户关系绑定,客户端也是绑定这同一个"安全密匙SecretKey"
$secret = $ga->createSecret();
echo "安全密匙SecretKey: ".$secret."\n\n";

$qrCodeUrl = $ga->getQRCodeGoogleUrl('www.domain.cn', $secret); //第一个参数是"标识",第二个参数为"安全密匙SecretKey" 生成二维码信息
echo "Google Charts URL for the QR-Code: ".$qrCodeUrl."\n\n"; //Google Charts接口 生成的二维码图片,方便手机端扫描绑定安全密匙SecretKey

$oneCode = $ga->getCode($secret); //服务端计算"一次性验证码"
echo "服务端计算的验证码是:".$oneCode."\n\n";

//把提交的验证码和服务端上生成的验证码做对比
// $secret 服务端的 "安全密匙SecretKey"
// $oneCode 手机上看到的 "一次性验证码"
// 最后一个参数 为容差时间,这里是2 那么就是 2* 30 sec 一分钟.
// 这里改成自己的业务逻辑

$checkResult = $ga->verifyCode($secret, $code, 1);
if ($checkResult) {
echo '匹配! OK';
} else {
echo '不匹配! FAILED';
}