Content-Length: 300029 | pFad | http://github.com/akamai/luda/commit/5fe686dc22ab3bc1f2545788e49a113eb35d6372

A5 with regex report · akamai/luda@5fe686d · GitHub
Skip to content

Commit

Permalink
with regex report
Browse files Browse the repository at this point in the history
  • Loading branch information
JordanGarzon committed Aug 3, 2021
1 parent 4256be6 commit 5fe686d
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 10 deletions.
29 changes: 19 additions & 10 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -148,29 +148,30 @@ We just turned off all step exept the regex generation steps that we want to run

Now again (from the docker)

/!\ This step can take few hours ( ~2h on a 48CPU machine, 378GB RAM without using all its ressources)

```bash
python main.py
python main.py
```

Check the log on luda_output/logs/luda.log at the end you can see a small report
Check the log on luda_output/logs/luda.log at the end you can see a small report in the log ( where you see how each signature evolved at each round)

```txt
N paths: 64
N cluster : 2
N paths: 44
N benign in final test: 9486
Benign number for retraining : 30
N round: 10
Cluster sig paths:
cluster_27_0 : (\.*+[^_])++ ---> [^bin]++[^\.]++\.bin
cluster_12_15 : [^php]*+php ---> /\w\w++/gate\.php ---> /\w\w\w\w\d/gate\.php
cluster_8_16 : ([^_]\w++)++ ---> [^php]++php ---> /\w++/PHP/\w++\.php
cluster_17_4 : ([^_]\w++)++ ---> [^\.]*+\.php ---> /\w++(?:/kbpanel)?+/post\.php ---> [^php]*+\w\w\w/?+\w++/post\.php
cluster_27_0 : (\.*+[^_])++ ---> [^bin]*+[^\.]*+\.bin
cluster_17_4 : ([^_]\w++)++ ---> [^\.]++\.php ---> (\w*+/)++post\.php ---> [^php]++\w\w\w/?+\w++/post\.php
After final testing:
Cluster with 0 FP: {'cluster_8_16', 'cluster_17_4', 'cluster_27_0', 'cluster_12_15'}
Number of paths covered with 0 FP: 64
Cluster with 0 FP: {'cluster_17_4', 'cluster_27_0'}
Number of paths covered with 0 FP: 44
Percentage of paths covered with 0 FP: 100.0 %
### FP Report ###
Expand All @@ -181,9 +182,17 @@ cluster_17_4 : ([^_]\w++)++ ---> [^\.]*+\.php ---> /\w++(?:/kbpanel)?+/post\.php
Without:
['cluster_12_15', 'cluster_8_16', 'cluster_27_0', 'cluster_17_4']
['cluster_27_0', 'cluster_17_4']
```

You also get a report showing basic info on the run. It's a csv stored in the "regex_folder" ( following the above config, it is luda_output/myregexes/report_myregexes.csv)

|id|name |regex_js |regex_java |malicious|benign|round|example_malicious |results_file |input_file |
|------|------------|----------------------------------------------------|-------------------------------|---------|------|-----|---------------------------|-------------------------|-----------------------|
|0 |cluster_17_4|(?=([^php]+))\1\w\w\w(?=(/?))\2(?=(\w+))\3/post\.php|[^php]++\w\w\w/?+\w++/post\.php|17 |61 |3 |/mupanel/post.php. |results_cluster_17_4.json|input_cluster_17_4.json|
|1 |cluster_27_0|(?=([^bin]*))\1(?=([^\.]*))\2\.bin |[^bin]*+[^\.]*+\.bin |27 |30 |1 |/neat/serverphp/config.bin.|results_cluster_27_0.json|input_cluster_27_0.json|


Congrats on your first LUDA run. You now have 2 (Java) regex that can be used malicious urls belonging to the clusters you found :)

On the next part, we will dive into LUDA architecture to understand each of its components, understand what else you can do and possibly make
Expand Down
1 change: 1 addition & 0 deletions src/regex/regex.py
Original file line number Diff line number Diff line change
Expand Up @@ -351,3 +351,4 @@ def remove_nan_value_from_list(_list):
continue
result.append(el)
return result

1 change: 1 addition & 0 deletions src/use_case/use_case_regex_generation.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ def run(self, main_file, features_folder, cluster_list, benign_for_retrain=20,
self.regex_object.run_with_benign_check(_cluster_dict=cluster_dict, benign_list=str_to_not_match,
benign_for_retrain=benign_for_retrain,
take_existing_result=take_existing_result, round_max=round_max)
self.regex_object.create_result_report()

@staticmethod
def load_df(main_file, features_folder):
Expand Down

0 comments on commit 5fe686d

Please sign in to comment.








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/akamai/luda/commit/5fe686dc22ab3bc1f2545788e49a113eb35d6372

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy