TypeError: 'type' object is not iterable

I am trying to do sense and when using the exploit pfSense < 2.1.4 - ‘status_rrd_graph_img.php’ Command Injection
I get the following error message
[kali@kali:sense]$ python 43560.py
Traceback (most recent call last):
File “43560.py”, line 13, in
import requests
File “/usr/local/lib/python2.7/dist-packages/requests/init.py”, line 84, in
from urllib3.contrib import pyopenssl
File “/usr/local/lib/python2.7/dist-packages/urllib3/contrib/pyopenssl.py”, line 46, in
import OpenSSL.SSL
File “/home/kali/.local/lib/python2.7/site-packages/OpenSSL/init.py”, line 8, in
from OpenSSL import crypto, SSL
File “/home/kali/.local/lib/python2.7/site-packages/OpenSSL/crypto.py”, line 12, in
from cryptography import x509
File “/usr/local/lib/python2.7/dist-packages/cryptography/x509/init.py”, line 8, in
from cryptography.x509.base import (
File “/usr/local/lib/python2.7/dist-packages/cryptography/x509/base.py”, line 18, in
from cryptography.x509.extensions import Extension, ExtensionType
File “/usr/local/lib/python2.7/dist-packages/cryptography/x509/extensions.py”, line 26, in
from cryptography.x509.general_name import GeneralName, IPAddress, OtherName
File “/usr/local/lib/python2.7/dist-packages/cryptography/x509/general_name.py”, line 16, in
from cryptography.x509.name import Name
File “/usr/local/lib/python2.7/dist-packages/cryptography/x509/name.py”, line 28, in
_ASN1_TYPE_TO_ENUM = {i.value: i for i in _ASN1Type}
TypeError: ‘type’ object is not iterable

I also had the same kind of error happen when I used a different python exploit that was meant to be used on the swagshop machine,

Any help on this would be appreciated

Script is written in python3 & looks like you may be running via python 2

Type your comment> @absolutenoob said:

Script is written in python3 & looks like you may be running via python 2

Yeah that seemed to be the issue, is there any easy way to tell if its meant to be run in python3 if there is no shebang?

An easy check is that in python3 the print function has to be invoked with parentheses whereas this is voluntary in python2 so you could check that although its by no means 100% accurate. Other differences between the two are outlined in a table within the below web-page;

Really could just execute it via one & if it produces errors then try the other.