Ignoring the legalities/moral conundrums...
Whenever I need to do something like this (usually if I'm doing a cover and want a copy of the original as a reference in the project) I just use stereo mini jack to 1/4" mono splitter from the headphone output on my laptop into a stereo line in pair on my interface (I mostly do this through my mixer for better input/output level control) and record it into a stereo track.
Much simpler than screwing around with a bunch of software solutions BUT any program that is able to accept and record the audio output from Windows (or your browser) like Audacity can supposedly do OR you can route the signal using virtual cables with programs like Voicemeeter which pretend like they are an analog input that you can choose in your ASIO DAW (like Sonar).
Basically to do it all "In the Box" takes software routing which is... well kind of screwy and confusing which is why I've mostly avoided it and just recorded direct from an actual analog audio source from a separate computer. My laptop really doesn't have fancy audio outputs at all and the signal I get is totally fine. By putting it through my mixer first too I can even EQ it a bit to be more how I like (which I generally don't have to do). Of course once it's in Sonar I can screw with it even more with effects (but usually just correcting timing issues or even transposing to new keys to learn my parts).
Like I said I just do this to get audio in to the DAW to learn covers and may do some light sampling this way which I think, how I use this stuff (especially after mangling), falls under "Fair Use" laws. I would never use such samples as the foundation of a song or play them back in a club or whatever (I ain't no Vanilla Ice, yo). Not really out of some corporately defined legal "morality" but more because I've got enough art in me I don't need to swipe other people's stuff... and clubs can play their own crap and deal with the legalities/fees of it all (not that I play live anymore these days anyway).
Common sense and courtesy amongst artists and their works is my moral code. The law talkin' dude crap is just too stale and confusing for me to worry about and if someone gets upset (and they have a reason to) I am more than willing to put their name on the effort and give them their share or just scrap the tune altogether. I honestly don't give a sh*t. Life is too short to spend any time or effort screwing around with lawyers.
Cheers.