shanty - identical to shack (in the US, shanty is rare, you are more likely to hear "shack") both are usually small crudely built houses. In the poorest of countries, shanties and shacks can be built of a hodepodge of building materials clasp together. In the US, there are building codes that forbid this sort of dwelling. (dwelling - another word for a residence. It could be a shack, a shanty, a house, etc.)
cabin - when I think of a cabin, I think of a house made out of whole logs or raw timber. They can be small and dilapidated or run-down, but they can also be very large and grandiose.
tent - a collapsable, moveable object that is usually made from a material such as canvas or polyester. A tent can usually be erected in minutes.
hut - refers to a small, usually temporary housing made of whatever material is local and abundant, such as palm leaves, rocks, bamboo, straw, and even snow and ice (igloos are a form of hut). Huts can be a form of permanent housing if well-constructed.
shelter - shelter can refer to a permanent structure that houses (shelters) homeless people, battered women and their children, or people who are escaping a storm and are "seeking shelter" in a building that is sturdier than their residence. Shelter can also refer to any type of cover that you can find when you are out in the woods, the jungle, homeless in the streets, or wherever you might be. An overpass can be shelter for a homeless person during a storm. A cave can be shelter for someone out in the wilderness. Your car can be your shelter for the night, sheltering you from the animals, the insects, and/or the weather.