Skip to content
This repository has been archived by the owner on Dec 29, 2022. It is now read-only.

Commit

Permalink
Add -wait flag
Browse files Browse the repository at this point in the history
  • Loading branch information
rgov committed Jul 27, 2018
1 parent babefc9 commit 6d76620
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions ssl_logger.py
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@
ssl_sessions = {}


def ssl_log(process, pcap=None, verbose=False):
def ssl_log(process, pcap=None, verbose=False, wait=False):

This comment has been minimized.

Copy link
@beerdonut

beerdonut Jul 29, 2018

"""Decrypts and logs a process's SSL traffic.
Hooks the functions SSL_read() and SSL_write() in a given process and logs
Expand Down Expand Up @@ -353,6 +353,13 @@ def on_message(message, data):
log_pcap(pcap_file, p["ssl_session_id"], p["function"], p["src_addr"],
p["src_port"], p["dst_addr"], p["dst_port"], data)

while wait:
try:
frida.get_local_device().get_process(process)
break
except frida.ProcessNotFoundError:
time.sleep(0.1)

session = frida.attach(process)

if pcap:
Expand Down Expand Up @@ -407,13 +414,15 @@ def error(self, message):
""")

args = parser.add_argument_group("Arguments")
args.add_argument("-pcap", metavar="<path>", required=False,

This comment has been minimized.

Copy link
@beerdonut
args.add_argument("-pcap", metavar="<path>",
help="Name of PCAP file to write")
args.add_argument("-verbose", required=False, action="store_const",
const=True, help="Show verbose output")
args.add_argument("-verbose", action="store_true",
help="Show verbose output")
args.add_argument("-wait", action="store_true",
help="Wait for the process")
args.add_argument("process", metavar="<process name | process id>",
help="Process whose SSL calls to log")
parsed = parser.parse_args()

ssl_log(int(parsed.process) if parsed.process.isdigit() else parsed.process,
parsed.pcap, parsed.verbose)
parsed.pcap, parsed.verbose, parsed.wait)

0 comments on commit 6d76620

Please sign in to comment.