Example #1
0
    def createKmsResponse(self, kmsRequest, currentClientCount):
        response = kmsResponseStruct()
        response['versionMinor'] = kmsRequest['versionMinor']
        response['versionMajor'] = kmsRequest['versionMajor']

        if not self.config["epid"]:
            response["kmsEpid"] = codecs.encode(
                kmsPidGenerator.epidGenerator(
                    kmsRequest['applicationId'].get(),
                    kmsRequest['versionMajor'], self.config["lcid"]),
                'utf_16_le')
        else:
            response["kmsEpid"] = codecs.encode(self.config["epid"],
                                                'utf_16_le')
        response['clientMachineId'] = kmsRequest['clientMachineId']
        response['responseTime'] = kmsRequest['requestTime']
        if self.config["CurrentClientCount"]:
            response['currentClientCount'] = self.config["CurrentClientCount"]
        else:
            response['currentClientCount'] = currentClientCount
        response['vLActivationInterval'] = self.config["VLActivationInterval"]
        response['vLRenewalInterval'] = self.config["VLRenewalInterval"]

        if self.config['sqlite'] and self.config['dbSupport']:
            con = None
            try:
                con = sqlite3.connect(self.dbName)
                cur = con.cursor()
                cur.execute("SELECT * FROM clients WHERE clientMachineId=?;",
                            [str(kmsRequest['clientMachineId'].get())])
                try:
                    data = cur.fetchone()
                    #print "Data:", data
                    if data[6]:
                        response["kmsEpid"] = codecs.encode(
                            data[6], 'utf_16_le')
                    else:
                        cur.execute(
                            "UPDATE clients SET kmsEpid=? WHERE clientMachineId=?;",
                            (str(response["kmsEpid"].decode('utf-16le')),
                             str(kmsRequest['clientMachineId'].get())))

                except sqlite3.Error as e:
                    print("Error %s:" % e.args[0])

            except sqlite3.Error as e:
                print("Error %s:" % e.args[0])
                sys.exit(1)

            finally:
                if con:
                    con.commit()
                    con.close()

        if self.config['verbose']:
            print("      Server ePID: %s" %
                  response["kmsEpid"].decode('utf-16le'))
        return response
Example #2
0
	def createKmsResponse(self, kmsRequest):
		response = self.kmsResponseStruct()
		response['versionMinor'] = kmsRequest['versionMinor']
		response['versionMajor'] = kmsRequest['versionMajor']

		if not self.config["epid"]:
			response["kmsEpid"] = kmsPidGenerator.epidGenerator(kmsRequest['applicationId'], kmsRequest['versionMajor'], self.config["lcid"]).encode('utf-16le')
		else:
			response["kmsEpid"] = self.config["epid"].encode('utf-16le')
		response['clientMachineId'] = kmsRequest['clientMachineId']
		response['responseTime'] = kmsRequest['requestTime']
		response['currentClientCount'] = self.config["CurrentClientCount"]
		response['vLActivationInterval'] = self.config["VLActivationInterval"]
		response['vLRenewalInterval'] = self.config["VLRenewalInterval"]
		logging.info("Server ePID: %s" % response["kmsEpid"].decode('utf-16le'))
		return response
