I think it was rouge elements of the CIA, who may or may not have the blessing of CIA leadership. Said elements than use their mafia connections to take out Oswald.
I don't think LBJ knew beforehand or had anything to do with it, but I very much think he knew of a conspiracy afterwards and kept quite about it.
I would encourage all here to read "Best Evidence" by David S. Lifton. I read this in the 1980s, before JFK came out in theatres. Then I would suggest that you ask yourselves what sort of work our CIA, FBI, and other Intel Agencies actually do on a daily basis.
Lyman Kirkpatrick, Inspector General for the CIA during the Eisenhower years, once said that the ideal covert operation remains secret "from inception to eternity". The Lifton book contains quotes from Allen Dulles about the risks of "losses of cover" during covert operations that talk about the consequences of an operative being in a situation where he is out of place in plain sight. I would encourage all to read that with an open mind. Reading Joseph Persico's biography of the late CIA Director WIlliam J. Casey would be a good read as well.