The base weapon attack that's part of the cantrip doesn't become magical.
Jeremy Crawford, official 5e rules designer, addresses this question here:
Is the attack made as part of Booming Blade magical? It's delivered as part of a spell, but has its "usual effects" and is a prerequisite for the spell to work.
The booming blade spell isn't intended to make the required weapon attack magical.
So the weapon attack you make as part of the spell is not magical on its own.
...But the extra damage is magical.
The booming blade spell description says:
As part of the action used to cast this spell, you must make a melee attack with a weapon against one creature within the spell’s range, otherwise the spell fails. On a hit, the target suffers the attack’s normal effects, and it becomes sheathed in booming energy until the start of your next turn. If the target willingly moves before then, it immediately takes 1d8 thunder damage, and the spell ends.
Similarly, green-flame blade says:
As part of the action used to cast this spell, you must make a melee attack with a weapon against one creature within the spell’s range, otherwise the spell fails. On a hit, the target suffers the attack’s normal effects, and green fire leaps from the target to a different creature of your choice that you can see within 5 feet of it. The second creature takes fire damage equal to your spellcasting ability modifier.
When the caster of either cantrip reaches higher levels, the initial attack does extra damage as well (in addition to boosting the secondary damage).
Per Crawford's ruling above, the required weapon attack remains nonmagical; the fact that the spell calls for a normal weapon attack doesn't change the properties of the weapon. However, the added damage done by the spell itself is magical, as it's caused directly by the spell. This is true both of the secondary damage of both spells, and of the extra initial damage both spells do at higher levels.