Changeset 28
- Timestamp:
- 12/21/12 22:44:29 (12 years ago)
- Location:
- trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bin/bletchley-analyze
r13 r28 29 29 30 30 31 parser = argparse.ArgumentParser(description='Analyzes samples of encrypted data in an attempt to decode samples to binary and identify patterns useful in cryptanalysis.') 31 parser = argparse.ArgumentParser( 32 description='Analyzes samples of encrypted data in an attempt to decode' 33 ' samples to binary and identify patterns useful in cryptanalysis.' 34 ' For more information, see: http://code.google.com/p/bletchley/wiki/Overview') 32 35 parser.add_argument('input_file', nargs='?', default=None, 33 help='File containing encrypted blobs to analyze, one per line. Omit to read from stdin.') 36 help='File containing encrypted blobs to analyze, one per' 37 ' line. Omit to read from stdin.') 34 38 parser.add_argument('-e', dest='encoding_chain', type=str, default=None, 35 help='Comma-separated sequence of formats used to encode the tokens, beginning with the last one applied. (default: auto-detect)') 39 help='Comma-separated sequence of formats used to encode' 40 ' the tokens, beginning with the last one applied. ' 41 '(default: auto-detect. Use "?" for a listing of supported encodings.)') 36 42 parser.add_argument('-b', dest='block_size', type=int, default=8, 37 43 help='The block size displayed and used in highlighting (default: 8)') … … 44 50 options = parser.parse_args() 45 51 52 if options.encoding_chain == '?': 53 print('\n\t'.join(['Supported encodings:']+blobtools.supportedEncodings())) 54 sys.exit(0) 55 46 56 input_file = sys.stdin 47 57 if options.input_file is not None: 48 58 input_file = file(options.input_file, 'rb') 49 50 59 51 60 blobs = input_file.read().rstrip('\n').replace('\r', '').split('\n') -
trunk/bin/bletchley-decode
r20 r28 28 28 29 29 30 parser = argparse.ArgumentParser(description='A simple decoder script that is useful in shell scripts.') 31 parser.add_argument('input_file', nargs='?', default=None, 32 help='File containing encrypted blobs to analyze, one per line. Omit to read from stdin.') 33 parser.add_argument('-e', dest='encoding_chain', type=str, required=True, 34 help='Comma-separated sequence of encoding formats used to encode the token.') 30 parser = argparse.ArgumentParser( 31 description='A simple decoder script that is useful in shell scripts.' 32 ' For more information, see: http://code.google.com/p/bletchley/wiki/Overview') 33 parser.add_argument( 34 'input_file', nargs='?', default=None, 35 help='File containing encrypted blobs to analyze, one per line.' 36 ' Omit to read from stdin.') 37 parser.add_argument( 38 '-e', dest='encoding_chain', type=str, required=True, 39 help='Comma-separated sequence of encoding formats used to encode the token.' 40 ' (Use "?" for a listing of supported encodings.)') 35 41 options = parser.parse_args() 42 43 if options.encoding_chain == '?': 44 print('\n\t'.join(['Supported encodings:']+blobtools.supportedEncodings())) 45 sys.exit(0) 36 46 37 47 input_file = sys.stdin -
trunk/bin/bletchley-encode
r20 r28 28 28 29 29 30 parser = argparse.ArgumentParser(description='A simple encoder script that is useful in shell scripts.') 31 parser.add_argument('input_file', nargs='?', default=None, 32 help='File containing encrypted blobs to analyze, one per line. Omit to read from stdin.') 33 parser.add_argument('-e', dest='encoding_chain', type=str, required=True, 34 help='Comma-separated sequence of encoding formats used to encode the token, starting with the last encoding to apply.') 30 parser = argparse.ArgumentParser( 31 description='A simple encoder script that is useful in shell scripts.' 32 ' For more information, see: http://code.google.com/p/bletchley/wiki/Overview') 33 parser.add_argument( 34 'input_file', nargs='?', default=None, 35 help='File containing encrypted blobs to analyze, one per line. ' 36 'Omit to read from stdin.') 37 parser.add_argument( 38 '-e', dest='encoding_chain', type=str, required=True, 39 help='Comma-separated sequence of encoding formats used to encode the' 40 ' token, starting with the last encoding to apply.' 41 ' (Use "?" for a listing of supported encodings.)') 35 42 options = parser.parse_args() 43 44 if options.encoding_chain == '?': 45 print('\n\t'.join(['Supported encodings:']+blobtools.supportedEncodings())) 46 sys.exit(0) 36 47 37 48 input_file = sys.stdin … … 43 54 specified_encodings = options.encoding_chain.split(',') 44 55 specified_encodings.reverse() 56 # XXX: report invalid encodings 45 57 sys.stdout.write(blobtools.encodeChain(specified_encodings, blob)) 58 sys.stdout.write('\n') -
trunk/bin/bletchley-http2py
r14 r28 41 41 sys.exit(1) 42 42 43 parser = argparse.ArgumentParser(description='Process some integers.') 44 parser.add_argument('requestfile', type=file, nargs='?', default=sys.stdin, 45 help='A file containing an HTTP request. Defaults to stdin if omitted.') 46 parser.add_argument('--burp', action='store_true', help='Input file is a XML export from Burp. (First request in file is used.)') 43 parser = argparse.ArgumentParser( 44 description='A script which accepts an HTTP request and prints out a' 45 ' generated Python script which sends a similar request. This is useful' 46 ' when one wants to automate sending a large number of requests to a' 47 ' particular page or application.' 48 ' For more information, see: http://code.google.com/p/bletchley/wiki/Overview') 49 parser.add_argument( 50 'requestfile', type=file, nargs='?', default=sys.stdin, 51 help='A file containing an HTTP request. Defaults to stdin if omitted.') 52 parser.add_argument( 53 '--burp', action='store_true', help='Input file is a XML export from Burp.' 54 ' (First request in file is used.)') 47 55 args = parser.parse_args() 48 56 -
trunk/lib/bletchley/blobtools.py
r20 r28 324 324 encodings["%s/%s" % (enc.name, d)] = e 325 325 326 def supportedEncodings(): 327 e = encodings.keys() 328 e.sort() 329 return e 330 326 331 327 332 def possibleEncodings(blob):
Note: See TracChangeset
for help on using the changeset viewer.