【 Grey Hack 】万金油脚本:从路由器获取Password

目录

  • 脚本源码
  • 用法
  • 效果及示例

版本:Grey Hack v0.7.3618 - Alpha


脚本源码

if params.len != 2 or params[0] == "-h" or params[0] == "--help" then exit("<b>Usage: "+program_path.split("/")[-1]+" [ip_address] [LAN_address]</b>")
metaxploit = include_lib("/lib/metaxploit.so")
if not metaxploit thenmetaxploit = include_lib(current_path + "/metaxploit.so")
end if
if not metaxploit then exit("Error: Can't find metaxploit library in the /lib path or the current folder")cryptools = include_lib("/lib/crypto.so")
if not cryptools thencryptools = include_lib(current_path + "/crypto.so")
end if
if not cryptools then exit("Error: Can't find crypto.so library in the /lib path or the current folder")Flag_Bank_Mail = 0
Flag_User_Key = 0
Flag_User_Ask_Key = 0
Bank_Key = 0
Mail_Key = 0
User_Key = 0GetPassword = function(userPass)if userPass.len != 2 then returnpassword = cryptools.decipher(userPass[1])return password
end functionAccessPasswdFile = function(result)print("Accesing to password file...")files = result.get_filesfor file in filesif file.name == "passwd" thenif not file.has_permission("r") then Flag_User_Key = 0return end if listUsers = file.get_content.split("\n")for line in listUsersuserPass = line.split(":")password = GetPassword(userPass)if not password then print("Nothing found...")elseprint("=> Deciphering user <b>" + userPass[0] + "</b> : <b>" + password + "</b>")end ifend forglobals.Flag_User_Key = 1if globals.Flag_Bank_Mail == 1 and globals.Flag_User_Key == 1 then exit("Done...")end ifend forprint("Error: /etc/passwd file not found. Program aborted");
end functionbankFound = false
mailFound = falseAccessHomeFile = function(homeFolder)print("Accesing to Mail.txt files...\nSearching users...")folders = homeFolder.get_foldersfor user in foldersprint("User: " + user.name +" found...")subFolders = user.get_foldersfor subFolder in subFoldersif subFolder.name == "Config" thenfiles = subFolder.get_filesfor file in filesif file.name == "Bank.txt" thenglobals.Flag_Bank_Mail = 1if not file.has_permission("r") then print("failed. Can't access to file contents. Permission denied")if typeof(globals.Bank_Key) != "string" then globals.Bank_Key = user_input("Read Bank Password? [Y/N]\n")if globals.Bank_Key == "Y" or globals.Bank_Key == "y" or globals.Bank_Key == "Yes" or globals.Bank_Key == "yes" thenlistUsers = file.get_content.split("\n")for line in listUsersuserPass = line.split(":")password = GetPassword(userPass)if not password then print("Nothing found...")elseprint("=> Deciphering user <b>" + userPass[0] + "</b> : <b>" + password + "</b>")end ifend forend ifglobals.bankFound = trueelse if file.name == "Mail.txt" thenglobals.Flag_Bank_Mail = 1if not file.has_permission("r") then print("failed. Can't access to file contents. Permission denied")if typeof(globals.Mail_Key) != "string" then globals.Mail_Key = user_input("Read Mail Password? [Y/N]\n")if globals.Mail_Key == "Y" or globals.Mail_Key == "y" or globals.Mail_Key == "Yes" or globals.Mail_Key == "yes" thenlistUsers = file.get_content.split("\n")for line in listUsersuserPass = line.split(":")password = GetPassword(userPass)if not password then print("Nothing found...")elseprint("=> Deciphering user <b>" + userPass[0] + "</b> : <b>" + password + "</b>")end ifend forend ifglobals.mailFound = trueend ifend forend ifend forend forif not globals.mailFound then print("Mail file not found.")if not globals.bankFound then print("Bank file not found.")if folders.len == 0 then print("No users found. Program aborted")
end functionaddress = params[0]
net_session = metaxploit.net_use( address )
if not net_session then exit("Error: can't connect to net session")
libKernel = net_session.dump_libprint("Founded " + libKernel.lib_name + " "+ libKernel.version)if not libKernel then exit("Error: TargetLib not found.")lanIp = params[1]exploits = metaxploit.scan(libKernel)
for exploit in exploitsprint(exploit)result_lists = metaxploit.scan_address(libKernel, exploit).split("Unsafe check: ")[1:]for result_list in result_liststarget_str = result_list.split(".")[0]target_key = target_str.split(" ")[-1]result = libKernel.overflow(exploit, target_key[3:-4], lanIp)if(typeof(result) == "computer") thenif Flag_Bank_Mail == 0 thenhomeFolder = result.File("/home")if not homeFolder then print("Error: /home folder not found")elseuserFolders = homeFolder.get_foldersfounded_bank = falsefounded_mail = falseBank_Key = user_input("Read Banks Password? [Y/N]\n")if Bank_Key == "Y" or Bank_Key == "y" or Bank_Key == "Yes" or Bank_Key == "yes" thenfor userFolder in userFoldersbankFile = result.File("/home/" + userFolder.name + "/Config/Bank.txt")if not bankFile then continueif not bankFile.has_permission("r") then print("Error: can't read file contents. Permission deniend")breakend ifuserPass = bankFile.get_content.split(":")print("Deciphering bank password for user: " + userFolder.name)password = GetPassword(userPass)if not password then print("Nothing found...")elseprint("Bank account: <b>" + userPass[0] +"</b>\nBank Password: <b>" + password + "</b>")founded_bank = trueend ifend forelsefounded_bank = trueend ifMail_Key = user_input("Read Mails Password? [Y/N]\n")if Mail_Key == "Y" or Mail_Key == "y" or Mail_Key == "Yes" or Mail_Key == "yes" thenfor userFolder in userFoldersmailFile = result.File("/home/" + userFolder.name + "/Config/Mail.txt")if not mailFile then continueif not mailFile.has_permission("r") then print("Error: can't read file contents. Permission deniend")breakend ifuserPass = mailFile.get_content.split(":")print("Deciphering mail password for user: " + userFolder.name)password = GetPassword(userPass)if not password then print("Nothing found...")elseprint("Mail account: <b>" + userPass[0] +"</b>\nMail Password: <b>" + password + "</b>")founded_mail = trueend ifend forelsefounded_mail = trueend ifif founded_bank and founded_mail then Flag_Bank_Mail = 1end ifend ifif Flag_User_Key == 0 then if Flag_User_Ask_Key == 0 thenUser_Key = user_input("Read User Password? [Y/N]\n")Flag_User_Ask_Key = 1	end if 	if User_Key == "Y" or User_Key == "y" or User_Key == "Yes" or User_Key == "yes" thenfile = result.File("/etc/passwd")if not file then exit("Error: file /etc/passwd not found")if not file.has_permission("r") then continue if file.is_binary then exit("Error: invalid /etc/passwd file found.")Flag_User_Key = 1listUsers = file.get_content.split("\n")for line in listUsersuserPass = line.split(":")password = GetPassword(userPass)if not password then print("Nothing found...")elseprint("=> Deciphering user <b>" + userPass[0] + "</b> : <b>" + password + "</b>")end ifend forelseFlag_User_Key = 1end ifend ifif Flag_Bank_Mail == 1 and Flag_User_Key == 1 then exit("Done...")end ifend ifend for
end for	for exploit in exploitsprint(exploit)result_lists = metaxploit.scan_address(libKernel, exploit).split("Unsafe check: ")[1:]if Flag_User_Key == 0 then for result_list in result_liststarget_str = result_list.split(".")[0]target_key = target_str.split(" ")[-1]result = libKernel.overflow(exploit, target_key[3:-4], lanIp)if (typeof(result) == "file") thenprint("Obtained access to " + result.path)if Flag_Bank_Mail != 1 then if typeof(Bank_Key) != "string" and typeof(Mail_Key) != "string" then if result.path == "/home" thenAccessHomeFile(result)elseprint("Searching home folder...")while not result.path == "/"result = result.parentend whilefolders = result.get_foldersfor folder in foldersif folder.path == "/home" thenAccessHomeFile(folder)end ifend forend ifend ifend if	if typeof(User_Key) != "string" then User_Key = user_input("Read User Password? [Y/N]\n")if User_Key == "Y" or User_Key == "y" or User_Key == "Yes" or User_Key == "yes" thenif Flag_User_Key != 1 then if result.path == "/etc" thenAccessPasswdFile(result)else print("Attempting to reach /etc folder...")while result.path != "/"result = result.parentend whilefolders = result.get_foldersfor folder in foldersif folder.path == "/etc" thenAccessPasswdFile(folder)end ifend forend if  end if end ifend ifend for end if
end forexit("Fail...")

