346 lines
		
	
	
		
			7.2 KiB
		
	
	
	
		
			Markdown
		
	
	
	
	
	
			
		
		
	
	
			346 lines
		
	
	
		
			7.2 KiB
		
	
	
	
		
			Markdown
		
	
	
	
	
	
| ---
 | |
| created: 2024-01-06T01:25:36.078Z
 | |
| draft: true;
 | |
| type: topic
 | |
| updated: 2024-07-15T23:43:36.403Z
 | |
| ---
 | |
| 
 | |
| # DESKTOP-H6JG91B
 | |
| 
 | |
| ```conf
 | |
| maas
 | |
| 1178
 | |
| 1178
 | |
| ```
 | |
| 
 | |
| ```bash
 | |
| sudo -i
 | |
| apt-get update
 | |
| apt-get upgrade
 | |
| apt-get install links unzip net-tools ufw nginx git ncdu nano nmap -y
 | |
| reboot
 | |
| ```
 | |
| 
 | |
| ```bash
 | |
| wsl --export Ubuntu Ubuntu-MAAS-001.tar
 | |
| ```
 | |
| 
 | |
| ```bash
 | |
| ip a
 | |
| lsb_release -a
 | |
| ufw enable
 | |
| ufw status numbered
 | |
| ufw disable
 | |
| ```
 | |
| 
 | |
| ```bash
 | |
| cd /home/maas/
 | |
| wget https://dot.net/v1/dotnet-install.sh -O dotnet-install.sh
 | |
| chmod +x ./dotnet-install.sh
 | |
| ./dotnet-install.sh --channel 8.0
 | |
| ln -s /home/maas/.dotnet/dotnet /usr/local/bin/dotnet
 | |
| export DOTNET_ROOT=$HOME/.dotnet
 | |
| export PATH=$PATH:$HOME/.dotnet:$HOME/.dotnet/tools
 | |
| dotnet --info
 | |
| ```
 | |
| 
 | |
| ```bash
 | |
| timedatectl set-timezone America/Phoenix
 | |
| snap install dashkiosk
 | |
| snap restart dashkiosk
 | |
| snap install ubuntu-frame wpe-webkit-mir-kiosk
 | |
| snap set wpe-webkit-mir-kiosk url=http://localhost:9400/receiver
 | |
| wpe-webkit-mir-kiosk.cog http://localhost:9400/receiver
 | |
| ```
 | |
| 
 | |
| ```bash
 | |
| /snap/wpe-webkit-mir-kiosk/current/bin/setup.sh
 | |
| wpe-webkit-mir-kiosk.cog http://localhost:9400/receiver
 | |
| ```
 | |
| 
 | |
| ```bash
 | |
| snap set ubuntu-frame daemon=true
 | |
| apt-get install -y ca-certificates
 | |
| nano /home/maas/localhost.conf
 | |
| echo >/home/maas/localhost.conf && nano /home/maas/localhost.conf
 | |
| ```
 | |
| 
 | |
| ```conf
 | |
| [req]
 | |
| default_bits       = 2048
 | |
| default_keyfile    = localhost.key
 | |
| distinguished_name = req_distinguished_name
 | |
| req_extensions     = req_ext
 | |
| x509_extensions    = v3_ca
 | |
| 
 | |
| [req_distinguished_name]
 | |
| countryName                 = Country Name (2 letter code)
 | |
| countryName_default         = US
 | |
| stateOrProvinceName         = State or Province Name (full name)
 | |
| stateOrProvinceName_default = Arizona
 | |
| localityName                = Locality Name (eg, city)
 | |
| localityName_default        = Anthem
 | |
| organizationName            = Organization Name (eg, company)
 | |
| organizationName_default    = Phares
 | |
| organizationalUnitName      = organizationalunit
 | |
| organizationalUnitName_default = Development
 | |
| commonName                  = Common Name (e.g. server FQDN or YOUR name)
 | |
| commonName_default          = desktop-h6jg91b
 | |
| commonName_max              = 64
 | |
| 
 | |
| [req_ext]
 | |
| subjectAltName = @alt_names
 | |
| 
 | |
| [v3_ca]
 | |
| subjectAltName = @alt_names
 | |
| 
 | |
| [alt_names]
 | |
| DNS.1   = desktop-h6jg91b
 | |
| DNS.2   = localhost
 | |
| DNS.3   = 127.0.0.1
 | |
| ```
 | |
| 
 | |
| ```bash
 | |
| openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/nginx/localhost.key -out /etc/nginx/localhost.crt -config /home/maas/localhost.conf
 | |
| ls /etc/nginx
 | |
| nano /etc/nginx/sites-available/default
 | |
| echo >/etc/nginx/sites-available/default && nano /etc/nginx/sites-available/default
 | |
| ```
 | |
