pwn 0.5.310 → 0.5.311

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 285a68a2cda6bbdd1ae33ec4a3fd37f5831f27780eb55b1b405ac3d01c14cf9d
4
- data.tar.gz: 145f7a73a322bd700cd0852c1e35349413ab45ff1e2e71e3895f43c8c0e457a1
3
+ metadata.gz: cf124a838b0f13e7e6e2ac3d13d354fd885c07f7c71c24e05134cf33dd66ba10
4
+ data.tar.gz: 0e4413b5365adadf3d7fc688ccf372d6caf8145ba8876bb0c6d65b6145048279
5
5
  SHA512:
6
- metadata.gz: 212678e418bcf5fe6c4c5d2c6ed9c5ef0ebf31ed526ec72b52a81dacab60d53eff8637631259f0e267c4eb870dbda6de891fa31cf1ed8aca44d44585ec27ac07
7
- data.tar.gz: e7bbae0e1600fa8f712c663eb787cc93edfeced5c8324617d616cb6981d881ac0aad6d41f2510ec340891f46d717c8dcb9ac39317512fa1cf28e37c1f389f8fa
6
+ metadata.gz: caf9d4f9fd676258b3405562f9ece2e85cfedcce57e83360e4b536ab2222c25487ccf19c82d19d3a26f07311d8f635222c9ffd765404cbda42d357593ddbbd18
7
+ data.tar.gz: 5ff6987e379badb54018ea566e5f288188a7e99e3c40d6fc27b13189cdde1eb9e5d45a42d4b2b510cacb270ee79c0465a21f014903671b317164fb650bb3c3df
data/README.md CHANGED
@@ -37,7 +37,7 @@ $ cd /opt/pwn
37
37
  $ ./install.sh
38
38
  $ ./install.sh ruby-gem
39
39
  $ pwn
40
- pwn[v0.5.310]:001 >>> PWN.help
40
+ pwn[v0.5.311]:001 >>> PWN.help
41
41
  ```
42
42
 
43
43
  [![Installing the pwn Security Automation Framework](https://raw.githubusercontent.com/0dayInc/pwn/master/documentation/pwn_install.png)](https://youtu.be/G7iLUY4FzsI)
@@ -52,7 +52,7 @@ $ rvm use ruby-3.4.4@pwn
52
52
  $ gem uninstall --all --executables pwn
53
53
  $ gem install --verbose pwn
54
54
  $ pwn
55
- pwn[v0.5.310]:001 >>> PWN.help
55
+ pwn[v0.5.311]:001 >>> PWN.help
56
56
  ```
57
57
 
58
58
  If you're using a multi-user install of RVM do:
@@ -62,7 +62,7 @@ $ rvm use ruby-3.4.4@pwn
62
62
  $ rvmsudo gem uninstall --all --executables pwn
63
63
  $ rvmsudo gem install --verbose pwn
64
64
  $ pwn
