mushorg / glastopf

Web Application Honeypot
http://glastopf.org
550 stars 170 forks source link

Internal Server Error #238

Closed bunk3r closed 9 years ago

bunk3r commented 9 years ago

After a while running glastopf (latest git pull + rebuild of all the dependencies) homepage returns 'Internal Server Error' instead of normal index page.

I need to delete all /opt/myhonepot directory and launch glastopf as the first time.

I'm using mysql as DB, I tried to convert all tables to utf8 but nothing changes. OS is updated Raspian on rasp BI+.

No errors in log file!

Where I can take a look to solve the issue? I've rebuild glastopf from scratch... only the mysql DB is the old db full of data.

glaslos commented 9 years ago

Can you paste the console output?

bunk3r commented 9 years ago

As you can see, it replies with internal server error, look at http://nowhere.purificato.org

here's the output after a restart:

2015-05-16 19:57:38,071 (glastopf.glastopf) Initializing Glastopf 3.1.3-dev using "/opt/myhoneypot" as work directory. 2015-05-16 19:57:39,564 (glastopf.glastopf) Connecting to main database with: mysql://user:pass@localhost/db 2015-05-16 19:57:41,048 (glastopf.glastopf) Glastopf started and privileges dropped. 2015-05-16 19:57:58,247 (glastopf.glastopf) 192.168.1.66 requested GET / on raspberrypi:80 2015-05-16 19:57:58,867 (glastopf.glastopf) 192.168.1.66 requested GET /favicon.ico on raspberrypi:80

Same result with internal or esternal IP, no errors in log.

bunk3r commented 9 years ago

I've located the problem: i's the comment file!

There is something wrong with the comments stored in 'data/comments.txt'

I've temporarely solved cleaning the file, but it's only safe until the next injection:

root@raspberrypi:/opt/myhoneypot/data# cat comments.txt

Detta är sannolikt den mest informativ artikel om detta ämne jag har läst på sistone. Jag håller med och du är på den punkten. Grattis till ett väl utfört arbete. [url=http:// ?pid=86]Nike Air Maz[/url]root@raspberrypi:/opt/myhoneypot/data# echo > comments.txt root@raspberrypi:/opt/myhoneypot/data#

update with quick & dirty workaround: remove writing permission from comments.txt file

genericcx commented 9 years ago

I also have this too, (cleaned out the comments fixed it): (edited the domain and IP)

Traceback:

2015-05-18 14:11:25,832 (glastopf.glastopf) 0.0.0.0 requested GET /plugins/content/plugin_googlemap2_proxy.php?url=www.example.com on vps000.000.com:80 Traceback (most recent call last): File "/usr/local/lib/python2.7/dist-packages/gevent/pywsgi.py", line 508, in handle_one_response self.run_application() File "/usr/local/lib/python2.7/dist-packages/gevent/pywsgi.py", line 494, in run_application self.result = self.application(self.environ, self.start_response) File "/usr/local/lib/python2.7/dist-packages/Glastopf-3.1.3_dev-py2.7.egg/glastopf/wsgi_wrapper.py", line 50, in application remote_addr, sensor_addr) File "/usr/local/lib/python2.7/dist-packages/Glastopf-3.1.3_dev-py2.7.egg/glastopf/glastopf.py", line 268, in handle_request emulator.handle(attack_event) File "/usr/local/lib/python2.7/dist-packages/Glastopf-3.1.3_dev-py2.7.egg/glastopf/modules/handlers/emulators/unknown.py", line 52, in handle template, display_comments = self._get_template(attack_event) File "/usr/local/lib/python2.7/dist-packages/Glastopf-3.1.3_dev-py2.7.egg/glastopf/modules/handlers/emulators/unknown.py", line 45, in _get_template display_comments = '' + str(general_comments) UnicodeEncodeError: 'ascii' codec can't encode characters in position 1727-1729: ordinal not in range(128)

glaslos commented 9 years ago

Can you please test with the latest version from the master branch? #239 should solve the issue you are experiencing.

bunk3r commented 9 years ago

EDIT: solved adding [SSL] section to glastopf.cfg

Still testing the update


Missing something?

root@raspberrypi:/opt/myhoneypot# glastopf-runner Traceback (most recent call last): File "/usr/local/bin/glastopf-runner", line 5, in pkg_resources.run_script('Glastopf==3.1.3-dev', 'glastopf-runner') File "/usr/local/lib/python2.7/dist-packages/distribute-0.6.35-py2.7.egg/pkg_resources.py", line 505, in run_script self.require(requires)[0].run_script(script_name, ns) File "/usr/local/lib/python2.7/dist-packages/distribute-0.6.35-py2.7.egg/pkg_resources.py", line 1245, in run_script execfile(script_filename, namespace, namespace) File "/usr/local/lib/python2.7/dist-packages/Glastopf-3.1.3_dev-py2.7.egg/EGG-INFO/scripts/glastopf-runner", line 83, in if conf_parser.get("ssl", "enabled"): File "/usr/lib/python2.7/ConfigParser.py", line 607, in get raise NoSectionError(section) ConfigParser.NoSectionError: No section: 'ssl' Exception KeyError: KeyError(16908416,) in <module 'threading' from '/usr/lib/python2.7/threading.pyc'> ignored root@raspberrypi:/opt/myhoneypot#

bunk3r commented 9 years ago

this update seems to fix the problem for me

glaslos commented 9 years ago

Perfect!