finalshell查看连接远程linux的用户名和密码

2023-12-10 08:38

本文主要是介绍finalshell查看连接远程linux的用户名和密码,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

使用finalshell去连接linux,由于用户名和密码输入一次后,下次finalshell会替我们记住密码。接着,时间久了,密码忘了。
以mac为例,密码存放在/Users/$USER/Library/FinalShell/conn文件中,密码以密文形式保存。比如我的主机名叫"shuangyueliao.cn",查看主机对应密码,在conn目录下执行
grep -rni "shuangyueliao.cn" *
在这里插入图片描述
把密码放到下面文件中s1位置并执行,就能得到解密后的密码

pom.xml文件

		<dependency><groupId>commons-codec</groupId><artifactId>commons-codec</artifactId><version>1.15</version></dependency>

Test.java

//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by Fernflower decompiler)
//package com.shuang;import org.apache.commons.codec.digest.DigestUtils;import javax.crypto.Cipher;
import javax.crypto.SecretKey;
import javax.crypto.SecretKeyFactory;
import javax.crypto.spec.DESKeySpec;
import java.io.ByteArrayOutputStream;
import java.io.DataOutputStream;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.security.SecureRandom;
import java.util.Random;public class Test {
//    private static final String OO0O00OO00OOOOOO0000O0O000O0O0000OOOO00OO000OO0000OO000000O00O0O000OO00O0O000O00O0O00OOOOOO0OOO0 = "DES";public static long number = 3680984568597093857L;private static int num = 8;public static void main(String[] args) throws Exception {
//        String content = "sdsfew1tf45r1g3";
//        String s1 = encode(content);// 加密后的密码String s1 = "***********************";String s2 = decode(s1);System.out.println(s1);System.out.println(s2);}public static String decode(String data) throws IOException, Exception {if (data == null) {return null;} else {String rs = "";if (!fff(data)) {byte[] buf = ggg(data);byte[] head = new byte[num];System.arraycopy(buf, 0, head, 0, head.length);byte[] d = new byte[buf.length - head.length];System.arraycopy(buf, head.length, d, 0, d.length);byte[] bt = jjj(d, kkk(head));rs = new String(bt);}return rs;}}public static String encode(String content) throws Exception {byte[] head = aaa(num);byte[] d = bbb(content.getBytes("utf-8"), head);byte[] result = new byte[head.length + d.length];System.arraycopy(head, 0, result, 0, head.length);System.arraycopy(d, 0, result, head.length, d.length);String rs = ccc(result);return rs;}static byte[] aaa(int len) {byte[] data = new byte[len];for(int i = 0; i < len; ++i) {data[i] = (byte)(new Random()).nextInt(127);}return data;}public static byte[] bbb(byte[] data, byte[] head) throws Exception {SecureRandom sr = new SecureRandom();DESKeySpec dks = new DESKeySpec(kkk(head));SecretKeyFactory keyFactory = SecretKeyFactory.getInstance("DES");SecretKey securekey = keyFactory.generateSecret(dks);Cipher cipher = Cipher.getInstance("DES");cipher.init(1, securekey, sr);return cipher.doFinal(data);}public static String ccc(byte[] byteData) throws UnsupportedEncodingException {return ddd(byteData, "UTF-8");}public static String ddd(byte[] byteData, String encoding) throws UnsupportedEncodingException {if (byteData == null) {throw new IllegalArgumentException("byteData cannot be null");} else {return new String(eee(byteData), encoding);}}public static final byte[] eee(byte[] byteData) {if (byteData == null) {throw new IllegalArgumentException("byteData cannot be null");} else {byte[] byteDest = new byte[(byteData.length + 2) / 3 * 4];int iSrcIdx = 0;int iDestIdx;for(iDestIdx = 0; iSrcIdx < byteData.length - 2; iSrcIdx += 3) {byteDest[iDestIdx++] = (byte)(byteData[iSrcIdx] >>> 2 & 63);byteDest[iDestIdx++] = (byte)(byteData[iSrcIdx + 1] >>> 4 & 15 | byteData[iSrcIdx] << 4 & 63);byteDest[iDestIdx++] = (byte)(byteData[iSrcIdx + 2] >>> 6 & 3 | byteData[iSrcIdx + 1] << 2 & 63);byteDest[iDestIdx++] = (byte)(byteData[iSrcIdx + 2] & 63);}if (iSrcIdx < byteData.length) {byteDest[iDestIdx++] = (byte)(byteData[iSrcIdx] >>> 2 & 63);if (iSrcIdx < byteData.length - 1) {byteDest[iDestIdx++] = (byte)(byteData[iSrcIdx + 1] >>> 4 & 15 | byteData[iSrcIdx] << 4 & 63);byteDest[iDestIdx++] = (byte)(byteData[iSrcIdx + 1] << 2 & 63);} else {byteDest[iDestIdx++] = (byte)(byteData[iSrcIdx] << 4 & 63);}}for(iSrcIdx = 0; iSrcIdx < iDestIdx; ++iSrcIdx) {if (byteDest[iSrcIdx] < 26) {byteDest[iSrcIdx] = (byte)(byteDest[iSrcIdx] + 65);} else if (byteDest[iSrcIdx] < 52) {byteDest[iSrcIdx] = (byte)(byteDest[iSrcIdx] + 97 - 26);} else if (byteDest[iSrcIdx] < 62) {byteDest[iSrcIdx] = (byte)(byteDest[iSrcIdx] + 48 - 52);} else if (byteDest[iSrcIdx] < 63) {byteDest[iSrcIdx] = 43;} else {byteDest[iSrcIdx] = 47;}}while(iSrcIdx < byteDest.length) {byteDest[iSrcIdx] = 61;++iSrcIdx;}return byteDest;}}public static boolean fff(String str) {if (str == null) {return true;} else {String s2 = str.trim();return s2.equals("");}}public static final byte[] ggg(String encoded) throws UnsupportedEncodingException {return hhh(encoded, "UTF-8");}public static final byte[] hhh(String encoded, String encoding) throws IllegalArgumentException, UnsupportedEncodingException {if (encoded == null) {throw new IllegalArgumentException("encoded cannot be null");} else {return iii(encoded.getBytes(encoding));}}public static final byte[] iii(byte[] byteData) throws IllegalArgumentException {if (byteData == null) {throw new IllegalArgumentException("byteData cannot be null");} else {byte[] byteTemp = new byte[byteData.length];int reviSrcIdx;for(reviSrcIdx = byteData.length; reviSrcIdx - 1 > 0 && byteData[reviSrcIdx - 1] == 61; --reviSrcIdx) {}if (reviSrcIdx - 1 == 0) {return null;} else {byte[] byteDest = new byte[reviSrcIdx * 3 / 4];int iSrcIdx;for(iSrcIdx = 0; iSrcIdx < reviSrcIdx; ++iSrcIdx) {if (byteData[iSrcIdx] == 43) {byteTemp[iSrcIdx] = 62;} else if (byteData[iSrcIdx] == 47) {byteTemp[iSrcIdx] = 63;} else if (byteData[iSrcIdx] < 58) {byteTemp[iSrcIdx] = (byte)(byteData[iSrcIdx] + 52 - 48);} else if (byteData[iSrcIdx] < 91) {byteTemp[iSrcIdx] = (byte)(byteData[iSrcIdx] - 65);} else if (byteData[iSrcIdx] < 123) {byteTemp[iSrcIdx] = (byte)(byteData[iSrcIdx] + 26 - 97);}}iSrcIdx = 0;int iDestIdx;for(iDestIdx = 0; iSrcIdx < reviSrcIdx && iDestIdx < byteDest.length / 3 * 3; iSrcIdx += 4) {byteDest[iDestIdx++] = (byte)(byteTemp[iSrcIdx] << 2 & 252 | byteTemp[iSrcIdx + 1] >>> 4 & 3);byteDest[iDestIdx++] = (byte)(byteTemp[iSrcIdx + 1] << 4 & 240 | byteTemp[iSrcIdx + 2] >>> 2 & 15);byteDest[iDestIdx++] = (byte)(byteTemp[iSrcIdx + 2] << 6 & 192 | byteTemp[iSrcIdx + 3] & 63);}if (iSrcIdx < reviSrcIdx) {if (iSrcIdx < reviSrcIdx - 2) {byteDest[iDestIdx++] = (byte)(byteTemp[iSrcIdx] << 2 & 252 | byteTemp[iSrcIdx + 1] >>> 4 & 3);byteDest[iDestIdx++] = (byte)(byteTemp[iSrcIdx + 1] << 4 & 240 | byteTemp[iSrcIdx + 2] >>> 2 & 15);} else {if (iSrcIdx >= reviSrcIdx - 1) {throw new IllegalArgumentException("Warning: 1 input bytes left to process. This was not Base64 input");}byteDest[iDestIdx++] = (byte)(byteTemp[iSrcIdx] << 2 & 252 | byteTemp[iSrcIdx + 1] >>> 4 & 3);}}return byteDest;}}}public static byte[] jjj(byte[] data, byte[] key) throws Exception {SecureRandom sr = new SecureRandom();DESKeySpec dks = new DESKeySpec(key);SecretKeyFactory keyFactory = SecretKeyFactory.getInstance("DES");SecretKey securekey = keyFactory.generateSecret(dks);Cipher cipher = Cipher.getInstance("DES");cipher.init(2, securekey, sr);return cipher.doFinal(data);}static byte[] kkk(byte[] head) {long ks = number / (long)(new Random((long)head[5])).nextInt(127);Random random = new Random(ks);int t = head[0];for(int i = 0; i < t; ++i) {random.nextLong();}long n = random.nextLong();Random r2 = new Random(n);long[] ld = new long[]{(long)head[4], r2.nextLong(), (long)head[7], (long)head[3], r2.nextLong(), (long)head[1], random.nextLong(), (long)head[2]};ByteArrayOutputStream bos = new ByteArrayOutputStream();DataOutputStream dos = new DataOutputStream(bos);long[] var15 = ld;int var14 = ld.length;for(int var13 = 0; var13 < var14; ++var13) {long l = var15[var13];try {dos.writeLong(l);} catch (IOException var18) {var18.printStackTrace();}}try {dos.close();} catch (IOException var17) {var17.printStackTrace();}byte[] keyData = bos.toByteArray();keyData = DigestUtils.md5(keyData);return keyData;}
}

