Esempio n. 1
0
def submitCallBack():
    url = E1.get()
    main.process_test_url(url, 'test_features.csv')
    return_ans = tr.gui_caller('url_features.csv', 'test_features.csv')
    a = str(return_ans).split()
    print("-----")
    print("return_ans:", return_ans)
    print("-----")
    if int(a[1]) == 0:
        tkMessageBox.showinfo("URL Checker Result",
                              "The URL " + url + " is Safe to Visit")
        new = 1
        answer = tkMessageBox.askquestion("Redirect",
                                          "Do you want to visit the url?")
        if answer == 'yes':
            #webbrowser.open(url=E1.get(), new=1)
            chrome_path = 'C:/Program Files (x86)/Google/Chrome/Application/chrome.exe %s'
            webbrowser.get(chrome_path).open(url=E1.get(), new=1)
    elif int(a[1]) == 1:
        tkMessageBox.showinfo("URL Checker Result",
                              "The URL " + url + " is Malicious")
        answer_2 = tkMessageBox.askquestion(
            "Redirect",
            "The url MALICIOUS, Do you still want to visit the url?")
        if answer_2 == 'yes':
            webbrowser.open(url=E1.get(), new=1)
    else:
        tkMessageBox.showinfo("URL Checker Result",
                              "The URL " + url + " is Malware")
        tkMessageBox.showwarning("Warning",
                                 "Cant Redirect, url contains a malware")
Esempio n. 2
0
def hello():
    form = ReusableForm(request.form)

    print
    form.errors
    if request.method == 'POST':
        url = request.form['name']
        main.process_test_url(url, 'gui_url_features.csv')
        return_ans = tr.gui_caller('url_features.csv', 'gui_url_features.csv')
        a = str(return_ans).split()
        val = int(a[1])

        if form.validate():
            # Save the comment here.
            if val == 0 or val == 2:
                flash('URL  ' + url + '  is Safe')
                webbrowser.get("C:/Program Files (x86)/Google/Chrome/Application/chrome.exe %s").open(url)
            elif val == 1:
                flash('URL  ' + url + '  is Malicious')
            else:
                flash('URL  ' + url + '  is Malware')
        else:
            flash('Error: All the form fields are required. ')

    return render_template('index.html', form=form)
Esempio n. 3
0
def submitCallBack():
    url = E1.get()
    main.process_test_url(url, 'test_features.csv')
    return_ans = tr.gui_caller('url_features.csv', 'test_features.csv')
    a = str(return_ans).split()
    if int(a[1]) == 0:
        tkMessageBox.showinfo("URL Checker Result", "The URL " + url + " is Benign")
    elif int(a[1]) == 1:
        tkMessageBox.showinfo("URL Checker Result", "The URL " + url + " is Malicious")
    else:
        tkMessageBox.showinfo("URL Checker Result", "The URL " + url + " is Malware")
Esempio n. 4
0
def submitCallBack():
	url=E1.get()
	main.process_test_url(url,'test_features.csv')
	return_ans = tr.gui_caller('url_features.csv','test_features.csv')
	a=str(return_ans).split()
	if int(a[1])==0:
		tkMessageBox.showinfo( "URL Checker Result","The URL "+url+" is Benign")
	elif int(a[1])==1:
		tkMessageBox.showinfo( "URL Checker Result","The URL "+url+" is Malicious")
	else:
		tkMessageBox.showinfo( "URL Checker Result","The URL "+url+" is Malware")
Esempio n. 5
0
def submitCallBack():
	"""docstring for submitCallBack"""
	url = E1.get()
	main.process_test_url(url, 'test_features.csv')
	return_ans = tr.gui_caller('url_features.csv', 'test_features.csv')
	a = str(return_ans).split()
	if int(a[1]) == 0:
		tkMessageBox.showinfo('URL Checker Result', 'The URL ' + url + ' is Benign')
	elif int(a[1]) == 1:
		tkMessageBox.showinfo('URL Checker Result', 'The URL ' + url + ' is Malicious')
	else:
		tkMessageBox.showinfo('URL Checker Result', 'The URL ' + url + ' is Malware')
