Slijede razlike između dviju inačica stranice.
Starije izmjene na obje strane Starija izmjena Novija izmjena | Starija izmjena | ||
racfor_wiki:email:automated_spear_phishing_using_machine_learning [2020/01/07 18:41] divankovic [Conclusion] |
racfor_wiki:email:automated_spear_phishing_using_machine_learning [2024/12/05 12:24] (trenutno) |
||
---|---|---|---|
Redak 3: | Redak 3: | ||
===== Abstract ===== | ===== Abstract ===== | ||
- | –DO THIS LAST | + | Phishing and spear phishing are one of the most effective ways to target an organization, |
- | How do you write an abstract? Identify your purpose. You're writing about a correlation between lack of lunches | + | While machine learning in security has mostly been used in defensive manner with applications like malware and intrusion detection, it is necessary to also explore the use of machine learning for malicious attacks, since the technology (ML) is becoming widely publicly available and easy to use. |
+ | |||
+ | The purpose | ||
+ | |||
+ | Social media offers more benefits for this type of approach compared to email because of their strong incentive to disclose personal data, colloquial and short messages, bot-friendly API and the use of shortened URLs. | ||
+ | |||
+ | SNAP_R operates on twitter and uses the target' | ||
+ | |||
+ | A single running instance of the model outperformed a human in spear phishing over a 2-hour period, managing to get 275 victims out of 819 targeted to click the link (33.6% success), while the human managed to get 49 victims out of 129 targeted to click the link (38% success). The achieved results are comparable to large scale manual spear phishing campaigns, and the number of sent phishing tweets is arbitrarily scalable with the number of running instances of the tool, keeping in mind Twitter' | ||
+ | |||
+ | The work is meant to foster greater awareness and understanding of spear phishing, specially on social media, and to raise awareness on the threats | ||
- | Keywords: **abstract**; | ||
===== Introduction ===== | ===== Introduction ===== | ||
- | Phishing is a social engineering technique that attempts to obtain sensitive information (such as passwords, credit card details, …) from the target, typically using email spoofing or instant messaging on social media. The target is typically redirected to a fake website which looks like the original website and requires input of sensitive information. Another | + | Phishing is a social engineering technique that attempts to obtain sensitive information (such as passwords, credit card details, …) from the target, typically using email spoofing or instant messaging on social media. The target is typically redirected to a fake website which looks like the original website and requires input of sensitive information. Another |
- | Spear phishing is a targeted phishing attempt (directed at specific individuals or companies) which requires gathering data and profiling phishing targets. By gathering target' | + | Spear phishing is a targeted phishing attempt (directed at specific individuals or companies) which requires gathering data and profiling phishing targets. By gathering target' |
Spear phishing has grown to be the predominant vector used to compromise an organization [3]. | Spear phishing has grown to be the predominant vector used to compromise an organization [3]. | ||
- | Social media sites such as Facebook, Twitter, and LinkedIn, because of their strong incentive to disclose personal data, can provide an adversary with a wealth of information on a target’s work interests and expertise. Compared to email, it can be argued that social media' | + | Social media sites such as Facebook, Twitter, and LinkedIn, because of their strong incentive to disclose personal data, can provide an adversary with a wealth of information on the target’s work interests and expertise. Compared to email, it can be argued that social media' |
- | These natural weaknesses at scale are just waiting to be exploitet. How ? Well that's when machine learning can come into play. | + | These natural weaknesses at scale are just waiting to be exploited. How? Well that's when machine learning can come into play. |
- | Machine Learning (ML) and Artificial Intelligence (AI) have become essential to any effective cybersecurity and defense | + | Machine Learning (ML) and Artificial Intelligence (AI) have become essential to many effective cybersecurity and defense |
- | While machine learning has mostly been used in a defensive manner in the security community, machine learning can also be utilized as a weapon to perform malicious attacks by weaponizing social media. | + | While machine learning has mostly been used in a defensive manner in the security community, machine learning can also be utilized as a weapon to perform malicious attacks. In this case it's done by weaponizing social media. |
- | Since inspecting and profiling targets is a critical and very time consuming measure which has to be taken in order to create a beliveable | + | Since inspecting and profiling targets is a critical and very time consuming measure which has to be taken in order to create a believable |
Natural language processing is a subfield of AI that deals with raw unstructured text as a data source. It is particularly suitable for phishing because existing textual data can be used to identify the topics that the target is interested in and generate sentences which might be interesting to the target, and to which the target might respond. | Natural language processing is a subfield of AI that deals with raw unstructured text as a data source. It is particularly suitable for phishing because existing textual data can be used to identify the topics that the target is interested in and generate sentences which might be interesting to the target, and to which the target might respond. | ||
- | In this seminar it will be discussed how threat actors can enhance the effectiveness of phishing attacks by using ML as a malicious tool for profiling the targets and generating phishing messages | + | In this seminar it will be discussed how threat actors can enhance the effectiveness of phishing attacks by using ML as a malicious tool for profiling the targets and generating phishing messages, describing the SNAP_R tool as an example. |
===== SNAP_R tool overview ===== | ===== SNAP_R tool overview ===== | ||
Redak 37: | Redak 46: | ||
* bot-friendly API | * bot-friendly API | ||
* colloquial syntax | * colloquial syntax | ||
- | * use of shortened | + | * use of shortened |
An example of a Twitter post : | An example of a Twitter post : | ||
Redak 54: | Redak 63: | ||
The first step is determining whether a user is a valid target. High value targets are identified based on their level of social engagement (number of followers, retweets, …), posted personal information (job, popularity, …), account details and click-rates of IP-tracked links. | The first step is determining whether a user is a valid target. High value targets are identified based on their level of social engagement (number of followers, retweets, …), posted personal information (job, popularity, …), account details and click-rates of IP-tracked links. | ||
- | |||
- | SNAP_R uses a recurrent neural network or a Markov model trained on spear phishing pen-testing data and tweets, which will be described in more detail in the model training section. The ML model is used to generate fishing posts which contain an embedded shortened phishing link and an @mention, targeting specific users. | ||
The second step is timeline scraping of the target to a specified depth, obtaining information which will be used to generate a phishing post. (gen_markov_tweet(), | The second step is timeline scraping of the target to a specified depth, obtaining information which will be used to generate a phishing post. (gen_markov_tweet(), | ||
- | The profiling of the users is done by extracting topics from the target' | + | SNAP_R uses a recurrent neural network or a Markov model trained on spear phishing pen-testing data and tweets, which will be described in more detail in the model training section. |
+ | |||
+ | The profiling of the users is done by extracting topics from the target' | ||
The most frequent words (excluding the stopwords - words like the, in, at, that, which, …) were the most effective way for seeding [6]. The phishing tweet is sent within the hour that the target is most active (schedule_tweet_and_sleep()) or immediately (post_tweet_and_sleep()). The hour that the target is the most active at is determined by simply counting the total number of tweets in each hour. | The most frequent words (excluding the stopwords - words like the, in, at, that, which, …) were the most effective way for seeding [6]. The phishing tweet is sent within the hour that the target is most active (schedule_tweet_and_sleep()) or immediately (post_tweet_and_sleep()). The hour that the target is the most active at is determined by simply counting the total number of tweets in each hour. | ||
Redak 69: | Redak 78: | ||
{{: | {{: | ||
- | Additional things that are kept in mind are obeying the rate limit of Tweeter and posting non-phishing posts in order to build a beliveable | + | Additional things that should be kept in mind are obeying the rate limit of Tweeter and posting non-phishing posts in order to build a believable |
- | The tool and the techiques | + | The tool and the techniques |
===== Automated target discovery ===== | ===== Automated target discovery ===== | ||
- | As mentioned high value targets are selected based on their number of followers, tweets, retweets, posted personal information, | + | As mentioned, high value targets are selected based on their number of followers, tweets, retweets, posted personal information, |
- | From a large number of users high value targets can be selected using rule based methods and thresholds. For example | + | From a large number of users high value targets can be selected using rule based methods and thresholds. For example |
- | Another approach, that the authors explored [6] is using k-means++ [17] for clustering to cluster similar targets together. The number of clusters used in the algorithm is selected with grid search using the silhoutte | + | Another approach, that the authors explored [6] is using k-means++ [17] for clustering to cluster similar targets together. The number of clusters used in the algorithm is selected with grid search using the silhouette |
===== URL shortening ===== | ===== URL shortening ===== | ||
- | Other than keeping tweeter posts short, shortening the link also obfuscates the malicious link which the target might recongize, since there is a blacklist of known malicious links. | + | Other than keeping tweeter posts short, shortening the link also obfuscates the malicious link which the target might recognize, since there is a blacklist of known malicious links. |
- | Not all shorteners allow shortening of malicious links, so [6] had to try out a number of them to find the one that is suitable. There are multiple options suitable, but goo.gl is used to shorten the malicious link, since it provides additional features. | + | Not all shorteners allow shortening of malicious links, so [6] had to try out a number of them to find the one that is suitable. There are multiple options suitable, but goo.gl is used to shorten the malicious link since it provides additional features. |
- | Some of the extra features are the target' | + | Some of the extra features are the target' |
No real malicious links were used during testing, the authors just measured the click-through rate. | No real malicious links were used during testing, the authors just measured the click-through rate. | ||
Redak 95: | Redak 104: | ||
==== Markov model ==== | ==== Markov model ==== | ||
- | Markov model is a stohastic | + | Markov model is a stochastic |
For example if the training data has many instances of the phrase 'the cat in the hat' then if the model generates the word ' | For example if the training data has many instances of the phrase 'the cat in the hat' then if the model generates the word ' | ||
Redak 103: | Redak 112: | ||
{{: | {{: | ||
- | The next word is selecting using a ' | + | The next word is selecting using a ' |
Markov models are also agnostic to language, since they only use content on the target' | Markov models are also agnostic to language, since they only use content on the target' | ||
- | It's also possible to use a markov | + | It's also possible to use a Markov |
- | This is implemented using python' | + | Markov model of 2nd order was used here, and was implemented using python' |
==== LSTM ==== | ==== LSTM ==== | ||
- | LSTM (Long-short term memory) is a type of a recurrent neural network (RNN) which has feedback connections between units and is suitable for sequential data (like text senteces) and capable of learning long-term dependencies. This model has been very successfully applied to a variety of problems ranging from speech recognition and language modeling to machine translation, | + | LSTM (Long-short term memory) is a type of a recurrent neural network (RNN) which has feedback connections between units and is suitable for sequential data (like text sentences) and capable of learning long-term dependencies. This model has been very successfully applied to a variety of problems ranging from speech recognition and language modeling to machine translation, |
- | LSTM is a repeating chain-like structure composed of LSTM units. An LSTM unit is composed of a cell and 3 gates - input, output and forget gate. The cell is used to remember values over time and the gates are used to control the information flow into and out of the cell. | + | LSTM is a repeating chain-like structure composed of LSTM units. An LSTM unit is composed of a cell and 3 gates - input, output and the forget gate. The cell is used to remember values over time and the gates are used to control the information flow into and out of the cell. |
- | The forget gate (lower left) is used to remove information from the cell state (top horizontal line). The input gate (middle) is used to update the cell state. The output gate (right) is used to filter the cell state and produce an output. Each of these gates has a matrix of weights (2 for input gate) which are learned using backpropagation since all functions used are differentiable. The loss used in optimization is (categorical) cross entropy loss. More details about how an LSTM works can be found in [12]. | + | The forget gate (lower left in the picture) is used to remove information from the cell state (top horizontal line). The input gate (middle |
LSTM structure : | LSTM structure : | ||
Redak 123: | Redak 132: | ||
{{: | {{: | ||
- | So how is an LSTM trained to generate words? First, it is neccessary | + | So how is an LSTM trained to generate words? First, it is necessary |
- | An LSTM for text generation can operate on character level and on word level. In the case of character level mode, characters are represented using one hot encoding, and the correct output of the LSTM should be next character in the sequence. This approach could be generalized to using n-grams (n-character parts of the word) [14]. In the case of word level mode, words are also represented using one-hot encoding or word embeddings [13], while the correct output of the LSTM should be the next word in the sequence. | + | An LSTM for text generation can operate on character |
- | The text is generated by seeding the LSTM with a starting word, or a starting sequence of characters, and the output is comprised of ht's which are provided as input to the next cell of the LSTM chain. It is possible to stack multiple layers where ht's are inputs (xt's) to the next layer. | + | The text is generated by seeding the LSTM with a starting word or a starting sequence of characters, and the output is comprised of ht's which are provided as input to the next cell of the LSTM chain. It is possible to stack multiple layers where ht's are inputs (xt's) to the next layer. |
- | The authors train an LSTM (TODO character, n-gram or word level) comprised of 3 layers of about 500 units per layer (equal to the size of the hidden state ht) on Amazon EC2, using a dataset of 2M tweets (from @verified account comprised of tweets from verified users), which took about 5 days to train. | + | The authors train a word level LSTM comprised of 3 layers of about 500 units per layer (equal to the size of the hidden state ht) on Amazon EC2, using a dataset of 2M tweets (from @verified account comprised of tweets from verified users), which took about 5 days to train. |
==== Comparison ==== | ==== Comparison ==== | ||
- | The comparison | + | The comparison |
{{: | {{: | ||
Redak 153: | Redak 162: | ||
The human was permitted to create as many Twitter characters as he/she wanted prior to the competition, | The human was permitted to create as many Twitter characters as he/she wanted prior to the competition, | ||
- | Copying and pasting turned out to be a problem, as Twitter stops users from posting the same message | + | Copying and pasting turned out to be a problem, as Twitter stops users from posting the same message |
- | A single instance of SNAP_R tool was run during 2 hours. SNAP_R sent phishing tweets to 819 usera at 6.85 tweets/ | + | A single instance of SNAP_R tool was run during 2 hours. SNAP_R sent phishing tweets to 819 users at 6.85 tweets/ |
- | The human managed to send 129 phishing tweets (with copying and pasting pre-made tweets) at 1.075 tweets/ | + | The human managed to send 129 phishing tweets (with copying and pasting pre-made tweets) at 1.075 tweets/ |
===== Conclusion ===== | ===== Conclusion ===== | ||
Redak 163: | Redak 172: | ||
This type of work marks an advance in offensive capabilities by combining the advantages of bulk phishing (mostly automated, but low accuracy) and spear phishing (high accuracy, but mostly manual) through machine learning, and also as a way to show that machine learning can also be used as a weapon, other than using it for defense in security. | This type of work marks an advance in offensive capabilities by combining the advantages of bulk phishing (mostly automated, but low accuracy) and spear phishing (high accuracy, but mostly manual) through machine learning, and also as a way to show that machine learning can also be used as a weapon, other than using it for defense in security. | ||
- | The approach lies on the fact that social media is emerging as an easy target for social engineering and phishing attacks. Twitter is used as a platform of interest because of its culture of exposing personal information, | + | The approach lies on the fact that social media is emerging as an easy target for social engineering and phishing attacks. Twitter is used as a platform of interest because of its culture of exposing personal information, |
The complete SNAP_R tool is fully data-driven : the models learn relevant textual characteristics of successful spear phishing on social media using target' | The complete SNAP_R tool is fully data-driven : the models learn relevant textual characteristics of successful spear phishing on social media using target' | ||
- | The tool also serves as a way of fostering greater awareness and understaning of spear phishing | + | As spear phishing |
- | It also was not released in its entirety, just the ' | + | The tool also serves as a way of fostering greater awareness and understanding of spear phishing and social engineering attacks, specially on social media, and aims to raise social media security awareness |
- | + | ||
- | As spearphishing spambots improve, the question is can Twitter (social networks) prevent them from taking over. | + | |
+ | Another main focus is raising awareness on the threats that machine learning tools can also be used in an offensive manner, since machine learning is rapidly becoming more and more automated. So it's necessary to be aware that 'black hats' will have more and more capabilities pretty soon. | ||
===== Sources ===== | ===== Sources ===== | ||
Redak 210: | Redak 218: | ||
[17] [[https:// | [17] [[https:// | ||
- | [18] [[https:// | + | [18] [[https:// |
+ | |||
+ | [19] [[https:// | ||