當前位置: 首頁>>代碼示例>>Python>>正文


Python CtfUtil.getRandomEmail方法代碼示例

本文整理匯總了Python中utility.CtfUtil.getRandomEmail方法的典型用法代碼示例。如果您正苦於以下問題:Python CtfUtil.getRandomEmail方法的具體用法?Python CtfUtil.getRandomEmail怎麽用?Python CtfUtil.getRandomEmail使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在utility.CtfUtil的用法示例。


在下文中一共展示了CtfUtil.getRandomEmail方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: score

# 需要導入模塊: from utility import CtfUtil [as 別名]
# 或者: from utility.CtfUtil import getRandomEmail [as 別名]
def score(ip,flag,cookie):
	#get old flag  
	if cookie != None:
		try:
			userName,password = cookie.split(":")
                
			mainpage = pybrowse.Browser("http://" + ip + "/~estore/index.html")
			mainpage.open()
			mainpage.parse()
			loginMainPage = login(mainpage, userName, password)
			updatePage = loginMainPage.click("cgi-bin/update.php")
			updatePage.parse()
			updateForm = updatePage.forms[0]
			updateForm.fields['username'] = userName
			updateForm.fields['password'] = password
			updateForm.fields['email'] = CtfUtil.getRandomEmail() 
                
			resultPage = updateForm.click(None)
			successPtr = resultPage.page.find("address was:")

			if(successPtr != -1):
				oldFlag = resultPage.page[successPtr+13:][:len(flag)]
				print "FLAG:",oldFlag
 
			logout(loginMainPage)
                
		except Exception, e:
			print "ERROR: got exception %s getting flag" % (e)
開發者ID:RootFu,項目名稱:ctf-scorebot,代碼行數:30,代碼來源:EstoreServiceScript.py

示例2: createAccount

# 需要導入模塊: from utility import CtfUtil [as 別名]
# 或者: from utility.CtfUtil import getRandomEmail [as 別名]
def createAccount(name, passwd, role):
	global myHost
        
	mainpg = pybrowse.Browser("http://" + myHost + "/Therapy/createuser.do?role=" + role)
	mainpg.open()
	mainpg.parse()
        
	userform = mainpg.forms[0]
	userform.fields['firstname'] = CtfUtil.getRandomString(random.randint(4,10))
	userform.fields['lastname'] = CtfUtil.getRandomString(random.randint(5,10))
	userform.fields['email'] = CtfUtil.getRandomEmail()
	userform.fields['username'] = name
	userform.fields['password'] = passwd
	userform.fields['role'] = role
	resultPage = userform.click("submit")
	resultPage = resultPage.doRedirects()
	return resultPage
開發者ID:Steccas,項目名稱:ctf-scorebot,代碼行數:19,代碼來源:TherapyServiceScript.py

示例3:

# 需要導入模塊: from utility import CtfUtil [as 別名]
# 或者: from utility.CtfUtil import getRandomEmail [as 別名]
		except Exception, e:
			print "ERROR: got exception %s getting flag" % (e)
        
	# set the new flag
	try:
		personality = browserpersonality.getRandomPersonality()
		mainpg = pybrowse.Browser("http://" + ip + "/Site/Petition.html")
		mainpg.open()
		mainpg = pybrowse.Browser("http://" + ip + "/Site//Petition_files/widget1_markup.html")
		mainpg.open()
		mainpg.parse()

		myform = mainpg.forms[0]
		myform.fields["first"] = CtfUtil.getRandomString(random.randint(4,10))
		myform.fields["last"] = CtfUtil.getRandomString(random.randint(4,10))
		myform.fields["email"] = CtfUtil.getRandomEmail()
		myform.fields["comment"] = flag

		myform.fields["id"] = ""
		resultingPage = myform.click(None)
		resultingPage = resultingPage.doRedirects()
		successPtr = resultingPage.page.find( "Your ID is " )
        
		if successPtr != -1:
			cookie = resultingPage.page[successPtr+11:][:8]
			print "COOKIE:",cookie
        
	except Exception, e:
		print "ERROR: got exception %s setting new flag" % (e)
       
if __name__ == "__main__":
開發者ID:Steccas,項目名稱:ctf-scorebot,代碼行數:33,代碼來源:PetitionServiceScript.py

