mushorg / snare

Super Next generation Advanced Reactive honEypot
http://mushmush.org
GNU General Public License v3.0
444 stars 135 forks source link

Hosting a built PHP site with snare #107

Closed bmfmancini closed 6 years ago

bmfmancini commented 6 years ago

Hey All

I am trying to get snare to host a local web app written in PHP I ask snare to point to the folder with all the files but it fails with a key error

pages was converted. Try to clone again for the better results.Traceback (most recent call last):File "snare.py", line 474, in if not os.path.exist(os.path.join(base_page_path,args.page_dir,os.path.join(meta_info[args.index_page]['hash'])));KeyError: '/index.html'

Also, snare seems to change the names of all the files in the folder any ideas?

Thanks, guys !

glaslos commented 6 years ago

You have to serve your web app via a web server to render the PHP into HTML. Then you point the cloner to the webserver for crawling.

afeena commented 6 years ago

Hi, in general we support only cloned pages which are stored with hashes. Do you have meta.json file in your folder? If yes, do you have index.html reference there?

bmfmancini commented 6 years ago

Thanks Guys I will check this out

bmfmancini commented 6 years ago

Ok so we hosted our code on a local http server then ran the crawler then the hashed files go to /opt/snare/pages now able to run snare.py no errors come out but the pages is not reachable

sudo python3 snare.py --port 8080 --page-dir /opt/snare/pages/example.com/


/ // | / / | / \/ __/ __ \/ |/ / /| | / // / / / / /| / |/ , / / /____// |// |// |_/___/

afeena commented 6 years ago

Do you have any errors when you try to access pages?

bmfmancini commented 6 years ago

In general no

No connectivity issues we also have another web server on a different port on the same server the code is working fine after a while snare comes back with this error Can't connect to tanner host http://tanner.mushmush.org:8090/version

Thanks for the help !

afeena commented 6 years ago

Please, try to run like this sudo python3 snare.py --port 8080 --page-dir example.com -- do you have any difference?

I tried to run snare as you and got the problem with access to the pages.But if I run without full path (because we add /opt/snare/pages inside the code) everything is fine.

bmfmancini commented 6 years ago

Same

That is one of my sites you can test it on this page if that helps sudo python3 snare.py --port 8080 --page-dir www.trulyrandom.tk


/ // | / / | / \/ __/ __ \/ |/ / /| | / // / / / / /| / |/ , / / /____// |// |// |_/___/

privileges dropped, running as "nobody:nogroup" serving on ('::1', 8080) with uuid 74411072-baad-4e77-b1e9-ae325d1d293f you are running the latest version

afeena commented 6 years ago

I cloned your website,

sudo python3 clone.py --target www.trulyrandom.tk sudo python3 snare.py --page-dir www.trulyrandom.tk

and then access via 127.0.0.1:8080 screenshot from 2018-02-24 23-04-14

bmfmancini commented 6 years ago

Thanks !

But this is strange I got mine working but only when I put my ip address in

sean@snare:~/snare$ sudo python3 snare.py --host-ip 192.168.2.53 --page-dir www.trulyrandom.tk


/ // | / / | / \/ __/ __ \/ |/ / /| | / // / / / / /| / |/ , / / /____// |// |// |_/___/

privileges dropped, running as "nobody:nogroup" serving on ('192.168.2.53', 8080) with uuid 74411072-baad-4e77-b1e9-ae325d1d293f you are running the latest version Request path: / Request path: /gtag/js?id=UA-111740696-1 Request path: /pagead/js/adsbygoogle.js Request path: /favicon.ico Request path: /favicon.ico

afeena commented 6 years ago

Seems strange, thanks for the issue! If you get any other problem - just let us know

bmfmancini commented 6 years ago

Thanks for the help! happy weekend

afeena commented 6 years ago

No problem :) Have a nice weekend too :)

JharnaSubedi commented 6 months ago

Hey All

I am trying to get snare to host a local web app written in PHP I ask snare to point to the folder with all the files but it fails with a key error

pages was converted. Try to clone again for the better results.Traceback (most recent call last):File "snare.py", line 474, in if not os.path.exist(os.path.join(base_page_path,args.page_dir,os.path.join(meta_info[args.index_page]['hash'])));KeyError: '/index.html'

Also, snare seems to change the names of all the files in the folder any ideas?

Thanks, guys !

same i am trying to host a local web app written in php and got this error

Traceback (most recent call last): File "/usr/local/bin/snare", line 4, in import('pkg_resources').run_script('Snare==0.3.0', 'snare') File "/usr/lib/python3/dist-packages/pkg_resources/init.py", line 656, in run_script self.require(requires)[0].run_script(script_name, ns) File "/usr/lib/python3/dist-packages/pkg_resources/init.py", line 1460, in run_script exec(script_code, namespace, namespace) File "/usr/local/lib/python3.10/dist-packages/Snare-0.3.0-py3.10.egg/EGG-INFO/scripts/snare", line 190, in KeyError: '/index.html'

How do i solve this ?

glaslos commented 6 months ago

Can you share the command that is causing the issue?

JharnaSubedi commented 6 months ago

sudo snare --port 8080 --page-dir /home/jojo/Documents/snare/pages/localhost --path ~/snare_data i used this command i am trying to clone dvwa page which is locally hosted on my ubuntu

glaslos commented 6 months ago

Did you first run the clone command?

JharnaSubedi commented 6 months ago

yes i did use the clone command sudo clone --target http://localhost/DVWA/login.php --path ~/Documents clone command runs successfully but when i try to run snare it throws error.