20199114 "network attack and defense practice" holiday job

2019914 "network attack and defense practice" holiday job

This work belongs courses "Network attack and defense practice."
Where this requirement in the job https://edu.cnblogs.com/campus/besti/19attackdefense/homework/10228
My aim in this course is Understand network attack and defense-related knowledge, learn the basic methods of network attack and defense, improve network attack and defense-related skills
In particular aspects of the job which helped me achieve goals This job helped me learn how to install and configure virtual machines, how to complete the job in the blog using Markdown, learning to use Linux commands
Text of the job See below details of the job (a job, a job two)
Other references

A job

Q: How much do you know about network attack and defense? The course requires basic knowledge of computers and related network, you are what former professional professional, you have mastered the basics of how much current?

A: I was undergraduate software engineering, learning the "computer network", for a basic understanding of computer network-related knowledge, had not been exposed to offensive and defensive aspects of the knowledge network.

Q: Job To use Markdown formatting, Markdown introductions (need to master)?

A: This is the first use Markdown finish the job, downloaded Typora to assist the completion of use is not skilled, took a long time to become familiar.

Operation two

(1) learning to install Ubuntu on VirtualBox virtual machine graphic tutorials installed on your notebook the Linux operating system (you can also use VMWare virtual machine installation, the installation method at your own Baidu).

  • This is my first attempt to install a virtual machine on a laptop, I follow the requirements of the job, installing a VirtualBox virtual machine, and Ubuntu installed on a virtual machine, the operation is performed in accordance with the graphic tutorial given, because the virtual create a blog and installation of machines at the same time is not completed, so there is no installation process shots, only the results of completed shots.





  • In the entire process based on VirtualBox install Ubuntu graphic tutorial very smoothly under the guidance of, but there were two small trouble

    1. In execution
    sudo apt-get update

    When there have been the following:

    After Baidu, to solve the problem, namely input

    sudo rm /var/lib/apt/lists/lock
    sudo rm /var/cache/apt/archives/lock

    And then execute it again.

    1. In execution

      sudo apt-get update
      sudp apt-get upgrade

      的时候,下载速度太太太太太太慢,我等了好久都没结束,最后ctrl+c,后来参考了百度上的方法才光速解决,就跟百度网盘开了超级会员一样的速度,下面是解决过程:

      • sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak 备份原来的sorce文件

      • sudo gedit /etc/apt/sources.list 修改sources.list文件

      • 添加阿里、中科大镜像源

        # 中科大镜像源
        deb https://mirrors.ustc.edu.cn/ubuntu/ bionic main restricted universe multiverse
        deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic main restricted universe multiverse
        deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
        deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
        deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
        deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
        deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
        deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
        deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse
        deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse
        # 阿里镜像源
        deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
        deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
        deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
        deb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
        deb http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
        deb-src http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
        deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
        deb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
        deb-src http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
        deb-src http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse

        将上面的镜像源覆盖到sources.list里,保存。

      • sudo apt-get update 更新源

(2)通过实践学习别出心裁的Linux命令学习法,掌握Linux命令的学习方法。

  • Linux学习应用的一个特点是通过命令行进行使用。命令行的好处主要是可以批处理并自动化,还有些功能GUI无法完成。

    快捷键

    使用Ubuntu有几个快捷键要掌握一下,可以提高使用命令行的效率:

    • CTRL+ALT+T:打开终端,天天使用终端,用鼠标打开太低效了;
    • CTRL+SHIFT+T:新建标签页,编程时有重要应用;
    • ALT+数字N:终端中切换到第N个标签页,编程时有重要应用;
    • Tab:终端中命令补全,当输入某个命令的开头的一部分后,按下Tab键就可以得到提示或者帮助完成;
    • 上下键盘:切换命令历史,刚输入一个很长的命令,按键就可以恢复;
    • CTRL+C:中断程序运行。

    命令

    登录Linux后,我们就可以在#或$符后面去输入命令,Linux中命令格式为:

    command [options] [arguments] //中括号代表是可选的,即有些命令不需要选项也不需要参数

    其中选项(option)是调整命令执行行为的开关,选项不同决定了命令的显示结果不同,参数(arugment)是指命令的作用对象。

    • 执行lsls .命令,显示当前目录内容,这里“.”就是参数;执行 ls -a .显示当前目录中所有内容,如下图所示:

    • 执行man man来查看man帮助,如下图所示:

    • 执行man printfman 1 printfman 3 printf,如下图所示:

    • 后续命令均执行,但cheat安装失败,尚未解决。

(3)参考上面的学习方法通过实践学习Linux 基础入门(新版)课程,掌握常用的Linux命令,重点是3/4/5/6/7/8节。

实验三
who am i          // 查看当前用户
//who命令常用参数
//-a    打印能打印的全部
//-d    打印死掉的进程
//-m    同am i,mom likes
//-q    打印当前登录用户数及用户名
//-u    打印当前登录用户登录信息
//-r    打印运行等级
sudo adduser username   //创建用户
su username                   //切换用户
groups username            //加入用户组
sudo usermod -G sudo username    //给sudo权限
sudo deluser username --remove-home    //删除用户及其目录
ls //显示目录
touch filename    //创建文件
chmod  XXX filename //赋予文件权限,XXX分别是0-7的三个数字分别代表user和groups、others
//1 2 4 三个数字分别代表x执行、w写和r读,加和为7
sudo chmod 777 filename//给出了最大的权限