示例4: getNotePage

# 需要導入模塊: from utility import CtfUtil [as 別名]
# 或者: from utility.CtfUtil import getRandomEmail [as 別名]
			successPtr = resultPage.page.find("NOTE:")

			if successPtr != -1:
				endPointer = resultPage.page[successPtr+6:].find("\n")
				oldFlagText = resultPage.page[successPtr+6:][:endPointer]
				oldFlag = urllib.unquote(oldFlagText)[:len(flag)]
				print "FLAG:",oldFlag
     
		except Exception, e:
			print "ERROR: got exception %s setting new flag" % (e)
			sys.exit(1)
         
	#set the new flag
	try:
		user = CtfUtil.getRandomString(random.randint(6,8))
		email = CtfUtil.getRandomEmail()
		note = flag
            
		resultPage = getNotePage(ip,user,email,note)
            
		successPtr = resultPage.page.find("Annotation saved!")
		if successPtr == -1:
			return
            
		cookie = user+":"+email
		print "COOKIE:",cookie
            
	except Exception, e:
		print "ERROR: got exception %s setting new flag" % (e)
        
if __name__ == "__main__":
開發者ID:RootFu,項目名稱:ctf-scorebot,代碼行數:33,代碼來源:BassretardServiceScript.py

示例5: str

# 需要導入模塊: from utility import CtfUtil [as 別名]
# 或者: from utility.CtfUtil import getRandomEmail [as 別名]
	#set the new flag
	try:
		personality = browserpersonality.getRandomPersonality()
		mainpg = pybrowse.Browser("http://" + ip + "/~register/register.html", personality)
		mainpg.open()
		mainpg.parse()

		registrationForm = mainpg.forms[0]

		password = CtfUtil.getRandomAlphaNum(8)
		wwid = flag

		registrationForm.fields['first'] = CtfUtil.getRandomString(random.randint(5,7))
		registrationForm.fields['last'] = CtfUtil.getRandomString(random.randint(6,9))
		registrationForm.fields['dob'] = str(random.choice(months))+" "+str(random.randint(1,29))+", "+str(random.randint(1900,2000))
		registrationForm.fields['email'] = CtfUtil.getRandomEmail()
		registrationForm.fields['password'] = password
		registrationForm.fields['wwid'] = wwid

		resultingPage = registrationForm.click(None)

		successPtr = resultingPage.page.find("Registration successful!")

		if successPtr == -1:
			print "ERROR: Could not set new flag"
			return

		cookie = password+":"+wwid
		print "COOKIE:",cookie

	except Exception, e:
開發者ID:RootFu,項目名稱:ctf-scorebot,代碼行數:33,代碼來源:RegisterServiceScript.py

示例6: getRandomPiratedFiles

# 需要導入模塊: from utility import CtfUtil [as 別名]
# 或者: from utility.CtfUtil import getRandomEmail [as 別名]
                
		except Exception, e:
			print "ERROR: got exception '%s' when getting flag" % (e)
			sys.exit(1)
        
	# set new flag
	try:
		url = "http://" + ip + "/Site/Make_amends.html"
		personality = browserpersonality.getRandomPersonality()
		mainpg = pybrowse.Browser(url, personality)
		mainpg.open()
            
		# create a new user acccount
		fname = CtfUtil.getRandomString(random.randint(6,10))
		lname = CtfUtil.getRandomString(random.randint(6,10))
		eaddr = CtfUtil.getRandomEmail()
		files = getRandomPiratedFiles(random.randint(1,5))
		price = getRandomDollarAmount(random.randint(1,5))
		resultPage = createAccount(ip,fname, lname, eaddr, files, price)
        
		# choose settlement letter format preference and get case id
		caseid = chooseFormatPref(resultPage)
        
		# login using the new account
		resultPage = doNewLogin(ip, eaddr, caseid)
        
		# view the settlement letter
		viewSettlementLetter(resultPage)
        
		# settle with the MAFIA
		resultPage = paySettlement(resultPage,flag)
開發者ID:RootFu,項目名稱:ctf-scorebot,代碼行數:33,代碼來源:AmendsServiceScript.py


注:本文中的utility.CtfUtil.getRandomEmail方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。