本文整理汇总了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)
示例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
示例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__":
示例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__":
示例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:
示例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)