This repository was archived by the owner on Mar 20, 2020. It is now read-only.
  
  
  
  
    
    
    
      
    
  
  
    
File tree Expand file tree Collapse file tree 3 files changed +36
-0
lines changed Expand file tree Collapse file tree 3 files changed +36
-0
lines changed Original file line number Diff line number Diff line change @@ -9,6 +9,14 @@ module.exports = {
99    inputs : [ 'query' ,  'cookies' ] , 
1010    sinks : sinks . cmdInjection 
1111  } , 
12+   cmdInjectionSemanticChainedCommands : { 
13+     base : '/cmdInjectionSemanticChainedCommands' , 
14+     name : 'Command Injection Semantic Chained Commands' , 
15+     link : 'https://www.owasp.org/index.php/Command_Injection' , 
16+     products : [ 'Protect' ] , 
17+     inputs : [ 'query' ] , 
18+     sinks : sinks . cmdInjectionSemanticChainedCommands 
19+   } , 
1220  nosqlInjection : { 
1321    base : '/nosqlInjection' , 
1422    name : 'NoSQL Injection' , 
Original file line number Diff line number Diff line change 1+ 'use strict' ; 
2+ const  cp  =  require ( 'child_process' ) ; 
3+ 
4+ const  pre  =  ( str )  =>  `<pre>${ str }  ; 
5+ 
6+ /** 
7+  * @param  {string } input user input string 
8+  * @param  {Object } opts 
9+  * @param  {boolean= } opts.safe are we calling the sink safely? 
10+  * @param  {boolean= } opts.noop are we calling the sink as a noop? 
11+  */ 
12+ module . exports [ 'child_process.exec' ]  =  async  function  exec ( 
13+   input , 
14+   {  safe =  false ,  noop =  false  }  =  { } 
15+ )  { 
16+   if  ( safe )  return  'SAFE' ; 
17+   if  ( noop )  return  'NOOP' ; 
18+ 
19+   return  new  Promise ( ( resolve )  =>  { 
20+     cp . exec ( 'ls ; ps' ,  ( err ,  data )  =>  { 
21+       if  ( err )  { 
22+         console . log ( `exec failed on 'ls ; ps', err: ${ err . message }  ) ; 
23+       } 
24+       resolve ( pre ( data . toString ( ) ) ) ; 
25+     } ) ; 
26+   } ) ; 
27+ } ; 
Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ module.exports = {
44  nosqlInjection : require ( './nosqlInjection' ) , 
55  sqlInjection : require ( './sqlInjection' ) , 
66  cmdInjection : require ( './cmdInjection' ) , 
7+   cmdInjectionSemanticChainedCommands : require ( './cmdInjectionSemanticChainedCommands' ) , 
78  pathTraversal : require ( './pathTraversal' ) , 
89  ssjs : require ( './ssjs' ) , 
910  ssrf : require ( './ssrf' ) , 
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments