feat(new tool): Cookies Parser

Fix #1576
This commit is contained in:
ShareVB committed 2025-05-08 10:26:40 +02:00
1 parent 134a5e829b
commit 41d24a52e7
2 files changed
+54

No files matched your search

@@ -0,0 +1,41 @@
<script lang="ts" setup>
import { useQueryParam } from '@/composable/queryParams';
const cookieHeader = useQueryParam({ name: 'cookies', defaultValue: '' });
const parsedCookies = computed(() => {
return (cookieHeader.value || '').replace(/^Cookie:\s*/, '').split('; ').map((cookie) => {
const [name, value] = cookie.split('=');
return { name, value: decodeURIComponent(value || '') };
});
});
</script>
<template>
<n-card title="Cookie Parser">
<n-space vertical>
<n-input v-model:value="cookieHeader" placeholder="Enter cookie header" type="text" />
</n-space>
<n-p>
Tip: Navigate to a website to test, open F12 Console and run <n-tag :bordered="false">
<code>window.copy(document.cookie)</code>
</n-tag>. This will copy the cookie string to your clipboard. Note: This will only copy cookies available to javascript (HTTP only and secure cookies will be omitted).
</n-p>
<n-table v-if="parsedCookies.length">
<thead><tr><th>Name</th><th>Value</th></tr></thead>
<tbody>
<tr v-for="cookie in parsedCookies" :key="cookie.name">
<td>
<n-a :href="`https://cookiedatabase.org/?s=${cookie.name}`" target="_blank">
{{ cookie.name }}
</n-a>
</td>
<td>{{ cookie.value }}</td>
</tr>
</tbody>
</n-table>
<n-alert v-else type="warning">
No cookies found
</n-alert>
</n-card>
</template>
+13
View File
@@ -0,0 +1,13 @@
import { Cookie } from '@vicons/tabler';
import { defineTool } from '../tool';
export const tool = defineTool({
name: 'Cookies Parser',
path: '/cookies-parser',
description: 'Parse Cookie HTTP Header',
keywords: ['cookies', 'parser'],
component: () => import('./cookies-parser.vue'),
icon: Cookie,
createdAt: new Date('2025-05-01'),
category: 'Forensic',
});