Cyber security

AppleConnect – Streamlining Local Network With Bonjour

AppleConnect is a small Swift wrapper around a Network TCP stream on the local network (using Bonjour for discovery).

Even though the transport is two-way, the API is built around a “service” that is offered by a single server and to which many clients can connect.

Usage

Setup for servers differs a little bit from that for clients. Once a connection is established, the channel is identical from both ends. All connections are encrypted using TLS-PSK derived from a shared key of your choosing.

Important

For security, you should generate the shared key using cryptographically appropriate random data. Sharing this key should be done out-of-band and is out of scope for AppleConnect.

For user-facing applications, one way you might do this is by generating a code on one device and asking the user to confirm it on the second one.

Setting Up The Server

A typical server should advertise its availability using Connection.advertise(forServiceType:name:key:). Attempts by clients to connect will show up as NWConnection objects, which you can pass to Connection.init(connection:) to complete the connection process.

Setting Up The Client

A client should browse for servers it wants to connect to. Connection.endpoints(forServiceType:) will asynchronously stream a list of available NWEndpoints, and once you’ve found an endpoint that you’d like to connect to, call Connection.init(endpoint:key:) to establish the connection using the shared encryption key.

Transferring Data

Both clients and servers can send data to each other using Connection.send(data:), and receive data by watching Connection.data.

Tamil S

Tamil has a great interest in the fields of Cyber Security, OSINT, and CTF projects. Currently, he is deeply involved in researching and publishing various security tools with Kali Linux Tutorials, which is quite fascinating.

Recent Posts

Bomber : Navigating Security Vulnerabilities In SBOMs

bomber is an application that scans SBOMs for security vulnerabilities. So you've asked a vendor…

16 hours ago

EmbedPayloadInPng : A Guide To Embedding And Extracting Encrypted Payloads In PNG Files

Embed a payload within a PNG file by splitting the payload across multiple IDAT sections.…

16 hours ago

Exploit Street – Navigating The New Terrain Of Windows LPEs

Exploit-Street, where we dive into the ever-evolving world of cybersecurity with a focus on Local…

3 days ago

ShadowDumper – Advanced Techniques For LSASS Memory Extraction

Shadow Dumper is a powerful tool used to dump LSASS (Local Security Authority Subsystem Service)…

4 days ago

Shadow-rs : Harnessing Rust’s Power For Kernel-Level Security Research

shadow-rs is a Windows kernel rootkit written in Rust, demonstrating advanced techniques for kernel manipulation…

2 weeks ago

ExecutePeFromPngViaLNK – Advanced Execution Of Embedded PE Files via PNG And LNK

Extract and execute a PE embedded within a PNG file using an LNK file. The…

3 weeks ago