Exemplo n.º 1
0
# -*-coding:utf-8-*-

"""
Description

Created on 11/16/15
@author: Hui Li
"""
from CP2 import DBUtil
import matplotlib.pyplot as plt

if __name__ == "__main__":

    feature_vectors = DBUtil.select_all_features()
    list = []
    for vec in feature_vectors:
        list.append(vec[0])

    # the histogram of the data
    plt.hist(list)

    plt.show()
Exemplo n.º 2
0
#-*-coding:utf-8-*-

"""
Description

Created on 11/14/15
@author: Hui Li
"""
from random import randint
from CP2 import DBUtil

if __name__=="__main__":
    log_count = DBUtil.select_log_count()

    # randon pick 23 logs and do injections

    ids = []
    for i in range(0, 23):
        ids.append(randint(1, log_count + 1))

    # print ids

    ids = [668879, 91181, 518074, 655140, 428926, 470409, 278861, 634648, 637119, 748989, 328187, 780770, 31263, 573774, 504508, 469440, 690935, 501443, 138230, 781767, 306420, 787702, 728695]

    log = DBUtil.select_one_log(ids[0])
    log.s_sitename = "DRUPAL"
    log.s_computername = "WWW4"
    log.s_ip = "202.168.12.11"
    log.cs_method = "HEAD"
    log.cs_uri = "http://www.sweetgeorgia.com/cgi­bin/af.cgi?_browser_out=| echo;id;exit"
    log.s_port = 443