Esempio n. 6
0
def submitCallBack():
    url = E1.get()
    urlFeature = feature_extractor.extract(url)
    test_file_name = 'gui_test_feature.csv'
    os.remove(test_file_name)
    main.write_feature(urlFeature, test_file_name, True)
    return_ans = tr.gui_caller('url_features.csv', test_file_name)
    a = str(return_ans).split()

    if int(a[1]) == 0:
        tkMessageBox.showinfo("CIS475",
                              "The specified URL \'" + url + "\' is Benign")
    else:
        tkMessageBox.showinfo("CIS475",
                              "The specified URL \'" + url + "\' is Malicious")
def submitCallback():
    url = E1.get()
    main.process_test_url(url, 'test_features.csv')
    return_ans = tr.gui_caller('url_features.csv', 'test_features.csv')
    a = str(return_ans).split()
    if int(a[1]) == 0:
        tkinter.messagebox.showinfo("URL Checker Result",
                                    "The URL" + url + "is Benign")
        import webbrowser
        webbrowser.open(url, new=2)
    elif int(a[1]) == 1:
        tkinter.messagebox.showinfo("URL Checker Result",
                                    "The URL" + url + "is Malicious")
    else:
        tkinter.messagebox.showinfo("URL Checker Result",
                                    "The URL" + url + "is Malware")
Esempio n. 8
0
def submit(link):
    url = extract_url(link)
    process_test_url(url, 'test_features.csv')
    return_ans = tr.gui_caller('url_features.csv', 'test_features.csv')
    a = str(return_ans).split()
    if int(a[1]) == 0:
        return Results.SAFE
        # answer = tkMessageBox.askquestion("Redirect","Do you want to visit the url?")
        # if answer == 'yes':
        #         webbrowser.open(url=E1.get(), new=1)
    elif int(a[1]) == 1:
        return Results.MALICIOUS
        # tkMessageBox.showinfo("URL Checker Result", "The URL " + url + " is Malicious")
        # answer_2 = tkMessageBox.askquestion("Redirect", "The url MALICIOUS, Do you still want to visit the url?")
        # if answer_2=='yes':
        #     webbrowser.open(url=E1.get(),new=1)
    else:
        # tkMessageBox.showinfo("URL Checker Result", "The URL " + url + " is Malware")
        # tkMessageBox.showwarning("Warning","Cant Redirect, url contains a malware")
        return Results.MALWARE
Esempio n. 9
0
import trainer as tr
import pandas
import main

url = [
    'http://jd.com', 'http://google.com', 'http://facebook.com',
    'http://youtube.com', 'http://yahoo.com', 'http://baidu.com',
    'http://wikipedia.org', 'http://qq.com',
    'http://208.115.247.197/au/index1.php',
    'http://toc.cl/wp-admin/www.sparkasse.de/online-banking.aktualisieren.htm',
    'http://paristokyo.biz/trouvay-cauvin.co.uk/includes/AOL/index.php',
    'http://fenixexpressgc.com/cooljoe/CLICK/CLICK/index.php.htm',
    'http://arbiitours.com/wp-content/plugins/contact-form-777/images/online/login.jsp.html',
    'http://ruthdunn.org/paypal.co.uk.c17d1db50d22aa998bed4a8d7855d5fa03/ffd12b054185e4e1b246b1abc08efb1a/cgi-bin/en/account/login/index.php%5B%2A%2Aqmark%2A%2A%5D',
    'http://civilwarvetswastate.com/gxy/',
    'http://200.98.128.198/testax14/p/itant.html',
    'http://musicmoviesnbooks.com/codec.exe',
    'http://musicmoviesnbooks.com/codec/197.exe',
    'http://musicmoviesnbooks.com/file.exe',
    'http://musicmoviesnbooks.com/pcdef.exe',
    'http://mybest-adult.com/promo1/get.php',
    'http://mybest-adult.com/promo2/get.php',
    'http://mybest-adult.com/promo3/get.php'
]

for testurl in url:
    main.process_test_url(testurl, 'test_features.csv')
    return_ans = tr.gui_caller('url_features.csv', 'test_features.csv')

print return_ans