Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python error #727

Open
Ni-ka-sH opened this issue Apr 25, 2020 · 13 comments
Open

Python error #727

Ni-ka-sH opened this issue Apr 25, 2020 · 13 comments

Comments

@Ni-ka-sH
Copy link

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
Copy link

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
Copy link

ghost commented Apr 26, 2020

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
Copy link

ghost commented May 6, 2020

@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
Copy link
Author

Ni-ka-sH commented May 8, 2020 via email

@Ni-ka-sH
Copy link
Author

Ni-ka-sH commented May 8, 2020 via email

@bkaitare
Copy link

@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
Copy link

@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
Copy link

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
Copy link

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

@technicalminds2105
Copy link

technicalminds2105 commented Apr 5, 2021

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
Copy link

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
Copy link

djorkaef commented Sep 25, 2021

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
Copy link

6062055 commented Nov 2, 2021

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants