The QCD equation of state at zero and finite baryon densities is considered in the framework of a Hagedorn bag-like model with a crossover transition from hadronic matter to quark-gluon plasma. The model, augmented with non-zero masses of quarks and gluons in the bag spectrum, provides a fair quantitative description of lattice data on thermodynamic functions, the (higher-order) fluctuations and correlations of conserved charges, as well as the Fourier coefficients of net-baryon density at imaginary chemical potential. Signatures of a possible first-order phase transition at finite baryon densities are discussed within this framework as well.