Skip to content

Commit

Permalink
feat: add OSINT and Pentest tags
Browse files Browse the repository at this point in the history
  • Loading branch information
GZTimeWalker committed Aug 31, 2024
1 parent 3a21a9e commit 1d991fe
Show file tree
Hide file tree
Showing 8 changed files with 82 additions and 40 deletions.
2 changes: 2 additions & 0 deletions src/GZCTF.sln.DotSettings
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@
<s:Boolean x:Key="/Default/UserDictionary/Words/=Leet/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=localizer/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=nowtime/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=osint/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=Participations/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=pentest/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=Prelaunch/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=remoteip/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=ulid/@EntryIndexedValue">True</s:Boolean>
Expand Down
2 changes: 2 additions & 0 deletions src/GZCTF/ClientApp/src/Api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -633,6 +633,8 @@ export enum ChallengeTag {
Mobile = "Mobile",
PPC = "PPC",
AI = "AI",
Pentest = "Pentest",
OSINT = "OSINT",
}

/** 列表响应 */
Expand Down
22 changes: 12 additions & 10 deletions src/GZCTF/ClientApp/src/locales/en_US/challenge.json
Original file line number Diff line number Diff line change
Expand Up @@ -143,17 +143,19 @@
}
},
"tag": {
"ai": "AI",
"ai": "AI security",
"blockchain": "Blockchain",
"crypto": "Crypto",
"forensics": "Forensics",
"hardware": "Hardware",
"misc": "Misc",
"mobile": "Mobile",
"ppc": "PPC",
"pwn": "Pwn",
"reverse": "Reverse",
"web": "Web"
"crypto": "Cryptography",
"forensics": "Digital forensics",
"hardware": "Hardware security",
"misc": "Miscellaneous",
"mobile": "Mobile security",
"ppc": "Programming",
"pwn": "Binary exploitation",
"reverse": "Reverse engineering",
"web": "Web security",
"osint": "Open-source intel",
"pentest": "Penetration testing"
},
"type": {
"dynamic_attachment": {
Expand Down
12 changes: 7 additions & 5 deletions src/GZCTF/ClientApp/src/locales/ja_JP/challenge.json
Original file line number Diff line number Diff line change
Expand Up @@ -143,17 +143,19 @@
}
},
"tag": {
"ai": "AI",
"ai": "AIセキュリティ",
"blockchain": "ブロックチェーン",
"crypto": "暗号学",
"forensics": "フォレンジック",
"hardware": "ハードウェア",
"forensics": "デジタル・フォレンジック",
"hardware": "ハードウェアセキュリティ",
"misc": "その他",
"mobile": "モバイルセキュリティ",
"ppc": "プログラミング",
"pwn": "Pwn",
"pwn": "エクスプロイト",
"reverse": "リバースエンジニアリング",
"web": "Web"
"web": "ウェブセキュリティ",
"osint": "オープンソース情報",
"pentest": "ペネトレーションテスト"
},
"type": {
"dynamic_attachment": {
Expand Down
18 changes: 10 additions & 8 deletions src/GZCTF/ClientApp/src/locales/zh_CN/challenge.json
Original file line number Diff line number Diff line change
Expand Up @@ -143,17 +143,19 @@
}
},
"tag": {
"ai": "AI",
"ai": "人工智能安全",
"blockchain": "区块链",
"crypto": "密码学",
"forensics": "取证",
"hardware": "硬件",
"misc": "杂项",
"forensics": "数字取证",
"hardware": "硬件安全",
"misc": "安全杂项",
"mobile": "移动安全",
"ppc": "编程",
"pwn": "Pwn",
"reverse": "逆向",
"web": "Web"
"ppc": "专业编程",
"pwn": "二进制漏洞利用",
"reverse": "逆向工程",
"web": "网络安全",
"osint": "开源情报",
"pentest": "渗透测试"
},
"type": {
"dynamic_attachment": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ const GameChallengeEdit: FC = () => {
placeholder={t('admin.content.show_all')}
clearable
searchable
w="16rem"
value={category}
nothingFoundMessage={t('admin.content.nothing_found')}
onChange={(value) => setCategory(value as ChallengeTag | null)}
Expand Down
59 changes: 43 additions & 16 deletions src/GZCTF/ClientApp/src/utils/Shared.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,12 @@ import {
mdiHexagonSlice2,
mdiHexagonSlice4,
mdiHexagonSlice6,
mdiLanPending,
mdiLightbulbOnOutline,
mdiMatrix,
mdiPlus,
mdiRobotLoveOutline,
mdiSearchWeb,
mdiWeb,
} from '@mdi/js'
import { Icon } from '@mdi/react'
Expand Down Expand Up @@ -104,6 +106,8 @@ export const ChallengeTypeItem: SelectProps['renderOption'] = ({ option }) => {
export const useChallengeTagLabelMap = () => {
const { t } = useTranslation()
const theme = useMantineTheme()
const { colorScheme } = useMantineColorScheme()
const revert = colorScheme === 'dark' ? 'light' : 'dark'

return new Map<ChallengeTag, ChallengeTagItemProps>([
[
Expand All @@ -122,8 +126,8 @@ export const useChallengeTagLabelMap = () => {
desrc: t('challenge.tag.crypto'),
icon: mdiMatrix,
name: ChallengeTag.Crypto,
color: 'indigo',
colors: theme.colors['indigo'],
color: 'violet',
colors: theme.colors['violet'],
},
],
[
Expand Down Expand Up @@ -162,8 +166,8 @@ export const useChallengeTagLabelMap = () => {
desrc: t('challenge.tag.blockchain'),
icon: mdiEthereum,
name: ChallengeTag.Blockchain,
color: 'lime',
colors: theme.colors['lime'],
color: 'green',
colors: theme.colors['green'],
},
],
[
Expand All @@ -172,8 +176,8 @@ export const useChallengeTagLabelMap = () => {
desrc: t('challenge.tag.forensics'),
icon: mdiFingerprint,
name: ChallengeTag.Forensics,
color: 'cyan',
colors: theme.colors['cyan'],
color: 'indigo',
colors: theme.colors['indigo'],
},
],
[
Expand All @@ -182,8 +186,8 @@ export const useChallengeTagLabelMap = () => {
desrc: t('challenge.tag.hardware'),
icon: mdiChip,
name: ChallengeTag.Hardware,
color: 'violet',
colors: theme.colors['violet'],
color: 'grape',
colors: theme.colors['grape'],
},
],
[
Expand All @@ -202,8 +206,8 @@ export const useChallengeTagLabelMap = () => {
desrc: t('challenge.tag.ppc'),
icon: mdiConsole,
name: ChallengeTag.PPC,
color: 'orange',
colors: theme.colors['orange'],
color: revert,
colors: theme.colors[revert],
},
],
[
Expand All @@ -212,8 +216,28 @@ export const useChallengeTagLabelMap = () => {
desrc: t('challenge.tag.ai'),
icon: mdiRobotLoveOutline,
name: ChallengeTag.AI,
color: 'green',
colors: theme.colors['green'],
color: 'lime',
colors: theme.colors['lime'],
},
],
[
ChallengeTag.OSINT,
{
desrc: t('challenge.tag.osint'),
icon: mdiSearchWeb,
name: ChallengeTag.OSINT,
color: 'orange',
colors: theme.colors['orange'],
},
],
[
ChallengeTag.Pentest,
{
desrc: t('challenge.tag.pentest'),
icon: mdiLanPending,
name: ChallengeTag.Pentest,
color: 'cyan',
colors: theme.colors['cyan'],
},
],
])
Expand All @@ -230,14 +254,17 @@ export interface ChallengeTagItemProps {
type SelectChallengeTagItemProps = ChallengeTagItemProps & ComboboxItem

export const ChallengeTagItem: SelectProps['renderOption'] = ({ option }) => {
const { colors, icon, name } = option as SelectChallengeTagItemProps
const { colors, icon, name, desrc } = option as SelectChallengeTagItemProps

return (
<Group wrap="nowrap">
<Icon color={colors[4]} path={icon} size={1.2} />
<Text size="sm" fw="bold">
{name}
</Text>
<Stack gap={0}>
<Text size="sm" fw="bold">
{name}
</Text>
<Text size="xs">{desrc}</Text>
</Stack>
</Group>
)
}
Expand Down
6 changes: 5 additions & 1 deletion src/GZCTF/Utils/Enums.cs
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,11 @@ public enum ChallengeTag : byte
Hardware = 7,
Mobile = 8,
PPC = 9,
AI = 10
// ReSharper disable once InconsistentNaming
AI = 10,
Pentest = 11,
// ReSharper disable once InconsistentNaming
OSINT = 12,
}

/// <summary>
Expand Down

0 comments on commit 1d991fe

Please sign in to comment.