Categories
Uncategorized

Proxmox on a Laptop end of 2022

Proxmox is a grate tool to have in your home lab, and installing on a laptop can be a cheap why to setup a proxmox server but there are something that you need to do to have it work right with the built in hardware of a laptop. to day we are going to show you the needed commands to turn on and disable the settings of this.

Screen Time Out

The first config file that we are going to have the edit is /etc/default/grub we are going to do this with nano

nano /etc/default/grub

you will scroll down looking for GRUB_CMDLINE_LINUX = “” you will want to edit this line to look like

GRUB_CMDLINE_LINUX = 'consoleblank=20'

Save the file and now we need to update grub

update-grub

Stop Sleep when Lid is closed

So most laptops will go into sleep mode when the screen is closed we don’t want a proxmox sever to do this. so to do this we need to change a setting called HandleLidSwithch in a config file.

To do this we are going to use nano to edit this file

nano /etc/systemd/logind.conf

with the file open scroll down looking for HandleLidSwithch= with you find it change it to look like

from HandleLidSwithch=ignore

And remove the # for it to work.

Now all that is left to do is reboot the system and it will all be working.

Categories
Uncategorized

Detecting Deauthentication Attacks with Python

I was looking for a way to use python the detect wifi deauthing and I could not find a good way to do this so here is the script that I made.

# WIFI needs to be in monitor mode
# find wifi name [ip address]
# sudo airmon-ng check kill
# sudo airmon-ng start wlx00a1b0b00de1
# verify using [ip address]
# sudo airodump-ng wlan0mon

# install needed
# sudo apt install python3 -y
# sudo apt install python3-pip -y
# sudo pip3 install scapy
# sudo apt install aircrack-ng -y

from scapy.all import *
import datetime

# looking for Dot11 AKA Deauthentication Packet
def process_packet(packet):
    if packet.haslayer(Dot11Deauth):
        print(' [ ' +  str(datetime.datetime.now())+ ' ] '+  ' Deauthentication Attack Detected Against Mac Address: ' +   str(packet.addr2).swapcase())
#Running scanner for packet
sniff(iface="wlan0mon", prn=process_packet, store=False, count=0)

where to find the other script used

https://python.plainenglish.io/deauthentication-attacks-with-python-aa5cc6eeb331

Categories
Uncategorized

Controlling your 3D Printer with Proxmox

A big part of the post is reusing info from a post on the OctoPrint forum

https://community.octoprint.org/t/setting-up-octoprint-on-a-raspberry-pi-running-raspberry-pi-os-debian/2337

That being said it was not written to be installing on Ubuntu or in a VM so there are some more steps that we are going to need to take.

For this post I am going to assume that you know how to setup a vm and how to pass a usb port to a vm in Proxmox if you do not it will be covered in the video at the bottom.

Now that you have your VM of Ubuntu 22.04 running and your USB port for your printer passed to that VM it is time to start installing OctoPrint. The first thing that we you need to do is to update and upgrade your install of Ubuntu.

sudo apt update && sudo apt upgrade -y

now that you have your update done it is time to setup a new user OctoPrint is ment to be used with a user pi but Ubuntu dose not have this user by default like a Raspberry Pi would so we will need to set this up.

sudo adduser pi

now we need to give the user sudo rights

sudo adduser pi sudo

The last step for user config is to give the user the rights to use serial

sudo usermod -a -G tty pi
sudo usermod -a -G dialout pi
exit

Now log back in with the pi user

now lets go to root

cd ~

and install dependencies for OctoPrint

sudo apt install python3-pip python3-dev python3-setuptools python3-venv git libyaml-dev build-essential -y

make an folder for OctoPrint and move to the folder.

mkdir OctoPrint && cd OctoPrint

setup a virtual environment for python

python3 -m venv venv

Activate the environment

source venv/bin/activate

Now lets install OctoPrint

pip install pip --upgrade
pip install octoprint

Time to test the web interface

~/OctoPrint/venv/bin/octoprint serve

Go to a web browser and navigate to http://<your IP>:5000

the last step is to set up auto start up. To do this we are going to download this script and move it to systemd/system

wget https://github.com/OctoPrint/OctoPrint/raw/master/scripts/octoprint.service && sudo mv octoprint.service /etc/systemd/system/octoprint.service

Adjust the path if needed if you fallowed this post your /etc/systemd/system/octoprint.service shoud look like this

ExecStart=/home/pi/OctoPrint/venv/bin/octoprint

now start you service

sudo service octoprint start