Anti-tank development is littered with attempts, formal and improvised, at giving your average soldier the ability to blow up a tank at suicidally short range. I'd recommend Ian Hogg's book with the no nonsense title Tank Killing. Unfortunately my copy seems to have taken a walk, so I'll have to do this from memory. I'm going to skip what the other answers have covered.
The most effective and ubiquitous weapon that fits your description is the Panzerfaust 30. Appearing in 1943 with an effective range of just 30 meters, it fired a highly effective shaped charge lobbed along at a pokey 30m/s. The weapon was discarded after a single shot. It was issued to all sorts of troops in great quantity. It was only in late 1944 that Panzerfausts with a range of 100m reached the troops.
The US Army, desperately playing catch up with European armies, got the idea maybe a soldier could shove various pieces of their kit into a tank's wheels and make it throw a track. In Nov 1939 US tanks were scarce, so they brought out a T5E4 combat car as a stand in and shoved rifle stocks, machine gun barrels, and rocks into the tracks. First they figured out this was basically impossible to do on a moving tank, so they slowed it to a crawl. Once they finally got the things jammed in there they discovered that a tank is very good at destroying rifle stocks, machine gun barrels, and rocks. Source: The Chieftain's Hatch: Rifles vs Tanks.
The Molotov cocktail was mentioned in the question, and I believe this qualifies. While they could be used by dedicated tank hunter teams, their fragility and extremely short range did not make them good weapons in this role. In order to be effective, the burning cocktail had to strike the engine cover at the rear of the tank. This was best done after the tank had driven past you, or from a second story window, or the firing slit of a bunker.
They could be improvised, but many were manufactured. The Finns, during the Winter War with Russia, lacking anti-tank weaponry, made half a million of them. Rather than a rag in a bottle of gas, it was gasoline or other fuel to make it burn, plus rubber or tar to make it sticky. Rather than using a rag, they used a bundle of wind-proof matches or a glass vial of exothermic chemicals.
The preferred improvised weapon was a bundle of hand grenades, the Germans called them Geballte Ladung. An individual hand grenade wouldn't do much to a tank, but a bundle of six warheads tied to a single stick grenade could. Not a lot of damage, but it would do something. It could be safely carried, created out of materials at hand, and with the handle it could be thrown up to 30 meters.

(Finnish Soldiers with a bundle of grenades, and a Molotov Cocktail using matches as the igniter)