用法

【脚本名】 【公网IP】 【局域网IP】

效果及示例

先检测目标端口库版本
再尝试遍历攻破漏洞以获取password
视情况不同,可能得到游客、用户或root权限
一般情况下,游客身份可获取用户的Bank Password及Mail Password及登录名
用户及root身份可获得root的Password及各用户的Password及登录名

如图,本案例中目标IP尚未开放常见端口
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/400712.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

Java的注解机制——Spring自动装配的实现原理

JDK1.5加入了对注解机制的支持&#xff0c;实际上我学习Java的时候就已经使用JDK1.6了&#xff0c;而且除了Override和SuppressWarnings(后者还是IDE给生成的……)之外没接触过其他的。 进入公司前的面试&#xff0c;技术人员就问了我关于注解的问题&#xff0c;我就说可以生成…

【一知半解】AQS

&#x1f680; 优质资源分享 &#x1f680; 学习路线指引&#xff08;点击解锁&#xff09;知识定位人群定位&#x1f9e1; Python实战微信订餐小程序 &#x1f9e1;进阶级本课程是python flask微信小程序的完美结合&#xff0c;从项目搭建到腾讯云部署上线&#xff0c;打造一…

CentOS下Samba文件服务器的安装与配置

前言&#xff1a;文件服务器提供的服务在大多数公司或企业都会被用到&#xff0c;因为在任何的公司或企业都涉及不同职位获取不同资源文件的情况&#xff0c;这就需要根据不同职位配置相关的不同权限&#xff0c;以保证相关资源文件的安全性和保密性。一、Samba介绍&#xff1a…

