├── .gitignore ├── README.md ├── RedTeamToolkit.code-workspace ├── configs └── .vscode │ └── settings.json └── tests └── src ├── server ├── Cargo.toml ├── index.html ├── index.js ├── package-lock.json ├── package.json ├── src │ ├── components │ │ ├── header.rs │ │ └── mod.rs │ └── lib.rs ├── ts │ └── index.ts ├── tsconfig.json ├── webpack.config.js └── yarn.lock └── wasmtime ├── Cargo.toml └── src └── main.rs /.gitignore: -------------------------------------------------------------------------------- 1 | ### Rust 2 | # Generated by Cargo 3 | # will have compiled files and executables 4 | /target/ 5 | 6 | # Remove Cargo.lock from gitignore if creating an executable, leave it for libraries 7 | # More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html 8 | Cargo.lock 9 | 10 | # These are backup files generated by rustfmt 11 | **/*.rs.bk 12 | 13 | ### macOS 14 | # General 15 | .DS_Store 16 | .AppleDouble 17 | .LSOverride 18 | 19 | # Icon must end with two \r 20 | Icon 21 | 22 | # Thumbnails 23 | ._* 24 | 25 | # Files that might appear in the root of a volume 26 | .DocumentRevisions-V100 27 | .fseventsd 28 | .Spotlight-V100 29 | .TemporaryItems 30 | .Trashes 31 | .VolumeIcon.icns 32 | .com.apple.timemachine.donotpresent 33 | 34 | # Directories potentially created on remote AFP share 35 | .AppleDB 36 | .AppleDesktop 37 | Network Trash Folder 38 | Temporary Items 39 | .apdisk 40 | 41 | ### VisualStudioCode 42 | .vscode/* 43 | !.vscode/settings.json 44 | !.vscode/tasks.json 45 | !.vscode/launch.json 46 | !.vscode/extensions.json 47 | 48 | ### VisualStudio 49 | ## Ignore Visual Studio temporary files, build results, and 50 | ## files generated by popular Visual Studio add-ons. 51 | ## 52 | ## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore 53 | 54 | # User-specific files 55 | *.rsuser 56 | *.suo 57 | *.user 58 | *.userosscache 59 | *.sln.docstates 60 | *_tests 61 | target 62 | # User-specific files (MonoDevelop/Xamarin Studio) 63 | *.userprefs 64 | 65 | # Mono auto generated files 66 | mono_crash.* 67 | 68 | # Build results 69 | [Dd]ebug/ 70 | [Dd]ebugPublic/ 71 | [Rr]elease/ 72 | [Rr]eleases/ 73 | x64/ 74 | x86/ 75 | [Aa][Rr][Mm]/ 76 | [Aa][Rr][Mm]64/ 77 | bld/ 78 | [Bb]in/ 79 | [Oo]bj/ 80 | [Ll]og/ 81 | [Ll]ogs/ 82 | 83 | # Visual Studio 2015/2017 cache/options directory 84 | .vs/ 85 | # Uncomment if you have tasks that create the project's static files in wwwroot 86 | #wwwroot/ 87 | 88 | # Visual Studio 2017 auto generated files 89 | Generated\ Files/ 90 | 91 | # MSTest test Results 92 | [Tt]est[Rr]esult*/ 93 | [Bb]uild[Ll]og.* 94 | 95 | # NUnit 96 | *.VisualState.xml 97 | TestResult.xml 98 | nunit-*.xml 99 | 100 | # Build Results of an ATL Project 101 | [Dd]ebugPS/ 102 | [Rr]eleasePS/ 103 | dlldata.c 104 | 105 | # Benchmark Results 106 | BenchmarkDotNet.Artifacts/ 107 | 108 | # .NET Core 109 | project.lock.json 110 | project.fragment.lock.json 111 | artifacts/ 112 | 113 | # StyleCop 114 | StyleCopReport.xml 115 | 116 | # Files built by Visual Studio 117 | *_i.c 118 | *_p.c 119 | *_h.h 120 | *.ilk 121 | *.meta 122 | *.obj 123 | *.iobj 124 | *.pch 125 | *.pdb 126 | *.ipdb 127 | *.pgc 128 | *.pgd 129 | *.rsp 130 | *.sbr 131 | *.tlb 132 | *.tli 133 | *.tlh 134 | *.tmp 135 | *.tmp_proj 136 | *_wpftmp.csproj 137 | *.log 138 | *.vspscc 139 | *.vssscc 140 | .builds 141 | *.pidb 142 | *.svclog 143 | *.scc 144 | 145 | # Chutzpah Test files 146 | _Chutzpah* 147 | 148 | # Visual C++ cache files 149 | ipch/ 150 | *.aps 151 | *.ncb 152 | *.opendb 153 | *.opensdf 154 | *.sdf 155 | *.cachefile 156 | *.VC.db 157 | *.VC.VC.opendb 158 | 159 | # Visual Studio profiler 160 | *.psess 161 | *.vsp 162 | *.vspx 163 | *.sap 164 | 165 | # Visual Studio Trace Files 166 | *.e2e 167 | 168 | # TFS 2012 Local Workspace 169 | $tf/ 170 | 171 | # Guidance Automation Toolkit 172 | *.gpState 173 | 174 | # ReSharper is a .NET coding add-in 175 | _ReSharper*/ 176 | *.[Rr]e[Ss]harper 177 | *.DotSettings.user 178 | 179 | # TeamCity is a build add-in 180 | _TeamCity* 181 | 182 | # DotCover is a Code Coverage Tool 183 | *.dotCover 184 | 185 | # AxoCover is a Code Coverage Tool 186 | .axoCover/ 187 | !.axoCover/settings.json 188 | 189 | # Coverlet is a free, cross platform Code Coverage Tool 190 | coverage*[.json, .xml, .info] 191 | 192 | # Visual Studio code coverage results 193 | *.coverage 194 | *.coveragexml 195 | 196 | # NCrunch 197 | _NCrunch_* 198 | .*crunch*.local.xml 199 | nCrunchTemp_* 200 | 201 | # MightyMoose 202 | *.mm.* 203 | AutoTest.Net/ 204 | 205 | # Web workbench (sass) 206 | .sass-cache/ 207 | 208 | # Installshield output folder 209 | [Ee]xpress/ 210 | 211 | # DocProject is a documentation generator add-in 212 | DocProject/buildhelp/ 213 | DocProject/Help/*.HxT 214 | DocProject/Help/*.HxC 215 | DocProject/Help/*.hhc 216 | DocProject/Help/*.hhk 217 | DocProject/Help/*.hhp 218 | DocProject/Help/Html2 219 | DocProject/Help/html 220 | 221 | # Click-Once directory 222 | publish/ 223 | 224 | # Publish Web Output 225 | *.[Pp]ublish.xml 226 | *.azurePubxml 227 | # Note: Comment the next line if you want to checkin your web deploy settings, 228 | # but database connection strings (with potential passwords) will be unencrypted 229 | *.pubxml 230 | *.publishproj 231 | 232 | # Microsoft Azure Web App publish settings. Comment the next line if you want to 233 | # checkin your Azure Web App publish settings, but sensitive information contained 234 | # in these scripts will be unencrypted 235 | PublishScripts/ 236 | 237 | # NuGet Packages 238 | *.nupkg 239 | # NuGet Symbol Packages 240 | *.snupkg 241 | # The packages folder can be ignored because of Package Restore 242 | **/[Pp]ackages/* 243 | # except build/, which is used as an MSBuild target. 244 | !**/[Pp]ackages/build/ 245 | # Uncomment if necessary however generally it will be regenerated when needed 246 | #!**/[Pp]ackages/repositories.config 247 | # NuGet v3's project.json files produces more ignorable files 248 | *.nuget.props 249 | *.nuget.targets 250 | 251 | # Microsoft Azure Build Output 252 | csx/ 253 | *.build.csdef 254 | 255 | # Microsoft Azure Emulator 256 | ecf/ 257 | rcf/ 258 | 259 | # Windows Store app package directories and files 260 | AppPackages/ 261 | BundleArtifacts/ 262 | Package.StoreAssociation.xml 263 | _pkginfo.txt 264 | *.appx 265 | *.appxbundle 266 | *.appxupload 267 | 268 | # Visual Studio cache files 269 | # files ending in .cache can be ignored 270 | *.[Cc]ache 271 | # but keep track of directories ending in .cache 272 | !?*.[Cc]ache/ 273 | 274 | # Others 275 | ClientBin/ 276 | ~$* 277 | *~ 278 | *.dbmdl 279 | *.dbproj.schemaview 280 | *.jfm 281 | *.pfx 282 | *.publishsettings 283 | orleans.codegen.cs 284 | 285 | # Including strong name files can present a security risk 286 | # (https://github.com/github/gitignore/pull/2483#issue-259490424) 287 | #*.snk 288 | 289 | # Since there are multiple workflows, uncomment next line to ignore bower_components 290 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) 291 | #bower_components/ 292 | 293 | # RIA/Silverlight projects 294 | Generated_Code/ 295 | 296 | # Backup & report files from converting an old project file 297 | # to a newer Visual Studio version. Backup files are not needed, 298 | # because we have git ;-) 299 | _UpgradeReport_Files/ 300 | Backup*/ 301 | UpgradeLog*.XML 302 | UpgradeLog*.htm 303 | ServiceFabricBackup/ 304 | *.rptproj.bak 305 | 306 | # SQL Server files 307 | *.mdf 308 | *.ldf 309 | *.ndf 310 | 311 | # Business Intelligence projects 312 | *.rdl.data 313 | *.bim.layout 314 | *.bim_*.settings 315 | *.rptproj.rsuser 316 | *- [Bb]ackup.rdl 317 | *- [Bb]ackup ([0-9]).rdl 318 | *- [Bb]ackup ([0-9][0-9]).rdl 319 | 320 | # Microsoft Fakes 321 | FakesAssemblies/ 322 | 323 | # GhostDoc plugin setting file 324 | *.GhostDoc.xml 325 | 326 | # Node.js Tools for Visual Studio 327 | .ntvs_analysis.dat 328 | node_modules/ 329 | 330 | # Visual Studio 6 build log 331 | *.plg 332 | 333 | # Visual Studio 6 workspace options file 334 | *.opt 335 | 336 | # Visual Studio 6 auto-generated workspace file (contains which files were open etc.) 337 | *.vbw 338 | 339 | # Visual Studio LightSwitch build output 340 | **/*.HTMLClient/GeneratedArtifacts 341 | **/*.DesktopClient/GeneratedArtifacts 342 | **/*.DesktopClient/ModelManifest.xml 343 | **/*.Server/GeneratedArtifacts 344 | **/*.Server/ModelManifest.xml 345 | _Pvt_Extensions 346 | 347 | # Paket dependency manager 348 | .paket/paket.exe 349 | paket-files/ 350 | 351 | # FAKE - F# Make 352 | .fake/ 353 | 354 | # CodeRush personal settings 355 | .cr/personal 356 | 357 | # Python Tools for Visual Studio (PTVS) 358 | __pycache__/ 359 | *.pyc 360 | 361 | # Cake - Uncomment if you are using it 362 | # tools/** 363 | # !tools/packages.config 364 | 365 | # Tabs Studio 366 | *.tss 367 | 368 | # Telerik's JustMock configuration file 369 | *.jmconfig 370 | 371 | # BizTalk build output 372 | *.btp.cs 373 | *.btm.cs 374 | *.odx.cs 375 | *.xsd.cs 376 | 377 | # OpenCover UI analysis results 378 | OpenCover/ 379 | 380 | # Azure Stream Analytics local run output 381 | ASALocalRun/ 382 | 383 | # MSBuild Binary and Structured Log 384 | *.binlog 385 | 386 | # NVidia Nsight GPU debugger configuration file 387 | *.nvuser 388 | 389 | # MFractors (Xamarin productivity tool) working folder 390 | .mfractor/ 391 | 392 | # Local History for Visual Studio 393 | .localhistory/ 394 | 395 | # BeatPulse healthcheck temp database 396 | healthchecksdb 397 | 398 | # Backup folder for Package Reference Convert tool in Visual Studio 2017 399 | MigrationBackup/ 400 | 401 | # Ionide (cross platform F# VS Code tools) working folder 402 | .ionide/ 403 | 404 | ### VisualStudioCode.patch 405 | # Ignore all local history of files 406 | .history 407 | 408 | ### Vim 409 | # Swap 410 | [._]*.s[a-v][a-z] 411 | !*.svg # comment out if you don't need vector files 412 | [._]*.sw[a-p] 413 | [._]s[a-rt-v][a-z] 414 | [._]ss[a-gi-z] 415 | [._]sw[a-p] 416 | 417 | # Session 418 | Session.vim 419 | Sessionx.vim 420 | 421 | # Temporary 422 | .netrwhist 423 | *~ 424 | # Auto-generated tag files 425 | tags 426 | # Persistent undo 427 | [._]*.un~ 428 | 429 | ### Emacs 430 | # -*- mode: gitignore; -*- 431 | *~ 432 | \#*\# 433 | /.emacs.desktop 434 | /.emacs.desktop.lock 435 | *.elc 436 | auto-save-list 437 | tramp 438 | .\#* 439 | 440 | # Org-mode 441 | .org-id-locations 442 | *_archive 443 | 444 | # flymake-mode 445 | *_flymake.* 446 | 447 | # eshell files 448 | /eshell/history 449 | /eshell/lastdir 450 | 451 | # elpa packages 452 | /elpa/ 453 | 454 | # reftex files 455 | *.rel 456 | 457 | # AUCTeX auto folder 458 | /auto/ 459 | 460 | # cask packages 461 | .cask/ 462 | dist/ 463 | 464 | # Flycheck 465 | flycheck_*.el 466 | 467 | # server auth directory 468 | /server/ 469 | 470 | # projectiles files 471 | .projectile 472 | 473 | # directory configuration 474 | .dir-locals.el 475 | 476 | # network security 477 | /network-security.data 478 | 479 | 480 | ### Node 481 | # Logs 482 | logs 483 | *.log 484 | npm-debug.log* 485 | yarn-debug.log* 486 | yarn-error.log* 487 | lerna-debug.log* 488 | 489 | # Diagnostic reports (https://nodejs.org/api/report.html) 490 | report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json 491 | 492 | # Runtime data 493 | pids 494 | *.pid 495 | *.seed 496 | *.pid.lock 497 | 498 | # Directory for instrumented libs generated by jscoverage/JSCover 499 | lib-cov 500 | 501 | # Coverage directory used by tools like istanbul 502 | coverage 503 | *.lcov 504 | 505 | # nyc test coverage 506 | .nyc_output 507 | 508 | # Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) 509 | .grunt 510 | 511 | # Bower dependency directory (https://bower.io/) 512 | bower_components 513 | 514 | # node-waf configuration 515 | .lock-wscript 516 | 517 | # Compiled binary addons (https://nodejs.org/api/addons.html) 518 | build/Release 519 | 520 | # Dependency directories 521 | node_modules/ 522 | jspm_packages/ 523 | 524 | # TypeScript v1 declaration files 525 | typings/ 526 | 527 | # TypeScript cache 528 | *.tsbuildinfo 529 | 530 | # Optional npm cache directory 531 | .npm 532 | 533 | # Optional eslint cache 534 | .eslintcache 535 | 536 | # Microbundle cache 537 | .rpt2_cache/ 538 | .rts2_cache_cjs/ 539 | .rts2_cache_es/ 540 | .rts2_cache_umd/ 541 | 542 | # Optional REPL history 543 | .node_repl_history 544 | 545 | # Output of 'npm pack' 546 | *.tgz 547 | 548 | # Yarn Integrity file 549 | .yarn-integrity 550 | 551 | # dotenv environment variables file 552 | .env 553 | .env.test 554 | 555 | # parcel-bundler cache (https://parceljs.org/) 556 | .cache 557 | 558 | # Next.js build output 559 | .next 560 | 561 | # Nuxt.js build / generate output 562 | .nuxt 563 | dist 564 | 565 | # Gatsby files 566 | .cache/ 567 | # Comment in the public line in if your project uses Gatsby and not Next.js 568 | # https://nextjs.org/blog/next-9-1#public-directory-support 569 | # public 570 | 571 | # vuepress build output 572 | .vuepress/dist 573 | 574 | # Serverless directories 575 | .serverless/ 576 | 577 | # FuseBox cache 578 | .fusebox/ 579 | 580 | # DynamoDB Local files 581 | .dynamodb/ 582 | 583 | # TernJS port file 584 | .tern-port 585 | 586 | # Stores VSCode versions used for testing VSCode extensions 587 | .vscode-test 588 | 589 | ### Anjuta 590 | # Local configuration folder and symbol database 591 | /.anjuta/ 592 | /.anjuta_sym_db.db 593 | 594 | ### BitTorrent 595 | *.torrent 596 | 597 | ### Windows 598 | # Windows thumbnail cache files 599 | Thumbs.db 600 | Thumbs.db:encryptable 601 | ehthumbs.db 602 | ehthumbs_vista.db 603 | 604 | # Dump file 605 | *.stackdump 606 | 607 | # Folder config file 608 | [Dd]esktop.ini 609 | 610 | # Recycle Bin used on file shares 611 | $RECYCLE.BIN/ 612 | 613 | # Windows Installer files 614 | *.cab 615 | *.msi 616 | *.msix 617 | *.msm 618 | *.msp 619 | 620 | # Windows shortcuts 621 | *.lnk 622 | 623 | ### Linux 624 | *~ 625 | 626 | # temporary files which can be created if a process still has a handle open of a deleted file 627 | .fuse_hidden* 628 | 629 | # KDE directory preferences 630 | .directory 631 | 632 | # Linux trash folder which might appear on any partition or disk 633 | .Trash-* 634 | 635 | # .nfs files are created when an open file is removed but is still being accessed 636 | .nfs* 637 | 638 | ### Eclipse.patch 639 | # Eclipse Core 640 | .project 641 | 642 | # JDT-specific (Eclipse Java Development Tools) 643 | .classpath 644 | 645 | # Annotation Processing 646 | .apt_generated 647 | 648 | .sts4-cache/ 649 | 650 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | --- 2 | title : README 3 | author : Sam Aldis 4 | contact : samuel.aldis@owasp.org 5 | contributors : 6 | - OWASP 7 | - Sam Aldis: https://github.com/sam-aldis 8 | - Tony: https://github.com/crazykid95 9 | - Your name here 10 | slack: https://owasp.slack.com/archives/CH7CYTMRD 11 | repo : https://github.com/OWASP/RedTeamToolkit.git 12 | --- 13 | # RedTeamToolkit 14 | ### *The* Security toolkit for the new Web First Paradigm 15 | 16 | Goals : 17 | 18 | 1. Fully Browser based toolkit making use of the newest web technologies. 19 | 20 | 2. WASM modules to pull in only what you need. 21 | 22 | 3. Ability to use within a target organization without having to bring in physical media. 23 | 24 | 4. Central Reporting and Command UI. 25 | 26 | #### No more carrying an entire OS with you to run pentests, pull in anywhere, over HTTPS, DNSSEC or even IPFS 27 | 28 | We're Looking for contributors: 29 | 30 | - Join us on Slack [OWASP#RedTeamTK](https://owasp.slack.com/archives/CH7CYTMRD) 31 | - Fork/Clone this repo and submit a pull request 32 | - Email samuel.aldis@owasp.org 33 | 34 | It doesn't matter what language you normally program in, we are looking to create a language agnostic framework 35 | (even python runs on WASM) 36 | -------------------------------------------------------------------------------- /RedTeamToolkit.code-workspace: -------------------------------------------------------------------------------- 1 | { 2 | "folders": [ 3 | { 4 | "name" : "Web Compat", 5 | "path": "./tests/src/server/" 6 | }, 7 | { 8 | "name": "WASMTime Compat", 9 | "path": "./tests/src/wasmtime/" 10 | }, 11 | { 12 | "name": "Docs", 13 | "path": "./Docs" 14 | }, 15 | { 16 | "name": "Base", 17 | "path": "./" 18 | }, 19 | ], 20 | "extensions": { 21 | "recommendations": [ 22 | "rust-lang.rust", 23 | "swellaby.rust-pack", 24 | "jscearcy.rust-doc-viewer", 25 | "statiolake.vscode-rustfmt", 26 | "serayuzgur.crates", 27 | "panicbit.cargo", 28 | "jcmellado.vscode-wasm-essentials" 29 | ], 30 | }, 31 | "settings": { 32 | "rust-client.autoStartRls": true, 33 | "liveServer.settings.port": 5501, 34 | }, 35 | } -------------------------------------------------------------------------------- /configs/.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "liveServer.settings.port": 5501 3 | } -------------------------------------------------------------------------------- /tests/src/server/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | authors = ["sam aldis "] 3 | edition = "2018" 4 | name = "server" 5 | version = "0.1.0" 6 | [dependencies] 7 | js-sys = "*" 8 | wasm-bindgen = "*" 9 | wasm-bindgen-futures = "*" 10 | yew = "*" 11 | 12 | [dependencies.web-sys] 13 | features = ["Document", "Element", "HtmlElement", "Node", "Window", "EventListener"] 14 | version = "0.3.4" 15 | 16 | [lib] 17 | crate-type = ["cdylib", "rlib"] -------------------------------------------------------------------------------- /tests/src/server/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | RedTeam Toolkit 7 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /tests/src/server/index.js: -------------------------------------------------------------------------------- 1 | const rust = import("./pkg"); 2 | 3 | // rust 4 | // .then(m => m.main()) 5 | // .catch(console.error); -------------------------------------------------------------------------------- /tests/src/server/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "server", 3 | "version": "1.0.0", 4 | "main": "index.js", 5 | "author": "Sam Aldis", 6 | "description": "Server to pull in the required WASM modules and display results to the user", 7 | "license": "MIT", 8 | "scripts": { 9 | "build": "webpack", 10 | "serve": "webpack-dev-server" 11 | }, 12 | "devDependencies": { 13 | "@types/html-webpack-plugin": "3.2.3", 14 | "@types/text-encoding": "0.0.35", 15 | "@types/webpack": "4.41.13", 16 | "@types/webpack-dev-server": "3.11.0", 17 | "@wasm-tool/wasm-pack-plugin": "1.0.1", 18 | "html-webpack-plugin": "^3.2.0", 19 | "text-encoding": "^0.7.0", 20 | "webpack": "^4.29.4", 21 | "webpack-cli": "^3.1.1", 22 | "webpack-dev-server": "^3.1.0" 23 | }, 24 | "dependencies": { 25 | "parcel-bundler": "^1.12.4", 26 | "parcel-plugin-wasm.rs": "^1.2.15" 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /tests/src/server/src/components/header.rs: -------------------------------------------------------------------------------- 1 | // use yew::{ 2 | // Component 3 | // , ComponentLink 4 | // , html 5 | // , Html 6 | // , ShouldRender 7 | // }; 8 | use yew::prelude::*; 9 | 10 | pub struct Header { 11 | link : ComponentLink, 12 | } 13 | 14 | pub enum Event { 15 | Click, 16 | } 17 | 18 | impl Component for Header { 19 | type Message = Event; 20 | type Properties = (); 21 | 22 | fn create(_ : Self::Properties, link : ComponentLink) -> Self { 23 | Header { link } 24 | } 25 | fn update(&mut self, ev : Self::Message) -> ShouldRender { 26 | true 27 | } 28 | fn change(&mut self, _props: Self::Properties) -> ShouldRender { 29 | true 30 | } 31 | fn view(&self) -> Html { 32 | html! { 33 | <> 34 |
35 | {"test"} 36 |
37 | 38 | } 39 | } 40 | } -------------------------------------------------------------------------------- /tests/src/server/src/components/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod header; 2 | 3 | -------------------------------------------------------------------------------- /tests/src/server/src/lib.rs: -------------------------------------------------------------------------------- 1 | use wasm_bindgen::prelude::*; 2 | use wasm_bindgen_futures::*; 3 | use web_sys::*; 4 | use yew::prelude::*; 5 | mod components; 6 | use components::header::Header as Header; 7 | #[wasm_bindgen] 8 | extern "C"{ 9 | fn alert(msg : &str); 10 | } 11 | #[wasm_bindgen(start)] 12 | pub async fn main() -> Result<(), JsValue >{ 13 | let window = web_sys::window().expect("No Window"); 14 | let document = window.document().expect("No Document"); 15 | let body = document.body().expect("No body"); 16 | App::
::new().mount_to_body(); 17 | let jheader = document.create_element("header")?; 18 | jheader.set_inner_html("

RedTeam Toolkit

"); 19 | let p = document.create_element("p")?; 20 | p.set_inner_html("this is a test"); 21 | body.append_child(&jheader)?; 22 | body.append_child(&p)?; 23 | Ok(()) 24 | } -------------------------------------------------------------------------------- /tests/src/server/ts/index.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OWASP/RedTeamToolkit/ee57fb61cb2d5bd042eb4064872dcabd98b06d58/tests/src/server/ts/index.ts -------------------------------------------------------------------------------- /tests/src/server/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | /* Basic Options */ 4 | // "incremental": true, /* Enable incremental compilation */ 5 | "target": "es6", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019', 'ES2020', or 'ESNEXT'. */ 6 | "module": "commonjs", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', 'es2020', or 'ESNext'. */ 7 | "lib": ["DOM","ES6"], /* Specify library files to be included in the compilation. */ 8 | // "allowJs": true, /* Allow javascript files to be compiled. */ 9 | // "checkJs": true, /* Report errors in .js files. */ 10 | // "jsx": "preserve", /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */ 11 | // "declaration": true, /* Generates corresponding '.d.ts' file. */ 12 | // "declarationMap": true, /* Generates a sourcemap for each corresponding '.d.ts' file. */ 13 | // "sourceMap": true, /* Generates corresponding '.map' file. */ 14 | // "outFile": "./", /* Concatenate and emit output to single file. */ 15 | "outDir": "./pkg", /* Redirect output structure to the directory. */ 16 | "rootDir": "./", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */ 17 | // "composite": true, /* Enable project compilation */ 18 | // "tsBuildInfoFile": "./", /* Specify file to store incremental compilation information */ 19 | // "removeComments": true, /* Do not emit comments to output. */ 20 | // "noEmit": true, /* Do not emit outputs. */ 21 | // "importHelpers": true, /* Import emit helpers from 'tslib'. */ 22 | // "downlevelIteration": true, /* Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5' or 'ES3'. */ 23 | // "isolatedModules": true, /* Transpile each file as a separate module (similar to 'ts.transpileModule'). */ 24 | 25 | /* Strict Type-Checking Options */ 26 | "strict": true, /* Enable all strict type-checking options. */ 27 | // "noImplicitAny": true, /* Raise error on expressions and declarations with an implied 'any' type. */ 28 | // "strictNullChecks": true, /* Enable strict null checks. */ 29 | // "strictFunctionTypes": true, /* Enable strict checking of function types. */ 30 | // "strictBindCallApply": true, /* Enable strict 'bind', 'call', and 'apply' methods on functions. */ 31 | // "strictPropertyInitialization": true, /* Enable strict checking of property initialization in classes. */ 32 | // "noImplicitThis": true, /* Raise error on 'this' expressions with an implied 'any' type. */ 33 | // "alwaysStrict": true, /* Parse in strict mode and emit "use strict" for each source file. */ 34 | 35 | /* Additional Checks */ 36 | // "noUnusedLocals": true, /* Report errors on unused locals. */ 37 | // "noUnusedParameters": true, /* Report errors on unused parameters. */ 38 | // "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */ 39 | // "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */ 40 | 41 | /* Module Resolution Options */ 42 | // "moduleResolution": "node", /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */ 43 | // "baseUrl": "./", /* Base directory to resolve non-absolute module names. */ 44 | // "paths": {}, /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */ 45 | // "rootDirs": [], /* List of root folders whose combined content represents the structure of the project at runtime. */ 46 | // "typeRoots": [], /* List of folders to include type definitions from. */ 47 | // "types": [], /* Type declaration files to be included in compilation. */ 48 | // "allowSyntheticDefaultImports": true, /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */ 49 | "esModuleInterop": true, /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */ 50 | // "preserveSymlinks": true, /* Do not resolve the real path of symlinks. */ 51 | // "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */ 52 | 53 | /* Source Map Options */ 54 | // "sourceRoot": "", /* Specify the location where debugger should locate TypeScript files instead of source locations. */ 55 | // "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */ 56 | // "inlineSourceMap": true, /* Emit a single file with source maps instead of having a separate file. */ 57 | // "inlineSources": true, /* Emit the source alongside the sourcemaps within a single file; requires '--inlineSourceMap' or '--sourceMap' to be set. */ 58 | 59 | /* Experimental Options */ 60 | // "experimentalDecorators": true, /* Enables experimental support for ES7 decorators. */ 61 | // "emitDecoratorMetadata": true, /* Enables experimental support for emitting type metadata for decorators. */ 62 | 63 | /* Advanced Options */ 64 | "forceConsistentCasingInFileNames": true /* Disallow inconsistently-cased references to the same file. */ 65 | }, "files": [ 66 | "./ts/index.ts" 67 | ] 68 | } -------------------------------------------------------------------------------- /tests/src/server/webpack.config.js: -------------------------------------------------------------------------------- 1 | const path = require('path'); 2 | const HtmlWebpackPlugin = require('html-webpack-plugin'); 3 | const webpack = require('webpack'); 4 | const WasmPackPlugin = require("@wasm-tool/wasm-pack-plugin"); 5 | 6 | module.exports = { 7 | entry: './index.js', 8 | output: { 9 | path: path.resolve(__dirname, "dist"), 10 | filename: 'index.js', 11 | }, 12 | plugins: [ 13 | new HtmlWebpackPlugin(), 14 | new WasmPackPlugin({ 15 | crateDirectory: path.resolve(__dirname, ".") 16 | }), 17 | // Have this example work in Edge which doesn't ship `TextEncoder` or 18 | // `TextDecoder` at this time. 19 | new webpack.ProvidePlugin({ 20 | TextDecoder: ['text-encoding', 'TextDecoder'], 21 | TextEncoder: ['text-encoding', 'TextEncoder'] 22 | }) 23 | ], 24 | mode: 'development' 25 | }; -------------------------------------------------------------------------------- /tests/src/wasmtime/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "src_wasmtime" 3 | version = "0.1.0" 4 | authors = ["sam aldis "] 5 | edition = "2018" 6 | 7 | # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html 8 | 9 | [dependencies] 10 | wasmtime = "*" -------------------------------------------------------------------------------- /tests/src/wasmtime/src/main.rs: -------------------------------------------------------------------------------- 1 | fn main() { 2 | println!("Hello, world!"); 3 | } 4 | --------------------------------------------------------------------------------