Blog

  • logshell

    logshell

    Starts a shell and logs it to a file. Requires bash, and either script or screen. Note: cat the log file back for full color.

    To install:

    See the latest instructions on the releases page

    Usage information:

    Usage: logshell.sh [-hvo] [-c {script|screen}] [-f <logfile>] [-s <shell>] [-e <file>]
    
    Optional arguments:
      -h                      Print this help message
      -v                      Print the version number
      -o                      Strip escape sequences (and color) from output
      -e <file>               Strip escape sequences from an existing file
      -c [script|screen]      Command to use (script or screen)
      -f <logfile>            Output file (try default)
      -p <logpath>            Output path (do not use with -f)
      -s <shell>              Shell to use (or command to execute)
    

    Notes

    1. Default output directory is ~/.local/log/logshell.

    2. Once you have logged a shell session, use ‘cat’ to view it in full color. Note: this is not recommended unless the output file has been formatted with the -o or -e option.

    3. If you set a command as your shell (with the -s option), logshell will execute it, log the output, and then exit. The following will start the quizlight program, log its output, and then log out of the system entirely so the test-taker can’t do any tampering:

    logshell -s quizlight ; exit
    
    # Note: This only works with commands that output to standard output.
    
    1. Using logshell to capture trace output is a good development tool. Full output is captured, and can be compared to trace output from known working versions for debugging.

    2. logshell can also be used to watch live tcpdump output and log it at the same time.

    Visit original content creator repository
    https://github.com/dogoncouch/logshell

  • Search-Engine-implementation-for-databases

    Search Engine Implementation for database

    • Database: MongoDB
    • Data structure: Inverted Index

    Inverted Index

    An inverted index is an index data structure storing a mapping from content, such as words or numbers, to its locations in a document or a set of documents. In simple words, it is a hashmap like data structure that directs you from a word to a document or a web page.

    Steps to build an inverted index:

    • Fetch the Document Removing of Stop Words: Stop words are most occuring and useless words in document like “I”, “the”, “we”, “is”, “an”.
    • Stemming of Root Word Whenever I want to search for “cat”, I want to see a document that has information about it. But the word present in the document is called “cats” or “catty” instead of “cat”. To relate the both words, I’ll chop some part of each and every word I read so that I could get the “root word”. There are standard tools for performing this like “Porter’s Stemmer”.
    • Record Document IDs If word is already present add reference of document to index else create new entry. Add additional information like frequency of word, location of word etc. Repeat for all documents and sort the words.

    Dependencies Required

    • Python3
    • MongoDB
    • Qt-Creator

    File System

    1. Storage.py : Creates the folder “New Testament” and stores txt files in it.
    2. parsing.py : Contains methods to clean and store data in the database.
    3. browser.py : Responsible for designing GUI using PyQt4 modules and Qt-Creator.
    4. querying.py : Contains methods to rank the documents according to their frequencies.
    5. main.py : It ranks the documents according to their searched word frequency count with a summarised text detail.

    Terminal Commands

    $ python3 Storage.py
    
    $ sudo python3 main.py
    

    Output

    output snapshots

    Visit original content creator repository https://github.com/ayushianan/Search-Engine-implementation-for-databases
  • Search-Engine-implementation-for-databases

    Search Engine Implementation for database

    • Database: MongoDB
    • Data structure: Inverted Index

    Inverted Index

    An inverted index is an index data structure storing a mapping from content, such as words or numbers, to its locations in a document or a set of documents. In simple words, it is a hashmap like data structure that directs you from a word to a document or a web page.

    Steps to build an inverted index:

    • Fetch the Document Removing of Stop Words: Stop words are most occuring and useless words in document like “I”, “the”, “we”, “is”, “an”.
    • Stemming of Root Word Whenever I want to search for “cat”, I want to see a document that has information about it. But the word present in the document is called “cats” or “catty” instead of “cat”. To relate the both words, I’ll chop some part of each and every word I read so that I could get the “root word”. There are standard tools for performing this like “Porter’s Stemmer”.
    • Record Document IDs If word is already present add reference of document to index else create new entry. Add additional information like frequency of word, location of word etc. Repeat for all documents and sort the words.

    Dependencies Required

    • Python3
    • MongoDB
    • Qt-Creator

    File System

    1. Storage.py : Creates the folder “New Testament” and stores txt files in it.
    2. parsing.py : Contains methods to clean and store data in the database.
    3. browser.py : Responsible for designing GUI using PyQt4 modules and Qt-Creator.
    4. querying.py : Contains methods to rank the documents according to their frequencies.
    5. main.py : It ranks the documents according to their searched word frequency count with a summarised text detail.

    Terminal Commands

    $ python3 Storage.py
    
    $ sudo python3 main.py
    

    Output

    output snapshots

    Visit original content creator repository https://github.com/ayushianan/Search-Engine-implementation-for-databases
  • karma-sabarivka-reporter

    #StandWithUkraine

    logo

    karma-sabarivka-reporter Version Badge

    Code coverage badge Snyk Vulnerabilities badge Maintainability Language grade: JavaScript

    NPM badge

    ⭐️ Please, star me on GitHub — it helps!

    karma-sabarivka-reporter – is a Karma plugin which adds untested files to istanbul coverage statistic

    screenshot before

    screenshot after

    📖 Table of Contents

    ❓ Why? 🔝

    With karma, to test source code – you need to include only *.spec.(ts|js) files into test config. Then those spec files will import corresponding source code files. This leads to an issue with “fake” test coverage, as if some source code file would be omitted by all *.spec.(ts|js)) files – this source code file won’t be shown in coverage report at all.

    karma-sabarivka-reporter plugin fixes described issue by going through all the source files and including them explicitly into coverage result.

    Plugin works with both: TypeScript (*.ts) and JavaScript (*.js) files

    ✨ Features 🔝

    💾 Install 🔝

    With npm installed, run

    npm install --save-dev karma-sabarivka-reporter

    🎛️ API 🔝

    @param {string[] | string} coverageReporter.include – Glob pattern, string or array of strings. Files which should be included into the coverage result.

    🤹 Usage 🔝

    Important Note: if used with karma-coverage, 'sabarivka' should go before 'coverage' in reporters list

    Update karma.conf.js

    include as array of strings 🔝

    reporters: [
      // ...
      'sabarivka'
      // 'coverage-istanbul' or 'coverage' (reporters order is important for 'coverage' reporter)
      // ...
    ],
    coverageReporter: {
      include: [
          // Specify include pattern(s) first
          'src/**/*.(ts|js)',
          // Then specify "do not touch" patterns (note `!` sign on the beginning of each statement)
          '!src/main.(ts|js)',
          '!src/**/*.spec.(ts|js)',
          '!src/**/*.module.(ts|js)',
          '!src/**/environment*.(ts|js)'
      ]
    },

    Same result may be achieved with more complex one line glob pattern

    include as string 🔝

    reporters: [
      // ...
      'sabarivka'
      // 'coverage-istanbul' or 'coverage' (reporters order is important for 'coverage' reporter)
      // ...
    ],
    coverageReporter: {
        include: 'src/**/!(*.spec|*.module|environment*|main).(ts|js)',
    },

    karma plugins section 🔝

    If your karma config has plugins section, add also karma-sabarivka-reporter there, otherwise — no action is required.

    Karma’s documentation:

    By default, Karma loads all sibling NPM modules which have a name starting with karma-*.
    You can also explicitly list plugins you want to load via the plugins configuration setting. The configuration value can either be a string (module name), which will be required by Karma, or an object (inlined plugin).

    See here more info on how karma plugins loading works

    plugins: [
      // ...
      require('karma-sabarivka-reporter'),
      // ...
    ],

    📄 License 🔝

    This software is licensed under the MIT

    Stargazers over time

    Stargazers over time

    Visit original content creator repository https://github.com/kopach/karma-sabarivka-reporter
  • karma-sabarivka-reporter

    #StandWithUkraine

    logo

    karma-sabarivka-reporter Version Badge

    Code coverage badge Snyk Vulnerabilities badge Maintainability Language grade: JavaScript

    NPM badge

    ⭐️ Please, star me on GitHub — it helps!

    karma-sabarivka-reporter – is a Karma plugin which adds untested files to istanbul coverage statistic

    screenshot before

    screenshot after

    📖 Table of Contents

    ❓ Why? 🔝

    With karma, to test source code – you need to include only *.spec.(ts|js) files into test config. Then those spec files will import corresponding source code files. This leads to an issue with “fake” test coverage, as if some source code file would be omitted by all *.spec.(ts|js)) files – this source code file won’t be shown in coverage report at all.

    karma-sabarivka-reporter plugin fixes described issue by going through all the source files and including them explicitly into coverage result.

    Plugin works with both: TypeScript (*.ts) and JavaScript (*.js) files

    ✨ Features 🔝

    💾 Install 🔝

    With npm installed, run

    npm install --save-dev karma-sabarivka-reporter

    🎛️ API 🔝

    @param {string[] | string} coverageReporter.include – Glob pattern, string or array of strings. Files which should be included into the coverage result.

    🤹 Usage 🔝

    Important Note: if used with karma-coverage, 'sabarivka' should go before 'coverage' in reporters list

    Update karma.conf.js

    include as array of strings 🔝

    reporters: [
      // ...
      'sabarivka'
      // 'coverage-istanbul' or 'coverage' (reporters order is important for 'coverage' reporter)
      // ...
    ],
    coverageReporter: {
      include: [
          // Specify include pattern(s) first
          'src/**/*.(ts|js)',
          // Then specify "do not touch" patterns (note `!` sign on the beginning of each statement)
          '!src/main.(ts|js)',
          '!src/**/*.spec.(ts|js)',
          '!src/**/*.module.(ts|js)',
          '!src/**/environment*.(ts|js)'
      ]
    },

    Same result may be achieved with more complex one line glob pattern

    include as string 🔝

    reporters: [
      // ...
      'sabarivka'
      // 'coverage-istanbul' or 'coverage' (reporters order is important for 'coverage' reporter)
      // ...
    ],
    coverageReporter: {
        include: 'src/**/!(*.spec|*.module|environment*|main).(ts|js)',
    },

    karma plugins section 🔝

    If your karma config has plugins section, add also karma-sabarivka-reporter there, otherwise — no action is required.

    Karma’s documentation:

    By default, Karma loads all sibling NPM modules which have a name starting with karma-*.
    You can also explicitly list plugins you want to load via the plugins configuration setting. The configuration value can either be a string (module name), which will be required by Karma, or an object (inlined plugin).

    See here more info on how karma plugins loading works

    plugins: [
      // ...
      require('karma-sabarivka-reporter'),
      // ...
    ],

    📄 License 🔝

    This software is licensed under the MIT

    Stargazers over time

    Stargazers over time

    Visit original content creator repository https://github.com/kopach/karma-sabarivka-reporter
  • Pentest-Mapper

    Pentest Mapper

    Pentest Mapper is a Burp Suite extension that integrates the Burp Suite request logging with a custom application testing checklist. The extension provides a straightforward flow for application penetration testing. The extension includes functionalities to allow users to map the flow of the application for pentesting to better analyse the application and its vulnerabilities. The API calls from each flow can be connected with the function or flow name. The extension allows users to map or connect each flow or API to vulnerability with the custom checklist.

    Installation

    • Extension is available on Burp Suite BApp Store

    Documentation

    https://anof-cyber.github.io/Pentest-Mapper/

    Features Summary

    1. Checklist

    Allows to load the custom checklist

    2. API Mapper

    Allow to keep track of each API call, Flow and Test Cases for each API calls.

    3. Vulnerability

    Allows to keep track of vulnerabilities, Map each paramter and API call to vulnerability from the Checklist and severity

    4. Config

    Allow to set Auto save the project or extension data and auto load the checklist. Also import and export all data with one click

    Features

    1. Checklist

    The checklist allows users to create or upload the custom checklist to map each API call to the vulnerability from the custom uploaded checklist.

    picture

    2. API Mapper

    The API Mapper tab allows logging the HTTP request from the poxy or repeater tab and mapping the request with the flow and sorting the request based on the flow. Also, the tab allows users to write the comment or test cases for each API call logged into the extension. The tab allows mapping each API with the vulnerability from the checklist.

    picture

    picture

    3. Vulnerabilities

    The tab stores the URL and parameters and allows users to map the selected API to the vulnerabilities.

    picture picture

    4. Config

    The config tab allow you to set time for auto save after specific time peried and select the output location. You can also set the auto load the checklist file and Import and export data with one click. You can also turn on off the Auto Save and Auto Logging request from proxy for scope domain

    picture

    Sending Request

    picture


    TBD

    • Single Click Import and Export
    • Auto Save the project Data
    • Auto Logging Scope APIs and requests with Optional mode
    • Seach option for all 3 tables to manage long table
    • Solving long checklist selection from vulnerability
    • Updating checklist file automatically
    • Map Vulnerabilities with Severity
    • Custom and Default CVSS score generation
    • Multiple row selection for API Mapper
    • Turn on off auto save from config
    • Optimization of code
    • Allowing individual request to mark as completed
    • Allowing Request and Response for Vulnerability
    Visit original content creator repository https://github.com/Anof-cyber/Pentest-Mapper
  • Pentest-Mapper

    Pentest Mapper

    Pentest Mapper is a Burp Suite extension that integrates the Burp Suite request logging with a custom application testing checklist. The extension provides a straightforward flow for application penetration testing. The extension includes functionalities to allow users to map the flow of the application for pentesting to better analyse the application and its vulnerabilities. The API calls from each flow can be connected with the function or flow name. The extension allows users to map or connect each flow or API to vulnerability with the custom checklist.

    Installation

    • Extension is available on Burp Suite BApp Store

    Documentation

    https://anof-cyber.github.io/Pentest-Mapper/

    Features Summary

    1. Checklist

    Allows to load the custom checklist

    2. API Mapper

    Allow to keep track of each API call, Flow and Test Cases for each API calls.

    3. Vulnerability

    Allows to keep track of vulnerabilities, Map each paramter and API call to vulnerability from the Checklist and severity

    4. Config

    Allow to set Auto save the project or extension data and auto load the checklist. Also import and export all data with one click

    Features

    1. Checklist

    The checklist allows users to create or upload the custom checklist to map each API call to the vulnerability from the custom uploaded checklist.

    picture

    2. API Mapper

    The API Mapper tab allows logging the HTTP request from the poxy or repeater tab and mapping the request with the flow and sorting the request based on the flow. Also, the tab allows users to write the comment or test cases for each API call logged into the extension. The tab allows mapping each API with the vulnerability from the checklist.

    picture

    picture

    3. Vulnerabilities

    The tab stores the URL and parameters and allows users to map the selected API to the vulnerabilities.

    picture picture

    4. Config

    The config tab allow you to set time for auto save after specific time peried and select the output location. You can also set the auto load the checklist file and Import and export data with one click. You can also turn on off the Auto Save and Auto Logging request from proxy for scope domain

    picture

    Sending Request

    picture


    TBD

    • Single Click Import and Export
    • Auto Save the project Data
    • Auto Logging Scope APIs and requests with Optional mode
    • Seach option for all 3 tables to manage long table
    • Solving long checklist selection from vulnerability
    • Updating checklist file automatically
    • Map Vulnerabilities with Severity
    • Custom and Default CVSS score generation
    • Multiple row selection for API Mapper
    • Turn on off auto save from config
    • Optimization of code
    • Allowing individual request to mark as completed
    • Allowing Request and Response for Vulnerability
    Visit original content creator repository https://github.com/Anof-cyber/Pentest-Mapper
  • Show-Zero-Width-Glyphs

    Show Zero-Width Glyphs

    This is a plugin for the Glyphs font editor that draws colored lines to indicate the presence of zero-width glyphs in Edit View.

    Installation

    Download on the Plugin Manager

    Install the plugin using the button above or search for “Show Zero-Width Glyphs” in the Plugin Manager. Relaunch Glyphs for the plugin to be loaded.

    Preferences

    Show Zero-Width Glyphs offers a range of configurable preferences.

    Line Color

    The ShowZeroWidthGlyphsLineColor preference controls the color of the indicator line. Set the preference to 8 for the default purple color or one of the following numbers: 0: red, 1: orange, 2: brown, 3: yellow, 4: green, 7: blue, 8: purple, 9: pink, 10: gray.

    Run the following line in the Macro panel to set the color (or set it to None to reset it):

    Glyphs.defaults["ShowZeroWidthGlyphsLineColor"] = 1

    Line Alpha Value

    The ShowZeroWidthGlyphsLineAlphaValue preference controls the transparency of the indicator line. Set the preference to 0.5 for the default transparency. 1.0 makes the line fully opaque, and 0.0 hides the line (full transparency).

    If there are multiple zero-width glyphs next to each other, transparent colors will overlay, resulting in a more prominent line.

    Run the following line in the Macro panel to set the alpha value (or set it to None to reset it):

    Glyphs.defaults["ShowZeroWidthGlyphsLineAlphaValue"] = 0.25

    Line Thickness

    The ShowZeroWidthGlyphsLineThickness preference controls the thickness of the indicator line. This thickness is added on all four sides of the layer box. The default value is 1.0.

    Run the following line in the Macro panel to set the thickness (or set it to None to reset it):

    Glyphs.defaults["ShowZeroWidthGlyphsLineThickness"] = 5.0

    Maximum Width

    The ShowZeroWidthGlyphsMaximumWidth preference controls the maximum layer width for which the highlighting is applied. The default value is 0 (only zero-width glyphs are highlighted). Set it to a small value like 5 or 10 to also catch other very narrow glyphs.

    Run the following line in the Macro panel to set the maximum width (or set it to None to reset it):

    Glyphs.defaults["ShowZeroWidthGlyphsMaximumWidth"] = 10

    Licenses

    Licensed under the Apache License, Version 2.0.

    Visit original content creator repository https://github.com/florianpircher/Show-Zero-Width-Glyphs
  • neo4j-schema

    Neo4j Schema

    npm version

    A dead-simple client for neo4j in Javascript.

    Features

    1. Mongoose-like syntax, flat learning curve, bootstrap Javascript developers to access Neo4J in minutes.
    2. Resource pooling, automatically reuse connection resources to cut down network overhead.
    3. Support schema validation with built-in Joi-schema.
    4. Support ES6, ES7 syntax.

    Documentation

    Installation

    npm install --save neo4j-schema

    Example

    const Neo4JDB = require('neo4j-schema');
    const Query = Neo4JDB.Query;
    const db = new Neo4JDB({
        uri: 'bolt://localhost',
        username: 'neo4j',
        password: 'neo4j'
    }).connect();
    
    const PersonSchema = Neo4JDB.Schema({
                name: String,
                age: Number,
                isAdmin: {type: Boolean, default: false},
                tags: [String],
                createdAt: {type: Date, default: Date.now}
            });
    const Person = db.model('person', PersonSchema);
    
    // Create
    Person.create({
              variable: 'n',
              label: 'Person',
              props: {
                  name: 'foo',
                  age: 25,
                  tags: ['group A', 'group B', 'group C']
              }
          }).return(['*'])
            .exec()
            .then(docs => {
                console.log(docs);   // [Node {
                                     //      labels: ['Person'],
                                     //      properties: {
                                     //         name: 'foo',
                                     //         age: 25,
                                     //         tags: ['group A', 'group B', 'group C'],
                                     //         isAdmin: false,
                                     //         createdAt: 1529831729
                                     //      }
                                     // }]
            }).catch(e => {
                 console.error(e);
            });
    
    // Match
    let query = new Query(db);      // alternatively, use Person.match()
    query.match({
              variable: 'n',
              label: 'Person'
            })
            .where({
                name: 'foo',
                age: {$gt: 20}
            })
            .return(['*'])
            .exec()
            .then(docs => {
                console.log(docs);  // [Node {
                                    //      labels: ['Person'],
                                    //      properties: {
                                    //          name: 'foo',
                                    //          age: 25,
                                    //          tags: ['group A', 'group B', 'group C'],
                                    //          isAdmin: false,
                                    //          createdAt: 1529831729
                                    //      }
                                    // }]
            }).catch(e => {
                console.error(e);
            });
    
    // Set
    Person.match({
        variable: 'n',
        label: 'Admin'
    }).set({
        variable: 'n',
        props: {
            name: 'bar',
            age: 30
        }
    }).return(['*'])
        .exec()
        .then(docs => {
            console.log(docs);   // [Node {
                                 //      labels: ['Person', 'Admin'],
                                 //      properties: {
                                 //         name: 'bar',
                                 //         age: 30,
                                 //         tags: ['group A', 'group B', 'group C'],
                                 //         isAdmin: false,
                                 //         createdAt: 1529831729
                                 //      }
                                 // }]
        });
    
    // Remove Label
    Person.match({variable: 'n', label: 'Admin'})
        .remove({variable: 'n', label: 'Admin'})
        .return(['*'])
        .exec()
        .then(docs => {
            console.log(docs);   // [Node {
                                 //      labels: ['Person'],
                                 //      properties: {
                                 //         name: 'bar',
                                 //         age: 30,
                                 //         tags: ['group A', 'group B', 'group C'],
                                 //         isAdmin: false,
                                 //         createdAt: 1529831729
                                 //      }
                                 // }]
        });
    
    // Delete
    Person.match({
        variable: 'n',
        label: 'Person'
    }).detachDelete(['n'])
        .exec()
        .then(docs => {
            console.log(docs);   // Node deleted
        });
    
    Visit original content creator repository https://github.com/HastingsYoung/neo4j-schema
  • noblox.js-server

    noblox.js-server

    A RESTful API using noblox.js and Koa.

    JavaScript Style Guide noblox.js Discord Travis Build Status

    AboutPrerequisitesConfigurationExamplesYouTube SeriesCreditsLicense

    About

    This repository hosts the code for a working RESTful API that utilizes Koa.js to expose noblox.js functions on the internet. Essentially, with this project, you can host it on your own server and interact with the Roblox API through your own Roblox game.

    Prerequisites

    • node.js
    • a virtual private server (VPS)
      • To have your code running on a 24/7 basis, you need to use a VPS. We recommend using DigitalOcean for its ease of use and. This referral link provides you with a $100 credit which can be used over 60 days. Other options include Amazon Web Services, Microsoft Azure, and Google Compute Engine.

    Configuration

    server.js

    After installing this repository on your server, start by creating an .env file to house your configuration settings. You can duplicate the .env.sample file and fill in the missing details.

    • Unless you know what you are doing, leave the PORT number the same.
    • MAX_RANK refers to the highest rank (1-254) the logged in account is allowed to promote users to.
    • API_TOKEN refers to a secret key to secure your RESTful API to avoid your API being accessed by unauthorized users. It is best to generate a key that isn’t easy to guess. You can use this website to use an automatically generated key. You need not memorize this key.
    • COOKIE refers to the cookie of the logged-in user account the API will execute functions from. To find your cookie, please read this.

    After your file is configured, use a process manager like pm2 to have your script run 24/7. We do not provide support for VPS, network, and domain configuration.

    noblox.lua

    If you plan on using the provided Lua module (ModuleScript) in this project, please do the following:

    • Place the script only in ServerScriptService.
    • Update the DOMAIN value in CONFIGURATION to reflect your server’s IP address/domain & port. (e.g. if your domain name is noblox.io and this is running on port 3000, your value here would be https://noblox.io:3000)
    • Update the API_TOKEN value in CONFIGURATION so that it matches what you put earlier in server.js.
    • Optional: provide a DEFAULT_GROUP_ID to default to having noblox.js functions run on a single group when not specified.

    Credits

    • suufi – Lead maintainer

    License

    MIT

    Visit original content creator repository https://github.com/noblox/noblox.js-server