安全牛学习笔记端口扫描
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了安全牛学习笔记端口扫描相关的知识,希望对你有一定的参考价值。
端口扫描(二)
╋━━━━━━━━━━━━━━━━━╋
┃端口扫描 ┃
┃隐蔽扫描-----syn ┃
┃ 不建立完整链接 ┃
┃ 应用日志不记录扫描行为-----隐蔽 ┃
┃僵尸扫描 ┃
┃ 极度隐蔽 ┃
┃ 实施条件苛刻 ┃
┃ 可伪造源地址 ┃
┃ 选择僵尸机 ┃
┃ 闲置系统 ┃
┃ 系统使用递增的IPID ┃
┃ 0 ┃
┃ 随机 ┃
╋━━━━━━━━━━━━━━━━━╋
╋━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╋
┃僵尸扫描 ┃
┃Scapy-----zombie.py ┃
┃ i=IP() ┃
┃ t=TCP() ┃
┃ rz=(i/t) ┃
┃ rt=(i/t) ┃
┃ rz[IP].dst=IPz ┃
┃ rz[TCP].dport=445 ┃
┃ rt[IP].src=IPz ┃
┃ rt[IP].dst=IPt ┃
┃ rt[TCP].dport=22 ┃
┃ az1=sr1(rz) / at=sr1(rt) / az2=sr1(rz) ┃
┃ az1.display() / az2.display() ┃
╋━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╋
[email protected]:~# scapy
WARNING: No route found for IPv6 destination :: (no default route?)
Welcome to Scapy (2.2.0)
>>> i=IP()
>>> t=TCP()
>>> rz=(i/t)
>>> rt=(i/t)
>>> rz[IP].dst="192.168.1.133"
>>> rz[TCP].dport=445
>>> rt[IP].flags="SA"
>>> rt[IP].src="192.168.1.133"
>>> rt[IP].dst="192.168.1.134"
>>> rt[TCP].dport=25
>>> rt[TCP].flags="S
>>> az1=sr1(rz)
begin emission:
.Finished to send 1 packets.
*
Received 2 packets, got 1 answers, remaining 0 packets
>>> at=sr1(rt,timeout=1)
begin emission:
.Finished to send 1 packets.
*
Received 2 packets, got 0 answers, remaining 1 packets
>>> az2=sr1(rz)
.Finished to send 1 packets.
*
Received 1 packets, got 1 answers, remaining 0 packets
>>> az1
<IP version=4L ihl=5L tos=0x0 len=40 id=726 flags= frag=0L ttl=128 proto=tcp chksum=0xb39a src=192.168.1.133 ds192.168.1.133 options=[] |<TCP sport=microsoft_ds dport=ftp_data seq=0 ack=0 datapfs=sL reserved=0L flags=p
>>> az1
<IP version=4L ihl=5L tos=0x0 len=40 id=728 flags= frag=0L ttl=128 proot=tcp chksum=0xb39a src=192.168.1.133 ds192.168.1.133 options=[] |<TCP sport=microsoft_ds dport=ftp_data seq=0 ack=0
>>> rt[TCP].dport=33445
>>> az1=sr1(rz)
>>> at=sr1(rt,timeout=1)
>>> az2=sr1(rz)
>>> az1
<IP version=4L ihl=5L tos=0x0 len=40 id=729 flags= frag=0L ttl=128 proto=tcp chksum=0xb39a src=192.168.1.133 ds192.168.1.133 options=[] |<TCP sport=microsoft_ds dport=ftp_data seq=0 ack=0
>>> az1
<IP version=4L ihl=5L tos=0x0 len=40 id=730 flags= frag=0L ttl=128 proto=tcp chksum=0xb39a src=192.168.1.133 ds192.168.1.133 options=[] |<TCP sport=microsoft_ds dport=ftp_data seq=0 ack=0
╭────────────────────────────────────────────╮
[zombie.py]
#!/usr/bin/python
import loggging
logging.getLogger("scapy.runtime").setLevel(logging.ERROR)
from scapy.all import *
bef ipid(zombie):
reply1 = sr1(IP(dst = zombie)/TCP(flags = "SA"),timeout = 2,verbose = 0)
send(IP(dst = zombie)/TCP(flags = "SA"),verbose = 0)
reply2 = sr1(IP(dst = zombie)/TC{(flags = "SA"),timeout = 2,verbose = 0)
if reply2[IP].id == (reply1{IP].id+2);
print"IPID sequence is incremental and target appers to be idle. ZOMBIE LOCATED"
response=raw_input("DO you want to use this zombie to perform a scan? (Y or N): ")
if response == "Y";
target=raw_input("Enter the IP address pf the target system: ")
zombiescan(target,zombie)
else:
print"Either the IPID sequence is not incremental or the target is not idle. NOT A GOOD ZOMBIE"
def zombiescan(target,zombie):
print"\nScanning target "+target+" with zombie" +zombie
print"\n----------Open ports on Target----------\n"
for port in range[1,100]:
try:
start_val = sr1(IP(dst = zombie)/TCP(flags = "SA",dport = port),timeout = 2,verbose = 0)
send(IP(src = zombie,dst = tatget)/TCP(flags = "S",dport = port),verbose = 0)
end_val = sr1(IP(dst = zombie)/TCP(flags = "SA"),timeout = 2,verbose = 0)
if end_val[IP].id == (start_val[IP].id+2);
print port
except:
pass
print"------------Zombie Scan suite------------\n"
print"1 - Identify Zombie Host\n"
print"2 - Proform Zombie Scan\n"
ans = raw_input("Select an Option (1 or 2): ")
if ans =="1"
zombie=raw_input("Enter IP addrss to test IPID sequence: ")
ipid(zombie)
else:
if ans =="2"
aombie = raw_input("Enter IP address for zombie systme: ")
target = raw_input("Enter IP address of scan target: ")
zombiescan(target.zombie)
╰────────────────────────────────────────────╯
------------Zombie Scan suite------------
1 - Identify Zombie Host
2 - Proform Zombie Scan
Selecy an Option ( 1 or 2):
Enter IP address to test IPID sequence: 192.168.1.133
IPID sequence is incremental and target appears to be idle. ZOMBIE LOCATED
Do you want to use this zombie to perform a scan? (Y or N): Y
Enter the IP address of the target system: 192.168.1.134
Scanning target 192.168.1.1347 with zombie 192.168.1.133
---------Open ports on Target----------
21
22
23
25
80
111
139
445
512
513
514
╋━━━━━━━━━━━━━━━━━━━━━━━━━━╋
┃僵尸扫描 ┃
┃发现僵尸机 ┃
┃ nmap -p445 192.168.1.133 --script=ipidseq.nse ┃
┃扫描目标 ┃
┃ nmap 172.16.36.135 -sI 172.16.36.135 -Pb -p 0-100 ┃
╋━━━━━━━━━━━━━━━━━━━━━━━━━━╋
[email protected]:~# nmap -p445 192.168.1.133 --script=ipidseq.nse
Starting Nmap 6.49BETA5 ( https://nmap.org ) at 2015-10-03 16:27 CST
Nmap scan report for 192.168.1.133
Host is up (0.00060s latency).
PORT STATE SERVICE
445/tcp filtered microsoft-ds
MAC Address: 80:00:27:FB:0B:AA(Cadmus Computer Systems)
Host script results:
|_ipidseq: Incrementtal!
Nmap done: 1 IP address (1 host up) scanned in 5.85 seconds
[email protected]:~# nmap -p445 192.168.1.133 --script=ipidseq.nse
Starting Nmap 6.49BETA5 ( https://nmap.org ) at 2015-10-03 16:27 CST
Nmap scan report for 192.168.1.133
Host is up (0.00060s latency).
PORT STATE SERVICE
445/tcp filtered microsoft-ds
MAC Address: 80:00:27:B0:3A:76(Cadmus Computer Systems)
Host script results:
|_ipidseq: Incrementtal!
Nmap done: 1 IP address (1 host up) scanned in 5.85 seconds
[email protected]:~# nmap -p80 192.168.1.1 --script=ipidseq.nse
Starting Nmap 6.49BETA5 ( https://nmap.org ) at 2015-10-03 16:31 CST
Nmap scan report for 192.168.1.1
Host is up (0.00082s latency).
PORT STATE SERVICE
80/tcp open http
Host script results:
|_ipidseq: Incremental!
Nmap done: 1 IP address (1 host up) scanned in 0.37 seconds
[email protected]:~# nmap 192.168.1.134 -sI 192.168.1.132 -Pn -p 0-100
Starting Nmap 6.49BETA5 ( https://nmap.org ) at 2015-10-03 16:34 CST
Idle scan using zombie 192.168.1.132 (192.168.1.132:80); Class: Incremental
Host is up (0.00044s latency).
Not shown: 94 closed ports
PORT STATE SERVICE
21/tcp open ftp
22/tcp open ssh
23/tcp open telnet
25/tcp open smtb
53/tcp open domain
80/tcp open http
MAC Address: 80:00:27:B0:3A:76(Cadmus Computer Systems)
Nmap done: 1 IP address(1 host up) scanned in 10.80 seconds
该笔记为安全牛课堂学员笔记,想看此课程或者信息安全类干货可以移步到安全牛课堂
Security+认证为什么是互联网+时代最火爆的认证?
牛妹先给大家介绍一下Security+
Security+ 认证是一种中立第三方认证,其发证机构为美国计算机行业协会CompTIA ;是和CISSP、ITIL 等共同包含在内的国际 IT 业 10 大热门认证之一,和CISSP偏重信息安全管理相比,Security+ 认证更偏重信息安全技术和操作。
通过该认证证明了您具备网络安全,合规性和操作安全,威胁和漏洞,应用程序、数据和主机安全,访问控制和身份管理以及加密技术等方面的能力。因其考试难度不易,含金量较高,目前已被全球企业和安全专业人士所普遍采纳。
Security+认证如此火爆的原因?
原因一:在所有信息安全认证当中,偏重信息安全技术的认证是空白的, Security+认证正好可以弥补信息安全技术领域的空白 。
目前行业内受认可的信息安全认证主要有CISP和CISSP,但是无论CISP还是CISSP都是偏重信息安全管理的,技术知识讲的宽泛且浅显,考试都是一带而过。而且CISSP要求持证人员的信息安全工作经验都要5年以上,CISP也要求大专学历4年以上工作经验,这些要求无疑把有能力且上进的年轻人的持证之路堵住。在现实社会中,无论是找工作还是升职加薪,或是投标时候报人员,认证都是必不可少的,这给年轻人带来了很多不公平。而Security+的出现可以扫清这些年轻人职业发展中的障碍,由于Security+偏重信息安全技术,所以对工作经验没有特别的要求。只要你有IT相关背景,追求进步就可以学习和考试。
原因二: IT运维人员工作与翻身的利器。
在银行、证券、保险、信息通讯等行业,IT运维人员非常多,IT运维涉及的工作面也非常广。是一个集网络、系统、安全、应用架构、存储为一体的综合性技术岗。虽然没有程序猿们“生当做光棍,死亦写代码”的悲壮,但也有着“锄禾日当午,不如运维苦“的感慨。天天对着电脑和机器,时间长了难免有对于职业发展的迷茫和困惑。Security+国际认证的出现可以让有追求的IT运维人员学习网络安全知识,掌握网络安全实践。职业发展朝着网络安全的方向发展,解决国内信息安全人才的匮乏问题。另外,即使不转型,要做好运维工作,学习安全知识取得安全认证也是必不可少的。
原因三:接地气、国际范儿、考试方便、费用适中!
CompTIA作为全球ICT领域最具影响力的全球领先机构,在信息安全人才认证方面是专业、公平、公正的。Security+认证偏重操作且和一线工程师的日常工作息息相关。适合银行、证券、保险、互联网公司等IT相关人员学习。作为国际认证在全球147个国家受到广泛的认可。
在目前的信息安全大潮之下,人才是信息安全发展的关键。而目前国内的信息安全人才是非常匮乏的,相信Security+认证一定会成为最火爆的信息安全认证。
近期,安全牛课堂在做此类线上培训,感兴趣可以了解
本文出自 “11662938” 博客,请务必保留此出处http://11672938.blog.51cto.com/11662938/1965023
以上是关于安全牛学习笔记端口扫描的主要内容,如果未能解决你的问题,请参考以下文章