Skip to content

Commit 11afedd

Browse files
committed
Added code for replacing attributes in test data
1 parent c464743 commit 11afedd

File tree

2 files changed

+42
-8
lines changed

2 files changed

+42
-8
lines changed

Extension/manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
},
1010
"content_scripts": [{
1111
"css": ["styles.css"],
12-
"js": ["upload1.js"],
12+
"js": ["rough.js"],
1313
"matches": ["<all_urls>"]
1414
},
1515
{

Extension/rough.js

Lines changed: 41 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,44 @@
1+
var input = `@relation phishing
2+
3+
@attribute having_IP_Address {-1,1}
4+
@attribute URL_Length {1,0,-1}
5+
@attribute Shortining_Service {1,-1}
6+
@attribute having_At_Symbol {1,-1}
7+
@attribute double_slash_redirecting {-1,1}
8+
@attribute Prefix_Suffix {-1,1}
9+
@attribute having_Sub_Domain {-1,0,1}
10+
@attribute SSLfinal_State {-1,1,0}
11+
@attribute Domain_registeration_length {-1,1}
12+
@attribute Favicon {1,-1}
13+
@attribute port {1,-1}
14+
@attribute HTTPS_token {-1,1}
15+
@attribute Request_URL {1,-1}
16+
@attribute URL_of_Anchor {-1,0,1}
17+
@attribute Links_in_tags {1,-1,0}
18+
@attribute SFH {-1,1,0}
19+
@attribute Submitting_to_email {-1,1}
20+
@attribute Abnormal_URL {-1,1}
21+
@attribute Redirect {0,1}
22+
@attribute on_mouseover {1,-1}
23+
@attribute RightClick {1,-1}
24+
@attribute popUpWidnow {1,-1}
25+
@attribute Iframe {1,-1}
26+
@attribute age_of_domain {-1,1}
27+
@attribute DNSRecord {-1,1}
28+
@attribute web_traffic {-1,0,1}
29+
@attribute Page_Rank {-1,1}
30+
@attribute Google_Index {1,-1}
31+
@attribute Statistical_report {-1,1}
32+
@attribute Result {-1,1}
33+
34+
@data
35+
IP1,Length2,1,1,1,1,1,1,1,1,1,1,-1,-1,0,-1,1,1,0,1,1,1,1,-1,1,1,1,1,1,-1
36+
`;
37+
38+
//1 having_IP_Address
39+
input=window.location.hostname.match(/[a-z]/i)?input.replace("IP1","-1"):input.replace("IP1",1);
40+
//2 URL_Length
41+
URL_Length=location.hostname.length>75?input.replace("Length2","1"):location.hostname.length>=54?input.replace("Length2","0"):input.replace("Length2","-1");
142
function isShortUrl(url){
243
var query = url.split('?');
344
var fragment = url.split('/');
@@ -170,13 +211,6 @@ function gettagurls()
170211
return p/c<0.17?-1:p/c<0.81?0:1;
171212
}
172213

173-
//1
174-
having_IP_Address=window.location.hostname.match(/[a-z]/i)?-1:1;
175-
console.log(having_IP_Address);
176-
//2
177-
URL_Length=location.hostname.length>75?1:location.hostname.length>=54?0:-1;
178-
179-
console.log(URL_Length);
180214
//3
181215
Shortining_Service=isShortUrl(window.location.href)?1:-1;
182216
console.log(Shortining_Service);

0 commit comments

Comments
 (0)