Example #3
0
	def createKmsResponse(self, kmsRequest, currentClientCount):
		response = kmsResponseStruct()
		response['versionMinor'] = kmsRequest['versionMinor']
		response['versionMajor'] = kmsRequest['versionMajor']

		if not self.config["epid"]:
			response["kmsEpid"] = codecs.encode(kmsPidGenerator.epidGenerator(kmsRequest['applicationId'].get(), kmsRequest['versionMajor'], self.config["lcid"]), 'utf_16_le')
		else:
			response["kmsEpid"] = codecs.encode(self.config["epid"], 'utf_16_le')
		response['clientMachineId'] = kmsRequest['clientMachineId']
		response['responseTime'] = kmsRequest['requestTime']
		if self.config["CurrentClientCount"]:
			response['currentClientCount'] = self.config["CurrentClientCount"]
		else:
			response['currentClientCount'] = currentClientCount
		response['vLActivationInterval'] = self.config["VLActivationInterval"]
		response['vLRenewalInterval'] = self.config["VLRenewalInterval"]

		if self.config['sqlite'] and self.config['dbSupport']:
			con = None
			try:
				con = sqlite3.connect(self.dbName)
				cur = con.cursor()
				cur.execute("SELECT * FROM clients WHERE clientMachineId=?;", [str(kmsRequest['clientMachineId'].get())])
				try:
					data = cur.fetchone()
					#print "Data:", data
					if data[6]:
						response["kmsEpid"] = codecs.encode(data[6], 'utf_16_le')
					else:
						cur.execute("UPDATE clients SET kmsEpid=? WHERE clientMachineId=?;", (str(response["kmsEpid"].decode('utf-16le')), str(kmsRequest['clientMachineId'].get())))

				except sqlite3.Error as e:
					print("Error %s:" % e.args[0])

			except sqlite3.Error as e:
				print("Error %s:" % e.args[0])
				sys.exit(1)

			finally:
				if con:
					con.commit()
					con.close()

		if self.config['verbose']:
			print("      Server ePID: %s" % response["kmsEpid"].decode('utf-16le'))
		return response
Example #4
0
	def createKmsResponse(self, kmsRequest):
		response = self.kmsResponseStruct()
		response['versionMinor'] = kmsRequest['versionMinor']
		response['versionMajor'] = kmsRequest['versionMajor']

		if not self.config["epid"]:
			response["kmsEpid"] = kmsPidGenerator.epidGenerator(kmsRequest['applicationId'], kmsRequest['versionMajor'], self.config["lcid"]).encode('utf-16le')
		else:
			response["kmsEpid"] = self.config["epid"].encode('utf-16le')
		response['clientMachineId'] = kmsRequest['clientMachineId']
		response['responseTime'] = kmsRequest['requestTime']
		response['currentClientCount'] = self.config["CurrentClientCount"]
		response['vLActivationInterval'] = self.config["VLActivationInterval"]
		response['vLRenewalInterval'] = self.config["VLRenewalInterval"]
		if self.config['verbose']:
			print "      Server ePID: %s" % response["kmsEpid"].decode('utf-16le')
		return response
Example #5
0
    def createKmsResponse(self, kmsRequest):
        response = self.kmsResponseStruct()
        response['versionMinor'] = kmsRequest['versionMinor']
        response['versionMajor'] = kmsRequest['versionMajor']
        #print " : ", kmsRequest['applicationId'] ----> This line was returning garbage in the pidGenerator
        if not self.config["epid"]:
            response["kmsEpid"] = kmsPidGenerator.epidGenerator(
                applicationId, kmsRequest['versionMajor'],
                self.config["lcid"]).encode('utf-16le')
        else:
            response["kmsEpid"] = self.config["epid"].encode('utf-16le')

        response['clientMachineId'] = kmsRequest['clientMachineId']
        response['responseTime'] = kmsRequest['requestTime']
        response['currentClientCount'] = self.config["CurrentClientCount"]
        response['vLActivationInterval'] = self.config["VLActivationInterval"]
        response['vLRenewalInterval'] = self.config["VLRenewalInterval"]

        if self.config['sqlite'] and self.config['dbSupport']:
            con = None
            try:
                con = sqlite3.connect(self.dbName)
                cur = con.cursor()
                cur.execute("SELECT * FROM clients WHERE clientMachineId=?;",
                            [str(kmsRequest['clientMachineId'].get())])
                try:
                    data = cur.fetchone()
                    #print "Data:", data
                    if data[6]:
                        response["kmsEpid"] = data[6].encode('utf-16le')
                    else:
                        cur.execute(
                            "UPDATE clients SET kmsEpid=? WHERE clientMachineId=?;",
                            (str(response["kmsEpid"].decode('utf-16le')),
                             str(kmsRequest['clientMachineId'].get())))

                except sqlite3.Error, e:
                    logging.error("%s:" % e.args[0])

            except sqlite3.Error, e:
                logging.error("%s:" % e.args[0])
                sys.exit(1)
            finally:
Example #6
0
    def createKmsResponse(self, kmsRequest):
        response = self.kmsResponseStruct()
        response["versionMinor"] = kmsRequest["versionMinor"]
        response["versionMajor"] = kmsRequest["versionMajor"]

        if not self.config["epid"]:
            response["kmsEpid"] = kmsPidGenerator.epidGenerator(
                kmsRequest["applicationId"], kmsRequest["versionMajor"], self.config["lcid"]
            ).encode("utf-16le")
        else:
            response["kmsEpid"] = self.config["epid"].encode("utf-16le")
        response["clientMachineId"] = kmsRequest["clientMachineId"]
        response["responseTime"] = kmsRequest["requestTime"]
        response["currentClientCount"] = self.config["CurrentClientCount"]
        response["vLActivationInterval"] = self.config["VLActivationInterval"]
        response["vLRenewalInterval"] = self.config["VLRenewalInterval"]
        if self.config["verbose"]:
            print "      Server ePID: %s" % response["kmsEpid"].decode("utf-16le")
        return response
Example #7
0
	def createKmsResponse(self, kmsRequest):
		response = self.kmsResponseStruct()
		response['versionMinor'] = kmsRequest['versionMinor']
		response['versionMajor'] = kmsRequest['versionMajor']
		#print " : ", kmsRequest['applicationId'] ----> This line was returning garbage in the pidGenerator
		if not self.config["epid"]:
			response["kmsEpid"] = kmsPidGenerator.epidGenerator(applicationId, kmsRequest['versionMajor'], self.config["lcid"]).encode('utf-16le')
		else:
			response["kmsEpid"] = self.config["epid"].encode('utf-16le')
			
		response['clientMachineId'] = kmsRequest['clientMachineId']
		response['responseTime'] = kmsRequest['requestTime']
		response['currentClientCount'] = self.config["CurrentClientCount"]
		response['vLActivationInterval'] = self.config["VLActivationInterval"]
		response['vLRenewalInterval'] = self.config["VLRenewalInterval"]

		if self.config['sqlite'] and self.config['dbSupport']:
			con = None
			try:
				con = sqlite3.connect(self.dbName)
				cur = con.cursor()
				cur.execute("SELECT * FROM clients WHERE clientMachineId=?;", [str(kmsRequest['clientMachineId'].get())])
				try:
					data = cur.fetchone()
					#print "Data:", data
					if data[6]:
						response["kmsEpid"] = data[6].encode('utf-16le')
					else:
						cur.execute("UPDATE clients SET kmsEpid=? WHERE clientMachineId=?;", (str(response["kmsEpid"].decode('utf-16le')), str(kmsRequest['clientMachineId'].get())))

				except sqlite3.Error, e:
                                        logging.error("%s:" % e.args[0])
					
			except sqlite3.Error, e:
                                logging.error("%s:" % e.args[0])
				sys.exit(1)
			finally:
Example #8
0
#Variables
lcid = 1033
# 1033 (english) is en-us
# 1034 (spanish) is es-es
# 1041 (japanese) is ja

applicationId = "55C92734-D682-4D71-983E-D6EC3F16059F"  #Windows
applicationId2 = "0FF1CE15-A989-479D-AF46-F275C6370663"  #Office 15 (2013)
applicationId3 = "59A52881-A989-479D-AF46-F275C6370663"  #Office 14 (2010)

versionMajor = 6  # KMS Version
# 6 for date starting October 17, 2013
# 5 for date starting September 4, 2012
# 4 for date starting February 16, 2011

#Responses
response = kmsPidGenerator.epidGenerator('applicationId', versionMajor, lcid)
response2 = kmsPidGenerator.epidGenerator('applicationId2', versionMajor, lcid)
response3 = kmsPidGenerator.epidGenerator('applicationId3', versionMajor, lcid)

