Skip to content

Commit 736327c

Browse files
committed
Added two tamper scripts contributed by Roberto Salgado
1 parent 067354b commit 736327c

3 files changed

Lines changed: 125 additions & 23 deletions

File tree

doc/THANKS

Lines changed: 25 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@ Daniele Bellucci <daniele.bellucci@gmail.com>
3939

4040
Sebastian Bittig <s.bittig@r-tec.net> and the rest of the team at
4141
r-tec IT Systeme GmbH
42-
for providing with the DB2 fingerprint and enumeration support patch
42+
for contributing the DB2 support initial patch: fingerprint and
43+
enumeration
4344

4445
Anthony Boynes <aboynes@gmail.com>
4546
for reporting several bugs
@@ -54,7 +55,7 @@ Gianluca Brindisi <g@brindi.si>
5455
for reporting a couple of bugs
5556

5657
Jack Butler <fattredd@hotmail.com>
57-
for providing me with the sqlmap site favicon
58+
for contributing the sqlmap site favicon
5859

5960
Ulisses Castro <uss.thebug@gmail.com>
6061
for reporting a bug
@@ -70,7 +71,7 @@ Cesar Cerrudo <cesar@argeniss.com>
7071
http://www.argeniss.com/research/TokenKidnapping.pdf
7172

7273
Karl Chen <quarl@cs.berkeley.edu>
73-
for providing with the multithreading patch for the inference
74+
for contributing the initial multi-threading patch for the inference
7475
algorithm
7576

7677
Y P Chien <ypchien@cox.net>
@@ -113,9 +114,9 @@ Adam Faheem <faheem.adam@is.co.za>
113114
for reporting a few bugs
114115

115116
James Fisher <www@sittinglittleduck.com>
116-
for providing me with two very good feature requests
117+
for contributing two very good feature requests
117118
for his great tool too brute force directories and files names on
118-
web/application servers, Dir Buster, http://tinyurl.com/dirbuster
119+
web/application servers, DirBuster, http://tinyurl.com/dirbuster
119120

120121
Jim Forster <jimforster@goldenwest.com>
121122
for reporting a bug
@@ -161,7 +162,7 @@ Nico Golde <nico@ngolde.de>
161162

162163
Oliver Gruskovnjak <oliver.gruskovnjak@gmail.com>
163164
for reporting a bug
164-
for providing me with a minor patch
165+
for contributing a minor patch
165166

166167
Davide Guerri <d.guerri@caspur.it>
167168
for suggesting an enhancement
@@ -227,7 +228,7 @@ Sven Klemm <sven@c3d2.de>
227228
for reporting two minor bugs with PostgreSQL
228229

229230
Anant Kochhar <anant.kochhar@secureyes.net>
230-
for providing me with feedback on the user's manual
231+
for providing with feedback on the user's manual
231232

232233
Alexander Kornbrust <ak@red-database-security.com>
233234
for reporting a couple of bugs
@@ -239,10 +240,10 @@ Nicolas Krassas <krasn@deventum.com>
239240
for reporting a couple of bugs
240241

241242
Oliver Kuckertz <oliver.kuckertz@mologie.de>
242-
for providing a minor patch
243+
for contributing a minor patch
243244

244245
Alex Landa <landa.alex86@gmail.com>
245-
for providing a patch adding support for XML output
246+
for contributing a patch adding beta support for XML output
246247

247248
Guido Landi <lists@keamera.org>
248249
for reporting a couple of bugs
@@ -262,7 +263,7 @@ John J. Lee <jjl@pobox.com> & others
262263
forms when --forms switch is specified
263264

264265
Nico Leidecker <nico@leidecker.info>
265-
for providing me with feedback on a few features
266+
for providing with feedback on a few features
266267
for reporting a couple of bugs
267268
for his great tool icmpsh included in sqlmap tree to get a command
268269
prompt via an out-of-band tunnel over ICMP,
@@ -289,8 +290,7 @@ Michael Majchrowicz <mmajchrowicz@gmail.com>
289290
for suggesting a lot of ideas and features
290291

