Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
U
URL_clustering
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Svoboda, Jan
URL_clustering
Commits
f28896c7
Commit
f28896c7
authored
1 year ago
by
Svoboda, Jan
Browse files
Options
Downloads
Patches
Plain Diff
Update file README.md
parent
10cfdf51
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
README.md
+7
-38
7 additions, 38 deletions
README.md
with
7 additions
and
38 deletions
README.md
+
7
−
38
View file @
f28896c7
...
...
@@ -4,45 +4,14 @@
Part 1:
Basic exploration work on URLs from https://www.kaggle.com/datasets/sid321axn/malicious-urls-dataset
Data description: 6
,2 mil
URLs - 4 classes -> benign,malware,phishing,defacement
Data description: 6
00k
URLs - 4 classes -> benign,malware,phishing,defacement
Goal: Explore malware classification of URL data using Clustering methods
Find "good" clustering for this purpose and explore how to evaluate what is "good" in this case
Try to approach more sophisticated data (XSS,SQLi,DGA etc.) and discriminate between types of malicious URLs
Notebooks:
1 - Module "prototype.ipynb"
- Taking random sample of data
- Calculating basic features (either hand chosen, vectorized data or mix)
- Clustering
- Visualising results to 2D and plotting
- Computing metrics from the clustered data and visualising over range of parameters (k)
Using sklearn classes for
K-Means (minibatch,k-means++),
vectorization of URLs (tf-idf transformer with count vectorizer)
PCA to 2D for visualisation (TruncatedSVD for sparse matrices)
Basic metrics (Rand index, Silhouette score, Davies-Bouldin index, Homogeneity)
2 - Module "with_vec.ipynb"
- Based on "prototype.ipynb"
- PLUS:
- different ways to split dat
- strip "https://" etc.
- Leave whole
- Separate hostnames from path
- Way to SAVE the clusters to .json with important constants to re-initialize vectorizer and PCA
- Way to visually read samples from the different clusters (print 10 URLs at the time)
- Way to manually annotate clusters and then save the descriptions with the data for later exploration and clustering
- Elbow method for visually finding most advantageous k (best benefit for clustering with the least computation dificulty gain)
3 - Module "classifier.ipyb"
- Loads the .json
- Takes the new URLs as input
- Calculates the features for the new data based on saved settings
- Finds the closest cluster center (predicts cluster for new data)
- Shows the descriptions saved for the assigned clusters
4 - Module for testing the classification
- Work In Progress
TODO: Refactor code into classes to streamline work and separate functionality
Building "framework" for evaluation classification results
Experiment to find "good" classification
Try to approach more sophisticated data (XSS,SQLi,DGA etc.) and discriminate between types of malicious URLs.
python 3.8.10
jupyter 1.0.0
scikit-learn 1.2.2
numpy 1.23.2
matplotlib 3.7.4
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment