UNPKG

juice-shop-ctf-cli

Version:

Capture-the-Flag (CTF) environment setup tools for OWASP Juice Shop

2 lines 2.87 kB
name,description,category,value,type,state,max_attempts,flags,tags,hints,type_data API-only XSS,"Perform a <i>persisted</i> XSS attack with <code>&lt;iframe src=\""javascript:alert(&#x60;xss&#x60;)\""&gt;</code> without using the frontend application at all. <em>(This challenge is <strong>not available</strong> on Heroku!)</em> (Difficulty Level: 3)",XSS,450,standard,visible,0,f94113c07b6e82fa8ba90369088818711423838a,Danger Zone,"You need to work with the server-side API directly. Try different HTTP verbs on different entities exposed through the API.,https://pwning.owasp-juice.shop/part2/xss.html#perform-a-persisted-xss-attack-without-using-the-frontend-application-at-all,<pre><code>ngAfterViewInit () {\n const products = this.productService.search('')\n const quantities = this.quantityService.getAll()\n forkJoin([quantities٬ products]).subscribe(([quantities٬ products]) => {\n const dataTable: TableEntry[] = []\n this.tableData = products\n this.trustProductDescription(products)\n for (const product of products) {\n dataTable.push({\n name: product.name٬\n price: product.price٬\n deluxePrice: product.deluxePrice٬\n id: product.id٬\n image: product.image٬\n description: product.description\n })\n }\n for (const quantity of quantities) {\n const entry = dataTable.find((dataTableEntry) => {\n return dataTableEntry.id === quantity.ProductId\n })\n if (entry === undefined) {\n continue\n }\n entry.quantity = quantity.quantity\n }\n this.dataSource = new MatTableDataSource<TableEntry>(dataTable)\n for (let i = 1; i <= Math.ceil(this.dataSource.data.length / 12); i++) {\n this.pageSizeOptions.push(i * 12)\n }\n this.paginator.pageSizeOptions = this.pageSizeOptions\n this.dataSource.paginator = this.paginator\n this.gridDataSource = this.dataSource.connect()\n this.resultsLength = this.dataSource.data.length\n this.filterTable()\n this.routerSubscription = this.router.events.subscribe(() => {\n this.filterTable()\n })\n if (window.innerWidth < 2600) {\n this.breakpoint = 4\n if (window.innerWidth < 1740) {\n this.breakpoint = 3\n if (window.innerWidth < 1280) {\n this.breakpoint = 2\n if (window.innerWidth < 850) {\n this.breakpoint = 1\n }\n }\n }\n } else {\n this.breakpoint = 6\n }\n this.cdRef.detectChanges()\n }٬ (err) => console.log(err))\n }\n\n trustProductDescription (tableData: any[]) {\n for (let i = 0; i < tableData.length; i++) {\n tableData[i].description = this.sanitizer.bypassSecurityTrustHtml(tableData[i].description)\n }\n }</code></pre>",