291292
Ferruh Mavituna <ferruh@mavituna.com>
292-
for providing me with ideas on the implementation of a couple of
293-
new features
293+
for sharing ideas on the implementation of a couple of features
294294

295295
David McNab <david@conscious.co.nz>
296296
for his XMLObject module that allows XML files to be operated on
@@ -300,11 +300,11 @@ Spencer J. McIntyre <smcintyre@securestate.com>
300300
for reporting a minor bug
301301

302302
Ahmad Maulana <matdhule@gmail.com>
303-
for providing one tamper scripts, halfversionedmorekeywords.py
303+
for contributing one tamper scripts, halfversionedmorekeywords.py
304304

305305
Enrico Milanese <enricomilanese@gmail.com>
306-
for reporting a bugs when using (-a) a single line User-Agent file
307-
for providing me with some ideas for the PHP backdoor
306+
for reporting a minor bug
307+
for sharing some ideas for the PHP backdoor
308308

309309
Devon Mitchell <devon.mitchell1988@yahoo.com>
310310
for reporting a minor bug
@@ -342,7 +342,7 @@ Shaohua Pan <pan@knownsec.com>
342342
for suggesting a few features
343343

344344
Antonio Parata <s4tan@ictsc.it>
345-
for providing me with some ideas for the PHP backdoor
345+
for sharing some ideas for the PHP backdoor
346346

347347
Adrian Pastor <ap@gnucitizen.org>
348348
for donating to sqlmap development
@@ -358,7 +358,7 @@ Mark Pilgrim <mark@diveintomark.org>
358358

359359
Steve Pinkham <steve.pinkham@gmail.com>
360360
for suggesting a feature
361-
for providing a new sql injection vector (MSSQL time based)
361+
for contributing a new SQL injection vector (MSSQL time-based blind)
362362
for donating to sqlmap development
363363

364364
Adam Pridgen <adam.pridgen@gmail.com>
@@ -402,6 +402,9 @@ Richard Safran <allapplyhere@yahoo.com>
402402
Tomoyuki Sakurai <cherry@trombik.org>
403403
for submitting to the FreeBSD project the sqlmap 0.5 port
404404

405+
Roberto Salgado <lightos@gmail.com>
406+
for contributing two tamper scripts
407+
405408
Pedro Jacques Santos Santiago <pedro__jacques@hotmail.com>
406409
for reporting considerable amount of bugs
407410

@@ -415,7 +418,7 @@ Jorge Santos <jorge_a_santos@hotmail.com>
415418
for reporting a minor bug
416419

417420
Sven Schluter <sschlueter@netzwerk.cc>
418-
for providing with a patch for waiting a number of seconds between
421+
for contributing a patch for waiting a number of seconds between
419422
each HTTP request
420423

421424
Ryan Sears <rdsears@mtu.edu>
@@ -433,8 +436,7 @@ Brian Shura <bshura@appsecconsulting.com>
433436
for reporting a bug
434437

435438
Sumit Siddharth <sid@notsosecure.com>
436-
for providing me with ideas on the implementation of a couple of
437-
features
439+
for sharing ideas on the implementation of a couple of features
438440

439441
Andre Silva <andreoaz@gmail.com>
440442
for reporting a bug
@@ -458,15 +460,15 @@ Jason Swan <jasoneswan@gmail.com>
458460
for suggesting a couple of improvements
459461

460462
Chilik Tamir <phenoman@gmail.com>
461-
for providing a patch for initial support SOAP requests
463+
for contributing a patch for initial support SOAP requests
462464

463465
Alessandro Tanasi <alessandro@tanasi.it>
464466
for extensively beta-testing sqlmap
465467
for suggesting many features and reporting some bugs
466468
for reviewing the documentation
467469

