This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python3 | |
| """ | |
| Generate ephemeral TURN credentials using a shared secret. | |
| TURN servers can use time-limited credentials where: | |
| - Username: <expiry_timestamp>:<username> | |
| - Password: Base64(HMAC-SHA1(shared_secret, username)) | |
| The expiry timestamp is a Unix timestamp indicating when the credentials expire. | |
| """ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import asyncio | |
| import json | |
| import ssl | |
| import websockets | |
| from websockets.server import WebSocketServerProtocol | |
| from aiohttp import web | |
| # Track per-connection state: streamSid + media counter | |
| client_state = {} # websocket -> {"streamSid": str | None, "media_count": int} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| -- Minimal Custom UDP Encapsulation Dissector | |
| -- Ignore the first 42 Bytes and treat the UDP payload as an IP frame | |
| -- This will show the content of encapsulated traffic | |
| local OUTER_UDP_PORT = 1024 -- default port. You can use "Decode as..." and choose UDP-ENCAP-IP | |
| local p_skip = Proto("udp_encap_ip", "UDP Encapsulated IP (skip 42 bytes)") | |
| local HEADER_SIZE = 42 | |
| local ip_dissector = Dissector.get("ip") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?xml version="1.0" encoding="iso-8859-2" ?> | |
| <!DOCTYPE scenario SYSTEM "sipp.dtd"> | |
| <scenario name="UAC INVITE + call"> | |
| <send retrans="500"> | |
| <![CDATA[ | |
| INVITE sip:[field3]@[field4]:5061;transport=tls SIP/2.0 | |
| Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/local/bin/python3 | |
| import json | |
| import argparse | |
| def rewrite_as_c_string(json_str): | |
| data = json.loads(json_str) | |
| formatted_json = json.dumps(data, indent=4) | |
| c_string = '"' + formatted_json.replace('"', '\\"').replace('\n', '\\n"\n"') + '"' | |
| return c_string |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import pyshark | |
| import opuslib | |
| import wave | |
| import argparse | |
| FRAME_SIZE = 960 | |
| SAMPLE_RATE = 48000 | |
| CHANNEL_COUNT = 1 | |
| SAMPLE_WIDTH = 2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/python3 | |
| import binascii | |
| import opuslib | |
| import wave | |
| total_len = 0 | |
| def process_audio_data(audio_data, wav_file): | |
| # print(binascii.hexlify(audio_data)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| gcc decrypt.c -o decrypt -lssl -lz -lcrypto | |
| encrypted="..." | |
| tag="..." | |
| iv="..." | |
| key="..." | |
| ./decrypt "${encrypted}" "${tag}" "${iv}" "${key}" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <stdio.h> | |
| #include <string.h> | |
| #include <openssl/evp.h> | |
| #include <openssl/rand.h> | |
| #include <openssl/bio.h> | |
| #include <openssl/buffer.h> | |
| #include <zlib.h> | |
| static char *base64_decode(const char *input, int length, int *output_length) { | |
| BIO *bio, *b64; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| F15 ACK Alice -> Proxy 1 | |
| ACK sip:bob@client.biloxi.example.com SIP/2.0 | |
| Via: SIP/2.0/TCP client.atlanta.example.com:5060;branch=z9hG4bK74b76 | |
| Max-Forwards: 70 | |
| Route: <sip:ss1.atlanta.example.com;lr>, | |
| <sip:ss2.biloxi.example.com;lr> | |
| From: Alice <sip:alice@atlanta.example.com>;tag=9fxced76sl | |
| To: Bob <sip:bob@biloxi.example.com>;tag=314159 | |
| Call-ID: 3848276298220188511@atlanta.example.com |
NewerOlder