Server IP : 103.119.228.120 / Your IP : 13.58.40.171 Web Server : Apache System : Linux v8.techscape8.com 3.10.0-1160.119.1.el7.tuxcare.els2.x86_64 #1 SMP Mon Jul 15 12:09:18 UTC 2024 x86_64 User : nobody ( 99) PHP Version : 5.6.40 Disable Function : shell_exec,symlink,system,exec,proc_get_status,proc_nice,proc_terminate,define_syslog_variables,syslog,openlog,closelog,escapeshellcmd,passthru,ocinum cols,ini_alter,leak,listen,chgrp,apache_note,apache_setenv,debugger_on,debugger_off,ftp_exec,dl,dll,myshellexec,proc_open,socket_bind,proc_close,escapeshellarg,parse_ini_filepopen,fpassthru,exec,passthru,escapeshellarg,escapeshellcmd,proc_close,proc_open,ini_alter,popen,show_source,proc_nice,proc_terminate,proc_get_status,proc_close,pfsockopen,leak,apache_child_terminate,posix_kill,posix_mkfifo,posix_setpgid,posix_setsid,posix_setuid,dl,symlink,shell_exec,system,dl,passthru,escapeshellarg,escapeshellcmd,myshellexec,c99_buff_prepare,c99_sess_put,fpassthru,getdisfunc,fx29exec,fx29exec2,is_windows,disp_freespace,fx29sh_getupdate,fx29_buff_prepare,fx29_sess_put,fx29shexit,fx29fsearch,fx29ftpbrutecheck,fx29sh_tools,fx29sh_about,milw0rm,imagez,sh_name,myshellexec,checkproxyhost,dosyayicek,c99_buff_prepare,c99_sess_put,c99getsource,c99sh_getupdate,c99fsearch,c99shexit,view_perms,posix_getpwuid,posix_getgrgid,posix_kill,parse_perms,parsesort,view_perms_color,set_encoder_input,ls_setcheckboxall,ls_reverse_all,rsg_read,rsg_glob,selfURL,dispsecinfo,unix2DosTime,addFile,system,get_users,view_size,DirFiles,DirFilesWide,DirPrintHTMLHeaders,GetFilesTotal,GetTitles,GetTimeTotal,GetMatchesCount,GetFileMatchesCount,GetResultFiles,fs_copy_dir,fs_copy_obj,fs_move_dir,fs_move_obj,fs_rmdir,SearchText,getmicrotime MySQL : ON | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /lib64/python2.7/Demo/rpc/ |
Upload File : |
# Remote nusers client interface import rpc from rpc import Packer, Unpacker, UDPClient, BroadcastUDPClient class RnusersPacker(Packer): def pack_utmp(self, ui): ut_line, ut_name, ut_host, ut_time = utmp self.pack_string(ut_line) self.pack_string(ut_name) self.pack_string(ut_host) self.pack_int(ut_time) def pack_utmpidle(self, ui): ui_itmp, ui_idle = ui self.pack_utmp(ui_utmp) self.pack_uint(ui_idle) def pack_utmpidlearr(self, list): self.pack_array(list, self.pack_itmpidle) class RnusersUnpacker(Unpacker): def unpack_utmp(self): ut_line = self.unpack_string() ut_name = self.unpack_string() ut_host = self.unpack_string() ut_time = self.unpack_int() return ut_line, ut_name, ut_host, ut_time def unpack_utmpidle(self): ui_utmp = self.unpack_utmp() ui_idle = self.unpack_uint() return ui_utmp, ui_idle def unpack_utmpidlearr(self): return self.unpack_array(self.unpack_utmpidle) class PartialRnusersClient: def addpackers(self): self.packer = RnusersPacker() self.unpacker = RnusersUnpacker('') def Num(self): return self.make_call(1, None, None, self.unpacker.unpack_int) def Names(self): return self.make_call(2, None, \ None, self.unpacker.unpack_utmpidlearr) def Allnames(self): return self.make_call(3, None, \ None, self.unpacker.unpack_utmpidlearr) class RnusersClient(PartialRnusersClient, UDPClient): def __init__(self, host): UDPClient.__init__(self, host, 100002, 2) class BroadcastRnusersClient(PartialRnusersClient, BroadcastUDPClient): def __init__(self, bcastaddr): BroadcastUDPClient.__init__(self, bcastaddr, 100002, 2) def test(): import sys if not sys.argv[1:]: testbcast() return else: host = sys.argv[1] c = RnusersClient(host) list = c.Names() for (line, name, host, time), idle in list: line = strip0(line) name = strip0(name) host = strip0(host) print "%r %r %r %s %s" % (name, host, line, time, idle) def testbcast(): c = BroadcastRnusersClient('<broadcast>') def listit(list, fromaddr): host, port = fromaddr print host + '\t:', for (line, name, host, time), idle in list: print strip0(name), print c.set_reply_handler(listit) all = c.Names() print 'Total Count:', len(all) def strip0(s): while s and s[-1] == '\0': s = s[:-1] return s test()