468470
Andres Tarasco <atarasco@gmail.com>
469-
for providing me with good feedback
471+
for contributing good feedback
470472

471473
Tom Thumb <k1971@live.co.uk>
472474
for reporting a major bug
@@ -505,7 +507,7 @@ Carlos Gabriel Vergara <carlosgabrielvergara@gmail.com>
505507
for suggesting couple of good features
506508

507509
Anthony Zboralski <anthony.zboralski@bellua.com>
508-
for providing me with detailed feedback
510+
for providing with detailed feedback
509511
for reporting a few minor bugs
510512
for donating to sqlmap development
511513

tamper/chardoubleencode.py

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
#!/usr/bin/env python
2+
3+
"""
4+
$Id$
5+
6+
Copyright (c) 2006-2011 sqlmap developers (http://sqlmap.sourceforge.net/)
7+
See the file 'doc/COPYING' for copying permission
8+
"""
9+
10+
import string
11+
12+
from lib.core.enums import PRIORITY
13+
14+
__priority__ = PRIORITY.LOW
15+
16+
def dependencies():
17+
pass
18+
19+
def tamper(payload):
20+
"""
21+
Double url-encodes all characters in a given payload (not processing
22+
already encoded)
23+
24+
Example:
25+
* Input: SELECT FIELD FROM%20TABLE
26+
* Output: %2553%2545%254c%2545%2543%2554%2520%2546%2549%2545%254c%2544%2520%2546%2552%254f%254d%2520%2554%2541%2542%254c%2545
27+
28+
Notes:
29+
* Useful to bypass some weak web application firewalls that do not
30+
double url-decode the request before processing it through their
31+
ruleset
32+
"""
33+
34+
retVal = payload
35+
36+
if payload:
37+
retVal = ""
38+
i = 0
39+
40+
while i < len(payload):
41+
if payload[i] == '%' and (i < len(payload) - 2) and payload[i+1] in string.hexdigits and payload[i+2] in string.hexdigits:
42+
retVal += payload[i:i+3]
43+
i += 3
44+
else:
45+
retVal += '%%25%X' % ord(payload[i])
46+
i += 1
47+
48+
return retVal

tamper/space2pound.py

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
#!/usr/bin/env python
2+
3+
"""
4+
$Id$
5+
6+
Copyright (c) 2006-2011 sqlmap developers (http://sqlmap.sourceforge.net/)
7+
See the file 'doc/COPYING' for copying permission
8+
"""
9+
10+
import os
11+
import random
12+
import string
13+
14+
from lib.core.common import singleTimeWarnMessage
15+
from lib.core.enums import DBMS
16+
from lib.core.enums import PRIORITY
17+
18+
__priority__ = PRIORITY.LOW
19+
20+
def dependencies():
21+
singleTimeWarnMessage("tamper script '%s' is only meant to be run against %s" % (os.path.basename(__file__)[:-3], DBMS.MYSQL))
22+
23+
def tamper(payload):
24+
"""
25+
Replaces space character (' ') with a pound character ('#') followed by
26+
a random string and a new line ('\n')
27+
28+
Example:
29+
* Input: 1 AND 9227=9227
30+
* Output: 1%23PTTmJopxdWJ%0AAND%23cWfcVRPV%0A9227=9227
31+
32+
Requirement:
33+
* MySQL
34+
35+
Tested against:
36+
* MySQL 5.0
37+
38+
Notes:
39+
* Useful to bypass several web application firewalls
40+
"""
41+
42+
retVal = ""
43+
44+
if payload:
45+
for i in xrange(len(payload)):
46+
if payload[i].isspace():
47+
randomStr = ''.join(random.choice(string.ascii_uppercase + string.lowercase) for x in range(random.randint(6, 12)))
48+
retVal += "%%23%s%%0A" % randomStr
49+
else:
50+
retVal += payload[i]
51+
52+
return retVal

0 commit comments

Comments
 (0)