Skip to content

Commit 91a6038

Browse files
committed
feat(new tool): Malicious Link Checker
Chekc for malicious links using Google Services
1 parent e876d03 commit 91a6038

File tree

3 files changed

+78
-0
lines changed

3 files changed

+78
-0
lines changed

src/tools/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { tool as base64FileConverter } from './base64-file-converter';
22
import { tool as base64StringConverter } from './base64-string-converter';
33
import { tool as basicAuthGenerator } from './basic-auth-generator';
4+
import { tool as maliciousLinksTester } from './malicious-links-tester';
45

56
import { tool as asciiTextDrawer } from './ascii-text-drawer';
67

@@ -128,6 +129,7 @@ export const toolsByCategory: ToolCategory[] = [
128129
httpStatusCodes,
129130
jsonDiff,
130131
safelinkDecoder,
132+
maliciousLinksTester,
131133
],
132134
},
133135
{
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import { ShieldCheck } from '@vicons/tabler';
2+
import { defineTool } from '../tool';
3+
4+
export const tool = defineTool({
5+
name: 'Malicious Links Checker',
6+
path: '/malicious-links-checker',
7+
description: 'Check an url against Google Safe Browsing service',
8+
keywords: ['malicious', 'links', 'checker', 'check', 'safe', 'safe-browsing', 'google'],
9+
component: () => import('./malicious-links-checker.vue'),
10+
icon: ShieldCheck,
11+
createdAt: new Date('2024-05-11'),
12+
});
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
<script setup lang="ts">
2+
import { request } from 'malicious-link-detector';
3+
import { useValidation } from '@/composable/validation';
4+
import { useQueryParam } from '@/composable/queryParams';
5+
6+
/*
7+
What tool do you want?
8+
Send Message via Whatsapp Web
9+
10+
Describe the solution you'd like
11+
I would like to have an input field where I can write a mobile number and a textfield, where I can send a message.
12+
A button "Send" which will open the follwowing url:
13+
14+
https://web.whatsapp.com/send/?phone=THE_MOBILE_NUMBER&text=THE_MESSAGE
15+
16+
it is important that the number is formatted correctly:
17+
the "0" at the beginning should be "49" (for germany) and all spaces or characters like "-" should be removed.
18+
*/
19+
20+
const url = useQueryParam({ name: 'url', defaultValue: '' });
21+
const urlValidation = useValidation({
22+
source: url,
23+
rules: [
24+
{
25+
message: 'Invalid url string',
26+
validator: (value) => {
27+
try {
28+
const _ = (new URL(value));
29+
return true;
30+
}
31+
catch {
32+
return false;
33+
}
34+
},
35+
},
36+
],
37+
});
38+
const result = computedAsync(async () => {
39+
const urlValue = url.value;
40+
return await request(urlValue);
41+
});
42+
</script>
43+
44+
<template>
45+
<div>
46+
<c-input-text
47+
v-model:value="url"
48+
label="Website url"
49+
placeholder="Put your website url here..."
50+
clearable
51+
mb-2
52+
:validation="urlValidation"
53+
/>
54+
55+
<c-alert v-if="result !== 'Safe'" type="error">
56+
Danger! '{{ url }}' website is listed as not safe by Google Safe Browsing: <strong>{{ result }}</strong>
57+
<c-alert />
58+
</c-alert>
59+
<c-alert v-if="result" type="success">
60+
This website is safe.
61+
<c-alert />
62+
</c-alert>
63+
</div>
64+
</template>

0 commit comments

Comments
 (0)