All Projects → zellyn → kooky

zellyn / kooky

Licence: MIT license
Go code to read cookies from browser cookie stores.

Programming Languages

go
31211 projects - #10 most used programming language

Labels

Projects that are alternatives of or similar to kooky

macaroon
Rust implementation of macaroons.
Stars: ✭ 16 (-80.25%)
Mutual labels:  cookies
cookies
Convenient way to use cookies with PSR-7
Stars: ✭ 17 (-79.01%)
Mutual labels:  cookies
scrapy-cookies
A middleware of cookies persistence for Scrapy
Stars: ✭ 19 (-76.54%)
Mutual labels:  cookies
corner-popup
jQuery pop-up script displaying various types of content in corner of browser
Stars: ✭ 23 (-71.6%)
Mutual labels:  cookies
spiced-final-project
Career explorer platform developed in React.js in 6 days.
Stars: ✭ 14 (-82.72%)
Mutual labels:  cookies
es-cookie
A simple, lightweight module for handling cookies
Stars: ✭ 36 (-55.56%)
Mutual labels:  cookies
craft-cookies
A simple plugin for setting and getting cookies from within Craft CMS templates.
Stars: ✭ 36 (-55.56%)
Mutual labels:  cookies
cookie-consent
Cookie consent with accessible dialog, agnostic tag triggers and conditional content, script and embed hooks.
Stars: ✭ 55 (-32.1%)
Mutual labels:  cookies
KaufmannDigital.GDPR.CookieConsent
A ready-to-run package, that integrates an advanced cookie consent banner into your Neos CMS site.
Stars: ✭ 21 (-74.07%)
Mutual labels:  cookies
FaucetCryptoBot
A bot for FaucetCrypto a cryptocurrency faucet. The bot can currently claim PTC ads, main reward and all the shortlinks except exe.io and fc.lc.
Stars: ✭ 69 (-14.81%)
Mutual labels:  cookies
web-ext-deploy
A tool for deploying WebExtensions to multiple stores.
Stars: ✭ 28 (-65.43%)
Mutual labels:  cookies
psr7-cookies
🍪 bakes cookies for PSR-7 messages
Stars: ✭ 35 (-56.79%)
Mutual labels:  cookies
cookies
Manage your cookies on client and server side (Angular Universal)
Stars: ✭ 40 (-50.62%)
Mutual labels:  cookies
aqua
A minimal and fast 🏃 web framework for Deno
Stars: ✭ 219 (+170.37%)
Mutual labels:  cookies
tradingconv
Convert trading history of cryptocurrency platforms
Stars: ✭ 24 (-70.37%)
Mutual labels:  cookies
Client-Storage
🗄 Bulletproof persistent Client storage, works with disabled Cookies and/or localStorage
Stars: ✭ 15 (-81.48%)
Mutual labels:  cookies
useCookie
A React hook for managing cookies with no dependencies.
Stars: ✭ 119 (+46.91%)
Mutual labels:  cookies
rabid
🍪 A CLI tool and library allowing to simply decode all kind of BigIP cookies.
Stars: ✭ 36 (-55.56%)
Mutual labels:  cookies
PolishCookieConsent
Polish Cookie Consent is an extension, which automatically accepts privacy policy/GDPR on websites.
Stars: ✭ 17 (-79.01%)
Mutual labels:  cookies
iron-session
🛠 Node.js stateless session utility using signed and encrypted cookies to store data. Works with Next.js, Express, NestJs, Fastify, and any Node.js HTTP framework.
Stars: ✭ 1,729 (+2034.57%)
Mutual labels:  cookies

kooky

PkgGoDev Go Report Card Lines of code No Maintenance Intended PRs Welcome MIT license

Reaching into browser-specific, vaguely documented, possibly concurrently modified cookie stores to pilfer cookies is a bad idea. Since you've arrived here, you're almost certainly going to do it anyway. Me too. And if we're going to do the Wrong Thing, at least let's try to Do it Right.

Package kooky contains routines to reach into cookie stores for Chrome, Firefox, Safari, ... and retrieve the cookies.

It aspires to be pure Go (I spent quite a while making go-sqlite/sqlite3 work for it).

It also aspires to work for all major browsers, on all three major platforms.

Status

Basic functionality works on Windows, MacOS and Linux. Some functions might not yet be implemented on some platforms. The API is currently not expected to be at all stable.

PRs more than welcome.

TODOs

  • Set up CI
  • Make it work on Windows. (Look at this and this to learn how to decrypt.)
  • Handle rows in Chrome's cookie DB with other than 14 columns (?)

Example usage

Any Browser - Cookie Filter Usage

package main

import (
	"fmt"

	"github.com/zellyn/kooky"
	_ "github.com/zellyn/kooky/browser/all" // register cookie store finders!
)

func main() {
	// uses registered finders to find cookie store files in default locations
	// applies the passed filters "Valid", "DomainHasSuffix()" and "Name()" in order to the cookies
	cookies := kooky.ReadCookies(kooky.Valid, kooky.DomainHasSuffix(`google.com`), kooky.Name(`NID`))

	for _, cookie := range cookies {
		fmt.Println(cookie.Domain, cookie.Name, cookie.Value)
	}
 }

Chrome on macOS

package main

import (
	"fmt"
	"log"
	"os"

	"github.com/zellyn/kooky/browser/chrome"
)

func main() {
	dir, _ := os.UserConfigDir() // "/<USER>/Library/Application Support/"
	cookiesFile := dir + "/Google/Chrome/Default/Cookies"
	cookies, err := chrome.ReadCookies(cookiesFile)
	if err != nil {
		log.Fatal(err)
	}
	for _, cookie := range cookies {
		fmt.Println(cookie)
	}
}

Safari

package main

import (
	"fmt"
	"log"
	"os"

	"github.com/zellyn/kooky/browser/safari"
)

func main() {
	dir, _ := os.UserHomeDir()
	cookiesFile := dir + "/Library/Cookies/Cookies.binarycookies"
	cookies, err := safari.ReadCookies(cookiesFile)
	if err != nil {
		log.Fatal(err)
	}
	for _, cookie := range cookies {
		fmt.Println(cookie)
	}
}

Thanks/references

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].