Giter VIP home page Giter VIP logo

pynternet's Introduction

Race against daughters internet

Or: how to do security by obscurity and open a backdor.

Setting is that daughter is root anyway and we secretely deny her internet via ufw default rules.

Get some python3 skills (back) during the way.

The process

  • Initially the firewall is set to block everything.

  • Timed Un-locks can be defined (i.e. open the firewall for X minutes)

  • A cronjob checks every minute if the firewall should be kept open.

  • Opening rules are files named by timestamp.

  • To prevent the opening rules persist after shutdown within an Un-Lock window (ufw doesnt know temporary rules), the cronjob will check if it already ran once, if not, close the firewall.

  • Because of insecure shebangs in python-scripts, wrote C wrappers.

  • A tool exists to create opening rule timestamp files. The password check is done supersecure using base64 (she is root anyway).

Installation

  • Place everything in /opt/pynternet
  • Compile the wrapper (daughter runs on ARM, have no cross-compiling expertise)
    gcc pynternet.c -o pynternet_open
    
  • Make it a suid, so it can manipulate ufw rules
  sudo chown root pynternet_open
  sudo chmod u+s pynternet_open
  • Add cronjob
    sudo crontab -u root -e
    # */1 * * * * /opt/pynternet/pynternetcheck.py
    

Other approaches

Networking services and/or interfaces could be shut down instead:

sudo nmcli networking off

sudo systemctl stop NetworkManager
sudo systemctl disable NetworkManager
sudo systemctl mask NetworkManager


sudo systemctl unmask systemd-networkd.service
sudo systemctl enable systemd-networkd.service
sudo systemctl start systemd-networkd.service

pynternet's People

Contributors

fwolfst avatar

Watchers

 avatar James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.