| 
 | |
| ```conf
 | |
| server {
 | |
|     listen 80 default_server;
 | |
|     listen [::]:80 default_server;
 | |
|     root /var/www/html;
 | |
|     index index.html index.htm index.nginx-debian.html;
 | |
|     server_name _;
 | |
|     location / {
 | |
|         try_files $uri $uri/ =404;
 | |
|     }
 | |
| }
 | |
| server {
 | |
|     ssl_certificate 'localhost.crt';
 | |
|     ssl_certificate_key 'localhost.key';
 | |
|     listen 443 default_server ssl http2;
 | |
|     ssl_protocols TLSv1.2 TLSv1.1 TLSv1;
 | |
|     listen [::]:443 default_server ssl http2;
 | |
|     server_name _;
 | |
|     location / {
 | |
|         proxy_set_header        Host $host;
 | |
|         proxy_set_header        X-Real-IP $remote_addr;
 | |
|         proxy_set_header        X-Forwarded-For $proxy_add_x_forwarded_for;
 | |
|         proxy_set_header        X-Forwarded-Proto $scheme;
 | |
|         proxy_pass              http://localhost:3000/;
 | |
|         proxy_read_timeout      600s;
 | |
|         proxy_send_timeout      600s;
 | |
|     }
 | |
| }
 | |
| ```
 | |
| 
 | |
| ```bash
 | |
| nginx -t
 | |
| systemctl restart nginx
 | |
| nginx -s reload
 | |
| exit
 | |
| ```
 | |
| 
 | |
| ```bash
 | |
| cp ~/.bash_history /home/maas/bash-history-2023-11-20.txt
 | |
| chown maas /home/maas -R
 | |
| chgrp maas /home/maas -R
 | |
| nano /home/maas/bash-history-2023-11-20.txt
 | |
| exit
 | |
| ```
 | |
| 
 | |
| ```bash 1.85 GB
 | |
| wsl --export Ubuntu Ubuntu-MAAS-002.tar
 | |
| ```
 | |
| 
 | |
| ```bash
 | |
| su -i
 | |
| reboot
 | |
| ```
 | |
| 
 | |
| ```bash
 | |
| # https://maas.io/docs/fresh-installation-of-maas
 | |
| sudo -i
 | |
| snap install --channel=3.4/edge maas
 | |
| systemctl disable --now systemd-timesyncd
 | |
| apt install -y postgresql
 | |
| ```
 | |
| 
 | |
| ```postgresql
 | |
| mikepharesjr = ___________
 | |
| 1178 = ___________
 | |
| maas = ___________
 | |
| localhost = _________
 | |
| ```
 | |
| 
 | |
| ```bash
 | |
| sudo -i -u postgres psql
 | |
| drop database maas with (force);
 | |
| \q
 | |
| sudo -i -u postgres psql -c "CREATE USER \"mikepharesjr\" WITH ENCRYPTED PASSWORD '1178'"
 | |
| sudo -i -u postgres createdb -O "mikepharesjr" "maas"
 | |
| cat /etc/postgresql/14/main/pg_hba.conf
 | |
| nano /etc/postgresql/14/main/pg_hba.conf
 | |
| ```
 | |
| 
 | |
| ```conf
 | |
| host    maas    mikepharesjr    0/0     md5
 | |
| ```
 | |
| 
 | |
| ```bash
 | |
| maas init region+rack --database-uri "postgres://mikepharesjr:1178@localhost/maas"
 | |
| ```
 | |
| 
 | |
| ```conf
 | |
| http://172.23.77.6:5240/MAAS
 | |
| http://127.0.0.1:5240/MAAS
 | |
| ```
 | |
| 
 | |
| ```bash
 | |
| maas createadmin
 | |
| ```
 | |
| 
 | |
| ```conf
 | |
| mikepharesjr
 | |
| 1178
 | |
| 1178
 | |
| mikepharesjr@msn.com
 | |
| gh:mikepharesjr
 | |
| ```
 | |
| 
 | |
| ```bash
 | |
| openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/nginx/localhost.key -out /etc/nginx/localhost.crt -config /home/maas/localhost.conf
 | |
| ls /etc/nginx
 | |
| ```
 | |
| 
 | |
| ```bash
 | |
| maas status
 | |
| # http://localhost:5240/MAAS
 | |
| ```
 | |
| 
 | |
| ```bash
 | |
| snap stop maas
 | |
| systemctl stop postgresql.service
 | |
| ~~systemctl stop maas-dhcpd.service~~
 | |
| ~~systemctl stop maas-rackd.service~~
 | |
| ~~systemctl stop maas-regiond.service~~
 | |
| ```
 | |
| 
 | |
