OSCP-1简单知识

这篇很浅,动手实践一下,会的就跳

kali命令行:

pwd当前工作目录

cd 换个目录 例 cd /var/www/html

man 手册,查看某命令的相关说明,q键退出 例  man pwd

ls 显示当前目录下文件。 常用 ls -l 和 ls -la , -l 查看详细,带权限,a就是显示所有,包括隐藏文件,,隐藏文件名前面有个点,例子    .cache

  例子:

    drwx r-x x-x 10 abc daddy 4049 Dec 9 15:00 .cache

    drwx :前4位是文件拥有者的权限,

    r-x:5到7位是组权限

    x-x:8到10位是用户权限

    第一位d指这是给目录,-:普通文件,l:链接文件,b:设备文件,c:字符设备文件,p:管道文件

    其他位:r指read 读。w是可写 ,x可执行, - 不可

mkdir 新建目录 例: mkdir new

rmdir删除目录

touch 新建文件  touch text.txt   平时一般用nano      nano exploit.py

cp  copy么。 cp text.txt /tmp所在目录考其他目前   。 cp /root/text.txt /tmp 其他目录考其他目录

mv 移动。 尽量使用cp。先考后删,减少误操作导致文件丢失

updatedb 用来创建或更新locate命令所必需的数据库文件,简单说就是查找前用一用

locate   找东东。。。locate flag                  

adduser  增加一个user, 例子,adduser Tom 然后输入密码

su 更换用户,su Bob

sudo 这个用法比较多,后面用到哪个细说哪个吧,

echo  echo hello显示在命令行,echo hello>hello.txt 这个是在文件第一行写入hello   ,echo hello>>hello.txt这个是在新的一行写入。

chmod 数字权限法,通过数字表示上面说到的文件权限问题,,动手B/G搜一下熟悉一下, 常用chmod 777 所有人可读写执行。

ifconfig   win是ipconfig 。,网络信息

ping  例:ping 192.168.1.2 -c4    ping4次,不然会一直ping。-c后面的数字就是数几次

service   运行停止服务 例 service apache2 start 停就start换成stop(网页服务的网页都存在/var/www/html中,放好 启动,简单网页就出来了)

扩展:

  service ssh start

  netstat -antp | grep ssh 查看ssh状态

  systemctl ssh start  开机启动ssh

  service postgresql start 

  systemctl ssh postgresql  开源数据库服务和ssh一样设置成开机启动吧

饿了,吃饭

  

猜你喜欢

转载自www.cnblogs.com/int21h/p/11606751.html
今日推荐