trustedsec / social-engineer-toolkit

The Social-Engineer Toolkit (SET) repository from TrustedSec - All new versions of SET will be deployed here.
10.69k stars 2.74k forks source link

Python error #727

Open Ni-ka-sH opened 4 years ago

Ni-ka-sH commented 4 years ago

When I try to run webiste cloning in setoolkit, it shows some python error like this..

[!] SOMETHING WENT WRONG : Printing the error : urllib has no attribute urlopen

Please help me how to solve this...Thanks in advance

CRO-THEHACKER commented 4 years ago

if you would check out

https://stackoverflow.com/questions/3969726/attributeerror-module-object-has-no-attribute-urlopen

Somone will need to push with the new import

ghost commented 4 years ago

Open a terminal and do:

  1. python
  2. type: help('modules')
  3. See if you have urllib, urllib2 or urllib3 and let us know
ghost commented 4 years ago

@Ni-ka-sH What did you try to run when this happened? Was there any line number that says where the error is? I imagine not since it jumped into the exception but just to check.

Ni-ka-sH commented 4 years ago

I started SET toolkit 1) Social-Engineering Attacks --> 2)Website Attack vectors --> 3) Credential Harvester Attack method --> 2) Site cloner and under this when i gave "WWW.FACEBOOK.COM", it took some seconds and showed the error...urlib has no attribute urlopen... If not clear Bro I'll send u screenshots in my next mail...Sorry for the late reply

On Wed, May 6, 2020 at 2:39 PM AgentWhite notifications@github.com wrote:

@Ni-ka-sH https://github.com/Ni-ka-sH What did you try to run when this happened? Was there any line number that says where the error is? I imagine not since it jumped into the exception but just to check.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/trustedsec/social-engineer-toolkit/issues/727#issuecomment-624531377, or unsubscribe https://github.com/notifications/unsubscribe-auth/AMKMM7OA342STZGO6TLV7VLRQESNLANCNFSM4MQR347Q .

Ni-ka-sH commented 4 years ago

and there was no number shown related to the error

On Fri, May 8, 2020 at 6:40 PM Nikash nikinemo489@gmail.com wrote:

I started SET toolkit 1) Social-Engineering Attacks --> 2)Website Attack vectors --> 3) Credential Harvester Attack method --> 2) Site cloner and under this when i gave "WWW.FACEBOOK.COM", it took some seconds and showed the error...urlib has no attribute urlopen... If not clear Bro I'll send u screenshots in my next mail...Sorry for the late reply

On Wed, May 6, 2020 at 2:39 PM AgentWhite notifications@github.com wrote:

@Ni-ka-sH https://github.com/Ni-ka-sH What did you try to run when this happened? Was there any line number that says where the error is? I imagine not since it jumped into the exception but just to check.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/trustedsec/social-engineer-toolkit/issues/727#issuecomment-624531377, or unsubscribe https://github.com/notifications/unsubscribe-auth/AMKMM7OA342STZGO6TLV7VLRQESNLANCNFSM4MQR347Q .

bkaitare commented 4 years ago

@Ni-ka-sH Did you get this fix? I am also experiencing the same issue when I try to go to clone a site

ciscochao commented 3 years ago

@Ni-ka-sH @bkaitare Did your get this fix? I am also experiencing the same issue when I try to go to clone a site

CRO-THEHACKER commented 3 years ago

Please let us know what version of urllib your on, urlopen is a full-dev pkg so make sure you have python dev pkg's installed.

PixelNinja132 commented 3 years ago

Still an active issue! I have urllib1 2 and 3, and I am running kali linux.

technicalminds2105 commented 3 years ago

Still an active issue! I have urllib1 2 and 3, and I am running kali linux.

I am facing the same issue , i have urllib , urllib1 , urllib2 ,urllib3 with kalilinux 2020.1 python version :Python 2.7.18

AssassinUKG commented 3 years ago

Getting the same, When will the new fix be pushed to main branch? Thanks (making a tutorial for tab napping, wanted to showcase SET) thank you

djorkaef commented 2 years ago

The issue is in social-engineer-toolkit/src/webattack/tabnabbing/tabnabbing.py https://github.com/trustedsec/social-engineer-toolkit/blob/5e057388e5b7ea521d4658f3e22c874d52bb4f43/src/webattack/tabnabbing/tabnabbing.py

Line 65
favicon = urllib.urlopen("%s/favicon.ico" % (URL)) Should be:
favicon = urllib.request.urlopen("%s/favicon.ico" % (URL))

Because python3 uses different urllib syntax.

Go to ./usr/share/set/src/webattack/tabnabbing/tabnabbing.py Adjust the python file, run again and it will work.

EDIT if there is no favicon on the website; this will result in HTTP 404 errors etc, so I just commented out these lines:

grab favicon

#headers = {'User-Agent': user_agent}
#favicon = urllib.request.urlopen("%s/favicon.ico" % (URL))
#output = open(userconfigpath + '/web_clone/favicon.ico', 'wb')
#output.write(favicon.read())
#output.close()

Now it all works for me.

6062055 commented 2 years ago

Thank you, @djorkaef :) Worked like a charm. Spent forever trying to figure that out. I had to pull an old source.js from an older Kali to get the resolved first, cause it was showing there was no source.js. What a headache.