实验四
touch filename                              // 新建文件
mkdir xxx                             //新建xxx目录
    //-p        新建多级目录
cp xxx /home/shiyanlou                //拷贝xxx文件夹到home/shiyanlou目录下
rm  xxx                             //删除xxx文件夹后加
    //-f        强制删除
    //-r        删除文件夹
mv xxx /home/shiyanlou                // 移动xxx文件夹到home/shiyanlou目录下
cat filename                                 // 顺序查看文件
    //-n        添加行数
nl filename                                //查看文件,显示行号,并且比前两个显示更专业
file filename                               //查看文件类型
head filename                               //显示文件前10行
tail filename                               //显示文件后10行
实验五
    // 修改变量
    path=$PATH
    $ echo $path
    $ path=${path%/home/shiyanlou/mybin}    // 或使用通配符,*表示任意多个任意字符
    $ path=${path%*/mybin}
    $ unset temp                //删除变量
    source .zshrc               //变量立即生效
    whereis filename             //只能搜索二进制文件(-b),man帮助文件(-m)和源代码文件(-s)
    locate filename                 //可以用来查找指定目录下的不同文件类型,但需要`apt-get install locate`
    which filename                 //我们通常使用 which 来确定是否安装了某个指定的软件,因为它只从 PATH 环境变量指定的路径中去搜索命令
    find filename                 //它可以通过文件类型、文件名进行查找,也可以根据文件的属性(如文件的时间戳,文件的权限等)进行搜索。 
        -atime              //最后访问时间
        -ctime              //最后修改文件内容的时间
        -mtime              //最后修改文件属性的时间
        -mtime n                //n 为数字,表示为在 n 天之前的“一天之内”修改过的文件
        -mtime +n                //列出在 n 天之前(不包含 n 天本身)被修改过的文件
        -mtime -n                //列出在 n 天之内(包含 n 天本身)被修改过的文件
        -newer file            //file 为一个已存在的文件,列出比 file 还要新的文件名
实验六
  • 打包
tar –cvf *.tar /home/shiyanlou/Desktop            //打包/home/shiyanlou/Desktop目录*.tar
tar –czf *.tar.gz /home/shiyanlou/Desktop         //打包/home/shiyanlou/Desktop目录为*.tar.gz
zip *.zip /home/shiyanlou/Desktop                 //打包/home/shiyanlou/Desktop目录为*.zip
  • 解压
tar –xvf *.tar              // 解压*.tar
tar -xzvf *.tar.gz             // 解压*.tar.gz
unzip *.zip             // 解压*.zip
实验七
  • 基本操作与输入输出
df              //显示磁盘容量
du              //显示目录大小
    -h          //更易于阅读
    -d          //显示深度
    -s          //显示总计
dd of=test bs=10 count=1 # 或者 dd if=/dev/stdin of=test bs=10 count=1        //输出到文件

dd if=/dev/stdin of=/dev/stdout bs=10 count=1                //输出到标准输出
//注,在打完了这个命令后,继续在终端打字,作为你的输入
dd if=/dev/stdin of=test bs=10 count=1 conv=ucase         //dd在拷贝的同时还可以实现数据转换,将输出的英文字符转换为大写再写入文件
  • 创建虚拟磁盘
dd if=/dev/zero of=virtual.img bs=1M count=256        //从/dev/zero设备创建一个容量为 256M 的空文件
du -h virtual.img
sudo mkfs.ext4 virtual.img            //将磁盘镜像格式化为ext4文件系统
sudo mount            //使用mount查看主机已经挂载的文件系统
mount -o loop -t ext4 virtual.img /mnt         //挂载我们创建的虚拟磁盘镜像到/mnt目录
sudo umount /mnt               //卸载
sudo fdisk -l                //查看硬盘分区表信息
sudo fdisk virtual.img            //中间的分区信息

实验八

Linux有分为内建命令与外部命令

内建命令实际上是 shell 程序的一部分,其中包含的是一些比较简单的 Linux 系统命令,这些命令是写在bash源码的builtins里面的,由 shell 程序识别并在 shell 程序内部完成运行,通常在 Linux 系统加载运行时 shell 就被加载并驻留在系统内存中。而且解析内部命令 shell 不需要创建子进程,因此其执行速度比外部命令快。比如:history、cd、exit 等等。
外部命令是 Linux 系统中的实用程序部分,因为实用程序的功能通常都比较强大,所以其包含的程序量也会很大,在系统加载时并不随系统一起被加载到内存中,而是在需要时才将其调入内存。虽然其不包含在 shell 中,但是其命令执行过程是由 shell 程序控制的。外部命令是在 Bash 之外额外安装的,通常放在/bin,/usr/bin,/sbin,/usr/sbin等等。比如:ls、vi等。

help            //help 命令是用于显示 shell 内建命令的简要帮助信息。
man         //man 工具是显示系统手册页中的内容,也就是一本电子版的字典,这些内容大多数都是对命令的解释信息,还有一些相关的描述。通过查看系统文档中的 man 也可以得到程序的更多相关信息和 Linux 的更多特性。
info            //得到的信息比 man 还要多,info 来自自由软件基金会的 GNU 项目,是 GNU 的超文本帮助系统,能够更完整的显示出 GNU 信息。

Guess you like

Origin www.cnblogs.com/wongyoho/p/12251826.html