{"id":765,"date":"2013-04-01T05:46:37","date_gmt":"2013-04-01T03:46:37","guid":{"rendered":"https:\/\/www.asafety.fr\/?p=765"},"modified":"2015-11-11T12:53:58","modified_gmt":"2015-11-11T10:53:58","slug":"vecteurs-dattaques-dans-les-codes-barres-et-qrcode","status":"publish","type":"post","link":"https:\/\/www.asafety.fr\/en\/vuln-exploit-poc\/vecteurs-dattaques-dans-les-codes-barres-et-qrcode\/","title":{"rendered":"Vecteurs d&#8217;attaques dans les codes-barres et QRcode"},"content":{"rendered":"<p><\/p>\n<p>Au cours de ma veille quotidienne, je suis tomb\u00e9 sur cet <a title=\"SQL Injection in the wild\" href=\"http:\/\/www.circleid.com\/posts\/20130325_sql_injection_in_the_wild\/\" target=\"_blank\">article de Gunter Ollmann<\/a> qui fait un retour sur les dangers des injections SQL appliqu\u00e9es au monde physique. L&#8217;illustration humoristique suivante, qui commence \u00e0 dater, d\u00e9crit une des applications possibles des SQLi physiques\u00a0(bien que ce soit tr\u00e8s probablement non fonctionnel) :<\/p>\n<div id=\"attachment_766\" style=\"width: 125px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/www.asafety.fr\/wp-content\/uploads\/sqli_physique.jpg\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-766\" class=\"size-medium wp-image-766\" alt=\"SQLi plaque immatriculation\" src=\"https:\/\/www.asafety.fr\/wp-content\/uploads\/sqli_physique-115x300.jpg\" width=\"115\" height=\"300\" srcset=\"https:\/\/www.asafety.fr\/wp-content\/uploads\/sqli_physique-115x300.jpg 115w, https:\/\/www.asafety.fr\/wp-content\/uploads\/sqli_physique.jpg 366w\" sizes=\"auto, (max-width: 115px) 100vw, 115px\" \/><\/a><p id=\"caption-attachment-766\" class=\"wp-caption-text\">SQLi plaque immatriculation<\/p><\/div>\n<p>Ce constat m&#8217;a rappel\u00e9 de vieux souvenirs quant \u00e0 l&#8217;exploitation de vecteurs d&#8217;attaques de type XSS\/SQLi au travers de repr\u00e9sentation non-textuelle. Je me suis donc replong\u00e9 dans mes archives pour retrouver ces sources documentaires.<\/p>\n<h2>Cibles potentielles d&#8217;attaques sur codes-barres et QRcode<\/h2>\n<p>Les vecteurs d&#8217;attaques non-textuels auxquels je fait r\u00e9f\u00e9rence concernent l&#8217;exploitation des codes barres en g\u00e9n\u00e9ral et plus particuli\u00e8rement des r\u00e9cents QRcode. L&#8217;id\u00e9e est de g\u00e9n\u00e9rer des codes barres sous une forme valide en vue d&#8217;injecter des donn\u00e9es arbitraires dans un syst\u00e8me. Parmi les syst\u00e8mes vuln\u00e9rables \u00e0 de potentielles attaques sur codes barres on peut citer :<\/p>\n<ul>\n<li>Les lecteurs manuels de code barre, g\u00e9n\u00e9ralement utilis\u00e9 en caisse dans les supermarch\u00e9s pour enregistrer les produits achet\u00e9s :<\/li>\n<\/ul>\n<div id=\"attachment_767\" style=\"width: 310px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/www.asafety.fr\/wp-content\/uploads\/barrecode_reader.jpg\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-767\" class=\"size-medium wp-image-767\" alt=\"Lecteur portatif de code barre\" src=\"https:\/\/www.asafety.fr\/wp-content\/uploads\/barrecode_reader-300x221.jpg\" width=\"300\" height=\"221\" srcset=\"https:\/\/www.asafety.fr\/wp-content\/uploads\/barrecode_reader-300x221.jpg 300w, https:\/\/www.asafety.fr\/wp-content\/uploads\/barrecode_reader.jpg 420w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><p id=\"caption-attachment-767\" class=\"wp-caption-text\">Lecteur portatif de code barre<\/p><\/div>\n<ul>\n<li>Les caisses de supermarch\u00e9s en libre service, tr\u00e8s \u00e0 la mode depuis quelques ann\u00e9es et qui assurent un gain de temps en caisse. Beaucoup de supermarch\u00e9s les ont d\u00e9ploy\u00e9. A noter que celles-ci embarquent souvent un Windows :<\/li>\n<\/ul>\n<div id=\"attachment_768\" style=\"width: 310px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/www.asafety.fr\/wp-content\/uploads\/caisse_self_service.jpg\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-768\" class=\"size-medium wp-image-768\" alt=\"Caisse self-service\" src=\"https:\/\/www.asafety.fr\/wp-content\/uploads\/caisse_self_service-300x226.jpg\" width=\"300\" height=\"226\" srcset=\"https:\/\/www.asafety.fr\/wp-content\/uploads\/caisse_self_service-300x226.jpg 300w, https:\/\/www.asafety.fr\/wp-content\/uploads\/caisse_self_service-1024x773.jpg 1024w, https:\/\/www.asafety.fr\/wp-content\/uploads\/caisse_self_service.jpg 1218w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><p id=\"caption-attachment-768\" class=\"wp-caption-text\">Caisse self-service<\/p><\/div>\n<ul>\n<li>Les bornes informatives des prix, qui commencent \u00e0 dater. Ces bornes sont souvent pr\u00e9sentes dans les grands supermarch\u00e9s au milieu des rayons. Elles permettent de scanner un code barre afin d&#8217;afficher le prix du produit. On peut ais\u00e9ment traduire ce fonctionnement par une simple requ\u00eate SQL SELECT dans la base des produits du magasin.<\/li>\n<\/ul>\n<div id=\"attachment_769\" style=\"width: 310px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/www.asafety.fr\/wp-content\/uploads\/supermarket-produce-scanner.jpg\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-769\" class=\"size-medium wp-image-769\" alt=\"Scanner de produit\" src=\"https:\/\/www.asafety.fr\/wp-content\/uploads\/supermarket-produce-scanner-300x225.jpg\" width=\"300\" height=\"225\" srcset=\"https:\/\/www.asafety.fr\/wp-content\/uploads\/supermarket-produce-scanner-300x225.jpg 300w, https:\/\/www.asafety.fr\/wp-content\/uploads\/supermarket-produce-scanner.jpg 468w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><p id=\"caption-attachment-769\" class=\"wp-caption-text\">Scanner de produit<\/p><\/div>\n<ul>\n<li>Bien \u00e9videmment, les caisses de paiement en elles-m\u00eames disposent d&#8217;un lecteur de code barre fixe (pour les codes-barres des produits mais aussi des cartes fid\u00e9lit\u00e9) ; ainsi que les syst\u00e8mes portatif de self-scan que les clients utilisent avec eux dans les magasins :<\/li>\n<\/ul>\n<div id=\"attachment_770\" style=\"width: 310px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/www.asafety.fr\/wp-content\/uploads\/self-scan.jpg\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-770\" class=\"size-medium wp-image-770\" alt=\"Self-scan\" src=\"https:\/\/www.asafety.fr\/wp-content\/uploads\/self-scan-300x225.jpg\" width=\"300\" height=\"225\" srcset=\"https:\/\/www.asafety.fr\/wp-content\/uploads\/self-scan-300x225.jpg 300w, https:\/\/www.asafety.fr\/wp-content\/uploads\/self-scan.jpg 500w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><p id=\"caption-attachment-770\" class=\"wp-caption-text\">Self-scan<\/p><\/div>\n<ul>\n<li>Finalement, je citerai les lecteurs de code-barre et QRcode tr\u00e8s pr\u00e9sents sur les t\u00e9l\u00e9phones portables. Ces lecteurs qui exploitent les cam\u00e9ras des t\u00e9l\u00e9phones sont vou\u00e9s \u00e0 remplacer progressivement tous instruments d\u00e9di\u00e9s dans les grandes surfaces. Ces lecteurs permettent de scanner tous QRcode que l&#8217;on peut croiser en abondance dans les nouvelles campagnes publicitaires. Autant dire que ces applications sont elles aussi vuln\u00e9rables \u00e0 de potentielles injections.<\/li>\n<\/ul>\n<div id=\"attachment_771\" style=\"width: 310px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/www.asafety.fr\/wp-content\/uploads\/smartphone_qrcode.jpg\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-771\" class=\"size-medium wp-image-771\" alt=\"Lecteur de QRcode sur Smartphone\" src=\"https:\/\/www.asafety.fr\/wp-content\/uploads\/smartphone_qrcode-300x229.jpg\" width=\"300\" height=\"229\" srcset=\"https:\/\/www.asafety.fr\/wp-content\/uploads\/smartphone_qrcode-300x229.jpg 300w, https:\/\/www.asafety.fr\/wp-content\/uploads\/smartphone_qrcode.jpg 450w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><p id=\"caption-attachment-771\" class=\"wp-caption-text\">Lecteur de QRcode sur Smartphone<\/p><\/div>\n<h2>Exploitation des codes-barres<\/h2>\n<p>Plus r\u00e9cemment, et suite au succ\u00e8s des QRcode, de nombreuses applications, API et syst\u00e8mes logiciels sont apparus pour exploiter ces codes-barres. Comme\u00a0\u00e9nonc\u00e9\u00a0pr\u00e9c\u00e9demment les smartphones en sont quasi-tous \u00e9quip\u00e9s ; mais des solutions existent aussi sur PC fixe en exploitant la webcam des ordinateurs.<\/p>\n<p>Parmi ces solutions de reconnaissance de QRcode\/codes-barres sur PC on peut citer (par Webcam ou via upload d&#8217;image) :<\/p>\n<ul>\n<li><a title=\"Flash Webcam QRcode Reader online\" href=\"http:\/\/miniqr.com\/reader.php\" target=\"_blank\">Flash Webcam QRcode Reader online<\/a><\/li>\n<li><a title=\"Web QRcode scanner\" href=\"http:\/\/www.webqr.com\/\" target=\"_blank\">Web QRcode scanner<\/a><\/li>\n<li>De nombreux plugins JQuery comme <a title=\"ScriptCam\" href=\"http:\/\/www.scriptcam.com\/\" target=\"_blank\">ScriptCam<\/a><\/li>\n<li>Etc.<\/li>\n<\/ul>\n<p>Et bien \u00e9videmment, en plus de solution de reconnaissance, il y a celles de g\u00e9n\u00e9ration de code barre dans de nombreux langages :<\/p>\n<ul>\n<li><a title=\"PHP QRcode generator\" href=\"http:\/\/phpqrcode.sourceforge.net\/\" target=\"_blank\">PHP QRcode generator<\/a><\/li>\n<li><a title=\"JQuery QRcode\" href=\"http:\/\/jeromeetienne.github.io\/jquery-qrcode\/\" target=\"_blank\">JQuery QRcode<\/a><\/li>\n<li><a title=\"Java barcode generator library\" href=\"http:\/\/www.onbarcode.com\/products\/java_barcode\/\" target=\"_blank\">Java barcode generator library<\/a><\/li>\n<li>Etc.<\/li>\n<\/ul>\n<h2>Type de codes-barres, repr\u00e9sentation et caract\u00e9ristiques<\/h2>\n<p>Il existe une multitude de codes-barres. Chacun d&#8217;eux \u00e0 ses sp\u00e9cificit\u00e9s (lecture lin\u00e9aire en 1 dimension, 2 dimensions&#8230;) et prend en compte plus ou moins de caract\u00e8res.<\/p>\n<p>C&#8217;est sur ce dernier point qui concerne le <em>charset<\/em> exploitable par les codes barres que le type d&#8217;injection et sa faisabilit\u00e9 vont se jouer. De plus, la cible envisag\u00e9e d\u00e9pend bien \u00e9videmment des types de codes-barres support\u00e9s.<\/p>\n<p>Il parait logique qu&#8217;une injection sera plus complexe voir\u00a0inefficace\u00a0si un code-barres n&#8217;accepte que des caract\u00e8res num\u00e9riques par exemple.<\/p>\n<p>Avant de pr\u00e9senter des vecteurs fonctionnels et de pr\u00e9senter un PoC, voici un \u00e9tat de l&#8217;art des types de codes-barres les plus courants et leurs sp\u00e9cifications (source <a title=\"makebarcode\" href=\"http:\/\/www.makebarcode.com\/specs\/barcodechart.html\" target=\"_blank\">makebarcode.com<\/a>) :<\/p>\n<div align=\"left\">\n<table id=\"table2\" width=\"900\" border=\"0\" cellspacing=\"0\">\n<tbody>\n<tr>\n<td width=\"235\"><strong>Barcode<\/strong><\/td>\n<td width=\"59\"><strong>Type<\/strong><\/td>\n<td width=\"136\"><strong>Character Set<\/strong><\/td>\n<td width=\"109\"><strong>Length<\/strong><\/td>\n<td width=\"85\"><strong>Checksum<\/strong><\/td>\n<td width=\"258\"><strong>Applications<\/strong><\/td>\n<\/tr>\n<tr>\n<td width=\"235\"><b>Australia Postal Code<\/b><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" src=\"http:\/\/www.makebarcode.com\/images\/symbologies\/australia_postal_example_blue.jpg\" width=\"210\" height=\"28\" border=\"0\" \/><\/td>\n<td width=\"59\">2D<\/td>\n<td width=\"134\">Numbers Only<\/td>\n<td width=\"107\">4<\/td>\n<td width=\"83\">Required<\/td>\n<td width=\"258\">Includes error correction<\/td>\n<\/tr>\n<tr>\n<td width=\"235\"><b>Aztec Code<\/b><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" src=\"http:\/\/www.makebarcode.com\/images\/symbologies\/aztec_example_blue.jpg\" width=\"80\" height=\"80\" border=\"0\" \/><\/td>\n<td width=\"59\">2D<\/td>\n<td width=\"134\">Full ASCII; FNC1 and ESI control codes<\/td>\n<td width=\"107\">Variable<br \/>\nMin 12<br \/>\nMax 3832<\/td>\n<td width=\"83\">Required<\/td>\n<td width=\"258\">Includes error correction; minimum is 15&#215;15 square, largest is 151&#215;151<\/td>\n<\/tr>\n<tr>\n<td width=\"235\"><a href=\"http:\/\/www.makebarcode.com\/specs\/codabar.html\" target=\"_blank\"><b>Codabar<\/b><\/a><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" style=\"line-height: 19px;\" alt=\"\" src=\"http:\/\/www.makebarcode.com\/images\/symbologies\/codabar_example_blue.jpg\" width=\"180\" height=\"64\" border=\"0\" \/><\/td>\n<td width=\"59\">1D<\/td>\n<td width=\"134\">Numbers: 0-9;<br \/>\nSymbols: &#8211; : . $ \/ +<br \/>\nStart\/Stop Characters:<br \/>\nA, B, C, D, E, *, N, or T<\/td>\n<td width=\"107\">Variable<\/td>\n<td width=\"83\">None<\/td>\n<td width=\"258\">Older code; often used in libraries and blood banks.\u00a0 See also USD-4, NW-7, 2of7<\/td>\n<\/tr>\n<tr>\n<td width=\"235\"><a href=\"http:\/\/www.makebarcode.com\/specs\/code_11.html\" target=\"_blank\"><b>Code 11<\/b><\/a><\/p>\n<p><b style=\"line-height: 19px;\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" src=\"http:\/\/www.makebarcode.com\/images\/symbologies\/code11_example_blue.jpg\" width=\"131\" height=\"61\" border=\"0\" \/><\/b><\/td>\n<td width=\"59\">1D<\/td>\n<td width=\"134\">Numbers Only<\/td>\n<td width=\"107\">Variable<\/td>\n<td width=\"83\">Required<\/td>\n<td width=\"258\">Recommend 2nd check digit<\/td>\n<\/tr>\n<tr>\n<td width=\"235\"><a href=\"http:\/\/www.makebarcode.com\/specs\/code_128.html\" target=\"_blank\"><b>Code 128<\/b><\/a><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" style=\"line-height: 19px;\" alt=\"\" src=\"http:\/\/www.makebarcode.com\/images\/symbologies\/code128_example_blue.jpg\" width=\"180\" height=\"64\" border=\"0\" \/><\/td>\n<td width=\"59\">1D<\/td>\n<td width=\"134\">All ASCII characters<br \/>\nand control codes<\/td>\n<td width=\"107\">Variable<\/td>\n<td width=\"83\">Required<\/td>\n<td width=\"258\">Widely used; excellent for many applications<\/td>\n<\/tr>\n<tr>\n<td width=\"235\"><b><a href=\"http:\/\/www.makebarcode.com\/specs\/code_39.html\" target=\"_blank\">Code 3<\/a><\/b><a href=\"http:\/\/www.makebarcode.com\/specs\/code_39.html\" target=\"_blank\"><b>9<\/b><\/a><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" src=\"http:\/\/www.makebarcode.com\/images\/symbologies\/code39_example_blue.jpg\" width=\"192\" height=\"60\" border=\"0\" \/><\/td>\n<td width=\"59\">1D<\/td>\n<td width=\"134\">Uppercase letters A-Z;<br \/>\nNumbers 0-9;<br \/>\nSpace &#8211; . $ \/ + %<\/td>\n<td width=\"107\">Variable<\/td>\n<td width=\"83\">Optional<\/td>\n<td width=\"258\">In very wide use for many types of applications<\/td>\n<\/tr>\n<tr>\n<td width=\"235\"><a href=\"http:\/\/www.makebarcode.com\/specs\/Code_39X.html\" target=\"_blank\"><b>Extended Code 39<\/b><\/a><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" style=\"line-height: 19px;\" alt=\"\" src=\"http:\/\/www.makebarcode.com\/images\/symbologies\/ext_code39_example_blue.jpg\" width=\"209\" height=\"58\" border=\"0\" \/><\/td>\n<td width=\"59\">1D<\/td>\n<td width=\"134\">All ASCII characters<br \/>\nand control codes<\/td>\n<td width=\"107\">Variable<\/td>\n<td width=\"83\">Optional<\/td>\n<td width=\"258\">Uses pairs of\u00a0 characters to encode non-standard symbols; wasteful of space<\/td>\n<\/tr>\n<tr>\n<td width=\"235\"><a href=\"http:\/\/www.makebarcode.com\/specs\/code_93.html\" target=\"_blank\"><b>Code 93<\/b><\/a><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" style=\"line-height: 19px;\" alt=\"\" src=\"http:\/\/www.makebarcode.com\/images\/symbologies\/code93_example_blue.jpg\" width=\"150\" height=\"60\" border=\"0\" \/><\/td>\n<td width=\"59\">1D<\/td>\n<td width=\"134\">Uppercase letters A-Z;<br \/>\nNumbers 0-9;<br \/>\nSpace &#8211; . $ \/ + %<\/td>\n<td width=\"107\">Variable<\/td>\n<td width=\"83\">Optional<\/td>\n<td width=\"258\">A more compact cousin of Code 39, not as widely in use<\/td>\n<\/tr>\n<tr>\n<td width=\"235\"><a href=\"http:\/\/www.makebarcode.com\/specs\/code_39.html\" target=\"_blank\"><b>C<\/b><b>omposite Code<\/b><\/a><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" style=\"line-height: 19px;\" alt=\"\" src=\"http:\/\/www.makebarcode.com\/images\/symbologies\/composite_example_blue.jpg\" width=\"184\" height=\"55\" border=\"0\" \/><\/p>\n<p>&nbsp;<\/td>\n<td width=\"59\">2D<\/td>\n<td width=\"134\">All ASCII characters<\/td>\n<td width=\"107\">Variable<\/td>\n<td width=\"83\">Required<\/td>\n<td width=\"258\">Code comprised of a PDF417 code stacked on top of a Code128; used in UCC\/EAN standards<\/td>\n<\/tr>\n<tr>\n<td width=\"235\"><b><a href=\"http:\/\/www.makebarcode.com\/specs\/datamatx.html\" target=\"_blank\">DataMatrix<\/a><\/b><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" style=\"line-height: 19px;\" alt=\"\" src=\"http:\/\/www.makebarcode.com\/images\/symbologies\/datamatrix_example_blue.jpg\" width=\"80\" height=\"80\" border=\"0\" \/><\/td>\n<td width=\"59\">2D<\/td>\n<td width=\"134\">All ASCII characters<\/td>\n<td width=\"107\">Variable<\/td>\n<td width=\"83\">Required<\/td>\n<td width=\"258\">Includes error correction, up to 2335 ASCII characters<\/td>\n<\/tr>\n<tr>\n<td width=\"235\"><b><a href=\"http:\/\/www.makebarcode.com\/specs\/ean_13.html\" target=\"_blank\">EAN-13<\/a><\/b><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" style=\"line-height: 19px;\" alt=\"\" src=\"http:\/\/www.makebarcode.com\/images\/symbologies\/ean13_example_blue.jpg\" width=\"172\" height=\"60\" border=\"0\" \/><\/td>\n<td width=\"59\">1D<\/td>\n<td width=\"134\">Numbers Only<\/td>\n<td width=\"107\">13 + check digit<br \/>\n+2 optional<br \/>\n+5 optional<\/td>\n<td width=\"83\">Required<\/td>\n<td width=\"258\">Retail product marking\u00a0\u00a0world-wide<\/td>\n<\/tr>\n<tr>\n<td width=\"235\"><b><a href=\"http:\/\/www.makebarcode.com\/specs\/ean_8.html\" target=\"_blank\">EAN-8<\/a><\/b><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" style=\"line-height: 19px;\" alt=\"\" src=\"http:\/\/www.makebarcode.com\/images\/symbologies\/ean8_example_blue.jpg\" width=\"110\" height=\"60\" border=\"0\" \/><\/td>\n<td width=\"59\">1D<\/td>\n<td width=\"134\">Numbers Only<\/td>\n<td width=\"107\">7 + check digit<\/td>\n<td width=\"83\">Required<\/td>\n<td width=\"258\">Retail product marking world-wide; compressed code for products with limited label space<\/td>\n<\/tr>\n<tr>\n<td width=\"235\"><b><a href=\"http:\/\/www.makebarcode.com\/specs\/bookland.html\" target=\"_blank\">EAN Bookland<\/a><\/b><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" style=\"line-height: 19px;\" alt=\"\" src=\"http:\/\/www.makebarcode.com\/images\/symbologies\/ean13_example_blue.jpg\" width=\"172\" height=\"60\" border=\"0\" \/><\/td>\n<td width=\"59\">1D<\/td>\n<td width=\"134\">Numbers Only<\/td>\n<td width=\"107\">13 + check digit<br \/>\n+2 optional<br \/>\n+5 optional<\/td>\n<td width=\"83\">Required<\/td>\n<td width=\"258\">Special use of the EAN-13 symbol to encode ISBN number on books<\/td>\n<\/tr>\n<tr>\n<td width=\"235\"><b><a href=\"http:\/\/www.makebarcode.com\/specs\/indl_25.html\" target=\"_blank\">Industrial 2 of 5<\/a><\/b><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" style=\"line-height: 19px;\" alt=\"\" src=\"http:\/\/www.makebarcode.com\/images\/symbologies\/industrial_2of5_example_blue.jpg\" width=\"150\" height=\"65\" border=\"0\" \/><\/td>\n<td width=\"59\">1D<\/td>\n<td width=\"134\">Numbers Only<\/td>\n<td width=\"107\">Variable<\/td>\n<td width=\"83\">None<\/td>\n<td width=\"258\">Older type of code<\/td>\n<\/tr>\n<tr>\n<td width=\"235\"><b><a href=\"http:\/\/www.makebarcode.com\/specs\/i2_of_5.html\" target=\"_blank\">Interleaved 2 of 5<\/a><\/b><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" src=\"http:\/\/www.makebarcode.com\/images\/symbologies\/itf_example_blue.jpg\" width=\"148\" height=\"60\" border=\"0\" \/><\/td>\n<td width=\"59\">1D<\/td>\n<td width=\"134\">Numbers Only<\/td>\n<td width=\"107\">Variable<\/td>\n<td width=\"83\">Optional<\/td>\n<td width=\"258\">Very compact encodes digits in pairs so total length must be even number of digits<\/td>\n<\/tr>\n<tr>\n<td width=\"235\"><b>ITF-14<\/b><\/p>\n<p><b style=\"line-height: 19px;\">(UPC Ship Container Code)<\/b><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" style=\"line-height: 19px;\" alt=\"\" src=\"http:\/\/www.makebarcode.com\/images\/symbologies\/itf-14_example_blue.jpg\" width=\"202\" height=\"60\" border=\"0\" \/><\/td>\n<td width=\"59\">1D<\/td>\n<td width=\"134\">Numbers Only<\/td>\n<td width=\"107\">13 + check digit<\/td>\n<td width=\"83\">Required<\/td>\n<td width=\"258\">Special use of the Interleaved 2 of 5 code to mark shipping cartons containing UPC encoded products<br \/>\n(see also SCC-14)<\/td>\n<\/tr>\n<tr>\n<td width=\"235\"><b><a href=\"http:\/\/www.makebarcode.com\/specs\/logmars.html\" target=\"_blank\">LOGMARS<\/a><\/b><\/p>\n<p><b style=\"line-height: 19px;\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" src=\"http:\/\/www.makebarcode.com\/images\/symbologies\/code39_example_blue.jpg\" width=\"192\" height=\"60\" border=\"0\" \/><\/b><\/td>\n<td width=\"59\">1D<\/td>\n<td width=\"134\">Uppercase letters A-Z;<br \/>\nNumbers 0-9;<br \/>\nSpace &#8211; . $ \/ + %<\/td>\n<td width=\"107\">Variable<\/td>\n<td width=\"83\">Optional<\/td>\n<td width=\"258\">Same as Code 39; this is the US government specification<\/td>\n<\/tr>\n<tr>\n<td width=\"235\"><b><a href=\"http:\/\/www.makebarcode.com\/specs\/maxicode.html\" target=\"_blank\">Maxicode<\/a><\/b><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" style=\"line-height: 19px;\" alt=\"\" src=\"http:\/\/www.makebarcode.com\/images\/symbologies\/maxicode_example_blue.jpg\" width=\"80\" height=\"76\" border=\"0\" \/><\/td>\n<td width=\"59\">2D<\/td>\n<td width=\"134\">All ASCII characters<\/td>\n<td width=\"107\">93<\/td>\n<td width=\"83\">Required<\/td>\n<td width=\"258\">Includes error correction, developed by the United Parcel Service for encoding destination information<\/td>\n<\/tr>\n<tr>\n<td width=\"235\"><b><a href=\"http:\/\/www.makebarcode.com\/specs\/msi.html\" target=\"_blank\">MSI<\/a><\/b><b><\/b><b style=\"line-height: 19px;\"><a href=\"http:\/\/www.makebarcode.com\/specs\/msi.html\" target=\"_blank\">MSI Plessey<\/a><\/b><\/p>\n<p><b style=\"line-height: 19px;\"><\/b><img loading=\"lazy\" decoding=\"async\" style=\"line-height: 19px;\" alt=\"\" src=\"http:\/\/www.makebarcode.com\/images\/symbologies\/misplessey_example_blue.jpg\" width=\"156\" height=\"60\" border=\"0\" \/><\/td>\n<td width=\"59\">1D<\/td>\n<td width=\"134\">Numbers Only<\/td>\n<td width=\"107\">Variable<\/td>\n<td width=\"83\">Required<\/td>\n<td width=\"258\">Grocery store shelf tags<\/td>\n<\/tr>\n<tr>\n<td width=\"235\"><b><a href=\"http:\/\/www.makebarcode.com\/specs\/opc.html\">OPC\u00a0<\/a><\/b><b><a href=\"http:\/\/www.makebarcode.com\/specs\/opc.html\">Optical Industry Assoc.<\/a><\/b><\/p>\n<p><b><\/b><img loading=\"lazy\" decoding=\"async\" style=\"line-height: 19px;\" alt=\"\" src=\"http:\/\/www.makebarcode.com\/images\/symbologies\/itf_example_blue.jpg\" width=\"148\" height=\"60\" border=\"0\" \/><\/td>\n<td width=\"59\">1D<\/td>\n<td width=\"134\">Numbers Only<\/td>\n<td width=\"107\">9 + check digit<\/td>\n<td width=\"83\">Required<\/td>\n<td width=\"258\">Special use of Interleaved 2 of 5 for marking retail optical products<\/td>\n<\/tr>\n<tr>\n<td width=\"235\"><b><a href=\"http:\/\/www.makebarcode.com\/specs\/pdf417.html\">PDF-41<\/a><\/b><b><a href=\"http:\/\/www.makebarcode.com\/specs\/pdf417.html\">7<\/a><\/b><\/p>\n<p><b><\/b><img loading=\"lazy\" decoding=\"async\" style=\"line-height: 19px;\" alt=\"\" src=\"http:\/\/www.makebarcode.com\/images\/symbologies\/pdf417_example_blue.jpg\" width=\"150\" height=\"60\" border=\"0\" \/><\/td>\n<td width=\"59\">2D<\/td>\n<td width=\"134\">All ASCII characters<\/td>\n<td width=\"107\">Variable<\/td>\n<td width=\"83\">Required<\/td>\n<td width=\"258\">Includes error correction, up to about 1850 ASCII or 2725 numeric characters<\/td>\n<\/tr>\n<tr>\n<td width=\"235\"><b><a href=\"http:\/\/www.makebarcode.com\/specs\/plessey.html\">Plessey<\/a><\/b><\/p>\n<p><b><\/b><img loading=\"lazy\" decoding=\"async\" style=\"line-height: 19px;\" alt=\"\" src=\"http:\/\/www.makebarcode.com\/images\/symbologies\/misplessey_example_blue.jpg\" width=\"156\" height=\"60\" border=\"0\" \/><\/td>\n<td width=\"59\">1D<\/td>\n<td width=\"134\">Numbers Only<\/td>\n<td width=\"107\">Variable<\/td>\n<td width=\"83\">Required<\/td>\n<td width=\"258\">Grocery store shelf tags<\/td>\n<\/tr>\n<tr>\n<td width=\"235\"><b><a href=\"http:\/\/www.makebarcode.com\/specs\/postnet.html\" target=\"_blank\">Postnet<\/a><\/b><\/p>\n<p><b><\/b><img loading=\"lazy\" decoding=\"async\" style=\"line-height: 19px;\" alt=\"\" src=\"http:\/\/www.makebarcode.com\/images\/symbologies\/postnet_example_blue.jpg\" width=\"200\" height=\"17\" border=\"0\" \/><\/td>\n<td width=\"59\">2D*<\/td>\n<td width=\"134\">Numbers Only<\/td>\n<td width=\"107\">5 + check digit<br \/>\n+4 optional<br \/>\n+6 optional<\/td>\n<td width=\"83\">Required<\/td>\n<td width=\"258\">USA postal code<br \/>\n(ZIP code)<\/td>\n<\/tr>\n<tr>\n<td width=\"235\"><b><a href=\"http:\/\/www.makebarcode.com\/specs\/qr.html\">QR Code<\/a><\/b><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" src=\"http:\/\/www.makebarcode.com\/images\/symbologies\/qrcode_example_blue.jpg\" width=\"80\" height=\"80\" border=\"0\" \/><\/td>\n<td width=\"59\">2D<\/td>\n<td width=\"134\">All ASCII Characters<\/td>\n<td width=\"107\">Variable<\/td>\n<td width=\"83\">Required<\/td>\n<td width=\"258\">Includes error correction, up to about 1520 ASCII or 2509 numeric charcters<\/td>\n<\/tr>\n<tr>\n<td width=\"235\"><b>SCC-14<\/b><\/p>\n<p><b>(UCC\/EAN Ship Cont. Code)<\/b><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" src=\"http:\/\/www.makebarcode.com\/images\/symbologies\/UCCEAN-SCC-14_example_blue.jpg\" width=\"210\" height=\"57\" border=\"0\" \/><\/td>\n<td width=\"59\">1D<\/td>\n<td width=\"134\">Numbers Only<\/td>\n<td width=\"107\">13 + checksum<\/td>\n<td width=\"83\">Required<\/td>\n<td width=\"258\">Special use of Code 128 to mark shipping cartons containing UPC encoded products<br \/>\n(see also ITF-14)<\/td>\n<\/tr>\n<tr>\n<td width=\"235\"><b><a href=\"http:\/\/www.makebarcode.com\/specs\/std_25.html\">Standard 2 of 5<\/a><\/b><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" src=\"http:\/\/www.makebarcode.com\/images\/symbologies\/industrial_2of5_example_blue.jpg\" width=\"150\" height=\"65\" border=\"0\" \/><b><br \/>\n<\/b><\/td>\n<td width=\"59\">1D<\/td>\n<td width=\"134\">Numbers Only<\/td>\n<td width=\"107\">Variable<\/td>\n<td width=\"83\">None<\/td>\n<td width=\"258\">Also called Industrial 2 of 5.<\/td>\n<\/tr>\n<tr>\n<td width=\"235\"><b>UCC\/EAN-128<\/b><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" src=\"http:\/\/www.makebarcode.com\/images\/symbologies\/UCCEAN128_example_blue.jpg\" width=\"210\" height=\"55\" border=\"0\" \/><\/td>\n<td width=\"59\">1D<\/td>\n<td width=\"134\">All ASCII characters<br \/>\nand control codes<\/td>\n<td width=\"107\">Variable<\/td>\n<td width=\"83\">Required<\/td>\n<td width=\"258\">Special ise of Code 128 which defines data formats for commerce<\/td>\n<\/tr>\n<tr>\n<td width=\"235\"><b>UCC\/EAN Shipping Container Code<\/b><br \/>\n<b>(SCC-14)<\/b><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" src=\"http:\/\/www.makebarcode.com\/images\/symbologies\/UCCEAN-SCC-14_example_blue.jpg\" width=\"210\" height=\"57\" border=\"0\" \/><\/td>\n<td width=\"59\">1D<\/td>\n<td width=\"134\">Numbers Only<\/td>\n<td width=\"107\">13 +check digit<\/td>\n<td width=\"83\">Required<\/td>\n<td width=\"258\">Special use of Code 128 to mark shipping cartons containing UPC encoded products<br \/>\n(see also ITF-14)<\/td>\n<\/tr>\n<tr>\n<td width=\"235\"><b><a href=\"http:\/\/www.makebarcode.com\/specs\/itf_14.html\">UPC Shipping Container Code<br \/>\n(ITF-14)<\/a><\/b><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" src=\"http:\/\/www.makebarcode.com\/images\/symbologies\/itf-14_example_blue.jpg\" width=\"202\" height=\"60\" border=\"0\" \/><\/td>\n<td width=\"59\">1D<\/td>\n<td width=\"134\">Numbers Only<\/td>\n<td width=\"107\">13 + check digit<\/td>\n<td width=\"83\">Required<\/td>\n<td width=\"258\">Special use of the Interleaved 2 of 5 code to mark shipping cartons containing UPC encoded products<br \/>\n(see also SCC-14)<\/td>\n<\/tr>\n<tr>\n<td width=\"235\"><b><a href=\"http:\/\/www.makebarcode.com\/specs\/upc_a.html\">UPC-A<\/a><\/b><\/p>\n<p><b><\/b><img loading=\"lazy\" decoding=\"async\" style=\"line-height: 19px;\" alt=\"\" src=\"http:\/\/www.makebarcode.com\/images\/symbologies\/UPCA_example_blue.jpg\" width=\"187\" height=\"60\" border=\"0\" \/><\/td>\n<td width=\"59\">1D<\/td>\n<td width=\"134\">Numbers Only<\/td>\n<td width=\"107\">11 + check digit<br \/>\n+2 optional<br \/>\n+5 optional<\/td>\n<td width=\"83\">Required<\/td>\n<td width=\"258\">Retail product marking in USA and Canada<\/td>\n<\/tr>\n<tr>\n<td width=\"235\"><b><a href=\"http:\/\/www.makebarcode.com\/specs\/upc_e.html\">UPC-E<\/a><\/b><\/p>\n<p><b><\/b><img loading=\"lazy\" decoding=\"async\" style=\"line-height: 19px;\" alt=\"\" src=\"http:\/\/www.makebarcode.com\/images\/symbologies\/UPCE_example_blue.jpg\" width=\"114\" height=\"60\" border=\"0\" \/><\/td>\n<td width=\"59\">1D<\/td>\n<td width=\"134\">Numbers Only<\/td>\n<td width=\"107\">7 + check digit<\/td>\n<td width=\"83\">Required<\/td>\n<td width=\"258\">Retail product in USA and Canada; compressed code for products with limited label space<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h2>Vecteurs d&#8217;attaques de codes-barres<\/h2>\n<p>Parmi les codes-barres les plus r\u00e9pandus, les plus utilis\u00e9s et les plus vuln\u00e9rables, on d\u00e9note le code 93, le code 39 et 39 \u00e9tendu, le code 128 A, B et C, et bien \u00e9videmment les QRcode. Ces codes disposent tous de charsets exploitables relativement complets (avec gestion de symboles) et peuvent repr\u00e9senter des cha\u00eenes de caract\u00e8res assez importantes. Il suffit d&#8217;encoder un vecteur usuel d&#8217;attaque (XSS, SQLi&#8230;) sous sa forme de codes-barres pour \u00e9valuer la r\u00e9sistance d&#8217;un lecteur quelconque.<\/p>\n<h3>Code 93<\/h3>\n<ul>\n<li>XSS standard alert()<\/li>\n<\/ul>\n<div id=\"attachment_786\" style=\"width: 310px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/www.asafety.fr\/wp-content\/uploads\/code93.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-786\" class=\"size-medium wp-image-786\" alt=\"code93 XSS\" src=\"https:\/\/www.asafety.fr\/wp-content\/uploads\/code93-300x20.png\" width=\"300\" height=\"20\" srcset=\"https:\/\/www.asafety.fr\/wp-content\/uploads\/code93-300x20.png 300w, https:\/\/www.asafety.fr\/wp-content\/uploads\/code93.png 658w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><p id=\"caption-attachment-786\" class=\"wp-caption-text\">code93 XSS<\/p><\/div>\n<ul>\n<li>SQLi standard bypass authentification<\/li>\n<\/ul>\n<div id=\"attachment_787\" style=\"width: 191px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/www.asafety.fr\/wp-content\/uploads\/code93sqli.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-787\" class=\"size-full wp-image-787\" alt=\"code93 SQLi\" src=\"https:\/\/www.asafety.fr\/wp-content\/uploads\/code93sqli.png\" width=\"181\" height=\"43\" \/><\/a><p id=\"caption-attachment-787\" class=\"wp-caption-text\">code93 SQLi<\/p><\/div>\n<h3>Code 39<\/h3>\n<h4>Version simple avec URLencode<\/h4>\n<ul>\n<li>XSS standard alert()<\/li>\n<\/ul>\n<div id=\"attachment_784\" style=\"width: 310px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/www.asafety.fr\/wp-content\/uploads\/code39.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-784\" class=\"size-medium wp-image-784\" alt=\"code39 XSS\" src=\"https:\/\/www.asafety.fr\/wp-content\/uploads\/code39-300x16.png\" width=\"300\" height=\"16\" srcset=\"https:\/\/www.asafety.fr\/wp-content\/uploads\/code39-300x16.png 300w, https:\/\/www.asafety.fr\/wp-content\/uploads\/code39.png 793w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><p id=\"caption-attachment-784\" class=\"wp-caption-text\">code39 XSS<\/p><\/div>\n<ul>\n<li>SQLi standard bypass authentification<\/li>\n<\/ul>\n<div id=\"attachment_790\" style=\"width: 244px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/www.asafety.fr\/wp-content\/uploads\/code39sqli.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-790\" class=\"size-full wp-image-790\" alt=\"code39 SQLi\" src=\"https:\/\/www.asafety.fr\/wp-content\/uploads\/code39sqli.png\" width=\"234\" height=\"43\" \/><\/a><p id=\"caption-attachment-790\" class=\"wp-caption-text\">code39 SQLi<\/p><\/div>\n<p><strong>Remarques :<\/strong><\/p>\n<ul>\n<li>Le code 39 non-\u00e9tendu ne permet pas l&#8217;utilisation d&#8217;un charset de symboles complet. C&#8217;est pourquoi les injections au travers de celui-ci peuvent se faire avec un encodage URLencode pour tous les caract\u00e8res non pris en comptes.<\/li>\n<\/ul>\n<h4>Version \u00e9tendue<\/h4>\n<ul>\n<li>XSS standard alert()<\/li>\n<\/ul>\n<div id=\"attachment_785\" style=\"width: 310px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/www.asafety.fr\/wp-content\/uploads\/code39e.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-785\" class=\"size-medium wp-image-785\" alt=\"code39e XSS\" src=\"https:\/\/www.asafety.fr\/wp-content\/uploads\/code39e-300x14.png\" width=\"300\" height=\"14\" srcset=\"https:\/\/www.asafety.fr\/wp-content\/uploads\/code39e-300x14.png 300w, https:\/\/www.asafety.fr\/wp-content\/uploads\/code39e.png 962w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><p id=\"caption-attachment-785\" class=\"wp-caption-text\">code39e XSS<\/p><\/div>\n<ul>\n<li>SQLi standard bypass authentification<\/li>\n<\/ul>\n<div id=\"attachment_791\" style=\"width: 244px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/www.asafety.fr\/wp-content\/uploads\/code39esqli.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-791\" class=\"size-full wp-image-791\" alt=\"code39e SQLi\" src=\"https:\/\/www.asafety.fr\/wp-content\/uploads\/code39esqli.png\" width=\"234\" height=\"43\" \/><\/a><p id=\"caption-attachment-791\" class=\"wp-caption-text\">code39e SQLi<\/p><\/div>\n<h3>Code 128 version A, B ou C<\/h3>\n<ul>\n<li>XSS standard alert()<\/li>\n<\/ul>\n<div id=\"attachment_788\" style=\"width: 310px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/www.asafety.fr\/wp-content\/uploads\/code128.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-788\" class=\"size-medium wp-image-788\" alt=\"code128 XSS\" src=\"https:\/\/www.asafety.fr\/wp-content\/uploads\/code128-300x28.png\" width=\"300\" height=\"28\" srcset=\"https:\/\/www.asafety.fr\/wp-content\/uploads\/code128-300x28.png 300w, https:\/\/www.asafety.fr\/wp-content\/uploads\/code128.png 486w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><p id=\"caption-attachment-788\" class=\"wp-caption-text\">code128 XSS<\/p><\/div>\n<ul>\n<li>SQLi standard bypass authentification<\/li>\n<\/ul>\n<div id=\"attachment_792\" style=\"width: 177px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/www.asafety.fr\/wp-content\/uploads\/code128sqli.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-792\" class=\"size-full wp-image-792\" alt=\"code128 SQLi\" src=\"https:\/\/www.asafety.fr\/wp-content\/uploads\/code128sqli.png\" width=\"167\" height=\"43\" \/><\/a><p id=\"caption-attachment-792\" class=\"wp-caption-text\">code128 SQLi<\/p><\/div>\n<h3>QRcode<\/h3>\n<ul>\n<li>XSS standard alert()<\/li>\n<\/ul>\n<div id=\"attachment_789\" style=\"width: 220px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/www.asafety.fr\/wp-content\/uploads\/qrcode.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-789\" class=\"size-full wp-image-789\" alt=\"qrcode XSS\" src=\"https:\/\/www.asafety.fr\/wp-content\/uploads\/qrcode.png\" width=\"210\" height=\"210\" srcset=\"https:\/\/www.asafety.fr\/wp-content\/uploads\/qrcode.png 210w, https:\/\/www.asafety.fr\/wp-content\/uploads\/qrcode-150x150.png 150w\" sizes=\"auto, (max-width: 210px) 100vw, 210px\" \/><\/a><p id=\"caption-attachment-789\" class=\"wp-caption-text\">qrcode XSS<\/p><\/div>\n<ul>\n<li>SQLi standard bypass authentification<\/li>\n<\/ul>\n<div id=\"attachment_793\" style=\"width: 172px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/www.asafety.fr\/wp-content\/uploads\/qrcodesqli.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-793\" class=\"size-full wp-image-793\" alt=\"qrcode SQLi\" src=\"https:\/\/www.asafety.fr\/wp-content\/uploads\/qrcodesqli.png\" width=\"162\" height=\"162\" srcset=\"https:\/\/www.asafety.fr\/wp-content\/uploads\/qrcodesqli.png 162w, https:\/\/www.asafety.fr\/wp-content\/uploads\/qrcodesqli-150x150.png 150w\" sizes=\"auto, (max-width: 162px) 100vw, 162px\" \/><\/a><p id=\"caption-attachment-793\" class=\"wp-caption-text\">qrcode SQLi<\/p><\/div>\n<h3>G\u00e9n\u00e9ration de vecteurs personnalis\u00e9s<\/h3>\n<p>L&#8217;ensemble des codes-barres pr\u00e9c\u00e9dents ont \u00e9t\u00e9 r\u00e9alis\u00e9s \u00e0 l&#8217;aide de l&#8217;<a title=\"IronGeek\" href=\"http:\/\/www.irongeek.com\/xss-sql-injection-fuzzing-barcode-generator.php\" target=\"_blank\">outil en ligne d&#8217;irongeek<\/a>. Il est possible d&#8217;y g\u00e9n\u00e9rer des codes-barres personnalis\u00e9s, embarquant des vecteurs d&#8217;attaques destin\u00e9s \u00e0 des audits\/pentest de votre choix.<\/p>\n<h2>D\u00e9monstration et PoC<\/h2>\n<p>Il ne m&#8217;est pas possible de faire une d\u00e9monstration d&#8217;un de ces vecteurs d&#8217;attaques via les \u00e9quipements de lecture de codes-barres pr\u00e9sent\u00e9s plus haut. Toutefois, pour illustrer le contenu de cet article dans un PoC fonctionnel, nous allons nous int\u00e9resser \u00e0 la solution <a title=\"ScriptCam\" href=\"http:\/\/www.scriptcam.com\" target=\"_blank\">ScriptCam<\/a>. Cette solution, sous forme d&#8217;un plugin JavaScript JQuery permet d&#8217;utiliser la webcam des ordinateurs communs \u00e0 des fins de lecteur de codes-barres et en particulier de QRcode.<\/p>\n<p>Le fonctionnement de ce plugin JQuery est de charger un module Flash qui peut\u00a0interagir\u00a0avec la webcam de l&#8217;utilisateur, afin de r\u00e9cup\u00e9rer des images et d&#8217;en extraire des informations par la suite.<\/p>\n<p>ScriptCam permet diverses manipulations de webcams, et l&#8217;analyse de codes-barres\/QRcode n&#8217;est qu&#8217;une de ses fonctionnalit\u00e9s. Une <a title=\"D\u00e9monstration ScriptCam\" href=\"http:\/\/www.scriptcam.com\/demo_5.cfm\" target=\"_blank\">page de d\u00e9monstration<\/a> de cette analyse est disponible sur le site officiel. Il suffit d&#8217;autoriser l&#8217;application flash \u00e0 utiliser la webcam, pr\u00e9senter un QRcode \u00e0 la cam\u00e9ra puis de cliquer sur &#8220;<em>Decode image<\/em>&#8221; pour visualiser le texte du QRcode juste \u00e0 c\u00f4t\u00e9 (sur l&#8217;exemple suivant, c&#8217;est l&#8217;url du site dans le QRcode) :<\/p>\n<div id=\"attachment_795\" style=\"width: 310px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/www.asafety.fr\/wp-content\/uploads\/demo_scriptcam.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-795\" class=\"size-medium wp-image-795\" alt=\"demo scriptcam\" src=\"https:\/\/www.asafety.fr\/wp-content\/uploads\/demo_scriptcam-300x216.png\" width=\"300\" height=\"216\" srcset=\"https:\/\/www.asafety.fr\/wp-content\/uploads\/demo_scriptcam-300x216.png 300w, https:\/\/www.asafety.fr\/wp-content\/uploads\/demo_scriptcam.png 967w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><p id=\"caption-attachment-795\" class=\"wp-caption-text\">demo scriptcam<\/p><\/div>\n<p>Imprimons et testons avec un QRcode exploitant un code JavaScript XSS (celui pr\u00e9sent\u00e9 un peu plus haut) :<\/p>\n<div id=\"attachment_796\" style=\"width: 310px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/www.asafety.fr\/wp-content\/uploads\/poc_scriptcam.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-796\" class=\"size-medium wp-image-796\" alt=\"PoC XSS ScriptCam\" src=\"https:\/\/www.asafety.fr\/wp-content\/uploads\/poc_scriptcam-300x217.png\" width=\"300\" height=\"217\" srcset=\"https:\/\/www.asafety.fr\/wp-content\/uploads\/poc_scriptcam-300x217.png 300w, https:\/\/www.asafety.fr\/wp-content\/uploads\/poc_scriptcam.png 970w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><p id=\"caption-attachment-796\" class=\"wp-caption-text\">PoC XSS ScriptCam<\/p><\/div>\n<p>Le vecteur d&#8217;attaque XSS renferm\u00e9 dans le QRcode s&#8217;injecte bien dans\u00a0l\u2019application\u00a0et est interpr\u00e9t\u00e9 comme tel. Il est alors possible d&#8217;imaginer toutes sortes de sc\u00e9narios d&#8217;attaques pour tout \u00e9quipement qui peut lire des codes barres. Dans l&#8217;exemple, seule une alertbox est g\u00e9n\u00e9r\u00e9e. Mais il aurait \u00e9t\u00e9 possible de concevoir une injection Javascript qui automatiserait toutes les N secondes la prise d&#8217;une photo de la webcam, et de l&#8217;envoie de celle-ci sur un serveur annexe par exemple ; ou tout simplement la prise de contr\u00f4le du navigateur victime par le <a title=\"BeEF : modules m0n0wall et pfSense\" href=\"https:\/\/www.asafety.fr\/vuln-exploit-poc\/beef-modules-m0n0wall-et-pfsense\/\" target=\"_blank\"><em>framework<\/em> BeEF<\/a>.<\/p>\n<h2>Conclusion et perspectives<\/h2>\n<p>Injection SQL, XSS, corruption de donn\u00e9es, plantage de syst\u00e8me&#8230; Les codes barres ont \u00e9t\u00e9\u00a0sous-estim\u00e9s\u00a0comme vecteur d&#8217;injection, et le nettoyage (<a title=\"sanitization\" href=\"https:\/\/en.wikipedia.org\/wiki\/Data_sanitization#Preventing_code_injection\" target=\"_blank\"><em>sanitization<\/em><\/a>) des donn\u00e9es extraites de ces codes bien trop souvent oubli\u00e9.<\/p>\n<p>Avec l&#8217;av\u00e8nement du QRcode et son utilisation de plus en plus courante au travers des smartphones, les injections et attaques avec ces m\u00e9canismes se r\u00e9pandent de plus en plus. Il est n\u00e9cessaire de prendre en compte ces consid\u00e9rations.<\/p>\n<p>Les codes-barres et QRcode ne sont qu&#8217;un moyen d&#8217;appliquer des attaques informatiques sur des \u00e9quipements physiques. Comme\u00a0\u00e9nonc\u00e9\u00a0en introduction, d&#8217;autres \u00e9quipements comme les cam\u00e9ras d&#8217;autoroute sont\u00a0susceptibles\u00a0d&#8217;\u00eatre corrompues par des vecteurs d&#8217;attaques similaires. Bien d&#8217;autres applications au monde r\u00e9el peuvent \u00eatre exploit\u00e9es ; \u00e0 vous de les imaginer !<\/p>\n<h2>Edits<\/h2>\n<p>J&#8217;ai contact\u00e9 le support de ScriptCam le 3 avril 2013 au matin pour les pr\u00e9venir de cette petite injection XSS dans leur page de d\u00e9monstration, bien qu&#8217;elle n&#8217;engendre pas un r\u00e9el danger. \u00a0En l&#8217;espace de 15 minutes ils ont corrig\u00e9 la vuln\u00e9rabilit\u00e9 et m&#8217;ont fait un <em>feedback<\/em>\u00a0de remerciement. Je retire mon chapeau quant \u00e0 leur r\u00e9activit\u00e9 ! Le PoC pr\u00e9c\u00e9dent n&#8217;est donc plus exploitable \u00e0 titre de d\u00e9monstration sur ScriptCam.<\/p>\n<p>Pour information, la correction portait sur la r\u00e9injection dans la page du contenu d\u00e9cod\u00e9 du QRcode. Ils utilisaient la m\u00e9thode html() de JQuery, qui interpr\u00e8te le contenu, plut\u00f4t que la m\u00e9thode text().<\/p>\n<p>Avant correction :<\/p>\n<p>[html]&amp;amp;amp;amp;lt;button class=&amp;amp;amp;amp;quot;btn btn-small&amp;amp;amp;amp;quot; id=&amp;amp;amp;amp;quot;btn1&amp;amp;amp;amp;quot; onclick=&amp;amp;amp;amp;quot;$(&#8216;#decoded&#8217;).html($.scriptcam.getBarCode());&amp;amp;amp;amp;quot;&amp;amp;amp;amp;gt;Decode image&amp;amp;amp;amp;lt;\/button&amp;amp;amp;amp;gt;[\/html]<\/p>\n<p>Apr\u00e8s correction :<\/p>\n<p>[html]&amp;amp;amp;amp;lt;button class=&amp;amp;amp;amp;quot;btn btn-small&amp;amp;amp;amp;quot;\u00a0id=&amp;amp;amp;amp;quot;btn1&amp;amp;amp;amp;quot; onclick=&amp;amp;amp;amp;quot;$(&#8216;#decoded&#8217;).text($.scriptcam.getBarCode());&amp;amp;amp;amp;quot;&amp;amp;amp;amp;gt;Decode image&amp;amp;amp;amp;lt;\/button&amp;amp;amp;amp;gt;[\/html]<\/p>\n<h2>Sources &amp; ressources<\/h2>\n<ul>\n<li><a title=\"SQL Injection in the Wild\" href=\"http:\/\/www.circleid.com\/posts\/20130325_sql_injection_in_the_wild\/\" target=\"_blank\">SQL Injection in the Wild &#8211; Article from Gunter Ollman<\/a><\/li>\n<li><a title=\"ScriptCam\" href=\"http:\/\/www.scriptcam.com\" target=\"_blank\">ScriptCam JQuery plugin<\/a><\/li>\n<li><a title=\"MakeBarcode\" href=\"http:\/\/www.makebarcode.com\/specs\/barcodechart.html\" target=\"_blank\">MakeBarcode specifications<\/a><\/li>\n<li><a title=\"IronGeek\" href=\"http:\/\/www.irongeek.com\/xss-sql-injection-fuzzing-barcode-generator.php\" target=\"_blank\">IronGeek barcode generator<\/a><\/li>\n<\/ul>\n<\/div>\n<p><\/p>","protected":false},"excerpt":{"rendered":"<p>Au cours de ma veille quotidienne, je suis tomb\u00e9 sur cet article de Gunter Ollmann qui fait un retour sur [&hellip;]<\/p>\n","protected":false},"author":1337,"featured_media":793,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[14],"tags":[310,327,331,329,330,326,206,328],"class_list":["post-765","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-vuln-exploit-poc","tag-attack-vector","tag-barcode","tag-code128","tag-code39","tag-code93","tag-codes-barres","tag-cross-site-scripting","tag-qrcode"],"_links":{"self":[{"href":"https:\/\/www.asafety.fr\/en\/wp-json\/wp\/v2\/posts\/765","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.asafety.fr\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.asafety.fr\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.asafety.fr\/en\/wp-json\/wp\/v2\/users\/1337"}],"replies":[{"embeddable":true,"href":"https:\/\/www.asafety.fr\/en\/wp-json\/wp\/v2\/comments?post=765"}],"version-history":[{"count":35,"href":"https:\/\/www.asafety.fr\/en\/wp-json\/wp\/v2\/posts\/765\/revisions"}],"predecessor-version":[{"id":1690,"href":"https:\/\/www.asafety.fr\/en\/wp-json\/wp\/v2\/posts\/765\/revisions\/1690"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.asafety.fr\/en\/wp-json\/wp\/v2\/media\/793"}],"wp:attachment":[{"href":"https:\/\/www.asafety.fr\/en\/wp-json\/wp\/v2\/media?parent=765"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.asafety.fr\/en\/wp-json\/wp\/v2\/categories?post=765"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.asafety.fr\/en\/wp-json\/wp\/v2\/tags?post=765"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}