Java基础软件的安装及配置及Javascript的运行

1.Jdk的安装及环境变量配置&#xff1a; &#xff08;1&#xff09;计算机-属性-高级系统设置。 &#xff08;2&#xff09;环境变量-系统变量-输入变量名JAVA_HOME-输入变量值C:\Program Files (x86)\Java\jdk1.7.0_79&#xff08;jdk安装路径&#xff09; &#xff08;3&…

【 Grey Hack 】万金油脚本:在路由器上获取shell

目录脚本源码用法效果及示例版本&#xff1a;Grey Hack v0.7.3618 - Alpha 脚本源码 if params.len ! 2 or params[0] "-h" or params[0] "--help" then exit("<b>Usage: "program_path.split("/")[-1]" [ip_address] […

面试问题整理笔记系列 一 Java容器类

虚线框表示接口&#xff1b;实线框表示实体类&#xff1b;粗线框表示最常用的实体类&#xff1b;虚线箭头表示实现了这个接口&#xff1b;实现箭头表示类可以制造箭头所指的那个类的对象。 Collection&#xff1a;只允许在每一个位置上放一个对象。它包括“以一定顺序持有一组对…

【 Grey Hack 】反向Shell

目录调查准备反向shell反向shell提权版本&#xff1a;Grey Hack v0.7.3618 - Alpha 如图&#xff0c;本案例中目标IP尚未开放常见端口 调查 通过路由器获得目标PC的用户邮箱账号和相应的Password 所用脚本介绍&#xff1a; routerpsw 准备反向shell 在本机获得root后配置r…

阈值PSI代码

&#x1f680; 优质资源分享 &#x1f680; 学习路线指引&#xff08;点击解锁&#xff09;知识定位人群定位&#x1f9e1; Python实战微信订餐小程序 &#x1f9e1;进阶级本课程是python flask微信小程序的完美结合&#xff0c;从项目搭建到腾讯云部署上线&#xff0c;打造一…

【 Grey Hack 】万金油脚本:原地提权工具

目录脚本源码用法效果及示例版本&#xff1a;Grey Hack v0.7.3618 - Alpha 脚本源码 metaxploit include_lib("/lib/metaxploit.so") if not metaxploit thenmetaxploit include_lib(current_path "/metaxploit.so") end if if not metaxploit then ex…