print "\nFor Windows:     ", response
print "\nFor Office 2013: ", response2
print "\nFor Office 2010: ", response3

#-----------------------------------------------------------------------------
#HWID Section
import uuid
key = uuid.uuid4().hex
print "\nRandom hwid:     ", key[:16]
Example #9
0
# 1033 (english) is en-us
# 1034 (spanish) is es-es
# 1041 (japanese) is ja
lcid = 1033 

applicationId = uuid.UUID("55C92734-D682-4D71-983E-D6EC3F16059F")  # Windows
applicationId2 = uuid.UUID("0FF1CE15-A989-479D-AF46-F275C6370663") # Office 15 (2013) and Office 16 (2016)
applicationId3 = uuid.UUID("59A52881-A989-479D-AF46-F275C6370663") # Office 14 (2010)

# KMS Version.
# 6 for date starting October 17, 2013
# 5 for date starting September 4, 2012
# 4 for date starting February 16, 2011
versionMajor = 6

# Responses.
response = kmsPidGenerator.epidGenerator(applicationId, versionMajor, lcid)
response2 = kmsPidGenerator.epidGenerator(applicationId2, versionMajor, lcid)
response3 = kmsPidGenerator.epidGenerator(applicationId3, versionMajor, lcid)

print "\nFor Windows:            ", response
print "\nFor Office 2013/2016:   ", response2
print "\nFor Office 2010:        ", response3

#-----------------------------------------------------------------------------
# HWID Section.
import uuid
key = uuid.uuid4().hex
print "\nRandom hwid:            ", key[:16]
print "\n"
Example #10
0
# 1041 (japanese) is ja
lcid = 1033

applicationId = uuid.UUID("55C92734-D682-4D71-983E-D6EC3F16059F")  # Windows
applicationId2 = uuid.UUID("0FF1CE15-A989-479D-AF46-F275C6370663"
                           )  # Office 15 (2013) and Office 16 (2016)
applicationId3 = uuid.UUID(
    "59A52881-A989-479D-AF46-F275C6370663")  # Office 14 (2010)

# KMS Version.
# 6 for date starting October 17, 2013
# 5 for date starting September 4, 2012
# 4 for date starting February 16, 2011
versionMajor = 6

# Responses.
response = kmsPidGenerator.epidGenerator(applicationId, versionMajor, lcid)
response2 = kmsPidGenerator.epidGenerator(applicationId2, versionMajor, lcid)
response3 = kmsPidGenerator.epidGenerator(applicationId3, versionMajor, lcid)

print "\nFor Windows:            ", response
print "\nFor Office 2013/2016:   ", response2
print "\nFor Office 2010:        ", response3

#-----------------------------------------------------------------------------
# HWID Section.
import uuid
key = uuid.uuid4().hex
print "\nRandom hwid:            ", key[:16]
print "\n"
Example #11
0
#Variables
lcid = 1033 
# 1033 (english) is en-us
# 1034 (spanish) is es-es
# 1041 (japanese) is ja

applicationId = "55C92734-D682-4D71-983E-D6EC3F16059F" #Windows
applicationId2 = "0FF1CE15-A989-479D-AF46-F275C6370663" #Office 15 (2013)
applicationId3 = "59A52881-A989-479D-AF46-F275C6370663" #Office 14 (2010)

versionMajor = 6 # KMS Version
# 6 for date starting October 17, 2013
# 5 for date starting September 4, 2012
# 4 for date starting February 16, 2011

#Responses
response = kmsPidGenerator.epidGenerator('applicationId', versionMajor, lcid)
response2 = kmsPidGenerator.epidGenerator('applicationId2', versionMajor, lcid)
response3 = kmsPidGenerator.epidGenerator('applicationId3', versionMajor, lcid)

print "\nFor Windows:     ", response
print "\nFor Office 2013: ", response2
print "\nFor Office 2010: ", response3

#-----------------------------------------------------------------------------
#HWID Section
import uuid
key = uuid.uuid4().hex
print "\nRandom hwid:     ", key[:16]