How to use openssh be the hacker's password "Caochuanjiejian"

Speaking last lesson hackers password dictionary files and directories dictionary is essential, and hackers around the world will use scripts or programs loaded their dictionaries to all hosts on the public network will be no difference in scanning range. Then this article will give you on how to use openssh be the hacker's password "Caochuanjiejian" .

Since it is openssh, then the system is certainly linux, then we install dependencies based on system type :

#centos

yum install gcc gcc-c++ zlib-devel openssl-devel -y

#ubuntu

apt-get install gcc zlib1g-dev libssl-dev -y

Next First openssh7.5p1 download down:

wget https://mirror.leaseweb.com/pub/OpenBSD/OpenSSH/portable/openssh-7.5p1.tar.gz

Next, modify the source code :

vim auth-passwd.c

Add the following code to find the function auth_password, the role of the system is in the default debug log (/ var / log / message) stored in the field data needed :

logit("username::password, %s::%s", authctxt->user, password);

The next confirmation code location , location profile position to ensure openssh the modified and the executable file:

Next, create a profile directory :

mkdir -p conf

接下来进行编译安装,后面的参数根据自己情况修改:

--sysconfdir #配置文件目录

--prefix #安装目录

./configure --sysconfdir=/root/openssh-7.5p1/conf --without-zlib-version-check --with-md5-passwords --prefix=/root/openssh-new && make && make install

为了避免冲突,先将原ssh端口修改为高端口(避免被黑客发现和爆破),并将新的openssh的端口改成22。注意:原ssh配置文件在/etc/ssh/sshd_config,而我这里新的openssh的配置文件在/root/openssh-7.5p1/conf。修改后各自启动对应的进程(直接运行各自的sbin目录下的sshd即可)。

注意看最右侧,此时我的10086端口是原始的sshd服务,22端口是可以记录密码的我修改过源码的sshd。

接下来大家可以等待个几天在看,就会发现在22端口爆破的黑客们的密码都被它记录下了,实现针对黑客密码的草船借箭。这边要先说一个常识性问题,如果你要抓取网络上黑客的密码,首先你肯定需要将服务暴露在公网,那就意味着你肯定要有一台公网服务器,所以大家不要在自己虚拟机测试成功后还奇怪为什么除了自己输入的,一个密码都没有

本篇文章主要讲的就是如何对黑客的密码字典进行针对性的收集,如果大家有兴趣,可以报名课程,各类黑科技骚操作等着你。

作  者:Testfan Covan

出  处:微信公众号:自动化软件测试平台

版权说明:欢迎转载,但必须注明出处,并在文章页面明显位置给出文章链接

Guess you like

Origin www.cnblogs.com/testfan2019/p/12101212.html