| ```bash
 | |
| snap stop maas
 | |
| snap remove --purge maas
 | |
| systemctl enable --now systemd-timesyncd
 | |
| ```
 | |
| 
 | |
| ```bash
 | |
| systemctl disable --now systemd-timesyncd
 | |
| snap install --channel=3.4/edge maas
 | |
| maas init region+rack --database-uri "postgres://mikepharesjr:1178@localhost/maas"
 | |
| maas status
 | |
| ```
 | |
| 
 | |
| ```bash 6.43 GB
 | |
| wsl --export Ubuntu Ubuntu/Ubuntu-MAAS-003.tar
 | |
| ```
 | |
| 
 | |
| ```conf
 | |
| 172.23.64.0/20 => 192.168.0.0/24
 | |
| 172.23.64.1 => 192.168.0.1
 | |
| ```
 | |
| 
 | |
| ```bash
 | |
| nmap -n -sU -p67 --script broadcast-dhcp-discover
 | |
| ```
 | |
| 
 | |
| ```PowerShell
 | |
| netstat -a -b
 | |
| ```
 | |
| 
 | |
| ```bash 6.45 GB
 | |
| wsl --export Ubuntu D:/9-Delete/Ubuntu-MAAS-004.tar
 | |
| wsl --unregister Ubuntu
 | |
| wsl --import Ubuntu "D:\9-Delete" "D:\9-Delete\Ubuntu-MAAS-004.tar"
 | |
| ```
 | |
| 
 | |
| ```conf
 | |
| pihole
 | |
| 1178
 | |
| 1178
 | |
| ```
 | |
| 
 | |
| ```bash
 | |
| sudo -i
 | |
| apt-get update
 | |
| apt-get upgrade
 | |
| apt-get install links unzip net-tools ufw nginx git ncdu nano nmap ca-certificates -y
 | |
| reboot
 | |
| ```
 | |
| 
 | |
| ```bash 1.34 GB
 | |
| wsl --export Ubuntu Ubuntu/Ubuntu-PiHole-001.tar
 | |
| wsl --unregister Ubuntu
 | |
| wsl --import Ubuntu "C:\Users\mikep\Ubuntu" "C:\Users\mikep\Ubuntu\Ubuntu-PiHole-001.tar"
 | |
| ```
 | |
| 
 | |
| ```bash
 | |
| sudo -i
 | |
| ```
 | |
| 
 | |
| ```bash
 | |
| cd /home/pihole
 | |
| curl -sSL https://install.pi-hole.net | bash
 | |
| ```
 | |
| 
 | |
| ```bash
 | |
| pihole -a -p 4hink
 | |
| nano /etc/lighttpd/lighttpd.conf
 | |
| ```
 | |
| 
 | |
| ```conf
 | |
| ...
 | |
| server.port = 8005
 | |
| ...
 | |
| ```
 | |
| 
 | |
| ```bash
 | |
| service lighttpd restart
 | |
| # http://localhost:8005/admin
 | |
| ```
 | |
| 
 | |
| ```bash
 | |
| mkdir -p /tftpboot/kali
 | |
| cd /tftpboot/kali
 | |
| # https://www.kali.org/docs/installation/network-pxe/
 | |
| # https://discourse.pi-hole.net/t/setting-up-a-pxe-boot-server-with-docker-compose-and-boot-kali-linux-or-other-oss/50218
 | |
| wget http://http.kali.org/kali/dists/kali-rolling/main/installer-amd64/current/images/netboot/netboot.tar.gz
 | |
| tar -zxpf netboot.tar.gz
 | |
| rm netboot.tar.gz
 | |
| nano /etc/dnsmasq.d/99-pxeboot.conf
 | |
| ls /etc/dnsmasq.d/
 | |
| ```
 | |
| 
 | |
| ```conf kali
 | |
| dhcp-boot=pxelinux.0
 | |
| enable-tftp
 | |
| tftp-root=/tftpboot/
 | |
| pxe-prompt="Press F8 for menu.", 60
 | |
| pxe-service=x86PC,"Boot from local disk",0
 | |
| pxe-service=x86PC,"Boot Kali Linux",kali/pxelinux
 | |
| ```
 | |
| 
 | |
| ```bash
 | |
| pihole restartdns
 | |
| pihole status
 | |
| pihole-FTL dhcp-discover
 | |
| nmap -n -sU -p67 --script broadcast-dhcp-discover
 | |
| ```
 | |
| 
 | |
| ```bash 1..49 GB
 | |
| wsl --export Ubuntu Ubuntu/Ubuntu-PiHole-002.tar
 | |
| wsl --unregister Ubuntu
 | |
| wsl --import Ubuntu "C:\Users\mikep\Ubuntu" "C:\Users\mikep\Ubuntu\Ubuntu-PiHole-002.tar"
 | |
| ```
 |