Cylul007 Webshell
Server :
Linux ip-148-66-134-25.ip.secureserver.net 3.10.0-1160.119.1.el7.tuxcare.els10.x86_64 #1 SMP Fri Oct 11 21:40:41 UTC 2024 x86_64
php :
8.0.30
on
cgi-fcgi
Time
25 Nov 2024 22:38:20
Current Directory :
/
lib64
/
python2.7
/
Demo
/
sockets
/
Upload File :
Mass Deface
Home
Bypass Passwd
Current File : //lib64/python2.7/Demo/sockets/udpecho.py
#! /usr/bin/env python # Client and server for udp (datagram) echo. # # Usage: udpecho -s [port] (to start a server) # or: udpecho -c host [port] <file (client) import sys from socket import * ECHO_PORT = 50000 + 7 BUFSIZE = 1024 def main(): if len(sys.argv) < 2: usage() if sys.argv[1] == '-s': server() elif sys.argv[1] == '-c': client() else: usage() def usage(): sys.stdout = sys.stderr print 'Usage: udpecho -s [port] (server)' print 'or: udpecho -c host [port] <file (client)' sys.exit(2) def server(): if len(sys.argv) > 2: port = eval(sys.argv[2]) else: port = ECHO_PORT s = socket(AF_INET, SOCK_DGRAM) s.bind(('', port)) print 'udp echo server ready' while 1: data, addr = s.recvfrom(BUFSIZE) print 'server received %r from %r' % (data, addr) s.sendto(data, addr) def client(): if len(sys.argv) < 3: usage() host = sys.argv[2] if len(sys.argv) > 3: port = eval(sys.argv[3]) else: port = ECHO_PORT addr = host, port s = socket(AF_INET, SOCK_DGRAM) s.bind(('', 0)) print 'udp echo client ready, reading stdin' while 1: line = sys.stdin.readline() if not line: break s.sendto(line, addr) data, fromaddr = s.recvfrom(BUFSIZE) print 'client received %r from %r' % (data, fromaddr) main()
./LuLlaby007 ♥ Tata Cantik - Copyright 2k18