As you use ShareLaTeX, you must patch the scrbook.cls provided by ShareLaTeX.
Compile the following document on ShareLaTeX to get the correct source (96 pages with colors):
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{lmodern}
\usepackage[T1]{fontenc}
\usepackage{xcolor}
%\usepackage[margin=1cm]{geometry}
\usepackage{fancyvrb}
\usepackage{listings}
\usepackage{accsupp}
\newcommand*{\noaccsupp}[1]{\BeginAccSupp{ActualText={}}#1\EndAccSupp{}}
\title{\texttt{scrbook.cls} listing on ShareLaTeX}
\author{Paul Gaborit}
\date{February 2018}
\lstdefinestyle{latex}{
fancyvrb=true,
language=[LaTeX]TeX,
basicstyle=\ttfamily\scriptsize,
keywordstyle=\color{blue}\bfseries,
commentstyle=\color{red!50!black}\itshape,
stringstyle=\ttfamily\color{green!50!black},
numbers=left,
numberstyle=\tiny\color{gray}\noaccsupp,
stepnumber=1,
numbersep=5pt,
showspaces=false,
showstringspaces=false,
%backgroundcolor=\color{white},
frame=leftline,
rulecolor=\color{gray!30},
fontadjust=true,
aboveskip=0pt,
belowskip=0pt,
emphstyle=\color{red},
keepspaces=true,
flexiblecolumns=true,
xleftmargin=1.2em,
}
\begin{document}
\maketitle
\lstinputlisting[style=latex]{scrbook.cls}
\end{document}
tex\latex\koma-script\scrbook.cls. V3.24 confirmed. – Steven B. Segletes Feb 08 '18 at 15:40