OSCP Learning Notes Kali Linux

Install Kali Linuxhttps://www.kali.org/

Common Commands:

  • pwd
  • man
  • ls
    • ls -la
  • cd
  • mkdir
  • rmdir
  • cp
  • mv
  • locate
  • adduser
  • su
  • sudo
  • echo
  • cat
  • nano
  • chmod
    • chmod 777 username
  • ifconfig
  • ping

Starting and Stopping Services:

  • HTTP
    • /var/www/html
    • apache2
  • SSH
    • netstat -antp | grep ssh
  • Postgresql

  How to Start/Autostart/Stop services(command):

  • service servicename start
  • systemctl enable servicename 
  • service servicename  stop

 Bash Scripting in Kali Linux:

 Example: pingssweep.sh

 1 #!/bin/bash
 2 
 3 if [ "$1" == "" ]
 4 then
 5 echo "Usage: ./pingsweep.sh [Network]"
 6 echo "Example: ./pingsweep.sh 192.168.1"
 7 else
 8 for ip in `seq 1 254`; do
 9 ping -c 1 $1.$ip | grep "64 bytes" | cut -d " " -f 4 | sed "s/.$//" &
10 done
11 fi

 Export the ping result to a file.

./pingsweep.sh 10.0.0 > iplist.txt

 Use with Namp

for ip in $(cat iplist.txt); do nmap -Pn $ip; done

 Result

相信未来 - 该面对的绝不逃避,该执著的永不怨悔,该舍弃的不再留念,该珍惜的好好把握。
原文地址:https://www.cnblogs.com/keepmoving1113/p/11029221.html