File tree Expand file tree Collapse file tree 2 files changed +33
-0
lines changed Expand file tree Collapse file tree 2 files changed +33
-0
lines changed Original file line number Diff line number Diff line change @@ -4,6 +4,9 @@ All notable changes to this add-on will be documented in this file.
44The format is based on [ Keep a Changelog] ( https://keepachangelog.com/en/1.0.0/ ) .
55
66## [ Unreleased]
7+ ### Added
8+ - targeted/SQLMapCommandGenerator.js - it will generate and copy sqlmap command based on the request
9+
710### Changed
811- Update minimum ZAP version to 2.12.0:
912 - Remove compatibility code that provided the singletons (` control ` and ` model ` ) in JavaScript scripts, they can now be accessed directly always.
Original file line number Diff line number Diff line change 1+ //it will generate and copy sqlmap command based on the request
2+ //released under the Apache v2.0 licence.
3+ //You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
4+ //author: @juliosmelo
5+
6+
7+ function invokeWith ( msg ) {
8+ var string = "sqlmap --url '" + msg . getRequestHeader ( ) . getURI ( ) . toString ( ) + "' \\\n" ;
9+ var header = msg . getRequestHeader ( ) . getHeadersAsString ( ) ;
10+ header = header . split ( msg . getRequestHeader ( ) . getLineDelimiter ( ) ) ;
11+
12+ for ( var i = 0 ; i < header . length ; i ++ ) {
13+ string += " -H '" + header [ i ] . trim ( ) + "' " ;
14+ }
15+ string += " \\\n" ;
16+ var body = msg . getRequestBody ( ) . toString ( ) ;
17+ if ( body . length ( ) != 0 ) {
18+ string += "--data='" + addSlashes ( body ) + "'" ;
19+ }
20+ var selected = new java . awt . datatransfer . StringSelection ( string ) ;
21+ var clipboard = java . awt . Toolkit . getDefaultToolkit ( ) . getSystemClipboard ( ) ;
22+ clipboard . setContents ( selected , null ) ;
23+ print ( string ) ;
24+ }
25+
26+ function addSlashes ( body ) {
27+ var a = { }
28+ a [ body ] = 1 ;
29+ return JSON . stringify ( a ) . slice ( 2 , - 4 ) ;
30+ }
You can’t perform that action at this time.
0 commit comments