<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>http://hacking-printers.net/wiki/index.php?action=history&amp;feed=atom&amp;title=Print_job_manipulation</id>
		<title>Print job manipulation - Revision history</title>
		<link rel="self" type="application/atom+xml" href="http://hacking-printers.net/wiki/index.php?action=history&amp;feed=atom&amp;title=Print_job_manipulation"/>
		<link rel="alternate" type="text/html" href="http://hacking-printers.net/wiki/index.php?title=Print_job_manipulation&amp;action=history"/>
		<updated>2026-05-02T05:11:13Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.26.4</generator>

	<entry>
		<id>http://hacking-printers.net/wiki/index.php?title=Print_job_manipulation&amp;diff=323&amp;oldid=prev</id>
		<title>84.153.135.135: /* Content Replacement */</title>
		<link rel="alternate" type="text/html" href="http://hacking-printers.net/wiki/index.php?title=Print_job_manipulation&amp;diff=323&amp;oldid=prev"/>
				<updated>2017-01-31T10:29:00Z</updated>
		
		<summary type="html">&lt;p&gt;‎&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Content Replacement&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;tr style='vertical-align: top;' lang='en'&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Revision as of 10:29, 31 January 2017&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l25&quot; &gt;Line 25:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 25:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== Content Replacement ==&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== Content Replacement ==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Even if an attacker can put an overlay above existing documents, she will not be able to alter specific values in the original document unless its exact structure is known. Sometimes ones does not only want to add custom content, but to parse and replace parts of the existing document. Especially replacing text seems to be an attractive function, introducing new possibilities to the attacker as she can go for targeted manipulation or randomly transpose digits and introduce misspellings. The problem of replacing text in PostScript files can be reduced to the problem of extracting strings from the rendered document. This is not trivial, because strings can be dynamically built by the PostScript program itself. Hence, simple parsing and replacing within the document source code is not an option. This issue has been discussed by &amp;lt;ref name=&amp;quot;nevill1997extracting&amp;quot;&amp;gt;''[https://pdfs.semanticscholar.org/494d/24a72be788a91a6ca45373c2d33013f33395.pdf Extracting Text from PostScript]'', C. Nevill-Manning, T. Reed and others, 1997&amp;lt;/ref&amp;gt;. They use a PostScript interpreter with a redefined ''show'' operator to index documents for the New Zealand Digital Library Project (NZDLP). The ''show'' operator accepts a string as input, which is painted to a certain location of the current page. By redefining the operator, text can elegantly be extracted. This approach can also be used for targeted searching and replacing in strings immediately before they are painted. While this scheme sounds good in theory and was ‘surprisingly effective on the 40,000 technical reports’ &amp;lt;ref name=&amp;quot;nevill1997extracting&amp;quot;/&amp;gt; of the NZDLP, it depends on the PostScript code quality generated either directly by an application or by a printing system like CUPS. For example, the approach is successful for ''LaTeX'' based PostScript documents which are directly &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;send &lt;/del&gt;to the printer while it fails for PostScript files generated by ''GIMP'' &amp;lt;ref&amp;gt;''[https://www.gimp.org/ GIMP – GNU Image Manipulation Program]'', S. Kimball and P. Mattis&amp;lt;/ref&amp;gt; which instead of strings creates raster graphics of their representation. The same issue occurs for any document format – even PostScript itself – when processed by CUPS. Theoretically such language constructs could also be parsed and should be subject of further research.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Even if an attacker can put an overlay above existing documents, she will not be able to alter specific values in the original document unless its exact structure is known. Sometimes ones does not only want to add custom content, but to parse and replace parts of the existing document. Especially replacing text seems to be an attractive function, introducing new possibilities to the attacker as she can go for targeted manipulation or randomly transpose digits and introduce misspellings. The problem of replacing text in PostScript files can be reduced to the problem of extracting strings from the rendered document. This is not trivial, because strings can be dynamically built by the PostScript program itself. Hence, simple parsing and replacing within the document source code is not an option. This issue has been discussed by &amp;lt;ref name=&amp;quot;nevill1997extracting&amp;quot;&amp;gt;''[https://pdfs.semanticscholar.org/494d/24a72be788a91a6ca45373c2d33013f33395.pdf Extracting Text from PostScript]'', C. Nevill-Manning, T. Reed and others, 1997&amp;lt;/ref&amp;gt;. They use a PostScript interpreter with a redefined ''show'' operator to index documents for the New Zealand Digital Library Project (NZDLP). The ''show'' operator accepts a string as input, which is painted to a certain location of the current page. By redefining the operator, text can elegantly be extracted. This approach can also be used for targeted searching and replacing in strings immediately before they are painted. While this scheme sounds good in theory and was ‘surprisingly effective on the 40,000 technical reports’ &amp;lt;ref name=&amp;quot;nevill1997extracting&amp;quot;/&amp;gt; of the NZDLP, it depends on the PostScript code quality generated either directly by an application or by a printing system like CUPS. For example, the approach is successful for ''LaTeX'' based PostScript documents which are directly &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;sent &lt;/ins&gt;to the printer while it fails for PostScript files generated by ''GIMP'' &amp;lt;ref&amp;gt;''[https://www.gimp.org/ GIMP – GNU Image Manipulation Program]'', S. Kimball and P. Mattis&amp;lt;/ref&amp;gt; which instead of strings creates raster graphics of their representation. The same issue occurs for any document format – even PostScript itself – when processed by CUPS. Theoretically such language constructs could also be parsed and should be subject of further research.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;'''How to test for this attack?'''&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;'''How to test for this attack?'''&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>84.153.135.135</name></author>	</entry>

	<entry>
		<id>http://hacking-printers.net/wiki/index.php?title=Print_job_manipulation&amp;diff=215&amp;oldid=prev</id>
		<title>Admin at 17:51, 23 January 2017</title>
		<link rel="alternate" type="text/html" href="http://hacking-printers.net/wiki/index.php?title=Print_job_manipulation&amp;diff=215&amp;oldid=prev"/>
				<updated>2017-01-23T17:51:27Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;tr style='vertical-align: top;' lang='en'&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Revision as of 17:51, 23 January 2017&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l5&quot; &gt;Line 5:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 5:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[File:Overlay.jpg|thumb|Smiley overlay attack on others' jobs]]&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[File:Overlay.jpg|thumb|Smiley overlay attack on others' jobs]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;One simple way to manipulate the appearance of printouts is to use overlays. PCL has a documented function to put overlay macros on top of a document. Unfortunately, this feature is limited to the current print job and cannot be made permanent. PostScript does not offer such functionality by default, however it can be programmed into by [[PostScript#Operator redefinition|redefining]] the ''showpage'' operator which is contained in every PostScript document to print the current page. The attacker can hook in there, execute her own code and then call the original version of the operator. Therefore she can overlay all pages to be printed with a custom ''EPS'' file. This hack can be used to add arbitrary graphics or fonts to hard copies of a document. It is handy to play pranks like putting &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;`hax0r slogans` &lt;/del&gt;on all sheets – but also for legitimate tasks such as creating letterheads. Pranks range from occasional coffee stains on the sheets of a particular user to the simulation of a near empty toner cartridge. It is also possible to completely alter the appearance of a document by overlaying a blank page and then adding custom content. For a more advanced attack, imagine the victim wants to sell a good to the attacker. Both parties agree on a price and receive a digital copy of the sales agreement. As the attacker knows the exact location of the price in the document, by manipulating the victim's printer she can add a blank rectangle here, including a lower price. If the printout is not re-checked before the contract is signed, the victim might need a good lawyer. This attack works even if the contract document was digitally signed and verified by a print server, because the file itself remains untouched. Obviously, such an approach can only be successful if PostScript is used as printer driver and no ''StartJobPassword'' (see [[credential disclosure]]) is set.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;One simple way to manipulate the appearance of printouts is to use overlays. PCL has a documented function to put overlay macros on top of a document. Unfortunately, this feature is limited to the current print job and cannot be made permanent. PostScript does not offer such functionality by default, however it can be programmed into by [[PostScript#Operator redefinition|redefining]] the ''showpage'' operator which is contained in every PostScript document to print the current page. The attacker can hook in there, execute her own code and then call the original version of the operator. Therefore she can overlay all pages to be printed with a custom ''EPS'' file. This hack can be used to add arbitrary graphics or fonts to hard copies of a document. It is handy to play pranks like putting &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;‘hax0r slogans’ &lt;/ins&gt;on all sheets – but also for legitimate tasks such as creating letterheads. Pranks range from occasional coffee stains on the sheets of a particular user to the simulation of a near empty toner cartridge. It is also possible to completely alter the appearance of a document by overlaying a blank page and then adding custom content. For a more advanced attack, imagine the victim wants to sell a good to the attacker. Both parties agree on a price and receive a digital copy of the sales agreement. As the attacker knows the exact location of the price in the document, by manipulating the victim's printer she can add a blank rectangle here, including a lower price. If the printout is not re-checked before the contract is signed, the victim might need a good lawyer. This attack works even if the contract document was digitally signed and verified by a print server, because the file itself remains untouched. Obviously, such an approach can only be successful if PostScript is used as printer driver and no ''StartJobPassword'' (see [[credential disclosure]]) is set.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;'''How to test for this attack?'''&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;'''How to test for this attack?'''&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l25&quot; &gt;Line 25:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 25:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== Content Replacement ==&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== Content Replacement ==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Even if an attacker can put an overlay above existing documents, she will not be able to alter specific values in the original document unless its exact structure is known. Sometimes ones does not only want to add custom content, but to parse and replace parts of the existing document. Especially replacing text seems to be an attractive function, introducing new possibilities to the attacker as she can go for targeted manipulation or randomly transpose digits and introduce misspellings. The problem of replacing text in PostScript files can be reduced to the problem of extracting strings from the rendered document. This is not trivial, because strings can be dynamically built by the PostScript program itself. Hence, simple parsing and replacing within the document source code is not an option. This issue has been discussed by &amp;lt;ref name=&amp;quot;nevill1997extracting&amp;quot;&amp;gt;''[https://pdfs.semanticscholar.org/494d/24a72be788a91a6ca45373c2d33013f33395.pdf Extracting Text from PostScript]'', C. Nevill-Manning, T. Reed and others, 1997&amp;lt;/ref&amp;gt;. They use a PostScript interpreter with a redefined ''show'' operator to index documents for the New Zealand Digital Library Project (NZDLP). The ''show'' operator accepts a string as input, which is painted to a certain location of the current page. By redefining the operator, text can elegantly be extracted. This approach can also be used for targeted searching and replacing in strings immediately before they are painted. While this scheme sounds good in theory and was &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;'surprisingly &lt;/del&gt;effective on the 40,000 technical &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;reports` &lt;/del&gt;&amp;lt;ref name=&amp;quot;nevill1997extracting&amp;quot;/&amp;gt; of the NZDLP, it depends on the PostScript code quality generated either directly by an application or by a printing system like CUPS. For example, the approach is successful for ''LaTeX'' based PostScript documents which are directly send to the printer while it fails for PostScript files generated by ''GIMP'' &amp;lt;ref&amp;gt;''[https://www.gimp.org/ GIMP – GNU Image Manipulation Program]'', S. Kimball and P. Mattis&amp;lt;/ref&amp;gt; which instead of strings creates raster graphics of their representation. The same issue occurs for any document format – even PostScript itself – when processed by CUPS. Theoretically such language constructs could also be parsed and should be subject of further research.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Even if an attacker can put an overlay above existing documents, she will not be able to alter specific values in the original document unless its exact structure is known. Sometimes ones does not only want to add custom content, but to parse and replace parts of the existing document. Especially replacing text seems to be an attractive function, introducing new possibilities to the attacker as she can go for targeted manipulation or randomly transpose digits and introduce misspellings. The problem of replacing text in PostScript files can be reduced to the problem of extracting strings from the rendered document. This is not trivial, because strings can be dynamically built by the PostScript program itself. Hence, simple parsing and replacing within the document source code is not an option. This issue has been discussed by &amp;lt;ref name=&amp;quot;nevill1997extracting&amp;quot;&amp;gt;''[https://pdfs.semanticscholar.org/494d/24a72be788a91a6ca45373c2d33013f33395.pdf Extracting Text from PostScript]'', C. Nevill-Manning, T. Reed and others, 1997&amp;lt;/ref&amp;gt;. They use a PostScript interpreter with a redefined ''show'' operator to index documents for the New Zealand Digital Library Project (NZDLP). The ''show'' operator accepts a string as input, which is painted to a certain location of the current page. By redefining the operator, text can elegantly be extracted. This approach can also be used for targeted searching and replacing in strings immediately before they are painted. While this scheme sounds good in theory and was &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;‘surprisingly &lt;/ins&gt;effective on the 40,000 technical &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;reports’ &lt;/ins&gt;&amp;lt;ref name=&amp;quot;nevill1997extracting&amp;quot;/&amp;gt; of the NZDLP, it depends on the PostScript code quality generated either directly by an application or by a printing system like CUPS. For example, the approach is successful for ''LaTeX'' based PostScript documents which are directly send to the printer while it fails for PostScript files generated by ''GIMP'' &amp;lt;ref&amp;gt;''[https://www.gimp.org/ GIMP – GNU Image Manipulation Program]'', S. Kimball and P. Mattis&amp;lt;/ref&amp;gt; which instead of strings creates raster graphics of their representation. The same issue occurs for any document format – even PostScript itself – when processed by CUPS. Theoretically such language constructs could also be parsed and should be subject of further research.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;'''How to test for this attack?'''&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;'''How to test for this attack?'''&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Admin</name></author>	</entry>

	<entry>
		<id>http://hacking-printers.net/wiki/index.php?title=Print_job_manipulation&amp;diff=214&amp;oldid=prev</id>
		<title>Admin at 17:21, 23 January 2017</title>
		<link rel="alternate" type="text/html" href="http://hacking-printers.net/wiki/index.php?title=Print_job_manipulation&amp;diff=214&amp;oldid=prev"/>
				<updated>2017-01-23T17:21:29Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;tr style='vertical-align: top;' lang='en'&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Revision as of 17:21, 23 January 2017&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l25&quot; &gt;Line 25:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 25:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== Content Replacement ==&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== Content Replacement ==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Even if an attacker can put an overlay above existing documents, she will not be able to alter specific values in the original document unless its exact structure is known. Sometimes ones does not only want to add custom content, but to parse and replace parts of the existing document. Especially replacing text seems to be an attractive function, introducing new possibilities to the attacker as she can go for targeted manipulation or randomly transpose digits and introduce misspellings. The problem of replacing text in PostScript files can be reduced to the problem of extracting strings from the rendered document. This is not trivial, because strings can be dynamically built by the PostScript program itself. Hence, simple parsing and replacing within the document source code is not an option. This issue has been discussed by &amp;lt;ref name=&amp;quot;nevill1997extracting&amp;quot;&amp;gt;''[https://pdfs.semanticscholar.org/494d/24a72be788a91a6ca45373c2d33013f33395.pdf Extracting Text from PostScript]'', C. Nevill-Manning, T. Reed and others, 1997&amp;lt;/ref&amp;gt;. They use a PostScript interpreter with a redefined ''show'' operator to index documents for the New Zealand Digital Library Project (NZDLP). The ''show'' operator accepts a string as input, which is painted to a certain location of the current page. By redefining the operator, text can elegantly be extracted. This approach can also be used for targeted searching and replacing in strings immediately before they are painted. While this scheme sounds good in theory and was 'surprisingly effective on the 40,000 technical reports` &amp;lt;ref name=&amp;quot;nevill1997extracting&amp;quot;/&amp;gt; of the NZDLP, it depends on the PostScript code quality generated either directly by an application or by a printing system like CUPS. For example, the approach is successful for ''LaTeX'' based PostScript documents which are directly send to the printer while it fails for PostScript files generated by ''GIMP'' &amp;lt;ref&amp;gt;''[https://www.gimp.org/ GIMP – GNU Image Manipulation Program]'', S. Kimball and P. Mattis&amp;lt;/ref&amp;gt; which instead of strings creates raster graphics of their representation. The same issue occurs for any document format – even PostScript itself – when processed by CUPS. Theoretically such language constructs could also be parsed&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;, this would however go beyond the scope &lt;/del&gt;of &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;this work&lt;/del&gt;.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Even if an attacker can put an overlay above existing documents, she will not be able to alter specific values in the original document unless its exact structure is known. Sometimes ones does not only want to add custom content, but to parse and replace parts of the existing document. Especially replacing text seems to be an attractive function, introducing new possibilities to the attacker as she can go for targeted manipulation or randomly transpose digits and introduce misspellings. The problem of replacing text in PostScript files can be reduced to the problem of extracting strings from the rendered document. This is not trivial, because strings can be dynamically built by the PostScript program itself. Hence, simple parsing and replacing within the document source code is not an option. This issue has been discussed by &amp;lt;ref name=&amp;quot;nevill1997extracting&amp;quot;&amp;gt;''[https://pdfs.semanticscholar.org/494d/24a72be788a91a6ca45373c2d33013f33395.pdf Extracting Text from PostScript]'', C. Nevill-Manning, T. Reed and others, 1997&amp;lt;/ref&amp;gt;. They use a PostScript interpreter with a redefined ''show'' operator to index documents for the New Zealand Digital Library Project (NZDLP). The ''show'' operator accepts a string as input, which is painted to a certain location of the current page. By redefining the operator, text can elegantly be extracted. This approach can also be used for targeted searching and replacing in strings immediately before they are painted. While this scheme sounds good in theory and was 'surprisingly effective on the 40,000 technical reports` &amp;lt;ref name=&amp;quot;nevill1997extracting&amp;quot;/&amp;gt; of the NZDLP, it depends on the PostScript code quality generated either directly by an application or by a printing system like CUPS. For example, the approach is successful for ''LaTeX'' based PostScript documents which are directly send to the printer while it fails for PostScript files generated by ''GIMP'' &amp;lt;ref&amp;gt;''[https://www.gimp.org/ GIMP – GNU Image Manipulation Program]'', S. Kimball and P. Mattis&amp;lt;/ref&amp;gt; which instead of strings creates raster graphics of their representation. The same issue occurs for any document format – even PostScript itself – when processed by CUPS. Theoretically such language constructs could also be parsed &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;and should be subject &lt;/ins&gt;of &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;further research&lt;/ins&gt;.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;'''How to test for this attack?'''&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;'''How to test for this attack?'''&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Admin</name></author>	</entry>

	<entry>
		<id>http://hacking-printers.net/wiki/index.php?title=Print_job_manipulation&amp;diff=213&amp;oldid=prev</id>
		<title>Admin at 17:17, 23 January 2017</title>
		<link rel="alternate" type="text/html" href="http://hacking-printers.net/wiki/index.php?title=Print_job_manipulation&amp;diff=213&amp;oldid=prev"/>
				<updated>2017-01-23T17:17:34Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;tr style='vertical-align: top;' lang='en'&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Revision as of 17:17, 23 January 2017&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l2&quot; &gt;Line 2:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 2:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== Content Overlay ==&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== Content Overlay ==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[[File:Overlay.jpg|thumb|Smiley overlay attack on others' jobs]]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;One simple way to manipulate the appearance of printouts is to use overlays. PCL has a documented function to put overlay macros on top of a document. Unfortunately, this feature is limited to the current print job and cannot be made permanent. PostScript does not offer such functionality by default, however it can be programmed into by [[PostScript#Operator redefinition|redefining]] the ''showpage'' operator which is contained in every PostScript document to print the current page. The attacker can hook in there, execute her own code and then call the original version of the operator. Therefore she can overlay all pages to be printed with a custom ''EPS'' file. This hack can be used to add arbitrary graphics or fonts to hard copies of a document. It is handy to play pranks like putting `hax0r slogans` on all sheets – but also for legitimate tasks such as creating letterheads. Pranks range from occasional coffee stains on the sheets of a particular user to the simulation of a near empty toner cartridge. It is also possible to completely alter the appearance of a document by overlaying a blank page and then adding custom content. For a more advanced attack, imagine the victim wants to sell a good to the attacker. Both parties agree on a price and receive a digital copy of the sales agreement. As the attacker knows the exact location of the price in the document, by manipulating the victim's printer she can add a blank rectangle here, including a lower price. If the printout is not re-checked before the contract is signed, the victim might need a good lawyer. This attack works even if the contract document was digitally signed and verified by a print server, because the file itself remains untouched. Obviously, such an approach can only be successful if PostScript is used as printer driver and no ''StartJobPassword'' (see [[credential disclosure]]) is set.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;One simple way to manipulate the appearance of printouts is to use overlays. PCL has a documented function to put overlay macros on top of a document. Unfortunately, this feature is limited to the current print job and cannot be made permanent. PostScript does not offer such functionality by default, however it can be programmed into by [[PostScript#Operator redefinition|redefining]] the ''showpage'' operator which is contained in every PostScript document to print the current page. The attacker can hook in there, execute her own code and then call the original version of the operator. Therefore she can overlay all pages to be printed with a custom ''EPS'' file. This hack can be used to add arbitrary graphics or fonts to hard copies of a document. It is handy to play pranks like putting `hax0r slogans` on all sheets – but also for legitimate tasks such as creating letterheads. Pranks range from occasional coffee stains on the sheets of a particular user to the simulation of a near empty toner cartridge. It is also possible to completely alter the appearance of a document by overlaying a blank page and then adding custom content. For a more advanced attack, imagine the victim wants to sell a good to the attacker. Both parties agree on a price and receive a digital copy of the sales agreement. As the attacker knows the exact location of the price in the document, by manipulating the victim's printer she can add a blank rectangle here, including a lower price. If the printout is not re-checked before the contract is signed, the victim might need a good lawyer. This attack works even if the contract document was digitally signed and verified by a print server, because the file itself remains untouched. Obviously, such an approach can only be successful if PostScript is used as printer driver and no ''StartJobPassword'' (see [[credential disclosure]]) is set.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Admin</name></author>	</entry>

	<entry>
		<id>http://hacking-printers.net/wiki/index.php?title=Print_job_manipulation&amp;diff=211&amp;oldid=prev</id>
		<title>Admin at 17:06, 23 January 2017</title>
		<link rel="alternate" type="text/html" href="http://hacking-printers.net/wiki/index.php?title=Print_job_manipulation&amp;diff=211&amp;oldid=prev"/>
				<updated>2017-01-23T17:06:32Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;tr style='vertical-align: top;' lang='en'&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Revision as of 17:06, 23 January 2017&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l23&quot; &gt;Line 23:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 23:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== Content Replacement ==&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== Content Replacement ==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Even if an attacker can put an overlay above existing documents, she will not be able to alter specific values in the original document unless its exact structure is known. Sometimes &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;we do &lt;/del&gt;not only want to add custom content, but to parse and replace parts of the existing document. Especially replacing text seems to be an attractive function, introducing new possibilities to the attacker as she can go for targeted manipulation or randomly transpose digits and introduce misspellings. The problem of replacing text in PostScript files can be reduced to the problem of extracting strings from the rendered document. This is not trivial, because strings can be dynamically built by the PostScript program itself. Hence, simple parsing and replacing within the document source code is not an option. This issue has been discussed by &amp;lt;ref name=&amp;quot;nevill1997extracting&amp;quot;&amp;gt;''[https://pdfs.semanticscholar.org/494d/24a72be788a91a6ca45373c2d33013f33395.pdf Extracting Text from PostScript]'', C. Nevill-Manning, T. Reed and others, 1997&amp;lt;/ref&amp;gt;. They use a PostScript interpreter with a redefined ''show'' operator to index documents for the New Zealand Digital Library Project (NZDLP). The ''show'' operator accepts a string as input, which is painted to a certain location of the current page. By redefining the operator, text can elegantly be extracted. &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;We use this &lt;/del&gt;approach for targeted searching and replacing in strings immediately before they are painted. While this scheme sounds good in theory and was 'surprisingly effective on the 40,000 technical reports` &amp;lt;ref name=&amp;quot;nevill1997extracting&amp;quot;/&amp;gt; of the NZDLP, it depends on the PostScript code quality generated either directly by an application or by a printing system like CUPS. For example, the approach is successful for ''LaTeX'' based PostScript documents which are directly send to the printer while it fails for PostScript files generated by ''GIMP'' &amp;lt;ref&amp;gt;''[https://www.gimp.org/ GIMP – GNU Image Manipulation Program]'', S. Kimball and P. Mattis&amp;lt;/ref&amp;gt; which instead of strings creates raster graphics of their representation. The same issue occurs for any document format – even PostScript itself – when processed by CUPS. Theoretically such language constructs could also be parsed, this would however go beyond the scope of this work.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Even if an attacker can put an overlay above existing documents, she will not be able to alter specific values in the original document unless its exact structure is known. Sometimes &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;ones does &lt;/ins&gt;not only want to add custom content, but to parse and replace parts of the existing document. Especially replacing text seems to be an attractive function, introducing new possibilities to the attacker as she can go for targeted manipulation or randomly transpose digits and introduce misspellings. The problem of replacing text in PostScript files can be reduced to the problem of extracting strings from the rendered document. This is not trivial, because strings can be dynamically built by the PostScript program itself. Hence, simple parsing and replacing within the document source code is not an option. This issue has been discussed by &amp;lt;ref name=&amp;quot;nevill1997extracting&amp;quot;&amp;gt;''[https://pdfs.semanticscholar.org/494d/24a72be788a91a6ca45373c2d33013f33395.pdf Extracting Text from PostScript]'', C. Nevill-Manning, T. Reed and others, 1997&amp;lt;/ref&amp;gt;. They use a PostScript interpreter with a redefined ''show'' operator to index documents for the New Zealand Digital Library Project (NZDLP). The ''show'' operator accepts a string as input, which is painted to a certain location of the current page. By redefining the operator, text can elegantly be extracted. &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;This &lt;/ins&gt;approach &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;can also be used &lt;/ins&gt;for targeted searching and replacing in strings immediately before they are painted. While this scheme sounds good in theory and was 'surprisingly effective on the 40,000 technical reports` &amp;lt;ref name=&amp;quot;nevill1997extracting&amp;quot;/&amp;gt; of the NZDLP, it depends on the PostScript code quality generated either directly by an application or by a printing system like CUPS. For example, the approach is successful for ''LaTeX'' based PostScript documents which are directly send to the printer while it fails for PostScript files generated by ''GIMP'' &amp;lt;ref&amp;gt;''[https://www.gimp.org/ GIMP – GNU Image Manipulation Program]'', S. Kimball and P. Mattis&amp;lt;/ref&amp;gt; which instead of strings creates raster graphics of their representation. The same issue occurs for any document format – even PostScript itself – when processed by CUPS. Theoretically such language constructs could also be parsed, this would however go beyond the scope of this work.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;'''How to test for this attack?'''&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;'''How to test for this attack?'''&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Admin</name></author>	</entry>

	<entry>
		<id>http://hacking-printers.net/wiki/index.php?title=Print_job_manipulation&amp;diff=210&amp;oldid=prev</id>
		<title>Admin: Created page with &quot;If an attacker can alter print jobs, she fundamentally undermines trust. A user cannot be sure anymore if the document viewed on screen is the same as the hard copy emerging f...&quot;</title>
		<link rel="alternate" type="text/html" href="http://hacking-printers.net/wiki/index.php?title=Print_job_manipulation&amp;diff=210&amp;oldid=prev"/>
				<updated>2017-01-23T17:05:25Z</updated>
		
		<summary type="html">&lt;p&gt;Created page with &amp;quot;If an attacker can alter print jobs, she fundamentally undermines trust. A user cannot be sure anymore if the document viewed on screen is the same as the hard copy emerging f...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;If an attacker can alter print jobs, she fundamentally undermines trust. A user cannot be sure anymore if the document viewed on screen is the same as the hard copy emerging from the printer. The impact depends on the context of the print job and can range from simple pranks to serious business impairment. Two PostScript based techniques are discussed below.&lt;br /&gt;
&lt;br /&gt;
== Content Overlay ==&lt;br /&gt;
&lt;br /&gt;
One simple way to manipulate the appearance of printouts is to use overlays. PCL has a documented function to put overlay macros on top of a document. Unfortunately, this feature is limited to the current print job and cannot be made permanent. PostScript does not offer such functionality by default, however it can be programmed into by [[PostScript#Operator redefinition|redefining]] the ''showpage'' operator which is contained in every PostScript document to print the current page. The attacker can hook in there, execute her own code and then call the original version of the operator. Therefore she can overlay all pages to be printed with a custom ''EPS'' file. This hack can be used to add arbitrary graphics or fonts to hard copies of a document. It is handy to play pranks like putting `hax0r slogans` on all sheets – but also for legitimate tasks such as creating letterheads. Pranks range from occasional coffee stains on the sheets of a particular user to the simulation of a near empty toner cartridge. It is also possible to completely alter the appearance of a document by overlaying a blank page and then adding custom content. For a more advanced attack, imagine the victim wants to sell a good to the attacker. Both parties agree on a price and receive a digital copy of the sales agreement. As the attacker knows the exact location of the price in the document, by manipulating the victim's printer she can add a blank rectangle here, including a lower price. If the printout is not re-checked before the contract is signed, the victim might need a good lawyer. This attack works even if the contract document was digitally signed and verified by a print server, because the file itself remains untouched. Obviously, such an approach can only be successful if PostScript is used as printer driver and no ''StartJobPassword'' (see [[credential disclosure]]) is set.&lt;br /&gt;
&lt;br /&gt;
'''How to test for this attack?'''&lt;br /&gt;
&lt;br /&gt;
Use [[PRET]]'s ''cross'' or ''overlay'' commands in ''ps'' mode, then disconnect and print an arbitrary document:&lt;br /&gt;
&lt;br /&gt;
 ./pret.py -q printer ps&lt;br /&gt;
 Connection to printer established&lt;br /&gt;
 &lt;br /&gt;
 Welcome to the pret shell. Type help or ? to list commands.&lt;br /&gt;
 printer:/&amp;gt; overlay overlays/smiley.eps&lt;br /&gt;
 printer:/&amp;gt; cross whoa &amp;quot;HACKED&amp;quot;&lt;br /&gt;
 printer:/&amp;gt; exit&lt;br /&gt;
&lt;br /&gt;
'''Who can perform this attack?'''&lt;br /&gt;
&lt;br /&gt;
Anyone who can print, for example through [[USB drive or cable]], [[Port 9100 printing]] or [[Cross-site printing]].&lt;br /&gt;
&lt;br /&gt;
== Content Replacement ==&lt;br /&gt;
&lt;br /&gt;
Even if an attacker can put an overlay above existing documents, she will not be able to alter specific values in the original document unless its exact structure is known. Sometimes we do not only want to add custom content, but to parse and replace parts of the existing document. Especially replacing text seems to be an attractive function, introducing new possibilities to the attacker as she can go for targeted manipulation or randomly transpose digits and introduce misspellings. The problem of replacing text in PostScript files can be reduced to the problem of extracting strings from the rendered document. This is not trivial, because strings can be dynamically built by the PostScript program itself. Hence, simple parsing and replacing within the document source code is not an option. This issue has been discussed by &amp;lt;ref name=&amp;quot;nevill1997extracting&amp;quot;&amp;gt;''[https://pdfs.semanticscholar.org/494d/24a72be788a91a6ca45373c2d33013f33395.pdf Extracting Text from PostScript]'', C. Nevill-Manning, T. Reed and others, 1997&amp;lt;/ref&amp;gt;. They use a PostScript interpreter with a redefined ''show'' operator to index documents for the New Zealand Digital Library Project (NZDLP). The ''show'' operator accepts a string as input, which is painted to a certain location of the current page. By redefining the operator, text can elegantly be extracted. We use this approach for targeted searching and replacing in strings immediately before they are painted. While this scheme sounds good in theory and was 'surprisingly effective on the 40,000 technical reports` &amp;lt;ref name=&amp;quot;nevill1997extracting&amp;quot;/&amp;gt; of the NZDLP, it depends on the PostScript code quality generated either directly by an application or by a printing system like CUPS. For example, the approach is successful for ''LaTeX'' based PostScript documents which are directly send to the printer while it fails for PostScript files generated by ''GIMP'' &amp;lt;ref&amp;gt;''[https://www.gimp.org/ GIMP – GNU Image Manipulation Program]'', S. Kimball and P. Mattis&amp;lt;/ref&amp;gt; which instead of strings creates raster graphics of their representation. The same issue occurs for any document format – even PostScript itself – when processed by CUPS. Theoretically such language constructs could also be parsed, this would however go beyond the scope of this work.&lt;br /&gt;
&lt;br /&gt;
'''How to test for this attack?'''&lt;br /&gt;
&lt;br /&gt;
Use [[PRET]]'s ''replace'' command in ''ps'' mode, then disconnect and print a PostScript document containing ‘DEF’:&lt;br /&gt;
&lt;br /&gt;
 ./pret.py -q printer ps&lt;br /&gt;
 Connection to printer established&lt;br /&gt;
 &lt;br /&gt;
 Welcome to the pret shell. Type help or ? to list commands.&lt;br /&gt;
 printer:/&amp;gt; replace &amp;quot;ABC&amp;quot; &amp;quot;DEF&amp;quot;&lt;br /&gt;
 printer:/&amp;gt; exit&lt;br /&gt;
&lt;br /&gt;
'''Who can perform this attack?'''&lt;br /&gt;
&lt;br /&gt;
Anyone who can print, for example through [[USB drive or cable]], [[Port 9100 printing]] or [[Cross-site printing]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;/div&gt;</summary>
		<author><name>Admin</name></author>	</entry>

	</feed>