Git Product home page Git Product logo

ap-router's Introduction

Description

Raspberry pi scripts to automate tasks. These are designed to work with rpi-linux distro, but should also work in linux desktop version.
I know some code is redundant but it was done to try to ensure that any user input is handled properly and try to cover noob user's mistakes.
See Extra section for more about using both together.


APVNCMODE

This script aims to solve the annoyance of manually installing and configuring hostapd, dhcp, vncserver every time we burn and initialize new images of raspberry pi, that in some version don't have these packages pre-installed. With this script you can easily setup and configure an Access Point on the raspberry-pi to connect with your device (pc, phone, etc) and if you also need to connect via VNC this script lets you choose which type of vncserver you prefer to install (tightvncserver or realvncserver).

Features in brief:

  • install and setup an Access Point
  • install and setup a Vnc Server
  • recognizes vncserver version already present
  • configure new or existing AccessPoint and VncServer
  • possibility to choose whether to set a temporary or a persistent-on-boot AP
  • automated "reset" to restore previous behavior, without having to manually remove packages and config files

ROUTERMODE

The purpose of this script is to help setup quickly the raspberry-pi to act like a router, thus forwarding traffic from an interface to another.
Designed above all to speed up the setup process to analyze the traffic generated by the devices.

Features in brief:

  • auto check required packages
  • auto config hostapd, dns, dhcp stuff
  • customization of desired network, ip, range, etc
  • auto recognition if already started
  • when stopped, automatic revert to previous behavior without having to manually remove or edit configuration files

Hint:

Tested and work in other linux desktop distro, but in this case if you had an error similar to the following:

"dnsmasq failed to create listening socket for port 53 address already in use"

this is because the system already has a dhcp resolver and we are trying to setup another dhcp server on the same port.
To solve:

  1. check with following command netstat -atunp or ss -lp "sport = :domain" if "systemd-resolver" if flagged
  2. if it is responsible, do:
    • sudo systemctl stop systemd-resolved (stop the service)
    • sudo systemctl disable systemd-resolved (disable service from start at boot)
    • sudo systemctl mask systemd-resolved (disable service from start at boot)
  3. if you need to restore/undo, do:
    • sudo systemctl unmask systemd-resolved (enable service to start at boot)
    • sudo systemctl enable systemd-resolved (enable service to start at boot)
    • sudo systemctl start systemd-resolved (start the service)


Extra:

These scripts can be used for the actions described above, but they were mainly designed to speed up the setup operations to use the raspberry-pi as a "MITM" to analyze the traffic generated by the connected client devices. For Example:

  1. run apvncmode: now we have an AP on wlan0
  2. run routermode: now we have rpi forwarding traffic from wlan0 to eth0 (router/wan/internet)
  3. now you can use either physical monitor or vnc connection from pc to rpi and:
    • on rpi open wireshark and listen on wlan0 interface
    • connect target device (phone,pc,etc) to rpi-AP, start googling
    • look at captured traffic in wireshark (obviously encrypted connections will remain so)
      --- OR ---
    • on rpi open zap/burp, export certificate, start listen on wlan0 port 8080
    • connect target mobile device to rpi-AP, download certificate, install it on device as CA, setup wifi config (in mobile, advanced options) to use proxy with ip "wlan-ip" (ip of rpi-AP, like 192[.]168[.]100[.]1) and port 8080, start googling or open some APP
    • on rpi in zap/burp you can start intercept, analyze, handle traffic (excluding apps with certificate pinning)

ap-router's People

Contributors

h3xstone avatar

Watchers

 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.