So you basically have some apps running in the background (or foreground) that are making those connections.
But what is X11? Is that like Wayland? ;-)
The database is embedded in the program. Specifically, it is this file:
https://github.com/h2337/connmap/blob/master/connmap/resourc...
Presumably generated by the author with this Python script
https://github.com/h2337/connmap/blob/master/tools/get-ip-da...
Which has now become some kind of meta-ironic fashion statement. It's 2025's going to the coffee shop with a typewriter.
Then you can import it under geo/viking port:
doas pkg_add viking
Open Viking and just load the geo.json file from /usr/local/share/markers/OpenBSD.geojson
void refreshConnections() {
ssOutput =
popen("ss -atun4 | grep ESTAB | awk '{print $6}' | cut -f1 -d\":\"", "r");
if (ssOutput == NULL) {
printf("Failed to run ss command\n");
exit(1);
}
}
edit: ssOutput is a global variable which is read elsewhere.
wslh•8h ago
char mapFilename[256]; strcat(strcpy(mapFilename, getenv("HOME")), RESOURCES); strcat(mapFilename, mapName);
h2337•8h ago
floating-io•8h ago
That's just off the top of my head; I've not written in C in a while.
h2337•8h ago
floating-io•7h ago
As to what could be accomplished with an overflow? I don't know; I'm not in security, and I don't sit around thinking of possible uses for various bugs when it comes to compromising systems.
Perhaps the most important thing to realize, though, is that you're distributing software publicly. Your security situation may not be the same as your user's security situation. Assumptions should not be made.
Something to keep in mind.
h2337•7h ago
floating-io•7h ago
db48x•4h ago
sedatk•8h ago
An unprivileged app could run your app (say, with more privileges), with a very long `HOME` environment path, causing a buffer overflow, and potentially exploit it to use your app's privileges to do more stuff than it was supposed to.
Basically, you should never use strcpy and strcat and but use the secure alternatives like strcpy_s and strcat_s, even when you know the source buffer would never exceed the destination size.
h2337•8h ago
Isn't it a moot point if unprivileged app can already run anything with more privileges? In normal operation, connmap requires no special privileges.
sedatk•7h ago
You can dismiss that possibility of course. But, as a general habit, it's best to use secure alternatives instead of mulling over probabilities every other line.
As a positive side-effect, the change would make your app not crash on systems with long HOME env paths.:)
DonHopkins•6h ago
h2337•7h ago
josephcsible•7h ago
im3w1l•6h ago