# BPy-RemCmd v1.0 # BytE-FucK Python Remote Command v1.0 # Created by BytE-FucK - NO SPAM # For Bug or Suggestions please contact me : c.ronaldo10@hotmail.it # Per bug o suggerimenti,contattami : c.ronaldo10@hotmail.it # no spam #**************************************************************************# # BytE-FucK Python Remote Command v1.0 # # Copyright (C) 2008 BytE-FucK # # # # This program is free software: you can redistribute it and/or modify # # it under the terms of the GNU General Public License as published by # # the Free Software Foundation, either version 3 of the License, or # # (at your option) any later version. # # # # This program is distributed in the hope that it will be useful, # # but WITHOUT ANY WARRANTY; without even the implied warranty of # # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # # GNU General Public License for more details. # # # # You should have received a copy of the GNU General Public License # # along with this program. If not, see . # #**************************************************************************# # Code start here ( Sorry for eventual bad comment ,i am italian :D ) from socket import * # Import the library of socket for comunication client/server import os # Import the library of os for the command shell from Tkinter import * # Import the library of Tkinter for the gui def InitServer(): # Function for start socket for server s.bind(('127.0.0.1',7778)) # Bind the socket for a after listening mode s.listen(1) # Set the socket in listening mode with accept max 1 connnection from client print "Server in attesa di un client ..." while 1: nfo = s.accept() # Accept an eventual requested connection from a client dati = s.recv(1024) # GGet the data from a client,with a buffer of max 1024 KB if dati: print "Comando ricevuto : \n",dati os.popen(dati) def InitClient(): # Function for start gui & socket for client global tk,f,send,cmdt tk = Tk() tk.title("BytE-FucK RemCmd v1.0") # Make thhe control f = Frame(tk,bg="black",height=70,width=250) send = Button(f,bg="black",fg="blue",text="Invia comando",height=1,width=50,command=send) cmdt = Text(f,bg="black",fg="blue",height=1,width=50) # End Make # Pack the control & run Tk f.pack() cmdt.pack() send.pack() tk.mainloop() # End Pack() s.connect((addr,7778)) # Connect the socket def send(): cmd = cmdt.get(1.0,END) s.send(cmd) print "Mandando comando : ",cmd cmdt.insert(END,"") # *** HERE THE PROGRAM START :) *** global addr s = socket(AF_INET,SOCK_STREAM) # Make the socket,of type AF_INET SOCKET_STREAM tipo = raw_input("Benvenuto in BytE-FucK Python Remote Command v1.0\nImmetti C per avviare il client oppure S per avviare il server\nC = Client\nS = Server\n->") if tipo == "C": # If the user want run the client addr = raw_input("Immetti l'ip del server remoto\n") print "Inizializzando GUI Client..." InitClient() # Call the function for run client elif tipo == "S": print "Inizializzando Server..." InitServer() # Call the function for run server