  We derive a compact analytical solution of the $n$th-order equal-time
correlation functions by using scattering matrix ($S$ matrix) under a weak
coherent state input. Our solution applies to any dissipative quantum system
that respects the U(1) symmetry. We further extend our analytical solution into
two categories depending on whether the input and output channels are
identical. The first category provides a different path for studying
cross-correlation and multiple-drive cases, while the second category is
instrumental in studying waveguide quantum electrodynamics systems. Our
analytical solution allows for easy investigation of the statistical properties
of multiple photons even in complex systems. Furthermore, we have developed a
user-friendly open-source library in Python known as the quantum correlation
solver, and this tool provides a convenient means to study various dissipative
quantum systems that satisfy the above-mentioned criteria. Our study enables
using $S$ matrix to study the photonic correlation and advance the
possibilities for exploring complex systems.
