social-engineer-toolkit icon indicating copy to clipboard operation
social-engineer-toolkit copied to clipboard

[!] Something went wrong, printing the error: name 'file' is not defined

Open socrateselton opened this issue 6 years ago • 14 comments

Expected Behaviour

Put here what the expected behaviour should be when reporting an issue

Actual Behaviour

Put here what the actual behaviour should be when reporting an issue

Set Version

Set version

Before opening an issue please make sure you are running the most up to date version of set

We see the same bug reports being opened for issues that have already been fixed in a new release

Set in Kali

Please make sure you are running kali-rolling and your system is up to date. To update your system do the following apt update && apt full-upgrade

Run the following to check your version of Kali lsb_release -rdc and you should see the following output

Description:	Kali GNU/Linux Rolling
Release:	kali-rolling
Codename:	kali-rolling

If you do not see the following output download the ISO from http://cdimage.kali.org/kali-images/kali-weekly/

If you do all of the above and still have an issue then please open a issue.

socrateselton avatar Jan 05 '20 20:01 socrateselton

im using setoolkit... to clone a websit

setoolkit->press 1 enter-> press 2 enter -> press 3 enter-> press 2 enter, then im giving my ip address and the website i want to clone(e.g www.facebook.com) this is not getting cloned and showing a error Capture [!]Something went wrong, printing the error: name 'file' is not defined

nitish-kumar0072 avatar Jan 11 '20 10:01 nitish-kumar0072

Capture2 Capture3 Capture4

nitish-kumar0072 avatar Jan 11 '20 10:01 nitish-kumar0072

Je rencontre egalement ce même problème! Je pense que le problème est venu après la mise à jour du système et après avoir exécuté apt-get autorenouvelable. Je pense que nous devons le désinstaller et le réinstaller pour voir

larsonclark avatar Jan 17 '20 20:01 larsonclark

i too have this issue in kali 2020.1 i really wish i could find the solution for the issue. i've tested it across at least 2 different installs with the same result. i'm going to do a fresh VM install on monday with the latest ISO to see if i can recreate it a 3rd time.

wdmarauder avatar Jan 26 '20 00:01 wdmarauder

just playing around with another VM i had that was an older version i did a couple of updates for testing. if i do just a standard apt-get upgrade the site cloner doesn't give me the above error but when i browse to the cloned site there are many errors output in kali and the page doesn't load (on the victim machine).

if i do apt-get full-upgrade then i get the same above error as i do on 3 different installs.

wdmarauder avatar Jan 26 '20 00:01 wdmarauder

the version i have on all of them when experiencing the error is:

Description: Kali GNU/Linux Rolling Release: 2020.1 Codename: kali-rolling

wdmarauder avatar Jan 26 '20 00:01 wdmarauder

i solved it.

if you go to the main page on here for SET and download the files, extract and then copy them into the /usr/share/set directory it should resolve the issue.

wdmarauder avatar Jan 27 '20 18:01 wdmarauder

will u show by sharing the screenshot

csharshtiwari avatar Jan 28 '20 13:01 csharshtiwari

i solved it.

if you go to the main page on here for SET and download the files, extract and then copy them into the /usr/share/set directory it should resolve the issue.

plz share the screenshot or a videolink

csharshtiwari avatar Jan 28 '20 13:01 csharshtiwari

i solved it. if you go to the main page on here for SET and download the files, extract and then copy them into the /usr/share/set directory it should resolve the issue.

plz share the screenshot or a videolink

found this with quick google search.

https://www.youtube.com/watch?v=DwpDihZzpQc

wdmarauder avatar Jan 28 '20 14:01 wdmarauder

In order to find the error, the best way is to go to the same directory where you have it installed, and open the "setoolkit" file with your favorite text editor, go to the final of the file, and comment the "except Exception as error" in order to let you get the root cause. You must have the "setoolkit" file like this:

# handle exceptions
#except Exception as error:
#    core.log(error)
#    print("\n\n[!] Something went wrong, printing the error: " + str(error))

So, then, if you launch again the toolkit, you will see the following error:

Traceback (most recent call last):
  File "./setoolkit", line 245, in <module>
    import src.core.set
  File "/opt/tools/other/set/src/core/set.py", line 606, in <module>
    import harvester
  File "/opt/tools/other/set/src/webattack/harvester/harvester.py", line 57, in <module>
    filewrite = file("%s/src/logs/harvester.log" % (os.getcwd()), "w")
NameError: name 'file' is not defined

And here, you could see that the problem is when setoolkit tries to open for writing the file "%s/src/logs/harvester.log" and it does not exist, so... you just need to execute the following:

$ cd /path/of/your/set/installation $ touch src/logs/harvester.log

zprian avatar Jan 30 '20 23:01 zprian

Fixed in 8.0.2

ghost avatar Feb 04 '20 00:02 ghost

i solved it.

if you go to the main page on here for SET and download the files, extract and then copy them into the /usr/share/set directory it should resolve the issue.

hey i did exactly what u said but didnot work the problem m facing now is the paste option is not working on /usr/share/set directory pls share screenshot

bibush0695 avatar Apr 28 '20 21:04 bibush0695

@bibush0695

Hi mate, that's also my problem but I solved it through having the root privileges. You should log in into your root account (the administrator one), then there you can edit freely the directories of /usr with copy and paste in ease. hope it helped.

Monabona89 avatar Jul 31 '20 16:07 Monabona89