官术网_书友最值得收藏!

Chapter 2. The Basics of Python Scripting

Before diving into writing your first Python script, a few concepts should be understood. Learning these items now will help you develop code quicker in the future. This will improve your abilities as a penetration tester or in understanding what an assessor is doing when they are creating real-time custom code and what questions you should be asking. You should also understand how to create the scripts and the goal you are trying to achieve. You will often find out that your scripts will morph over time and the purpose may change. This may happen because you realize that the real need for the script may not be there or that there is an existing tool for the particular capability.

Many scripters find this discouraging, as a project that they may have been working on for a great deal of time you may find that the tool has duplicate features of more advanced tools. Instead of looking at this as a failed project, look at the activity as an experience wherein you learned new concepts and techniques that you did not initially know. Additionally, keep it at the back of your mind at all times when you are developing code snippets that can be used for other projects in the future.

To this end, try and build your code cleanly, comment it with what you are doing, and make it modular so that once you learn how to build functions, they can be cut and pasted into other scripts in the future. The first step in this journey is to describe the computer science glossary at a high level so that you can understand future chapters or other tutorials. Without understanding these basic concepts, you may misunderstand how to achieve your desired results.

Note

Before running any of the scripts in this book, I recommend that you run the setup script on the git repository, which will configure your Kali instance with all the necessary libraries. The script can be found at https://raw.githubusercontent.com/funkandwagnalls/pythonpentest/master/setup.sh.

主站蜘蛛池模板: 洛扎县| 安龙县| 陈巴尔虎旗| 方城县| 明星| 临西县| 扎囊县| 临潭县| 白城市| 宁化县| 五河县| 恩平市| 炉霍县| 永兴县| 福泉市| 日土县| 永宁县| 礼泉县| 镇安县| 凯里市| 安达市| 海城市| 阳高县| 高尔夫| 来宾市| 温州市| 陵水| 墨竹工卡县| 金塔县| 宜宾市| 宣城市| 玛纳斯县| 西和县| 巫山县| 东至县| 沾化县| 鄂州市| 鄂伦春自治旗| 天津市| 蒲城县| 绍兴市|