-
Notifications
You must be signed in to change notification settings - Fork 70
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Configuration: Add Cyberchef to Chrome settings #725
Comments
adding CyberChef to bookmark bar is a bit tricky, as when fresh installation, the Google Chrome's bookmarks file and related # https://stackoverflow.com/questions/10813221/adding-bookmark-to-web-browser-from-external-applications
function Add-Chrome-Bookmark {
Param
(
[Parameter(Mandatory=$true, Position=0)]
[string] $bookMarkName,
[Parameter(Mandatory=$true, Position=1)]
[string] $bookMarkUrl
)
$fileBookmarks="$env:LOCALAPPDATA\Google\Chrome\User Data\Default\Bookmarks"
$dirBookmarks = Split-Path $fileBookmarks
# initial installation does not have the directories
if (Test-Path $dirBookmarks) {
$dataBookmarks=Get-Content $fileBookmarks -Encoding UTF8| Out-String |ConvertFrom-Json
} else {
New-Item -ItemType Directory -Force -Path $dirBookmarks # this does not work
$dataBookmarks= "{'roots': {'bookmark_bar': {'children': []}}}" | ConvertFrom-Json
}
function createNewChromeBookmark ($Bookmarks, [string]$BookmarkName, [string]$BookmarkURL) {
function getBookmarkIDs($object){
$object | ForEach-Object{
"{0:0000}" -f [int]($_.id);
if([bool]($_.PSobject.Properties.name -match "children")){
GetBookmarkIDs($_.children);
}
}
};
$nextBookmarkID = [int](getBookmarkIDs -object $Bookmarks.roots.bookmark_bar|Sort-Object -Descending|Select-Object -First 1) + 1
$currentChomeTime=[System.DateTimeOffset]::Now.ToUnixTimeMilliseconds()*10000;
$newBookmark= [PSCustomObject]@{
date_added=$currentChomeTime
guid=[guid]::NewGuid()
id=$nextBookMarkID
name="$BookmarkName"
type="url"
url="$BookmarkURL"
}
return $newBookmark;
}
$newBookmark = createNewChromeBookmark -Bookmarks $dataBookmarks -BookmarkName $bookMarkName -BookmarkURL $bookMarkUrl
$dataBookmarks.roots.bookmark_bar.children += $newBookmark;
# [+] Error: The maximum depth allowed for serialization is 100.
$dataBookmarksJSON = ConvertTo-Json -InputObject $dataBookmarks -Depth 100
Set-Content -Path $fileBookmarks -Value $dataBookmarksJSON -Encoding UTF8
} if the script tries to create the directory structure, upon opening the Chrome, the files are overwritten as of my testing |
Extracting Google Chrome part to the following issues to allow more focused discussions in every of them: |
Details
Add the following to the cyberchef.vm (needs #296):
Add the following to googlechrome.vm (to be created in #469):Set Chrome to default for .html filesSet Chrome as default browser (Default apps)The text was updated successfully, but these errors were encountered: