-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsvg_routes.py
143 lines (120 loc) · 16.5 KB
/
svg_routes.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
def generate_svg(position, crPosition, bbPosition, username, total,bbTotal ,crTotal ,bbReportsCount ,crReportsCount ,crVulnerability ,crBusinessRisk):
svg_template = f'''
<svg width="557" height="156" viewBox="0 0 557 156" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M78.3416 15.2544L81.4882 8.60006L84.6349 15.2544H78.3416ZM75.2134 1.4729L64.2725 26.8876H73.6139L75.4507 22.6196H87.5227L89.3595 26.8876H98.7533L87.8124 1.4729H75.2134Z" fill="white"/>
<path d="M151.371 19.9694H144.489V8.45212H151.371C155.717 8.45212 157.245 11.0315 157.245 14.2124C157.245 17.3932 155.313 19.9694 151.371 19.9694ZM151.84 1.4729H135.142V5.34524V6.81827V23.0699V23.9543V26.8843H151.92C158.213 26.8843 165.715 23.9962 165.715 14.177C165.715 3.3158 158.928 1.4729 151.84 1.4729Z" fill="white"/>
<path d="M184.537 20.3167C179.337 20.3167 176.943 17.6826 176.943 13.9968C176.943 10.028 179.343 7.67689 184.435 7.67689C189.021 7.67689 192.269 9.76423 192.269 13.9968C192.266 18.3709 189.273 20.3167 184.537 20.3167ZM184.234 1C173.284 1 168.023 5.00421 168.023 13.524C168.023 22.642 172.825 27 184.456 27C195.789 27 201.185 23.9124 201.185 14C201.185 3.86888 194.821 1 184.234 1Z" fill="white"/>
<path d="M230.695 9.14057V1.36694H254.882V5.5191V7.6804V26.8877H246.083H245.224H244.712V19.0852H230.695V11.6203H244.712V9.14057H230.695Z" fill="white"/>
<path d="M68.5786 9.91221V1.38599H36.3291V9.91221H47.7785V26.8875H48.0159H48.4103H56.5005H56.895H57.1292V9.91221H68.5786Z" fill="white"/>
<path d="M122.407 14.8781L111.904 1.38599H100.627V9.16283V9.7514V26.8875H108.717H109.506H109.978V13.1413L120.687 26.8875H131.755V19.1106V18.5221V1.38599H122.407V14.8781Z" fill="white"/>
<path d="M213.754 9.14057H227.771V1.36694H203.584V5.5191V7.6804V26.8877H212.383H213.243H213.754V19.0852H227.771V11.6203H213.754V9.14057Z" fill="white"/>
<path d="M19.1311 26.833C25.1841 26.833 29.1906 26.6143 31.7548 25.4854C34.3837 24.3307 35.5055 22.2209 35.5055 18.429C35.5055 16.8562 35.185 15.5987 34.5255 14.5856C34.3036 14.2446 33.8906 13.833 33.7981 13.7558C33.0893 13.1704 32.1308 12.733 30.7809 12.3824C30.7532 12.376 28.0534 11.6138 23.4705 11.2214C23.2301 11.1989 22.962 11.1764 22.6538 11.1474C21.8124 11.0702 20.6628 10.9609 19.0972 10.8515C18.0709 10.7808 17.1772 10.7422 16.3882 10.71C15.6516 10.6778 15.0136 10.6521 14.5051 10.6071C14.3818 10.5974 14.2401 10.5846 14.0798 10.5717C12.4371 10.4431 10.8314 10.2662 10.7944 9.65509C10.7667 9.16622 11.2259 8.69987 12.3909 8.5487C13.5774 8.39432 14.1291 8.33965 15.667 8.33965C17.3898 8.33965 21.7384 8.54549 22.7339 8.73203C23.2301 8.82208 23.5907 8.94752 23.939 9.14692C24.2595 9.33025 24.503 9.58111 24.6262 9.85449H34.5809L34.5686 9.49749C34.2912 2.71446 30.5929 1.05811 17.3744 1.05811C11.3215 1.05811 7.31492 1.27681 4.75073 2.40571C2.12183 3.56033 1 5.67018 1 9.46533C1 11.3854 1.47462 12.8392 2.44852 13.9102C3.14504 14.6113 4.15284 15.1034 5.72463 15.5118C5.74929 15.5183 8.45216 16.1615 13.035 16.5539C13.2692 16.5732 13.5343 16.5989 13.8363 16.6279C14.6777 16.7051 15.8334 16.8144 17.4114 16.9238C18.4377 16.9945 19.3284 17.0331 20.1143 17.0653C20.8539 17.0974 21.4919 17.1232 22.0035 17.1682C22.1237 17.1811 22.2655 17.1907 22.4226 17.2036C24.0777 17.3322 25.708 17.5123 25.7234 18.1749C25.7357 18.6798 25.4707 19.2202 24.1177 19.397C22.9312 19.5546 22.3795 19.6093 20.8416 19.6093C19.0572 19.6093 14.3387 19.4614 13.2446 19.2169C12.7052 19.0979 12.3138 18.9596 12.0118 18.786C11.7005 18.6059 11.4725 18.3646 11.3492 18.0848H1.38833V18.3807H1.40373L1.40682 18.4322C1.69344 25.138 5.66915 26.833 19.1311 26.833Z" fill="white"/>
<text opacity="0.6" fill="white" xml:space="preserve" style="white-space: pre" font-family="Arial" font-size="10" font-weight="bold" letter-spacing="0em"><tspan x="282" y="24.9668">Cyberrange Rating:</tspan></text>
<text x="550" y="30" fill="#88f000" text-anchor="end" font-size="28" font-weight="bold" font-family="Arial">{crPosition}</text>
<rect x="1" y="45" width="274" height="110" rx="10" fill="url(#paint0_linear_65_3439)"/>
<text opacity="0.6" fill="white" xml:space="preserve" style="white-space: pre" font-family="Arial" font-size="10" font-weight="bold" letter-spacing="0em"><tspan x="11" y="65.4668">Username: </tspan></text>
<text x="265" y="66" text-anchor="end" fill="#00ffa6" font-size="13" font-weight="bold" font-family="Arial">
{username}
</text>
<text opacity="0.6" fill="white" xml:space="preserve" style="white-space: pre" font-family="Arial" font-size="10" font-weight="bold" letter-spacing="0em"><tspan x="11" y="84.4668">Total rating:</tspan></text>
<text x="265" y="86" text-anchor="end" fill="#00ffa6" font-size="13" font-weight="bold" font-family="Arial">
{position}
</text>
<text opacity="0.6" fill="white" xml:space="preserve" style="white-space: pre" font-family="Arial" font-size="10" font-weight="bold" letter-spacing="0em"><tspan x="11" y="103.467">BugBounty Rating:</tspan></text>
<text x="265" y="105" text-anchor="end" fill="#00ffa6" font-size="13" font-weight="bold" font-family="Arial">
{bbPosition}
</text>
<text opacity="0.6" fill="white" xml:space="preserve" style="white-space: pre" font-family="Arial" font-size="10" font-weight="bold" letter-spacing="0em"><tspan x="11" y="122.467">Total score:</tspan></text>
<text x="265" y="125" text-anchor="end" fill="#00ffa6" font-size="13" font-weight="bold" font-family="Arial">
{total}
</text>
<text opacity="0.6" fill="white" xml:space="preserve" style="white-space: pre" font-family="Arial" font-size="10" font-weight="bold" letter-spacing="0em"><tspan x="11" y="141.467">BugBounty score:</tspan></text>
<text x="265" y="143" text-anchor="end" fill="#00ffa6" font-size="13" font-weight="bold" font-family="Arial">
{bbTotal}
</text>
<rect x="282" y="45" width="274" height="110" rx="10" fill="url(#paint1_linear_65_3439)"/>
<text opacity="0.6" fill="white" xml:space="preserve" style="white-space: pre" font-family="Arial" font-size="10" font-weight="bold" letter-spacing="0em"><tspan x="292" y="65.4668">Cyberrange score:</tspan></text>
<text x="545" y="66" text-anchor="end" fill="#00ffa6" font-size="13" font-weight="bold" font-family="Arial">
{crTotal}
</text>
<text opacity="0.6" fill="white" xml:space="preserve" style="white-space: pre" font-family="Arial" font-size="10" font-weight="bold" letter-spacing="0em"><tspan x="292" y="84.4668">BugBounty reports:</tspan></text>
<text x="545" y="86" text-anchor="end" fill="#00ffa6" font-size="13" font-weight="bold" font-family="Arial">
{bbReportsCount}
</text>
<text opacity="0.6" fill="white" xml:space="preserve" style="white-space: pre" font-family="Arial" font-size="10" font-weight="bold" letter-spacing="0em"><tspan x="292" y="103.467">Cyberrange reports:</tspan></text>
<text x="545" y="105" text-anchor="end" fill="#00ffa6" font-size="13" font-weight="bold" font-family="Arial">
{crReportsCount}
</text>
<text opacity="0.6" fill="white" xml:space="preserve" style="white-space: pre" font-family="Arial" font-size="10" font-weight="bold" letter-spacing="0em"><tspan x="292" y="122.467">Vulnerability score:</tspan></text>
<text x="545" y="124" text-anchor="end" fill="#00ffa6" font-size="13" font-weight="bold" font-family="Arial">
{crVulnerability}
</text>
<text opacity="0.6" fill="white" xml:space="preserve" style="white-space: pre" font-family="Arial" font-size="10" font-weight="bold" letter-spacing="0em"><tspan x="292" y="141.467">Business Risk score:</tspan></text>
<text x="545" y="143" text-anchor="end" fill="#00ffa6" font-size="13" font-weight="bold" font-family="Monospace">
{crBusinessRisk}
</text>
<defs>
<linearGradient id="paint0_linear_65_3439" x1="27.5504" y1="45" x2="98.4879" y2="228.606" gradientUnits="userSpaceOnUse">
<stop stop-color="#251548"/>
<stop offset="1" stop-color="#160611"/>
</linearGradient>
<linearGradient id="paint1_linear_65_3439" x1="308.55" y1="45" x2="379.488" y2="228.606" gradientUnits="userSpaceOnUse">
<stop stop-color="#251548"/>
<stop offset="1" stop-color="#160611"/>
</linearGradient>
</defs>
</svg>
'''
return svg_template
def generatebb_svg(username, bbPosition,signal,impact,reportsTotal,reportsFinished,reportsInProgress,reportsAccepted,reportsInformational,reportsDuplicate,reportsOutOfScope,reportsRejected,reportsAbuse):
bbsvg_template = f'''
<svg width="557" height="175" viewBox="0 0 557 175" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M78.3416 15.2544L81.4882 8.60006L84.6349 15.2544H78.3416ZM75.2134 1.4729L64.2725 26.8876H73.6139L75.4507 22.6196H87.5227L89.3595 26.8876H98.7533L87.8124 1.4729H75.2134Z" fill="white"/>
<path d="M151.371 19.9694H144.489V8.45212H151.371C155.717 8.45212 157.245 11.0315 157.245 14.2124C157.245 17.3932 155.313 19.9694 151.371 19.9694ZM151.84 1.4729H135.142V5.34524V6.81827V23.0699V23.9543V26.8843H151.92C158.213 26.8843 165.715 23.9962 165.715 14.177C165.715 3.3158 158.928 1.4729 151.84 1.4729Z" fill="white"/>
<path d="M184.537 20.3167C179.337 20.3167 176.943 17.6826 176.943 13.9968C176.943 10.028 179.343 7.67689 184.435 7.67689C189.021 7.67689 192.269 9.76423 192.269 13.9968C192.266 18.3709 189.273 20.3167 184.537 20.3167ZM184.234 1C173.284 1 168.023 5.00421 168.023 13.524C168.023 22.642 172.825 27 184.456 27C195.789 27 201.185 23.9124 201.185 14C201.185 3.86888 194.821 1 184.234 1Z" fill="white"/>
<path d="M230.695 9.14057V1.36694H254.882V5.5191V7.6804V26.8877H246.083H245.224H244.712V19.0852H230.695V11.6203H244.712V9.14057H230.695Z" fill="white"/>
<path d="M68.5786 9.91221V1.38599H36.3291V9.91221H47.7785V26.8875H48.0159H48.4103H56.5005H56.895H57.1292V9.91221H68.5786Z" fill="white"/>
<path d="M122.407 14.8781L111.904 1.38599H100.627V9.16283V9.7514V26.8875H108.717H109.506H109.978V13.1413L120.687 26.8875H131.755V19.1106V18.5221V1.38599H122.407V14.8781Z" fill="white"/>
<path d="M213.754 9.14057H227.771V1.36694H203.584V5.5191V7.6804V26.8877H212.383H213.243H213.754V19.0852H227.771V11.6203H213.754V9.14057Z" fill="white"/>
<path d="M19.1311 26.833C25.1841 26.833 29.1906 26.6143 31.7548 25.4854C34.3837 24.3307 35.5055 22.2209 35.5055 18.429C35.5055 16.8562 35.185 15.5987 34.5255 14.5856C34.3036 14.2446 33.8906 13.833 33.7981 13.7558C33.0893 13.1704 32.1308 12.733 30.7809 12.3824C30.7532 12.376 28.0534 11.6138 23.4705 11.2214C23.2301 11.1989 22.962 11.1764 22.6538 11.1474C21.8124 11.0702 20.6628 10.9609 19.0972 10.8515C18.0709 10.7808 17.1772 10.7422 16.3882 10.71C15.6516 10.6778 15.0136 10.6521 14.5051 10.6071C14.3818 10.5974 14.2401 10.5846 14.0798 10.5717C12.4371 10.4431 10.8314 10.2662 10.7944 9.65509C10.7667 9.16622 11.2259 8.69987 12.3909 8.5487C13.5774 8.39432 14.1291 8.33965 15.667 8.33965C17.3898 8.33965 21.7384 8.54549 22.7339 8.73203C23.2301 8.82208 23.5907 8.94752 23.939 9.14692C24.2595 9.33025 24.503 9.58111 24.6262 9.85449H34.5809L34.5686 9.49749C34.2912 2.71446 30.5929 1.05811 17.3744 1.05811C11.3215 1.05811 7.31492 1.27681 4.75073 2.40571C2.12183 3.56033 1 5.67018 1 9.46533C1 11.3854 1.47462 12.8392 2.44852 13.9102C3.14504 14.6113 4.15284 15.1034 5.72463 15.5118C5.74929 15.5183 8.45216 16.1615 13.035 16.5539C13.2692 16.5732 13.5343 16.5989 13.8363 16.6279C14.6777 16.7051 15.8334 16.8144 17.4114 16.9238C18.4377 16.9945 19.3284 17.0331 20.1143 17.0653C20.8539 17.0974 21.4919 17.1232 22.0035 17.1682C22.1237 17.1811 22.2655 17.1907 22.4226 17.2036C24.0777 17.3322 25.708 17.5123 25.7234 18.1749C25.7357 18.6798 25.4707 19.2202 24.1177 19.397C22.9312 19.5546 22.3795 19.6093 20.8416 19.6093C19.0572 19.6093 14.3387 19.4614 13.2446 19.2169C12.7052 19.0979 12.3138 18.9596 12.0118 18.786C11.7005 18.6059 11.4725 18.3646 11.3492 18.0848H1.38833V18.3807H1.40373L1.40682 18.4322C1.69344 25.138 5.66915 26.833 19.1311 26.833Z" fill="white"/>
<text opacity="0.6" fill="white" xml:space="preserve" style="white-space: pre" font-family="Arial" font-size="10" font-weight="bold" letter-spacing="0em"><tspan x="282" y="24.9668">BugBounty Rating:</tspan></text>
<text x="550" y="30" fill="#88f000" text-anchor="end" font-size="28" font-weight="bold" font-family="Arial">{bbPosition}</text>
<rect x="1" y="45" width="274" height="129" rx="10" fill="url(#paint0_linear_65_3326)"/>
<text opacity="0.6" fill="white" xml:space="preserve" style="white-space: pre" font-family="Arial" font-size="10" font-weight="bold" letter-spacing="0em"><tspan x="11" y="65.4668">Username: </tspan></text>
<text x="265" y="66" text-anchor="end" fill="#00ffa6" font-size="13" font-weight="bold" font-family="Arial">{username}</text>
<text opacity="0.6" fill="white" xml:space="preserve" style="white-space: pre" font-family="Arial" font-size="10" font-weight="bold" letter-spacing="0em"><tspan x="11" y="84.4668">Reports quality:</tspan></text>
<text x="265" y="86" text-anchor="end" fill="#00ffa6" font-size="13" font-weight="bold" font-family="Arial">{signal}</text>
<text opacity="0.6" fill="white" xml:space="preserve" style="white-space: pre" font-family="Arial" font-size="10" font-weight="bold" letter-spacing="0em"><tspan x="11" y="103.467">Reports impact:</tspan></text>
<text x="265" y="104" text-anchor="end" fill="#00ffa6" font-size="13" font-weight="bold" font-family="Arial">{impact}</text>
<text opacity="0.6" fill="white" xml:space="preserve" style="white-space: pre" font-family="Arial" font-size="10" font-weight="bold" letter-spacing="0em"><tspan x="11" y="122.467">Total report count:</tspan></text>
<text x="265" y="123" text-anchor="end" fill="#00ffa6" font-size="13" font-weight="bold" font-family="Arial">{reportsTotal}</text>
<text opacity="0.6" fill="white" xml:space="preserve" style="white-space: pre" font-family="Arial" font-size="10" font-weight="bold" letter-spacing="0em"><tspan x="11" y="141.467">Reports finished:</tspan></text>
<text x="265" y="143" text-anchor="end" fill="#00ffa6" font-size="13" font-weight="bold" font-family="Arial">{reportsFinished}</text>
<text opacity="0.6" fill="white" xml:space="preserve" style="white-space: pre" font-family="Arial" font-size="10" font-weight="bold" letter-spacing="0em"><tspan x="11" y="160.467">Reports in progress:</tspan></text>
<text x="265" y="161" text-anchor="end" fill="#00ffa6" font-size="13" font-weight="bold" font-family="Arial">{reportsInProgress}</text>
<rect x="282" y="45" width="274" height="129" rx="10" fill="url(#paint1_linear_65_3326)"/>
<text opacity="0.6" fill="white" xml:space="preserve" style="white-space: pre" font-family="Arial" font-size="10" font-weight="bold" letter-spacing="0em"><tspan x="292" y="65.4668">Accepted reports:</tspan></text>
<text x="545" y="66" text-anchor="end" fill="#00ffa6" font-size="13" font-weight="bold" font-family="Arial">{reportsAccepted}</text>
<text opacity="0.6" fill="white" xml:space="preserve" style="white-space: pre" font-family="Arial" font-size="10" font-weight="bold" letter-spacing="0em"><tspan x="292" y="84.4668">Informational:</tspan></text>
<text x="545" y="85" text-anchor="end" fill="#00ffa6" font-size="13" font-weight="bold" font-family="Arial">{reportsInformational}</text>
<text opacity="0.6" fill="white" xml:space="preserve" style="white-space: pre" font-family="Arial" font-size="10" font-weight="bold" letter-spacing="0em"><tspan x="292" y="103.467">Duplicate:</tspan></text>
<text x="545" y="104" text-anchor="end" fill="#00ffa6" font-size="13" font-weight="bold" font-family="Arial">{reportsDuplicate}</text>
<text opacity="0.6" fill="white" xml:space="preserve" style="white-space: pre" font-family="Arial" font-size="10" font-weight="bold" letter-spacing="0em"><tspan x="292" y="122.467">Out of scope:</tspan></text>
<text x="545" y="123" text-anchor="end" fill="#00ffa6" font-size="13" font-weight="bold" font-family="Arial">{reportsOutOfScope}</text>
<text opacity="0.6" fill="white" xml:space="preserve" style="white-space: pre" font-family="Arial" font-size="10" font-weight="bold" letter-spacing="0em"><tspan x="292" y="141.467">Rejected:</tspan></text>
<text x="545" y="142" text-anchor="end" fill="#00ffa6" font-size="13" font-weight="bold" font-family="Arial">{reportsRejected}</text>
<text opacity="0.6" fill="white" xml:space="preserve" style="white-space: pre" font-family="Arial" font-size="10" font-weight="bold" letter-spacing="0em"><tspan x="292" y="160.467">Spam:</tspan></text>
<text x="545" y="162" text-anchor="end" fill="#00ffa6" font-size="13" font-weight="bold" font-family="Arial">{reportsAbuse}</text>
<defs>
<linearGradient id="paint0_linear_65_3326" x1="27.5504" y1="45" x2="120.576" y2="250.313" gradientUnits="userSpaceOnUse">
<stop stop-color="#251548"/>
<stop offset="1" stop-color="#160611"/>
</linearGradient>
<linearGradient id="paint1_linear_65_3326" x1="308.55" y1="45" x2="401.576" y2="250.313" gradientUnits="userSpaceOnUse">
<stop stop-color="#251548"/>
<stop offset="1" stop-color="#160611"/>
</linearGradient>
</defs>
</svg>
'''
return bbsvg_template