-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathmain.py
More file actions
66 lines (56 loc) · 1.57 KB
/
main.py
File metadata and controls
66 lines (56 loc) · 1.57 KB
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#!/usr/bin/python
# -*- coding: utf-8 -*-
import urllib.request, urllib.parse, urllib.error
import urllib.request, urllib.parse, urllib.error
import time
import os
def check(file_name, string):
with open(file_name, 'r') as read_obj:
for line in read_obj:
if string in line:
return True
return False
def check2(file_name, string):
with open(file_name, 'r') as read_obj:
for line in read_obj:
if string in line:
return True
return False
def check3(file_name, word_list_file):
with open(file_name, 'r') as read_obj:
for line in read_obj:
with open(word_list_file, 'r') as read_obj2:
for line2 in read_obj2:
if (line2 in line):
return True
return False
print("GHOSTSEC - GSSD (Scam Detection Tool)")
site = input(' Enter site (make sure it is the exact url):')
showHTML = input('Show HTML? (True/False):')
true = True
print('Scanning ' + site + '...')
time.sleep(1)
html = urllib.request.urlopen(site).read()
html = str(html)
with open('url.txt', 'w+') as f:
f.write(html)
if showHTML == True:
print(html)
os.system('clear')
time.sleep(2)
isScam = False
"""" old code /ignore
wordlist = open('wordlist.txt')
all_the_lines = wordlist.readlines()
opts = []
for opts in opts:
if check('url.txt', opts):
print("Keyword found: " + opts)
isScam = True
break
"""
isScam = check3("url.txt","wordlist.txt")
if isScam == True:
print(site + " is probably a scam")
else:
print(site + " is most likely not a scam")