(In Java With Comments) (Project: Phishing Scanner) Phishing is a form of identi
ID: 3720510 • Letter: #
Question
(In Java With Comments)
(Project: Phishing Scanner) Phishing is a form of identity theft in which, in an e-mail, a sender posing as a trustworthy source attempts to acquire private information, such as your user names, passwords, credit-card numbers and social security number. Phishing e-mails claiming to be from popular banks, credit-card companies, auction sites, social networks and online payment services may look quite legitimate. These fraudulent messages often provide links to spoofed (fake) websites where you’re asked to enter sensitive information.
Visit http://www.snopes.com and other websites to find lists of the top phishing scams. Also check out the Anti-Phishing Working Group (http://www.antiphishing.org/), and the FBI’s Cyber Investigations website (http://www.fbi.gov/about-us/investigate/cyber/cyber), where you’ll find information about the latest scams and how to protect yourself.
Create a list of 30 words, phrases and company names commonly found in phishing messages. Assign a point value to each based on your estimate of its likeliness to be in a phishing message (e.g., one point if it’s somewhat likely, two points if moderately likely, or three points if highly likely). Write a program that scans a file of text for these terms and phrases. For each occurrence of a keyword or phrase within the text file, add the assigned point value to the total points for that word or phrase. For each keyword or phrase found, output one line with the word or phrase, the number of occurrences and the point total. Then show the point total for the entire message. Does your program assign a high point total to some actual phishing e-mails you’ve received? Does it assign a high point total to some legitimate e-mails you’ve received?
Explanation / Answer
So first we need to collect phishing words from some trusted source. I have collected some, and I have put them in a CSV file named word_list.csv and the contents of the file are given below.
FREE,2
attention,1
urgently,1
STOP,2
amazing,1
act,2
earn,2
act now,2
as seen on TV,3
be your own boss,3
call now,3
free cash,3
double your income,3
immediate payment,2
free access,3
free gift,1
check this out,2
free offer,1
financial freedom,1
Viagra,3
open now,2
don’t delete,2
this is not spam,2
$$$,3
lower your mortgage rate,2
lowest insurance rates,1
lose weight,3
promised you,2
your email won,3
job offer,1
And finally comes the C-Code that will try to provide spam score of a text user enters through his keyboard. You can anytime change the Input source to meet your needs!
#include<stdio.h>
#include<string.h>
typedef struct spamWord {
char text[30];
int weight;
} SPAMWORD;
SPAMWORD words[30];
void init() { //loads spam words from csv file
int i;
FILE *fp = fopen("word_list.csv", "r");
for (i = 0; i < 30; i++) {
fscanf(fp, "%[^,],%d ",words[i].text, &(words[i].weight));
}
}
int getFreq(char* doc, char* subStr) { //counts the frequrency of a word in a text document
int i = 0;
while ((doc = strstr(doc, subStr)) != NULL) {
doc = doc + strlen(subStr);
i++;
}
return i;
}
int main() {
init(); //do not forget to initialize
char doc[1024];
int i, score;
score = 0;
printf("Enter text to get spam score: ");
scanf("%[^ ]", doc);
for (i = 0; i < 30; i++) {
score = score + (getFreq(doc, words[i].text) * words[i].weight);
}
printf("Your spam score is: %d ", score);
}
As per as my findings it does assign a high point total to some legitimate e-mails I’ve received
If you have any query, please get back to me and get them solved. Am here to help you with all your queries!
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.