这篇关于finalshell查看连接远程linux的用户名和密码的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/476593

相关文章

W外链微信推广短连接怎么做?

制作微信推广链接的难点分析 一、内容创作难度 制作微信推广链接时,首先需要创作有吸引力的内容。这不仅要求内容本身有趣、有价值,还要能够激起人们的分享欲望。对于许多企业和个人来说,尤其是那些缺乏创意和写作能力的人来说,这是制作微信推广链接的一大难点。 二、精准定位难度 微信用户群体庞大,不同用户的需求和兴趣各异。因此,制作推广链接时需要精准定位目标受众,以便更有效地吸引他们点击并分享链接

linux-基础知识3

打包和压缩 zip 安装zip软件包 yum -y install zip unzip 压缩打包命令: zip -q -r -d -u 压缩包文件名 目录和文件名列表 -q:不显示命令执行过程-r:递归处理,打包各级子目录和文件-u:把文件增加/替换到压缩包中-d:从压缩包中删除指定的文件 解压:unzip 压缩包名 打包文件 把压缩包从服务器下载到本地 把压缩包上传到服务器(zip

Linux 网络编程 --- 应用层

一、自定义协议和序列化反序列化 代码: 序列化反序列化实现网络版本计算器 二、HTTP协议 1、谈两个简单的预备知识 https://www.baidu.com/ --- 域名 --- 域名解析 --- IP地址 http的端口号为80端口,https的端口号为443 url为统一资源定位符。CSDNhttps://mp.csdn.net/mp_blog/creation/editor

【Python编程】Linux创建虚拟环境并配置与notebook相连接

1.创建 使用 venv 创建虚拟环境。例如,在当前目录下创建一个名为 myenv 的虚拟环境: python3 -m venv myenv 2.激活 激活虚拟环境使其成为当前终端会话的活动环境。运行: source myenv/bin/activate 3.与notebook连接 在虚拟环境中,使用 pip 安装 Jupyter 和 ipykernel: pip instal

【测试】输入正确用户名和密码,点击登录没有响应的可能性原因

目录 一、前端问题 1. 界面交互问题 2. 输入数据校验问题 二、网络问题 1. 网络连接中断 2. 代理设置问题 三、后端问题 1. 服务器故障 2. 数据库问题 3. 权限问题: 四、其他问题 1. 缓存问题 2. 第三方服务问题 3. 配置问题 一、前端问题 1. 界面交互问题 登录按钮的点击事件未正确绑定,导致点击后无法触发登录操作。 页面可能存在

Linux_kernel驱动开发11

一、改回nfs方式挂载根文件系统         在产品将要上线之前,需要制作不同类型格式的根文件系统         在产品研发阶段,我们还是需要使用nfs的方式挂载根文件系统         优点:可以直接在上位机中修改文件系统内容,延长EMMC的寿命         【1】重启上位机nfs服务         sudo service nfs-kernel-server resta

【Linux 从基础到进阶】Ansible自动化运维工具使用

Ansible自动化运维工具使用 Ansible 是一款开源的自动化运维工具,采用无代理架构(agentless),基于 SSH 连接进行管理,具有简单易用、灵活强大、可扩展性高等特点。它广泛用于服务器管理、应用部署、配置管理等任务。本文将介绍 Ansible 的安装、基本使用方法及一些实际运维场景中的应用,旨在帮助运维人员快速上手并熟练运用 Ansible。 1. Ansible的核心概念

Linux服务器Java启动脚本

Linux服务器Java启动脚本 1、初版2、优化版本3、常用脚本仓库 本文章介绍了如何在Linux服务器上执行Java并启动jar包, 通常我们会使用nohup直接启动,但是还是需要手动停止然后再次启动, 那如何更优雅的在服务器上启动jar包呢,让我们一起探讨一下吧。 1、初版 第一个版本是常用的做法,直接使用nohup后台启动jar包, 并将日志输出到当前文件夹n

[Linux]:进程(下)

✨✨ 欢迎大家来到贝蒂大讲堂✨✨ 🎈🎈养成好习惯,先赞后看哦~🎈🎈 所属专栏:Linux学习 贝蒂的主页:Betty’s blog 1. 进程终止 1.1 进程退出的场景 进程退出只有以下三种情况: 代码运行完毕,结果正确。代码运行完毕,结果不正确。代码异常终止(进程崩溃)。 1.2 进程退出码 在编程中,我们通常认为main函数是代码的入口,但实际上它只是用户级