/linux

Simplified For Hacker

pr0xh4ck © 2022

Simplified For Hacker

Agenda


basic

intro

  • About your linux machine
cat /etc/os-release

lsb_release -a

hostnamectl

uname -a 

uname -r 
  • Update & Upgrade
sudo apt-get update
sudo apt-get upgrade 
sudo apt-get dist-upgrade
sudo apt update && sudo apt upgrade && sudo apt full-upgrade && sudo apt dist-upgrade && sudo apt-get check && sudo apt -f install && sudo apt -y clean && sudo apt -y autoclean && sudo apt autoremove && sudo dpkg --configure -a && sudo apt --fix-broken install

advanced

get-powerful-cli

  • ohmyzsh - get powerful command line
  • .tmux - get powerful command line

python

  • nstall python3
sudo apt-get install python3.9
  • install pip3
sudo apt install python3-pip
  • Set update python as default
sudo update-alternatives --install /usr/bin/python python /usr/bin/python3.9 10
  • Now create virtualenv
pip install virtualenv
  • Now create virtual diretory
mkdir python-venv
  • Now go to inside your python-venv directory through terminal
  • Start command
apt-get install python3-venv
python3 -m venv env
  • Now activation command
source env/bin/activate
  • Now check
python3 

>>> from pwn import *


golang

  • Download - Download from official golang website

or

sudo wget https://golang.org/dl/go1.18linux-amd64.tar.gz
  • Now remove your old golang
sudo rm -rf /usr/local/go/
  • Now extract your new golang
sudo tar -C /usr/local -xzf go1.17.3.linux-amd64.tar.gz
  • Now see your path
echo $PATH
  • Go $PATH
export GOPATH=/home/pr0xh4ck/go/bin

or

echo "export GOPATH=/home/pr0xh4ck/go" >> ~/.bashrc
  • Go ROOT
export GOROOT=/usr/local/go/bin

or

echo "export GOROOT=/usr/local/go" >> ~/.bashrc
mkdir -p ~/go
  • If you face any error

  • Define $PATH

PATH=$PATH:$GOROOT/bin/:$GOPATH/bin

or

echo "PATH=$PATH:$GOROOT/bin/:$GOPATH/bin" >> ~/.bashrc

Then

echo "PATH=$PATH:$GOROOT/bin/:$GOPATH/bin" >> ~/.bashrc

After that

tail ~/.bashrc

Eventually

. ~/.bashrc

bash


networking

ps aux | grep -i have
sudo apt install openvas
gvm-setup 
sudo gvm-check-setup
sudo gvm-feed-update
sudo gvm-start
sudo gvm-stop

Start your won Apache server

sudo service apache2 start

Stop your won Apache server

sudo service apache2 stop

Check open ports

netstat -antp