本文整理匯總了Python中utility.CtfUtil.main方法的典型用法代碼示例。如果您正苦於以下問題:Python CtfUtil.main方法的具體用法?Python CtfUtil.main怎麽用?Python CtfUtil.main使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類utility.CtfUtil
的用法示例。
在下文中一共展示了CtfUtil.main方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: initConversation
# 需要導入模塊: from utility import CtfUtil [as 別名]
# 或者: from utility.CtfUtil import main [as 別名]
print "ERROR: got exception %s getting flag" % (e)
#set the new flag
try:
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
sock.connect((ip, port))
name = CtfUtil.getRandomString(random.randint(6,8))
msg = name+" " + flag + "\n"
response = initConversation(msg,sock)
successPtr = response.find("summoning operator")
if successPtr == -1:
print "ERROR: Could not set new flag"
return
for i in range(random.randint(1,3)):
if len(askRandomQuestion(sock)) < 1:
print "ERROR: Something doesnt look right"
return
sock.close()
cookie = name
print "COOKIE:",cookie
except Exception, e:
print "ERROR: got exception %s setting new flag" % (e)
if __name__ == '__main__':
CtfUtil.main(score)
示例2: FlagClient
# 需要導入模塊: from utility import CtfUtil [as 別名]
# 或者: from utility.CtfUtil import main [as 別名]
#!/usr/bin/python -u
from utility import CtfUtil
from utility.flagclient import FlagClient
if __name__ == "__main__":
flagClient = FlagClient(port=8082)
CtfUtil.main(flagClient.score)