Mac system penetration test tips-the command line tool can be tab-completed

  In kali, various tools can be completed, but in mac, some of our tools need to be downloaded by ourselves. Every time we use a tool, we need to enter the directory and then open the command line, which will affect the speed of our penetration test (it means lazy).

Lazy people have their own lazy methods, in fact it is very simple, we only need to add a soft link to the /usr/local/bin/directory to complete the penetration testing tool tab.

The bin directory is a directory that has been included in the environment variable, and the program can be directly executed in the terminal when it is placed or linked to it.

command:

#创建软连接
ln -s <文件/目录> <为文件创建的软连接/目录>
#赋值权限
chmod 777 <文件名>

Demo:

(Note that the path to create the soft link must be the full path of the file)
Insert picture description here

After creating the soft link, do not call the tool in a hurry. Sometimes you need to exit and reopen the tool.


Problems in creating soft links


Question 1: python reports error env: python\r: No such file or directory

Obviously, it is executed well in the original folder, but how to create a soft connection is wrong?

Insert picture description here
solve:

  1. vim enter the source python file
  2. Enter a colon from the keyboard: then enter set ff=unix and press Enter
  3. Enter a colon: from the keyboard, then enter wq, press enter

Question 2: python2 or 3 call

If I encounter python3 files, I am used to running scripts like this:
python3 文件名.py
but soft links cannot be run like this

Insert picture description here

Because to run the file in this way, it will look for the file under python, but there is no such file in the python directory

Solution:

  1. vim edit python source file
  2. Add to#!/usr/bin/env python3

Insert picture description here

Guess you like

Origin blog.csdn.net/weixin_41924764/article/details/112915296