-
Notifications
You must be signed in to change notification settings - Fork 27
/
MonsterLogger.py
34 lines (31 loc) · 1.16 KB
/
MonsterLogger.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
import logging
import time
from colorama import init, Fore, Back, Style
logger = logging.getLogger()
console = logging.StreamHandler()
console.setLevel(logging.INFO)
formatter = logging.Formatter('%(asctime)s %(levelname)s %(message)s')
console.setFormatter(formatter)
logger.addHandler(console)
init()
def printJuicyCookie(msg):
print(Fore.RESET + "#################")
timestr = time.strftime('%Y-%m-%d %H:%M:%S')
print(Fore.RED + timestr + msg)
print(Fore.RESET + "#################")
def printJuicyForm(msg):
print(Fore.RESET + "#################")
timestr = time.strftime('%Y-%m-%d %H:%M:%S')
print(Fore.BLUE + timestr + msg)
print(Fore.RESET + "#################")
def storeCookie(ua,host, uri, juicyInfo,filename = "monsterCookie.log"):
msg = "ua: %s\nhost: %s\nuri: %s\n password: %s \n" % (ua, host, uri, juicyInfo)
storeToFile(msg, filename)
def storeForm(ua, host, uri, rawcookie,filename = "monsterCookie.log"):
msg = "ua: %s\nhost: %s\nuri: %s\n rawcookie: %s \n" % (ua, host, uri, rawcookie)
storeToFile(msg, filename)
def storeToFile(msg,filename):
f = open(filename, "a+")
timestr = time.strftime('%Y-%m-%d %H:%M:%S')
f.write(timestr + "\n" +msg)
f.close()