关于kali Linux工具打开提示SyntaxError: invalid syntax


我在kali中打开一些工具时都提示这个错误,例如zenmap和sslstrip

root@kali:~# zenmap
  File "/usr/bin/zenmap", line 176
    except ImportError, e:
                      ^
SyntaxError: invalid syntax

root@kali:~# sslstrip
  File "/usr/bin/sslstrip", line 39
    print "\nsslstrip " + gVersion + " by Moxie Marlinspike"
                      ^
SyntaxError: invalid syntax

我感觉很奇怪,为何软件提示语法错误,点进去看了好久才感觉可能是python版本的问题

因为python2和python3的语法规则并不是完全一样的

root@kali:~# python
Python 3.2.3 (default, Feb 20 2013, 17:02:41) 
[GCC 4.7.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> 


我在装完之后升级了python3,所以这些软件中python2的语法报错了



现在将python的默认连接改到python2,先删除连接,再重新连接

root@kali:~# rm /usr/bin/python
root@kali:~# ln -s /usr/bin/python2.7 /usr/bin/python


测试一下

root@kali:~# python
Python 2.7.3 (default, Mar 14 2014, 11:57:14) 
[GCC 4.7.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> 

root@kali:~# sslstrip -l 1000

sslstrip 0.9 by Moxie Marlinspike running...




你可能感兴趣的:(Web渗透,Python)