示例#1
0
	def killportprocess(self, port):
		a = os.popen(admin.getAdminExec("lsof -i :" + port + " -t", UserPasswd)).read()
		print(a)
		if a == None:
			return "Port is not in use"
		else:
			os.system("kill " + a)
示例#2
0
文件: ports.py 项目: iamlos/SecureMe
 def killportprocess(self, port):
     a = os.popen(admin.getAdminExec("lsof -i :" + port + " -t",
                                     UserPasswd)).read()
     print(a)
     if a == None:
         return "Port is not in use"
     else:
         os.system("kill " + a)
示例#3
0
	def getstatus(self, service):
		rawdata = os.popen(admin.getAdminExec("service " + service + " status", UserPasswd)).read()
		print(rawdata)
		if "start" in str(rawdata):
			print("Service is running!")
			return "Started"
		else:
			print("Service is stopped!")
			return "Stopped"
示例#4
0
	def getportprocess(self, port):
		pid = os.popen(admin.getAdminExec("lsof -i :" + port + " -t", UserPasswd)).read()
		print(pid)
		if pid == "":
			return False
		else:
			p = pid.rstrip()
			b = os.popen("ps -p " + p + " -o comm=").read()
			print(b)
			return b
示例#5
0
 def getstatus(self, service):
     rawdata = os.popen(
         admin.getAdminExec("service " + service + " status",
                            UserPasswd)).read()
     print(rawdata)
     if "start" in str(rawdata):
         print("Service is running!")
         return "Started"
     else:
         print("Service is stopped!")
         return "Stopped"
示例#6
0
文件: ports.py 项目: iamlos/SecureMe
 def getportprocess(self, port):
     pid = os.popen(
         admin.getAdminExec("lsof -i :" + port + " -t", UserPasswd)).read()
     print(pid)
     if pid == "":
         return False
     else:
         p = pid.rstrip()
         b = os.popen("ps -p " + p + " -o comm=").read()
         print(b)
         return b
示例#7
0
 def getStatus(self, rp):
     UserPassword = rp
     print('Getting Status')
     status = os.popen(admin.getAdminExec("ufw status",
                                          UserPassword)).read()
     return status
示例#8
0
	def getStatus(self, rp):
		UserPassword = rp
		print('Getting Status')
		status = os.popen(admin.getAdminExec("ufw status", UserPassword)).read()
		return status