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

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.

主站蜘蛛池模板: 伽师县| 建昌县| 阿巴嘎旗| 禄劝| 凤阳县| 晋城| 红原县| 来安县| 德阳市| 天津市| 建阳市| 北流市| 京山县| 屯昌县| 托里县| 靖安县| 弥勒县| 临潭县| 江口县| 和硕县| 彝良县| 丰顺县| 南宁市| 黄梅县| 咸宁市| 临邑县| 成都市| 金川县| 台江县| 兴文县| 澄迈县| 醴陵市| 稷山县| 涞水县| 商洛市| 新余市| 车致| 平塘县| 嘉荫县| 阿克苏市| 峡江县|