65
- pwn[v0.5.310]:001 >>> PWN.help
65
+ pwn[v0.5.311]:001 >>> PWN.help
66
66
  ```
67
67
 
68
68
  PWN periodically upgrades to the latest version of Ruby which is reflected in `/opt/pwn/.ruby-version`. The easiest way to upgrade to the latest version of Ruby from a previous PWN installation is to run the following script:
@@ -537,16 +537,20 @@ module PWN
537
537
  console.log(`Mutation ${index + 1}:`, mutation.type);
538
538
 
539
539
  if (mutation.type === 'childList') {
540
- // Log added or removed nodes
541
540
  if (mutation.addedNodes.length) {
542
541
  mutation.addedNodes.forEach((node) => {
543
542
  if (node.nodeType === Node.ELEMENT_NODE) {
544
- console.log('Added Element:', {
543
+ let logObj = {
545
544
  tagName: node.tagName,
546
545
  id: node.id || 'N/A',
547
546
  classList: node.className || 'N/A',
548
547
  outerHTML: node.outerHTML,
549
- });
548
+ };
549
+ if (['SCRIPT', 'IFRAME', 'FRAME', 'OBJECT', 'EMBED', 'APPLET'].includes(node.tagName)) {
550
+ console.warn('Potential XSS sink: Added', node.tagName, logObj);
551
+ } else {
552
+ console.log('Added Element:', logObj);
553
+ }
550
554
  } else if (node.nodeType === Node.TEXT_NODE) {
551
555
  console.log('Added Text Node:', {
552
556
  textContent: node.textContent,
@@ -573,23 +577,43 @@ module PWN
573
577
  });
574
578
  }
575
579
  } else if (mutation.type === 'attributes') {
576
- // Log attribute changes
577
- console.log(`Attribute "${mutation.attributeName}" modified on`, {
580
+ let logObj = {
578
581
  element: mutation.target.tagName,
579
582
  id: mutation.target.id || 'N/A',
583
+ attribute: mutation.attributeName,
580
584
  oldValue: mutation.oldValue,
581
585
  newValue: mutation.target.getAttribute(mutation.attributeName),
582
586
  outerHTML: mutation.target.outerHTML,
583
- });
587
+ };
588
+ if (
589
+ (mutation.attributeName === 'src' && ['SCRIPT', 'IFRAME', 'FRAME', 'OBJECT', 'EMBED'].includes(mutation.target.tagName)) ||
590
+ (mutation.attributeName === 'href' && ['A', 'AREA', 'LINK'].includes(mutation.target.tagName)) ||
591
+ (mutation.attributeName === 'action' && mutation.target.tagName === 'FORM') ||
592
+ mutation.attributeName.startsWith('on') ||
593
+ (mutation.attributeName === 'srcdoc' && mutation.target.tagName === 'IFRAME') ||
594
+ (mutation.attributeName === 'data' && mutation.target.tagName === 'OBJECT') ||
595
+ (mutation.attributeName === 'codebase' && mutation.target.tagName === 'OBJECT')
596
+ ) {
597
+ console.warn('Potential XSS sink: Attribute change', logObj);
598
+ } else {
599
+ console.log('Attribute changed:', logObj);
600
+ }
584
601
  } else if (mutation.type === 'characterData') {
585
- // Log text content changes (e.g., from user input in contenteditable or form fields)
586
- console.log('Text Content Changed:', {
587
- element: mutation.target.parentElement?.tagName || 'N/A',
588
- id: mutation.target.parentElement?.id || 'N/A',
589
- oldValue: mutation.oldValue,
590
- newValue: mutation.target.textContent,
591
- innerHTML: mutation.target.parentElement?.innerHTML || 'N/A',
592
- });
602
+ if (mutation.target.parentElement && mutation.target.parentElement.tagName === 'SCRIPT') {
603
+ console.warn('Potential XSS sink: Script content changed', {
604
+ scriptId: mutation.target.parentElement.id || 'N/A',
605
+ oldValue: mutation.oldValue,
606
+ newValue: mutation.target.textContent,
607
+ });
608
+ } else {
609
+ console.log('Text Content Changed:', {
610
+ element: mutation.target.parentElement?.tagName || 'N/A',
611
+ id: mutation.target.parentElement?.id || 'N/A',
612
+ oldValue: mutation.oldValue,
613
+ newValue: mutation.target.textContent,
614
+ innerHTML: mutation.target.parentElement?.innerHTML || 'N/A',
615
+ });
616
+ }
593
617
  }
594
618
  });
595
619
  console.groupEnd();
@@ -618,7 +642,7 @@ module PWN
618
642
  document.addEventListener('click', logUserInteraction); // For clicks
619
643
 
620
644
  // Function to stop the observer (run in console when needed)
621
- window.stopObserving = () => {
645
+ window.hide_dom_mutations = () => {
622
646
  observer.disconnect();
623
647
  document.removeEventListener('input', logUserInteraction);
624
648
  document.removeEventListener('click', logUserInteraction);
@@ -626,7 +650,7 @@ module PWN
626
650
  };
627
651
 
628
652
  // Log instructions to console
629
- console.log('MutationObserver started. To stop, run: stopObserving()');
653
+ console.log('MutationObserver started. To stop, run: hide_dom_mutations()');
630
654
  JAVASCRIPT
631
655
 
632
656
  console(browser_obj: browser_obj, js: 'clear();')
@@ -651,11 +675,11 @@ module PWN
651
675
  )
652
676
 
653
677
  js = <<~JAVASCRIPT
654
- if (typeof stopObserving === 'function') {
655
- stopObserving();
678
+ if (typeof hide_dom_mutations === 'function') {
679
+ hide_dom_mutations();
656
680
  console.log('DOM mutation observer and event listeners disabled.');
657
681
  } else {
658
- console.log('Error: stopObserving function not found. DOM mutation observer was not active.');
682
+ console.log('Error: hide_dom_mutations function not found. DOM mutation observer was not active.');
659
683
  }
660
684
  JAVASCRIPT
661
685
 
data/lib/pwn/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module PWN
4
- VERSION = '0.5.310'
4
+ VERSION = '0.5.311'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pwn
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.310
4
+ version: 0.5.311
5
5
  platform: ruby
6
6
  authors:
7
7
  - 0day Inc.