Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
ESA Assignment III
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
Velde, P. van der (Peter, Student M-CS)
ESA Assignment III
Commits
04eacb98
Commit
04eacb98
authored
2 years ago
by
Peter van der Velde
Browse files
Options
Downloads
Patches
Plain Diff
Added task 1a
parent
6885bccb
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
README.md
+1
-1
1 addition, 1 deletion
README.md
t1a.sh
+43
-0
43 additions, 0 deletions
t1a.sh
week5-assignment-spki.py
+1
-0
1 addition, 0 deletions
week5-assignment-spki.py
with
45 additions
and
1 deletion
README.md
+
1
−
1
View file @
04eacb98
...
...
@@ -53,7 +53,7 @@ A few programs are needed before the installation and use of the python scripts.
```
2.
Install all required libraries
```
sh
python3
-m
pi
3
p
install
--user
-r
requirements.txt
python3
-m
pip
./
install
--user
-r
requirements.txt
```
### Run Program
For more information run the program with the help flag (-h or --help).
...
...
This diff is collapsed.
Click to expand it.
t1a.sh
0 → 100644
+
43
−
0
View file @
04eacb98
#!/bin/bash
if
[
$#
!=
2
]
then
echo
"./t1a.sh avrofile1 avrofile2"
fi
# Gather the number of total domains per TLD
echo
Gather the number of total domains per TLD
avrocat
"
$1
"
| jq
-r
'.query_name'
| rev |
cut
-d
'.'
-f2
| rev |
sort
|
uniq
-c
|
awk
'$1 >= 100 {print $1,$2}'
>
"
${
1
##*/
}
"
_TLD_total_domains
avrocat
"
$2
"
| jq
-r
'.query_name'
| rev |
cut
-d
'.'
-f2
| rev |
sort
|
uniq
-c
|
awk
'$1 >= 100 {print $1,$2}'
>
"
${
2
##*/
}
"
_TLD_total_domains
cat
"
${
1
##*/
}
"
_TLD_total_domains
"
${
1
##*/
}
"
_TLD_total_domains
>
TLD_total_domains
# Get all signed domains
echo
Get all signed domains
avrocat
"
$1
"
| jq
-r
'select(.rrsig_signature != null) | .query_name'
|
sort
|
uniq
>
"
${
1
##*/
}
"
_signed_domains
avrocat
"
$2
"
| jq
-r
'select(.rrsig_signature != null) | .query_name'
|
sort
|
uniq
>
"
${
2
##*/
}
"
_signed_domains
echo
Get all domains
avrocat
"
$1
"
| jq
-r
'.query_name'
|
sort
|
uniq
-c
|
awk
'{print $2,$1}'
>
"
${
1
##*/
}
"
_all_domains
avrocat
"
$2
"
| jq
-r
'.query_name'
|
sort
|
uniq
-c
|
awk
'{print $2,$1}'
>
"
${
2
##*/
}
"
_all_domains
echo join
all domains with the signed ones
join
"
${
1
##*/
}
"
_all_domains
"
${
1
##*/
}
"
_signed_domains
>
"
${
1
##*/
}
"
_all_signed_domains
join
"
${
2
##*/
}
"
_all_domains
"
${
2
##*/
}
"
_signed_domains
>
"
${
2
##*/
}
"
_all_signed_domains
cat
"
${
1
##*/
}
"
_all_signed_domains
"
${
2
##*/
}
"
_all_signed_domains
>
all_signed_domains
echo
"reduce to only the TLD"
rm
TLD_total_signed_domains_u
touch
TLD_total_signed_domains_u
while
read
-r
key value
;
do
echo
"
$(
echo
$key
| rev |
cut
-d
'.'
-f2
| rev
)
$value
"
>>
TLD_total_signed_domains_u
done
< all_signed_domains
awk
'{ seen[$1] += $2 } END { for (i in seen) print i, seen[i] }'
TLD_total_signed_domains_u |
sort
>
TLD_total_domains_signed
rm
TLD_total_signed_domains_u
join
TLD_total_domains TLD_total_domains_signed |
awk
'OFS="," {print $1,($3/$2*100) }'
|
sort
-r
-t
','
-k
2
>
TLD_signed_perc.csv
This diff is collapsed.
Click to expand it.
week5-assignment-spki.py
+
1
−
0
View file @
04eacb98
...
...
@@ -16,3 +16,4 @@ cert.decode(der)
tbsCertificate
=
DerSequence
()
tbsCertificate
.
decode
(
cert
[
0
])
subjectPublicKeyInfo
=
tbsCertificate
[
6
]
cat
t
.
txt
|
rev
|
cut
-
d
'
.
'
-
f2
|
rev
|
sort
|
uniq
-
c
|
awk
'
$1 >= 100 {print$2}
'
|
xargs
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