-
Notifications
You must be signed in to change notification settings - Fork 0
/
rvc-rft
34 lines (32 loc) · 1.12 KB
/
rvc-rft
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/usr/bin/python3
#
# Rvc File transfer - Reverse Methodology - sender as client and reciever as server
# created by rvcgeeks <github.com/rvcgeeks> @ 12 Dec 2019 , 10:45 pm @Pune, India
#
# 1) first start rvc-rft in reciever mode
# ./rvc-rft recv (reciever hostname) (port no.) (path/to/save/file/as)
# 2) then transmit the remote file
# ./rvc-rft send (reciever hostname) (port no.) (path/to/file)
# 3) have patience and DONE!! cuz no progress bars, etc
# add if u want... but costly over remote shells
import os, sys, socket
if sys.argv[1] == 'send':
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect((socket.gethostbyname(sys.argv[2]), int(sys.argv[3])))
f = os.open(sys.argv[4], os.O_RDONLY)
while True:
x = os.read(f, 1024)
if len(x) == 0:
break
s.send(x)
elif sys.argv[1] == 'recv':
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.bind((socket.gethostbyname(sys.argv[2]), int(sys.argv[3])))
s.listen(128)
c, a = s.accept()
f = os.open(sys.argv[4], os.O_WRONLY | os.O_CREAT)
while True:
x = c.recv(f, 1024)
if len(x) == 0:
break
os.write(f, x)