0% found this document useful (0 votes)
35 views2 pages

Comenzi

This document provides commands for network scanning and system administration tasks in Linux. It lists commands like nmap, netdiscover, arp to discover hosts on the network. It also provides commands for adding users, managing files and directories, viewing processes and system information.

Uploaded by

Micah K
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
35 views2 pages

Comenzi

This document provides commands for network scanning and system administration tasks in Linux. It lists commands like nmap, netdiscover, arp to discover hosts on the network. It also provides commands for adding users, managing files and directories, viewing processes and system information.

Uploaded by

Micah K
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

sudo arp -a # enlist hosts

sudo netdiscover # a tool for discovering hosts as well


netstat -nr # this command will show your router ip
nmap 192.168.1.1/24
nmap -O <IP> # -O este folosit pentru a descoperi ce OS foloseste sistemul
respectiv
nmap -sV <IP> # detecteaza versiunea unui service al unui port deschis
nmap -sV --version-intensity <IP> # 7 e default, iar intensitatea poate fi de la 0
la 9 si este folosita pentru a identifica mai cu precizie versiunile.
nmap -A <IP> # aggressive option
nmap -S <IP> # Spoof the IP addr, it will make our target think that someone else
is scanning them
nmap -S -Pn -e -g <IP> # -S option will not work without -Pn option and assume that
are hosts are online, -e you must specify your netw interface
sessions -i <ID> # -i = to interact with a session
with -g option you can specify a certain port to bypass the firewall
cat something.txt | grep src (for example) # another interesting command
echo "Testing" > test.txt # another cool command
rm -rf directory # the command for removing directories
sudo adduser <name> # add a new user
ls -la # list all
man -k <command> # with k you can perform a keyword search
man -k '^command$' # search using regular expression
apropos <command> # this is equivalent to man command
locate <something> # locate something as it says
sudo find / -name sbd*
which <something>
sudo ss -antlp | grep sshd # to verify if ssh is running
apt-cache search <package name> # displays information stored in the internal
cached package database
sudo apt remove --purge <package name> # completely removes packages from Kali
sudo dpkg -i <package name> # install a package, either directly or indirectly
through apt
export b=<something> # define an environment variable
echo "$$" # display procID
history # the history of commands that has been entered
!! # repeats the last command that was executed during our terminal session
wc -m < something.txt # count characters from a file
cut -d ":" -f 1 /etc/passwd
echo "salut::mai::prietene" | awk -F "::" '{print $1, $3}' # awk is used as a data
extraction and -F is the field separator
ps -ef # lists processess system-wide, -ef = e: select all procs, f: display full
format listing (UID, PID, etc)
kill <PID> # kill a process
wget -O # download a file and save it with a different name
axel -a -n 20 -o something.pdf <link>
netstat -nr # -n to not resolve names and -r to display info routing table

cat /proc/cpuinfo or lscpu - show cpu info


clear <adresa/nume> - gdb - remove a breakpoint at the address

awk -F ":" '$7 == "/bin/false" {print "User is: "$1, "and the home dir is: "$6}'
/etc/passwd #
=> $7 == "/bin/false" # check if the 7th data column is /bin/false
-F ":" data delimiter to :
SAU putem si cu cut: cut -d: -f6 /etc/passwd

-----------------------------------------------------------------------------------
---------
/bin - basic programs (ls, cd, cat, etc.)
/sbin - system programs (fdisk, mkfs, sysctl, etc.)
/etc - configuration files
/usr/bin - apps (apt, ncat, nmap, etc.)
/usr/share - apps support and data files

-----------------------------------------------------------------------------------
---------

cache: example.com // gaseste content care a fost sters cica

You might also like