Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


[Linux/Python] Copy files from remote shell terminal?

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
NothingToShow
Grandmaster Cheater Supreme
Reputation: 0

Joined: 11 Jul 2007
Posts: 1579

PostPosted: Sun Mar 14, 2010 2:35 pm    Post subject: [Linux/Python] Copy files from remote shell terminal? Reply with quote

Heya.

While messing around on uselesspython.com, I found a source code which allows you to execute bash commands from a remote computer, but was wondering how I would be able to copy the files from the remote computer, to the local computer.

The codes are:

Client (On local computer)
Code:
#!/usr/bin/env python
import socket
IP = raw_input('IP: ')
PORT = input('PORT: ')
while 1:
   sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
   sock.connect((IP,PORT))
   send = raw_input('Send: ')
   sock.send(send)
   print sock.recv(2048)
   sock.close()


Server (On remote computer)

Code:
#!/usr/bin/env python
import socket
from subprocess import *
IP = '0.0.0.0'
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
sock.bind((IP, 1234))
sock.listen(5)
while True:
   channel, details = sock.accept()
   command = channel.recv(2048)
   #log = open('log.log', 'a')
   #log.write(str(details))
   #log.write('\n')
   try:
      echo = Popen(command, shell=True, stdout=PIPE).stdout.read()
      channel.send(echo)
      #log.write(echo)
   except:
      channel.send('Eh?')
   #log.close()
   channel.close()


Summarized:
I'm on my laptopt downstairs while my desktop pc is running upstairs.
I connect with my laptop using the client code, while the server code is running on the desktop.
How would I copy files from desktop pc while being on my laptop?
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites