[BusyBox] Copy files via Telnet, or use FTP
Дмитрий Понятов
osthmail at mail.ru
Thu Jan 9 05:32:03 UTC 2003
Hello
I work from Windows computers, and use Python from www.python.org
for Windows distribution, and symple http server written in Python.
It sends any file from directory, from it was runned without any protection (you can use ../ in file name)
#!/usr/bin/env python
from socket import *
host = '192.168.0.13'
port = 1979
s=socket(AF_INET,SOCK_STREAM)
s.bind((host,port))
file='index.html'
while file != '':
s.listen(1)
conn,addr = s.accept()
file=conn.recv(1024).split('\n')[0].split(' ')[1][1:]
if file == '':
file = 'index.html'
try:
f=open(file,'rb')
except IOError:
print addr[0],'-->',file,'not found\n'
file=''
else:
print addr[0],'-->',file,'\n'
conn.send('HTTP/1.0 200 OK\n\n')
conn.send(f.read())
conn.close()
s.close()
More information about the busybox
mailing list