{"id":993798,"date":"2024-12-27T08:49:03","date_gmt":"2024-12-27T00:49:03","guid":{"rendered":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/993798.html"},"modified":"2024-12-27T08:49:07","modified_gmt":"2024-12-27T00:49:07","slug":"%e5%a6%82%e4%bd%95%e7%94%a8kali%e5%86%99python","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/993798.html","title":{"rendered":"\u5982\u4f55\u7528kali\u5199python"},"content":{"rendered":"<p style=\"text-align:center;\" ><img decoding=\"async\" src=\"https:\/\/cdn-kb.worktile.com\/kb\/wp-content\/uploads\/2024\/04\/25071044\/63328be9-ef74-4ae3-8e62-3401804c2810.webp\" alt=\"\u5982\u4f55\u7528kali\u5199python\" \/><\/p>\n<p><p> <strong>\u5728Kali Linux\u4e0a\u5199Python\u4ee3\u7801\u53ef\u4ee5\u901a\u8fc7\u5b89\u88c5Python\u73af\u5883\u3001\u9009\u62e9\u5408\u9002\u7684\u7f16\u8f91\u5668\u6216IDE\u3001\u4f7f\u7528Python\u5e93\u8fdb\u884c\u5f00\u53d1\u7b49\u6b65\u9aa4\u5b9e\u73b0\u3002\u9996\u5148\uff0c\u786e\u4fdd\u7cfb\u7edf\u4e0a\u5b89\u88c5\u4e86Python\u89e3\u91ca\u5668\u548cpip\u5305\u7ba1\u7406\u5de5\u5177\uff0c\u53ef\u4ee5\u901a\u8fc7\u547d\u4ee4\u884c\u9a8c\u8bc1\u5b89\u88c5\u60c5\u51b5\uff1b\u5176\u6b21\uff0c\u9009\u62e9\u9002\u5408\u7684\u4ee3\u7801\u7f16\u8f91\u5668\u6216IDE\uff0c\u5982VS Code\u3001PyCharm\u3001Vim\u7b49\uff0c\u6839\u636e\u4e2a\u4eba\u9700\u6c42\u914d\u7f6e\u5f00\u53d1\u73af\u5883\uff1b\u6700\u540e\uff0c\u5b66\u4e60\u4f7f\u7528Python\u5e93\uff0c\u8fdb\u884c\u9879\u76ee\u5f00\u53d1\u3002<\/strong>\u4e0b\u9762\u5c06\u8be6\u7ec6\u4ecb\u7ecd\u5982\u4f55\u5728Kali Linux\u4e0a\u7528Python\u8fdb\u884c\u5f00\u53d1\u3002<\/p>\n<\/p>\n<p><p>\u4e00\u3001\u5b89\u88c5Python\u73af\u5883<\/p>\n<\/p>\n<p><p>\u5728Kali Linux\u4e0a\uff0cPython\u901a\u5e38\u662f\u9884\u88c5\u7684\uff0c\u4f46\u6709\u65f6\u53ef\u80fd\u9700\u8981\u5b89\u88c5\u6700\u65b0\u7248\u672c\u6216\u7279\u5b9a\u7248\u672c\u7684Python\u3002<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>\u68c0\u67e5Python\u7248\u672c<\/strong><\/p>\n<\/p>\n<p><p>\u6253\u5f00\u7ec8\u7aef\uff0c\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\u68c0\u67e5Python\u7248\u672c\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">python3 --version<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5982\u679c\u7cfb\u7edf\u4e2d\u5df2\u5b89\u88c5Python\uff0c\u4f1a\u663e\u793a\u7248\u672c\u53f7\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u5b89\u88c5Python<\/strong><\/p>\n<\/p>\n<p><p>\u5982\u679cPython\u672a\u5b89\u88c5\u6216\u9700\u8981\u66f4\u65b0\uff0c\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u547d\u4ee4\u5b89\u88c5Python 3\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">sudo apt update<\/p>\n<p>sudo apt install python3<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u5b89\u88c5pip<\/strong><\/p>\n<\/p>\n<p><p>pip\u662fPython\u7684\u5305\u7ba1\u7406\u5de5\u5177\uff0c\u53ef\u4ee5\u7528\u4e8e\u5b89\u88c5\u548c\u7ba1\u7406Python\u5e93\u3002\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u547d\u4ee4\u5b89\u88c5pip\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">sudo apt install python3-pip<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u9a8c\u8bc1\u5b89\u88c5\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">pip3 --version<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<\/ol>\n<p><p>\u4e8c\u3001\u9009\u62e9\u7f16\u8f91\u5668\u6216IDE<\/p>\n<\/p>\n<p><p>\u9009\u62e9\u5408\u9002\u7684\u7f16\u8f91\u5668\u6216IDE\u5bf9\u4e8e\u63d0\u9ad8\u5f00\u53d1\u6548\u7387\u81f3\u5173\u91cd\u8981\uff0c\u4ee5\u4e0b\u662f\u4e00\u4e9b\u5e38\u7528\u7684\u7f16\u8f91\u5668\u548cIDE\u3002<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>VS Code<\/strong><\/p>\n<\/p>\n<p><p>VS Code\u662f\u4e00\u6b3e\u6d41\u884c\u7684\u5f00\u6e90\u4ee3\u7801\u7f16\u8f91\u5668\uff0c\u652f\u6301\u4e30\u5bcc\u7684\u63d2\u4ef6\u548c\u6269\u5c55\u3002\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u6b65\u9aa4\u5b89\u88c5\uff1a<\/p>\n<\/p>\n<ul>\n<li>\n<p>\u4e0b\u8f7d\u5e76\u5b89\u88c5\uff1a\u4eceVS Code\u5b98\u65b9\u7f51\u7ad9\u4e0b\u8f7d.deb\u5b89\u88c5\u5305\uff0c\u7136\u540e\u4f7f\u7528dpkg\u547d\u4ee4\u8fdb\u884c\u5b89\u88c5\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">sudo dpkg -i &lt;VSCode\u4e0b\u8f7d\u8def\u5f84&gt;<\/p>\n<p>sudo apt-get install -f<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<li>\n<p>\u5b89\u88c5Python\u6269\u5c55\uff1a\u5728VS Code\u7684\u6269\u5c55\u5e02\u573a\u4e2d\u641c\u7d22\u5e76\u5b89\u88c5Python\u63d2\u4ef6\u3002<\/p>\n<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><strong>PyCharm<\/strong><\/p>\n<\/p>\n<p><p>PyCharm\u662fJetBr<a href=\"https:\/\/docs.pingcode.com\/blog\/59162.html\" target=\"_blank\">AI<\/a>ns\u5f00\u53d1\u7684\u4e00\u6b3e\u4e13\u4e3aPython\u5f00\u53d1\u8bbe\u8ba1\u7684IDE\uff0c\u529f\u80fd\u5f3a\u5927\u3002\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u65b9\u5f0f\u5b89\u88c5\uff1a<\/p>\n<\/p>\n<ul>\n<li>\n<p>\u4e0b\u8f7d\u5e76\u5b89\u88c5\uff1a\u4ecePyCharm\u5b98\u65b9\u7f51\u7ad9\u4e0b\u8f7d\u538b\u7f29\u5305\uff0c\u89e3\u538b\u540e\u8fd0\u884c\u5176\u4e2d\u7684\u5b89\u88c5\u811a\u672c\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p>\u914d\u7f6ePython\u89e3\u91ca\u5668\uff1a\u5728PyCharm\u7684\u8bbe\u7f6e\u4e2d\uff0c\u9009\u62e9\u672c\u5730Python\u89e3\u91ca\u5668\u3002<\/p>\n<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><strong>Vim<\/strong><\/p>\n<\/p>\n<p><p>Vim\u662f\u4e00\u6b3e\u5f3a\u5927\u7684\u6587\u672c\u7f16\u8f91\u5668\uff0c\u9002\u5408\u5728\u7ec8\u7aef\u4e2d\u4f7f\u7528\u3002\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u65b9\u5f0f\u914d\u7f6eVim\u7528\u4e8ePython\u5f00\u53d1\uff1a<\/p>\n<\/p>\n<ul>\n<li>\n<p>\u5b89\u88c5Vim\u63d2\u4ef6\u7ba1\u7406\u5668\uff08\u5982Vundle\uff09\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">git clone https:\/\/github.com\/VundleVim\/Vundle.vim.git ~\/.vim\/bundle\/Vundle.vim<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<li>\n<p>\u7f16\u8f91.vimrc\u6587\u4ef6\uff0c\u6dfb\u52a0Python\u76f8\u5173\u63d2\u4ef6\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-vim\">Plugin &#39;davidhalter\/jedi-vim&#39;<\/p>\n<p>Plugin &#39;vim-syntastic\/syntastic&#39;<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<li>\n<p>\u5b89\u88c5\u63d2\u4ef6\uff1a\u5728Vim\u4e2d\u6267\u884c<code>:PluginInstall<\/code>\u547d\u4ee4\u3002<\/p>\n<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<p><p>\u4e09\u3001\u5b66\u4e60Python\u57fa\u7840<\/p>\n<\/p>\n<p><p>\u5728Kali Linux\u4e0a\u8fdb\u884cPython\u5f00\u53d1\uff0c\u9996\u5148\u9700\u8981\u638c\u63e1Python\u7684\u57fa\u7840\u77e5\u8bc6\uff0c\u5305\u62ec\u8bed\u6cd5\u3001\u6570\u636e\u7c7b\u578b\u3001\u63a7\u5236\u7ed3\u6784\u3001\u51fd\u6570\u548c\u6a21\u5757\u7b49\u3002<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>Python\u8bed\u6cd5<\/strong><\/p>\n<\/p>\n<ul>\n<li>\n<p>\u6ce8\u91ca\uff1a\u4f7f\u7528<code>#<\/code>\u7b26\u53f7\u8fdb\u884c\u5355\u884c\u6ce8\u91ca\uff0c\u4f7f\u7528<code>&#39;&#39;&#39;<\/code>\u6216<code>&quot;&quot;&quot;<\/code>\u8fdb\u884c\u591a\u884c\u6ce8\u91ca\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p>\u53d8\u91cf\uff1aPython\u662f\u52a8\u6001\u7c7b\u578b\u8bed\u8a00\uff0c\u4e0d\u9700\u8981\u6307\u5b9a\u53d8\u91cf\u7c7b\u578b\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">x = 10<\/p>\n<p>name = &quot;Kali&quot;<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<li>\n<p>\u6570\u636e\u7c7b\u578b\uff1a\u5305\u62ec\u6574\u578b\u3001\u6d6e\u70b9\u578b\u3001\u5b57\u7b26\u4e32\u3001\u5217\u8868\u3001\u5143\u7ec4\u3001\u5b57\u5178\u548c\u96c6\u5408\u3002<\/p>\n<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><strong>\u63a7\u5236\u7ed3\u6784<\/strong><\/p>\n<\/p>\n<ul>\n<li>\n<p>\u6761\u4ef6\u8bed\u53e5\uff1a\u4f7f\u7528<code>if<\/code>\u3001<code>elif<\/code>\u548c<code>else<\/code>\u5b9e\u73b0\u5206\u652f\u7ed3\u6784\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">if x &gt; 0:<\/p>\n<p>    print(&quot;Positive&quot;)<\/p>\n<p>elif x &lt; 0:<\/p>\n<p>    print(&quot;Negative&quot;)<\/p>\n<p>else:<\/p>\n<p>    print(&quot;Zero&quot;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<li>\n<p>\u5faa\u73af\u8bed\u53e5\uff1a\u4f7f\u7528<code>for<\/code>\u548c<code>while<\/code>\u5b9e\u73b0\u5faa\u73af\u7ed3\u6784\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">for i in range(5):<\/p>\n<p>    print(i)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><strong>\u51fd\u6570\u548c\u6a21\u5757<\/strong><\/p>\n<\/p>\n<ul>\n<li>\n<p>\u51fd\u6570\uff1a\u4f7f\u7528<code>def<\/code>\u5173\u952e\u5b57\u5b9a\u4e49\u51fd\u6570\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">def greet(name):<\/p>\n<p>    return f&quot;Hello, {name}&quot;<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<li>\n<p>\u6a21\u5757\uff1a\u901a\u8fc7\u5bfc\u5165\u6a21\u5757\u4f7f\u7528\u5176\u529f\u80fd\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import math<\/p>\n<p>print(math.sqrt(16))<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<p><p>\u56db\u3001\u4f7f\u7528Python\u5e93\u8fdb\u884c\u5f00\u53d1<\/p>\n<\/p>\n<p><p>Python\u6709\u4e30\u5bcc\u7684\u7b2c\u4e09\u65b9\u5e93\uff0c\u6db5\u76d6\u4e86\u7f51\u7edc\u3001\u6570\u636e\u5206\u6790\u3001<a href=\"https:\/\/docs.pingcode.com\/ask\/59192.html\" target=\"_blank\">\u673a\u5668\u5b66\u4e60<\/a>\u7b49\u591a\u9886\u57df\u5e94\u7528\u3002<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>\u7f51\u7edc\u7f16\u7a0b<\/strong><\/p>\n<\/p>\n<ul>\n<li>\n<p>\u4f7f\u7528<code>socket<\/code>\u5e93\u8fdb\u884c\u7f51\u7edc\u7f16\u7a0b\uff0c\u5b9e\u73b0\u5ba2\u6237\u7aef\u548c\u670d\u52a1\u5668\u901a\u4fe1\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import socket<\/p>\n<p>s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)<\/p>\n<p>s.connect((&quot;example.com&quot;, 80))<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<li>\n<p>\u4f7f\u7528<code>requests<\/code>\u5e93\u8fdb\u884cHTTP\u8bf7\u6c42\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import requests<\/p>\n<p>response = requests.get(&quot;http:\/\/example.com&quot;)<\/p>\n<p>print(response.text)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><strong>\u6570\u636e\u5206\u6790<\/strong><\/p>\n<\/p>\n<ul>\n<li>\n<p>\u4f7f\u7528<code>pandas<\/code>\u5e93\u8fdb\u884c\u6570\u636e\u5206\u6790\u548c\u5904\u7406\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import pandas as pd<\/p>\n<p>df = pd.read_csv(&quot;data.csv&quot;)<\/p>\n<p>print(df.head())<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<li>\n<p>\u4f7f\u7528<code>numpy<\/code>\u5e93\u8fdb\u884c\u6570\u503c\u8ba1\u7b97\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import numpy as np<\/p>\n<p>array = np.array([1, 2, 3])<\/p>\n<p>print(array.mean())<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><strong>\u673a\u5668\u5b66\u4e60<\/strong><\/p>\n<\/p>\n<ul>\n<li>\n<p>\u4f7f\u7528<code>scikit-learn<\/code>\u5e93\u8fdb\u884c\u673a\u5668\u5b66\u4e60\u6a21\u578b\u8bad\u7ec3\u548c\u9884\u6d4b\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">from sklearn.model_selection import train_test_split<\/p>\n<p>from sklearn.linear_model import LinearRegression<\/p>\n<p>X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2)<\/p>\n<p>model = LinearRegression()<\/p>\n<p>model.fit(X_train, y_train)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<p><p>\u4e94\u3001\u9879\u76ee\u5f00\u53d1\u4e0e\u5b9e\u8df5<\/p>\n<\/p>\n<p><p>\u5728\u638c\u63e1\u4e86Python\u57fa\u7840\u77e5\u8bc6\u548c\u5e38\u7528\u5e93\u540e\uff0c\u53ef\u4ee5\u5f00\u59cb\u8fdb\u884c\u9879\u76ee\u5f00\u53d1\uff0c\u901a\u8fc7\u5b9e\u8df5\u63d0\u9ad8\u7f16\u7a0b\u6280\u80fd\u3002<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>\u9009\u62e9\u9879\u76ee\u9898\u6750<\/strong><\/p>\n<\/p>\n<p><p>\u6839\u636e\u81ea\u5df1\u7684\u5174\u8da3\u548c\u9700\u6c42\u9009\u62e9\u9879\u76ee\u9898\u6750\uff0c\u5982Web\u5f00\u53d1\u3001\u6570\u636e\u5206\u6790\u3001\u81ea\u52a8\u5316\u811a\u672c\u7b49\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u9879\u76ee\u89c4\u5212\u4e0e\u8bbe\u8ba1<\/strong><\/p>\n<\/p>\n<ul>\n<li>\u660e\u786e\u9879\u76ee\u76ee\u6807\uff0c\u5236\u5b9a\u5f00\u53d1\u8ba1\u5212\u3002<\/li>\n<li>\u8bbe\u8ba1\u9879\u76ee\u7ed3\u6784\uff0c\u89c4\u5212\u6a21\u5757\u548c\u529f\u80fd\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><strong>\u4ee3\u7801\u5b9e\u73b0\u4e0e\u6d4b\u8bd5<\/strong><\/p>\n<\/p>\n<ul>\n<li>\u6839\u636e\u8bbe\u8ba1\u65b9\u6848\u7f16\u5199\u4ee3\u7801\uff0c\u5b9e\u73b0\u5404\u4e2a\u529f\u80fd\u6a21\u5757\u3002<\/li>\n<li>\u7f16\u5199\u6d4b\u8bd5\u7528\u4f8b\uff0c\u8fdb\u884c\u5355\u5143\u6d4b\u8bd5\u548c\u96c6\u6210\u6d4b\u8bd5\uff0c\u786e\u4fdd\u4ee3\u7801\u8d28\u91cf\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><strong>\u9879\u76ee\u90e8\u7f72\u4e0e\u7ef4\u62a4<\/strong><\/p>\n<\/p>\n<ul>\n<li>\u90e8\u7f72\u9879\u76ee\u5230\u670d\u52a1\u5668\uff0c\u914d\u7f6e\u73af\u5883\u548c\u4f9d\u8d56\u3002<\/li>\n<li>\u5b9a\u671f\u7ef4\u62a4\u548c\u66f4\u65b0\u9879\u76ee\uff0c\u4fee\u590dBUG\uff0c\u4f18\u5316\u6027\u80fd\u3002<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<p><p>\u516d\u3001\u5b66\u4e60\u8d44\u6e90\u4e0e\u793e\u533a<\/p>\n<\/p>\n<p><p>\u5728\u5b66\u4e60\u548c\u5f00\u53d1\u8fc7\u7a0b\u4e2d\uff0c\u53ef\u4ee5\u5229\u7528\u4e30\u5bcc\u7684\u5b66\u4e60\u8d44\u6e90\u548c\u793e\u533a\u652f\u6301\u3002<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>\u5728\u7ebf\u6559\u7a0b\u4e0e\u4e66\u7c4d<\/strong><\/p>\n<\/p>\n<ul>\n<li>\u5b98\u65b9\u6587\u6863\u548c\u6559\u7a0b\uff0c\u5982Python\u5b98\u65b9\u6587\u6863\u3002<\/li>\n<li>\u5728\u7ebf\u5b66\u4e60\u5e73\u53f0\uff0c\u5982Codecademy\u3001Coursera\u3002<\/li>\n<li>\u7ecf\u5178\u4e66\u7c4d\uff0c\u5982\u300aPython\u7f16\u7a0b\uff1a\u4ece\u5165\u95e8\u5230\u5b9e\u8df5\u300b\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><strong>\u6280\u672f\u793e\u533a\u4e0e\u8bba\u575b<\/strong><\/p>\n<\/p>\n<ul>\n<li>\u53c2\u4e0e\u6280\u672f\u793e\u533a\uff0c\u5982Stack Overflow\u3001Reddit\u7684Python\u677f\u5757\u3002<\/li>\n<li>\u53c2\u52a0\u7ebf\u4e0b\u6d3b\u52a8\u548c\u4f1a\u8bae\uff0c\u4ea4\u6d41\u7ecf\u9a8c\uff0c\u83b7\u53d6\u65b0\u77e5\u3002<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<p><p>\u901a\u8fc7\u4ee5\u4e0a\u6b65\u9aa4\u548c\u5b9e\u8df5\uff0c\u4f60\u53ef\u4ee5\u5728Kali Linux\u4e0a\u9ad8\u6548\u5730\u8fdb\u884cPython\u5f00\u53d1\u3002\u4e0d\u65ad\u5b66\u4e60\u548c\u63a2\u7d22\uff0c\u63d0\u5347\u81ea\u5df1\u7684\u7f16\u7a0b\u80fd\u529b\u548c\u9879\u76ee\u7ecf\u9a8c\u3002<\/p>\n<\/p>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<p> <strong>\u5728Kali Linux\u4e0a\u5b89\u88c5Python\u5f00\u53d1\u73af\u5883\u9700\u8981\u54ea\u4e9b\u6b65\u9aa4\uff1f<\/strong><br \/>\u5728Kali Linux\u4e2d\uff0c\u60a8\u53ef\u4ee5\u4f7f\u7528\u5305\u7ba1\u7406\u5668APT\u8f7b\u677e\u5b89\u88c5Python\u3002\u6253\u5f00\u7ec8\u7aef\u5e76\u8f93\u5165<code>sudo apt update<\/code>\u6765\u66f4\u65b0\u8f6f\u4ef6\u5305\u5217\u8868\u3002\u63a5\u7740\uff0c\u4f7f\u7528<code>sudo apt install python3<\/code>\u5b89\u88c5Python 3\u3002\u5982\u679c\u60a8\u8fd8\u9700\u8981pip\uff08Python\u5305\u7ba1\u7406\u5668\uff09\uff0c\u53ef\u4ee5\u901a\u8fc7<code>sudo apt install python3-pip<\/code>\u8fdb\u884c\u5b89\u88c5\u3002\u8fd9\u4e9b\u6b65\u9aa4\u5c06\u786e\u4fdd\u60a8\u62e5\u6709Python\u7684\u6700\u65b0\u7248\u672c\u548c\u76f8\u5173\u5de5\u5177\u3002<\/p>\n<p><strong>\u6211\u53ef\u4ee5\u5728Kali\u4e0a\u4f7f\u7528\u54ea\u4e9bPython\u5e93\u6765\u589e\u5f3a\u6211\u7684\u9879\u76ee\uff1f<\/strong><br \/>Kali Linux\u662f\u4e00\u4e2a\u5f3a\u5927\u7684\u6e17\u900f\u6d4b\u8bd5\u5e73\u53f0\uff0c\u60a8\u53ef\u4ee5\u4f7f\u7528\u8bb8\u591aPython\u5e93\u6765\u589e\u5f3a\u60a8\u7684\u9879\u76ee\u3002\u4f8b\u5982\uff0c<code>Requests<\/code>\u5e93\u53ef\u4ee5\u5e2e\u52a9\u60a8\u5904\u7406HTTP\u8bf7\u6c42\uff0c<code>BeautifulSoup<\/code>\u9002\u7528\u4e8e\u7f51\u9875\u6293\u53d6\uff0c\u800c<code>Scapy<\/code>\u5219\u662f\u7f51\u7edc\u5305\u5904\u7406\u7684\u5f3a\u5927\u5de5\u5177\u3002\u6b64\u5916\uff0c\u60a8\u8fd8\u53ef\u4ee5\u4f7f\u7528<code>pandas<\/code>\u8fdb\u884c\u6570\u636e\u5206\u6790\uff0c\u6216\u4f7f\u7528<code>NumPy<\/code>\u8fdb\u884c\u6570\u503c\u8ba1\u7b97\uff0c\u8fd9\u4e9b\u5e93\u90fd\u80fd\u4e3a\u60a8\u7684\u9879\u76ee\u589e\u6dfb\u66f4\u591a\u529f\u80fd\u3002<\/p>\n<p><strong>\u5982\u4f55\u5728Kali Linux\u4e2d\u8fd0\u884cPython\u811a\u672c\uff1f<\/strong><br \/>\u8981\u5728Kali Linux\u4e2d\u8fd0\u884cPython\u811a\u672c\uff0c\u9996\u5148\u786e\u4fdd\u60a8\u5df2\u7ecf\u521b\u5efa\u4e86\u4e00\u4e2aPython\u6587\u4ef6\uff0c\u6587\u4ef6\u6269\u5c55\u540d\u4e3a<code>.py<\/code>\u3002\u5728\u7ec8\u7aef\u4e2d\uff0c\u5bfc\u822a\u5230\u811a\u672c\u6240\u5728\u7684\u76ee\u5f55\uff0c\u4f7f\u7528\u547d\u4ee4<code>python3 your_script.py<\/code>\u6765\u8fd0\u884c\u811a\u672c\u3002\u60a8\u4e5f\u53ef\u4ee5\u901a\u8fc7\u7ed9\u811a\u672c\u6dfb\u52a0\u6267\u884c\u6743\u9650\uff08\u4f7f\u7528<code>chmod +x your_script.py<\/code>\uff09\u5e76\u76f4\u63a5\u4f7f\u7528<code>.\/your_script.py<\/code>\u547d\u4ee4\u6765\u6267\u884c\u5b83\u3002\u786e\u4fdd\u60a8\u7684\u811a\u672c\u4e2d\u5305\u542b\u4e86\u6b63\u786e\u7684shebang\uff08<code>#!\/usr\/bin\/env python3<\/code>\uff09\uff0c\u8fd9\u6837\u53ef\u4ee5\u4fdd\u8bc1\u811a\u672c\u5728\u6267\u884c\u65f6\u4f7f\u7528\u6b63\u786e\u7684Python\u7248\u672c\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"\u5728Kali Linux\u4e0a\u5199Python\u4ee3\u7801\u53ef\u4ee5\u901a\u8fc7\u5b89\u88c5Python\u73af\u5883\u3001\u9009\u62e9\u5408\u9002\u7684\u7f16\u8f91\u5668\u6216IDE\u3001\u4f7f\u7528Pyth [&hellip;]","protected":false},"author":3,"featured_media":993817,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[37],"tags":[],"acf":[],"_links":{"self":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/993798"}],"collection":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/comments?post=993798"}],"version-history":[{"count":"1","href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/993798\/revisions"}],"predecessor-version":[{"id":993819,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/993798\/revisions\/993819"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/993817"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=993798"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=993798"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=993798"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}