LINUX Commands

LINUX Commands


Update the kali with complete Distribution upgrade:

  • sudo apt update
  • sudo apt upgrade
  • sudo apt full-upgrade -y
  • sudo apt dist-upgrade -y

Same on windows equivalent

  • PS C:\Users> winget.exe upgrade --all --include-unknown

How to Get Hostname and version of Linux

  • hostnamectl
  • lsb_release -a
  • cat /etc/os-release

Run without Admin Access

  • Create - run.bat, then below lines
  • Set_COMPAT_LAYER=RunAsInvoker
  • Start Chrome.exe

external IP address

  • $ curl ifconfig.me

Search the commands in History 

  • use CTRL + R and typing

Mount A network Drive 

  • sudo mount -t cifs //192.168.1.5/GNAS /mnt/nwgnas

Certain Linux commands:

  • screenfetch
  • glmark2
  • lscpu
  • lsblk

Network Address Commands

  • ip address
  • if config

To identify IPV6 address available 
  • netsat -tlnp | grep tcp6
  • ip -6 addr
for Windows
netsh interface ipv6 show subinterfaces

**************************************************************

Boot Disk Installer:

  • https://netboot.xyz/
  • https://www.ventoy.net/en/index.html
  • https://medicatusb.com/
**************************************************************

Wi-Fi

Reference : https://developer-old.gnome.org/NetworkManager/stable/nmcli.html

  •  nmcli general                                                
    • STATE      CONNECTIVITY  WIFI-HW  WIFI     WWAN-HW  WWAN   
  •  nmcli connection show
    • NAME    UUID    TYPE      DEVICE  
  • sudo systemctl restart NetworkManager
  • nmcli radio wifi off  
  • nmcli radio wifi on
  • nmcli device wifi list

        Connect to a password-protected wifi network

        • $ nmcli device wifi connect "$SSID" password "$PASSWORD"

        **************************************************************

        GREP command

        Nmap : using Grep to filter IP addresses
        Syntax : cat ip.txt | grep "text to search" | cut -d"" -f 2 | sort | uniq

        cat ip.txt | grep -e "Status: Up"    

        SEARCH commands: 

        find : sudo find / -type f -name apache2

        whereis

        locate

        which
        **************************************************************

        Installing deb package  

        sudo dpkg -i *.deb

        Load the wl module: https://wiki.debian.org/wl

        sudo modprobe wl

        Updating snap store in Ubuntu 

        sudo snap refresh snap-store

        Enable write permission on HFS+ HDD on Ubuntu

        sudo df
        sudo lsblk -o NAME,FSTYPE,SIZE,MOUNTPOINT,LABEL
        sudo blkid

        sudo fdisk -l

         sudo apt install hfsprogs 
         sudo chown -R $USER:$USER /media/gouti/HDD_MAC
        $ sudo umount /dev/sdb2
        $ sudo mount -t hfsplus -o rw,force /dev/sdb2 /mnt/HDDmac/


        Search a command to install from CLI:


        :~ $ apt search hwinfo
        Sorting... Done                                                                                                                    
        Full Text Search... Done                                                                                                          
        backupninja/oldstable,oldstable 1.2.1-1 all                                                                                        
          lightweight, extensible meta-backup system                                                                                      
                                                                                                                                           
        forensics-extra/oldstable,oldstable 2.29 all                                                                                      
          Forensics Environment - extra console components (metapackage)                                                                  
                                                                                                                                           
        hwinfo/oldstable 21.72-1 arm64                                                                                                    
          Hardware identification system                                                                                                  
                                                                                                                                           
        libhd-dev/oldstable 21.72-1 arm64
          Hardware identification system library and headers

        libhd-doc/oldstable,oldstable 21.72-1 all
          Hardware identification system library documentation

        libhd21/oldstable 21.72-1 arm64
          Hardware identification system library

        :~ $ sudo apt install hwinfo

        ************************************************************************************************

        MacBook pro 2012 : Ubuntu boot Error: uninstall kernel when  kernel panic not syncing:


        While Booting press options key  
        Advance Ubuntu
        select lower version kernel - login then perform the following commands to uninstall the kernel which causes problem
        Ubuntu-boot-error-kernel
        Ubuntu-boot-error-kernel

        Now use the below GUI to uninstall:


        Method 1: Installing Latest Mainline Kernel on Ubuntu via GUI
        sudo add-apt-repository ppa:cappelikan/ppa
        sudo apt update && sudo apt upgrade -y
        sudo apt install -y mainline

        If the GUI is not able to uninstall, get the error message as dependences and paste them as below to remove manually 


        sudo apt remove linux-headers-6.5.0-27-generic linux-image-6.5.0-27-generic linux-modules-extra-6.5.0-27-generic  linux-modules-6.5.0-27-generic

        Then use autoremove purge to remove residues 
        sudo apt autoremove --purge 
        sudo apt update 
        sudo apt upgrade -y

        ************************************************************************************************
        sudo apt install iptraf-ng
        iptraf-ng -i eth0
        iptraf-ng -i wlan0
        ****************************************

        Remote desktop Ubuntu machine  using Remmina


        on the client machine Enable the sharing option
        then enable the VNC, the click on the hamburger menu and select use password.


        Linux Command Line Browser:

        https://lynx.invisible-island.net/

        Sudo apt install lynx -y 

        terminal browser

        *****************************************************************

        Enable SSH on Kali


        :~@ sudo apt install openssh-server
        :~@ sudo systemctl start ssh
        :~@ sudo systemctl enable ssh


        :~@ ssh kali@192.168.1.10

        ********************************************

        Nmap

        Nmap Tutorial to find Network Vulnerabilities


        nmap -sS -D 10.1.0.1

        -D = decoy  and specifying a dummy ip-address 

        Nmap Scripting Engine (NSE)

        to check vulnerabilities 

        sudo nmap --script vuln 

        *********************************

        dig www.google.com  = gives the IP address 

        -Pn  No Host discovery  = Nmap skips the host searching process & performs full target scan 
        -PS means TCP SYN request
        -PA means TCP ACK request
        -PU means UDP request 
        -PE means ICMP echo request 
        -PR means ARP request

        TCP Scan Types 
        -sS    TCP SYN scan ( half open scan / stealthy  scan)
        -sT = TCP  connect scan (full open scan)
        -sN = TCP  NULL scan
        -sF = TCP  FIN scan
        -sX = TCP  Xmas scan
        -sA = TCP  ACK scan
        -sW = TCP window scan
        -sM  = TCP maimon scan

        -F  flag  does a fast scan 
        e.g. nmap  -F 192.168.1.1

        Timing template 

        -T5  insane 
        -T4  aggressive
        -T3  Normal
        -T2  polite
        -T1 sneaky
        -T0 paranoid 

        -sV  = Service version detection
        sudo nmap -sV -O -F 10.0.2.4 

        E.g. = nmap -T4 -F 192.168.1.*

        -A option provide details and inbuilt script of nmap scan
        sudo nmap -A -T4 192.168.1.*

        nmap saving output files

        -oN = Human readable text file
        -oX = Machine readable file
        -oG = Grepable text file

        -v  = allows to see progress by nmap 

        DNS spoofing: 
        windows powershell : ipconfig /displaydns

        ********************************************************









        Comments

        Popular Posts

        Chennai :MTC complaint cell Customer Care No.:+91-9445030516 /Toll Free : 18005991500

        Marriage Registration Online steps [Tamil Nadu]

        Multifactor authentication Updated for 2024