Linux的弱口令检测脚本
发布日期:2021-07-01 04:12:36 浏览次数:2 分类:技术文章

本文共 1404 字,大约阅读时间需要 4 分钟。

前言


由于前段时间,加强安全防护,需要扫描内网的弱口令的服务器,并对其修改密码。

于是写了一个基于nmap、hydra的弱密码空令检测脚本简略的脚本。

/script/Break/ip/ce_ip.txt中提供的是需要检测的ip,但是由于其中的一些服务器启用了tcp_wrapper,会导致hydra破解的时候,一直出现”[ERROR] could not connect to target port 22“,只好先用nmap对服务的版本进行查看,并将其排除,因此导致前期很缓慢。有其他好方法的,请不吝赐教。


#!/bin/bash> /script/Break/ip/break_ip.txt> /script/Break/log/nmap.log for t_nmap in `cat /script/Break/ip/ce_ip.txt`do  		nmap -sV $t_nmap > /script/Break/log/nmap.log	sleep 50    	echo $t_nmap	cat /script/Break/log/nmap.log |grep tcpwrap		if [ $? -eq 0 ];then		echo "$t_nmap open tcpwrap" >> /script/Break/log/tcpwrap_log.txt		echo "$t_nmap open tcpwrap"   else		echo "$t_nmap Password cracking is possible" >> /script/Break/log/tcpwrap_log.txt	    echo "$t_nmap Password cracking is possible"		echo "$t_nmap" >> /script/Break/ip/break_ip.txt	fi	    done echo "Scanning is complete and the next step is started..."  >>  /script/Break/log/tcpwrap_log.txtecho "Scanning is complete and the next step is started...">/script/Break/log/hydra_ssh.log>/script/Break/password.txtfor hyd in `cat /script/Break/ip/break_ip.txt`do  	echo "$hyd  password is being cracked"#hydra的破解速率,可根据需求进行调整    	hydra -L /script/Break/lib/userlist -P /script/Break/lib/passwdlist -vV -t 8  -e ns $hyd ssh  >> /script/Break/log/hydra_ssh.log     	cat /script/Break/log/hydra_ssh.log |grep "\[ssh\]"  >> /script/Break/password.txtdoneecho "sucessful!"


目录结构:

在这里插入图片描述

远程修改大量服务器密码脚本如下:

转载地址:https://moxiao.blog.csdn.net/article/details/89681014 如侵犯您的版权,请留言回复原文章的地址,我们会给您删除此文章,给您带来不便请您谅解!

上一篇:xtrabackup安装及问题解决
下一篇:批量检测文件是否改动的脚本

发表评论

最新留言

感谢大佬
[***.8.128.20]2024年04月14日 00时06分01秒

关于作者

    喝酒易醉,品茶养心,人生如梦,品茶悟道,何以解忧?唯有杜康!
-- 愿君每日到此一游!

推荐文章

【操作系统-Windows】Windows10 下触控板操作手势,触控操作 2019-05-02
【操作系统-Windows】Windows10 Win键相关快捷方式 2019-05-02
【操作系统-Windows】深度分析Windows 蓝屏 2019-05-02
【操作系统-Windows】浅析360带来的蓝屏问题 2019-05-02
【操作系统-Windows】杀毒软件工作原理 及 现在主要杀毒技术 2019-05-02
【操作系统-Windows】使用“任务计划程序”延时启动程序 2019-05-02
【语言-批处理】批处理延时启动程序 2019-05-02
【操作系统-Windows】Windows 开机自启 2019-05-02
【PLC】开机自动启动:因为应用程序正在发送一个输入同步呼叫,所以无法执行传出的呼叫。 2019-05-02
【操作系统-Windows】Win+R 常用程序指令 2019-05-02
【C# - Entity Framework】对一个或多个实体的验证失败。有关详细信息,请参阅“EntityValidationErrors”属性。 2019-05-02
【数据库-MySql】This function has none of ... in its declaration and binary logging is enabled 2019-05-02
【框架-MFC】MFC/C++用Char*(Byte*)读取文件utf-8的文件乱码----解码 2019-05-02
【框架-MFC】CTreeCtrl(chenlu-1):遍历CTreeCtrl ,修改无子节点的节点信息 2019-05-02
【框架-MFC】CTreeCtrl(chenlu-2):创建二叉树 2019-05-02
【框架-MFC】CTreeCtrl(chenlu-3):双击事件和选择事件 2019-05-02
【IDE-Visual Studio】编译出错(chenlu-2):传参时访问私有的构造函数 2019-05-02
【框架-MFC】MFC(chenlu-1):发送消息 2019-05-02
【IDE-Visual Studio】启动出错(chenlu-2):无法启动程序“.dll” 2019-05-02
【IDE-Visual Studio】启动出错(chenlu-3):创建空文档失败 2019-05-02