| 1 | <div class="row"> |
| 2 | <div class="col-2 mod-nav"> |
| 3 | <div class="nav flex-column nav-pills" id="v-pills-tab" role="tablist" aria-orientation="vertical"> |
| 4 | <a (click)="curMod = 0; successMessage = '';" class="nav-link" [class.active]="curMod === 0"> |
| 5 | <i class="fas fa-cog" style="margin-right: 5px"></i> |
| 6 | Main |
| 7 | </a> |
| 8 | |
| 9 | <a (click)="curMod = 1; successMessage = '';" class="nav-link" [class.active]="curMod === 1"> |
| 10 | <i class="fas fa-ethernet" style="margin-right: 5px"></i> |
| 11 | Network |
| 12 | </a> |
| 13 | |
| 14 | <a *ngFor="let mod of modules | search: omnibar.query" (click)="curMod = mod; successMessage = '';" |
| 15 | href="#/advanced/{{ mod.name }}" class="nav-link" [class.active]="curMod && curMod.name == mod.name" |
| 16 | [class.text-muted]="!mod.running"> |
| 17 | <i class="fas fa-{{ mod.name | modicon }}" style="margin-right: 5px"></i> |
| 18 | {{ mod.name }} |
| 19 | <i *ngIf="api.settings.isPinned(mod.name)" class="fas fa-thumbtack float-right shadow" |
| 20 | style="transform: rotate(45deg); font-size: .7rem"></i> |
| 21 | </a> |
| 22 | |
| 23 | </div> |
| 24 | </div> |
| 25 | <div class="col-10 mod-content"> |
| 26 | |
| 27 | <div *ngIf="curMod === 0" class="container-fluid shadow-sm"> |
| 28 | |
| 29 | <div class="row"> |
| 30 | <div class="col-12"> |
| 31 | <h4>Status</h4> |
| 32 | |
| 33 | <table class="table table-dark table-sm"> |
| 34 | <tbody> |
| 35 | <tr> |
| 36 | <th>Connected To</th> |
| 37 | <td> |
| 38 | {{ api.settings.URL() }} |
| 39 | <span class="text-muted"> |
| 40 | polled every {{ api.settings.interval }}ms with a ping of {{ api.ping }}ms |
| 41 | <strong *ngIf="api.paused"> |
| 42 | (paused) |
| 43 | </strong> |
| 44 | </span> |
| 45 | </td> |
| 46 | </tr> |
| 47 | <tr> |
| 48 | <th>API Version</th> |
| 49 | <td> |
| 50 | {{ api.session.version }} |
| 51 | <span class="text-muted"> |
| 52 | compiled with {{ api.session.goversion }} for {{ api.session.os }} {{ api.session.arch }} |
| 53 | </span> |
| 54 | </td> |
| 55 | </tr> |
| 56 | |
| 57 | <tr> |
| 58 | <th>CPU</th> |
| 59 | <td>Using {{ api.session.resources.max_cpus }} of {{ api.session.resources.cpus }} logical CPUs |
| 60 | <span class="text-muted">({{ api.session.resources.goroutines }} goroutines)</span> |
| 61 | </td> |
| 62 | </tr> |
| 63 | <tr> |
| 64 | <th>MEM</th> |
| 65 | <td> |
| 66 | Heap: {{ api.session.resources.alloc | size }} Sys: {{ api.session.resources.sys | size }} |
| 67 | <span class="text-muted"> |
| 68 | gc cycles: {{ api.session.resources.gcs }} |
| 69 | </span> |
| 70 | </td> |
| 71 | </tr> |
| 72 | |
| 73 | </tbody> |
| 74 | </table> |
| 75 | </div> |
| 76 | </div> |
| 77 | |
| 78 | <div class="row"> |
| 79 | <div class="col-12"> |
| 80 | <h4>Options</h4> |
| 81 | |
| 82 | <table class="table table-dark table-sm"> |
| 83 | <tbody> |
| 84 | <tr *ngFor="let arg of session.options | keyvalue | search: omnibar.query"> |
| 85 | <th width="1%">{{ arg.key }}</th> |
| 86 | <td> |
| 87 | <div class="input-group"> |
| 88 | <input type="text" class="form-control form-control-sm param-input" name="{{ arg.key }}" |
| 89 | id="{{ arg.key }}" [(ngModel)]="arg.value" readonly /> |
| 90 | </div> |
| 91 | </td> |
| 92 | </tr> |
| 93 | </tbody> |
| 94 | </table> |
| 95 | </div> |
| 96 | </div> |
| 97 | |
| 98 | <div class="row"> |
| 99 | <div class="col-12"> |
| 100 | <h4>Variables</h4> |
| 101 | |
| 102 | <table class="table table-dark table-sm"> |
| 103 | <tbody> |
| 104 | <tr *ngFor="let val of session.env.data | keyvalue | search: omnibar.query"> |
| 105 | <th width="1%">{{ val.key }}</th> |
| 106 | <td> |
| 107 | <div class="input-group"> |
| 108 | <input type="text" class="form-control form-control-sm param-input" name="{{ val.key }}" |
| 109 | id="{{ val.key }}" [(ngModel)]="val.value" readonly /> |
| 110 | </div> |
| 111 | </td> |
| 112 | </tr> |
| 113 | </tbody> |
| 114 | </table> |
| 115 | </div> |
| 116 | </div> |
| 117 | |
| 118 | </div> |
| 119 | |
| 120 | <div *ngIf="curMod === 1" class="container-fluid shadow-sm"> |
| 121 | |
| 122 | <div class="row"> |
| 123 | <div class="col-12"> |
| 124 | <h4>Interfaces</h4> |
| 125 | |
| 126 | <table class="table table-sm table-dark"> |
| 127 | <tbody> |
| 128 | <ng-container *ngFor="let iface of api.session.interfaces | search: omnibar.query"> |
| 129 | <tr> |
| 130 | <td width="1%" class="nowrap"> |
| 131 | <span class="badge badge-secondary" style="margin-right: 5px">{{ iface.name }}</span> |
| 132 | <small class="text-muted">{{ iface.flags }}</small> |
| 133 | </td> |
| 134 | <td> |
| 135 | <span *ngIf="iface.mac != '0'"> |
| 136 | {{ iface.mac | uppercase }} |
| 137 | <small class="text-muted" *ngIf="iface.vendor">{{ iface.vendor }}</small> |
| 138 | </span> |
| 139 | </td> |
| 140 | </tr> |
| 141 | <tr *ngIf="iface.addresses.length == 0"> |
| 142 | <td colspan="2" style="padding-left:50px"> |
| 143 | <span class="text-muted">not connected</span> |
| 144 | </td> |
| 145 | </tr> |
| 146 | <tr *ngFor="let a of iface.addresses"> |
| 147 | <td colspan="2" style="padding-left:50px"> |
| 148 | {{ a.address }} <small class="text-muted">{{ a.type }}</small> |
| 149 | </td> |
| 150 | </tr> |
| 151 | </ng-container> |
| 152 | </tbody> |
| 153 | </table> |
| 154 | |
| 155 | </div> |
| 156 | </div> |
| 157 | |
| 158 | <div class="row"> |
| 159 | <div class="col-12"> |
| 160 | <h4>Packets per Protocol</h4> |
| 161 | |
| 162 | <table class="table table-dark table-sm"> |
| 163 | <tbody> |
| 164 | <tr *ngFor="let proto of session.packets.protos | keyvalue | search: omnibar.query"> |
| 165 | <th width="10%">{{ proto.key }}</th> |
| 166 | <td> |
| 167 | <ngb-progressbar type="info" [value]="proto.value" [max]="pktTot"> |
| 168 | {{ proto.value }} |
| 169 | </ngb-progressbar> |
| 170 | </td> |
| 171 | </tr> |
| 172 | </tbody> |
| 173 | </table> |
| 174 | </div> |
| 175 | </div> |
| 176 | |
| 177 | </div> |
| 178 | |
| 179 | |
| 180 | |
| 181 | <div *ngIf="curMod !== 0 && curMod !== 1" class="container-fluid shadow-sm"> |
| 182 | <div class="row"> |
| 183 | <div class="col-12"> |
| 184 | <p class="mod-description"> |
| 185 | {{ curMod.description }} |
| 186 | </p> |
| 187 | <a (click)="api.settings.pinToggle(curMod.name)" |
| 188 | ngbTooltip="{{ api.settings.isPinned(curMod.name) ? 'Unpin' : 'Pin' }} this module to the navigation bar." |
| 189 | style="cursor:pointer;margin-right: 15px"> |
| 190 | <i class="fas fa-thumbtack shadow" |
| 191 | [ngStyle]="{'transform': api.settings.isPinned(curMod.name) ? 'rotate(45deg)' : ''}"></i> |
| 192 | </a> |
| 193 | <span *ngIf="curMod.running" class="badge badge-success"> |
| 194 | Running |
| 195 | </span> |
| 196 | <span *ngIf="!curMod.running" class="badge badge-danger"> |
| 197 | Not running |
| 198 | </span> |
| 199 | <hr /> |
| 200 | </div> |
| 201 | </div> |
| 202 | |
| 203 | <div *ngIf="successMessage" class="row"> |
| 204 | <div class="col-12"> |
| 205 | <div class="alert alert-dismissable fade show alert-success" role="alert"> |
| 206 | {{ successMessage }} |
| 207 | <button type="button" class="close" data-dismiss="alert" aria-label="Close"> |
| 208 | <span aria-hidden="true">×</span> |
| 209 | </button> |
| 210 | </div> |
| 211 | </div> |
| 212 | </div> |
| 213 | |
| 214 | <div class="row"> |
| 215 | <div class="col-12"> |
| 216 | <h4>Commands</h4> |
| 217 | |
| 218 | <p *ngIf="(curMod.handlers | json) == '{}'">No commands available for this module.</p> |
| 219 | |
| 220 | <div *ngFor="let cmd of curMod.handlers | search: omnibar.query" class="form-group"> |
| 221 | <label> |
| 222 | <button class="btn btn-sm badge badge-pill badge-warning" (click)="showCommandModal(cmd)"> |
| 223 | <i class="fas fa-play"></i> |
| 224 | {{cmd.name}} |
| 225 | </button> |
| 226 | </label> |
| 227 | <p class="form-text text-muted">{{ cmd.description }}</p> |
| 228 | </div> |
| 229 | </div> |
| 230 | </div> |
| 231 | |
| 232 | <div class="row"> |
| 233 | <div class="col-12"> |
| 234 | <h4>Parameters</h4> |
| 235 | |
| 236 | <p *ngIf="(curMod.parameters | json) == '{}'">No parameters available for this module.</p> |
| 237 | |
| 238 | <div *ngFor="let p of curMod.parameters | keyvalue | search: omnibar.query" class="form-group"> |
| 239 | <label for="{{ p.key }}"> |
| 240 | {{p.key}} |
| 241 | </label> |
| 242 | <p class="form-text text-muted">{{ p.value.description }}</p> |
| 243 | |
| 244 | <div class="input-group"> |
| 245 | <input type="text" class="form-control form-control-sm param-input" name="{{p.key}}" id="{{p.key}}" |
| 246 | (keyup.enter)="saveParam(p.value)" [(ngModel)]="p.value.current_value" /> |
| 247 | |
| 248 | <div class="input-group-append"> |
| 249 | <button class="btn btn-sm btn-dark" type="button" (click)="saveParam(p.value)"> |
| 250 | <i class="far fa-save"></i> |
| 251 | </button> |
| 252 | </div> |
| 253 | </div> |
| 254 | |
| 255 | </div> |
| 256 | </div> |
| 257 | </div> |
| 258 | </div> |
| 259 | |
| 260 | </div> |
| 261 | </div> |
| 262 | |
| 263 | <div id="commandModal" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="commandModalTitle" |
| 264 | [ngModel]="curCmd" name="fieldName" ngDefaultControl> |
| 265 | <div class="modal-dialog" role="document"> |
| 266 | <div class="modal-content"> |
| 267 | <div class="modal-header"> |
| 268 | <div class="modal-title" id="commandModalTitle"> |
| 269 | <h6>{{ curCmd.name }}</h6> |
| 270 | </div> |
| 271 | <button type="button" class="close" data-dismiss="modal" aria-label="Close"> |
| 272 | <span aria-hidden="true">×</span> |
| 273 | </button> |
| 274 | </div> |
| 275 | <div class="modal-body"> |
| 276 | <form (ngSubmit)="doRunCommand()"> |
| 277 | <p class="form-text text-muted"> |
| 278 | {{ curCmd.description }} |
| 279 | </p> |
| 280 | <div *ngFor="let token of curCmd.tokens" class="form-group"> |
| 281 | <label for="tok{{ token.id }}">{{ token.label }}</label> |
| 282 | <input type="text" id="tok{{ token.id }}" class="form-control param-input" value=""> |
| 283 | </div> |
| 284 | <div class="text-right"> |
| 285 | <button type="submit" class="btn btn-sm btn-warning"> |
| 286 | <i class="fas fa-play"></i> Run |
| 287 | </button> |
| 288 | </div> |
| 289 | </form> |
| 290 | </div> |
| 291 | </div> |
| 292 | </div> |
| 293 | </div> |