Advanced Mortgage Calculator

 

 

amc

After my first post about a simpler mortgage calculator now I developed a more advanced one, especially designed to compare different mortgages, and calculate which one lets you pay less interest over time.

The app can be found here

amc2

Compared to the last tool, which just calculated the total interests and the installment amount, this app offers these other features:

  • charts of the installments over time
  • capability to add different types of events:
    • interest rate change
    • time renegotiation
    • amortization on time
    • amortization on installment amount

amc4

Adding events makes this tool extremely versatile and allows for simulating complex scenarios. You can compare a 10 year mortgage with a 20 years one in which you reduce the time amortizations with annual cash deposits, or a combination of different interest rates which may happen in some situations. The charts are updated automatically, and there is a comparison chart to make it easy to compare the two mortgages over time, focusing on the interest amount paid.

amc3amc5

Plani3D – Planimetry/map to 3D model

In the last days I’ve been working on this helper software to make it easy to turn a planimetry of a house into a simple 3D model to make it easy to visualize it or any modification you would want to make.

 

plani3deditor

Plani3D

plani3d_conpla

The functionalities are extremely limited and it may be buggy – it was only coded to suit my specific needs.

So far it lets you:

  • Load a custom image (planimetry, map)
  • Define a scale (so the 3d model will have the right measures)
  • Draw 3 types of entity with the mouse
    • Walls
    • Windows
    • Doors
  • Change thickness of walls
  • Generate the 3D model
    • saving the link will let you see it in the future too, the model gets encoded in the url (which could get veeery big)
  • Export the generated model as a GTLF file

Note: no deletion of added walls is possible at this time. Not even editing the generated model. It’s more a rapid prototype tool, doesn’t let you make things precisely.

The project can be tested here.

 

Crypto bot

Recently I’ve been following the crypto market, which is very fascinating to me. I’ve subscribed to kraken, a popular exchange and put some money in it. After a service outage in the middle of january, kraken’s team decided to cut the transactions fees for a while, thus I took the opportunity to code and test a from-scratch crypto-trader bot.

I have no time to get into details, also because they are not so much interesting or particularly complex, but I’ll say that it uses a combination of some simple and common algorithms widely used in the study of the financial market. The bot actually works, in the sense that it makes trades on some deterministic rules, but unfortunately it is not clever enough to make profit (even without the fees) and barely breaks even.

Anyway, as always, it’s been very fun and instructive to code, as I had to study and learn how the market behaves, how to handle the market data and how to try to predict trends and accordingly set sell/buy points.

Since I’m not posting the code (yet), here’s its debug window:
cryptobot_best

Who wants to be millionaire?

You probably know the tv show “Who wants to be a millionaire”. Lately I’ve been invited at the graduation party of a friend, and thought about creating a game for it.

So I decided to create a HTML5 simulation of WWTBAB, complete with webcam support, sounds and introduction video. It has been quite fun, and I’ve been releasing the code on github.

Questions are hardcoded in the index.html file, but it’s trivial to modify them. Recently I’ve added support for images in questions.

I really don’t know if someone can actually make use of it, but who knows?

Just a quick overview about the keys used to control the simulation:

  • [Left arrow] – to skip to next step (video is not skippable by now)
  • [Down arrow] – to unveil the next answer
  • [A,B,C,D] – to highlight the selected answer
  • [Y,N] – when an answer is highlighted, Y makes it correct, N makes it wrong
  • [F] – to switch between the default background or the webcam image
  • [P] – to flash the background to induce some suspance

Github.

Example-link.

A try for a 3D game

Recently I’ve been experimenting a lot with 3D in the browser with Three.js, and although this is my first post about it, there’s a lot more I’m working on about 3D in JS, but it’s involved in my professional work and it’s not time to publish it yet.

Anyway, as usual I like to keep track of my projects here, so I link to this simple game I developed as a joke for a friend some days ago. The game is here, descriptions are in italian but if you don’t understand just click and everything will be fine.

JSMol plugin vulnerability and thoughts about security

JMol is a library used to create 3D models of molecules in Java, which can be embedded into webpages using the usual applets. JSMol is a Javascript library which is used to provide the Jmol capabilities through the HTML5 technologies, relying on server side computation for some functionality.

Here’s a short story about how I discovered some pretty bad vulnerabilities in the JSMol software, and how it can affect every server which is hosting this software.

 

Using my university’s moodle installation, I discovered that the JMol/JSMol plugin for moodle was installed and probably misconfigured in some way: it had unusual permissions set in its directory tree.

This made me curious and I wanted to better understand what was going on.

I made some research, and discovered the plugin along with its source code (the project is entirely open source), and started to look at the source of the only PHP file in the JSMol package.

Looking through the code, I discovered a lot of parameters used without proper sanitizing and checks, and quickly discovered two related and pretty serious vulnerabilities.

The first one is a vulnerability which allows an attacker to read the entire filesystem with the PHP process’ privileges. The second is even worse, but it seems it had been fixed in the newer releases of the software, and was about arbitrary execution of commands on the server.

They derived from an insecure use of PHP’s file_get_contents() and exec() functions in combination with badly checked parameters coming from GET and POST variables.

I immediately contacted the developer of the plugin and reported the vulnerability, along with the curator of the JMol plugin of moodle.

As of today, the vulnerability has been fixed by the developer, and should be available in the latest version of the software.

Anyway, some research I’ve made suggests that the vulnerability was present in many websites using the plugin, which I thinks are unlikely to upgrade the software. In particular I analyzed every registered moodle installation from moodle.net (roughly 50k) and discovered that a small fraction (~100) had the plugin installed and was vulnerable.

I would not classify it as a widespread vulnerability, but I think this should remind us of the nature of websites’ security. In fact, I would say that every even small piece of software publicly accessible on a website should be cause of concern when thinking about security.

As is often said, the best thing to do about software security is to firmly believe that you don’t have any.