android之PackageManager简单介绍

PackageManager相关 本类API是对全部基于载入信息的数据结构的封装&#xff0c;包含下面功能&#xff1a; 安装&#xff0c;卸载应用查询permission相关信息 查询Application相关信息(application&#xff0c;activity&#xff0c;receiver&#xff0c;service&#xff0c;prov…

【 Grey Hack 】万金油脚本:常见端口修改Password

目录脚本源码用法效果及示例版本&#xff1a;Grey Hack v0.7.3618 - Alpha 适用于SSH (22) 端口、FTP (21) 端口、HTTP (80) 端口、SMTP (25) 端口及3306/3307 端口等。 脚本源码 if params.len ! 2 or params[0] "-h" or params[0] "--help" then exi…

JavaScript中的原型和对象机制

1 对象相关的一些语言特性1.1 一切皆为对象JavaScript里所有的东西都是对象. 对象是属性的集合. 数字, 字符串, 布尔值等原始值是"伪对象", 它们同样拥有属性, 但是是在栈上分配并按值传递. 而其他的对象是堆上分配并按引用传递.一个很重要的概念是, 函数也是对象, 能…

【 Grey Hack 】记一次被黑经历

目录又被搞了版本&#xff1a;Grey Hack v0.7.3618 - Alpha 胆大包天的我黑进游戏内shop的IP后&#xff0c;顺着其上面的日志溯源到不少疑似其他玩家租的服务器&#xff0c;暂时没什么进展 不久后回到桌面才发现自己已经被黑入了 随后我打开日志查看记录 只看清是从我的1222…

【 Grey Hack 】加强版nmap

目录probe使用方法效果routerpcscan使用方法效果版本&#xff1a;Grey Hack v0.7.3618 - Alpha probe if params.len ! 1 or params[0] "-h" or params[0] "--help" then exit(command_info("<b>probe [IP]</b>")) if not is_va…

文档容器iOS网络编程-iCloud文档存储编程实例

在本文中,我们主要绍介文档容器的容内,自我感觉有个不错的建议和大家分享下 iCloud文档存储程编对相键值据数存储而言比较复杂&#xff0c;涉及到自定义文档类、取得iCloud文档录目、找查Ubiquity容器中的文档、保存文档和决解文档冲突等容内。 实例&#xff1a;iCloud文档存储…

CSS3之伪元素选择器和伪类选择器

伪类选择器&#xff0c;和一般的DOM中的元素样式不一样&#xff0c;它并不改变任何DOM内容。只是插入了一些修饰类的元素&#xff0c;这些元素对于用户来说是可见的&#xff0c;但是对于DOM来说不可见。伪类的效果可以通过添加一个实际的类来达到。 a:link|a:visited|a:hover|a…

CSS只是进化的一部分

Bert Bos是一位计算机科学家&#xff0c;他也是CSS的创始人之一。在CSS的发展过程中&#xff0c;Bos是最早与Hkon Wium Lie&#xff08;CSS之父&#xff09;合作的人之一。在1996年&#xff0c;他加入了World Wide Web Consortium&#xff08;W3C&#xff09;负责CSS的开发。他…

【 Grey Hack 】WIFI万能钥匙

目录脚本源码使用方法效果版本&#xff1a;Grey Hack v0.7.3618 - Alpha 脚本源码 computer get_shell.host_computer status "Unknown Error." crypto include_lib("/lib/crypto.so") if not crypto thencrypto include_lib(current_path "/cr…

面向对象编程学习5月7日-5月23日 网络直播yii-外企使用最多的PHP框架

每日一贴,今天的内容关键字为面向对象编程学习 课程说明: -------------------------------------------------------------------------------------------------------------- 9天玩转大型php框架Yii&#xff08;即将开始&#xff09;&#xff08;如何加入费免公然讲堂&#…

PHP 四种基本排序算法的代码实现(2)

2019独角兽企业重金招聘Python工程师标准>>> 许多人都说算法是程序的核心&#xff0c;算法的好坏决定了程序的质量。作为一个初级phper&#xff0c;虽然很少接触到算法方面的东西。但是对于基本的排序算法还是应该掌握的&#xff0c;它是程序开发的必备工具。这里介…