From dfad3c9eae2bb9c0ec367497af2e82a3dfef4115 Mon Sep 17 00:00:00 2001 From: Carlos Polop Date: Thu, 2 May 2024 16:12:28 +0200 Subject: [PATCH] a --- consumer | Bin 0 -> 33704 bytes consumer.c | 37 ++++++++++++++++++ .../pentesting-rlogin.md | 4 +- 3 files changed, 39 insertions(+), 2 deletions(-) create mode 100755 consumer create mode 100644 consumer.c diff --git a/consumer b/consumer new file mode 100755 index 0000000000000000000000000000000000000000..637af6e1a02810c4c48879ab7769ec4361e1c0cd GIT binary patch literal 33704 zcmeI5U2GIp6vyxEv~*hvY_XEsLfHh=Vj5~i1&P)vr2^rj1RB%m!?o>B+YQ~_W|=#&0nQ%L!#@%rp|b#@T;(_`36YT)N^lvK)%m9>?!s%FP->u84k640n5 zZPaO!m9ctArECs49>c%JTSt497}ou^C+3lnHRI4Y_nvLrvSVxY#w|0z6KQ#o&(g=q zkZ?ZsqgMXoLL@jpe#!$htg-z8@*gFi*%XkDk)KWDK$j5AZa(QwQm61Tf9X#an&kvlNkX9&4h_rP+h!)hCbdznZ5{-2WKOc}X== zE6PG;tK;S_%Xoxl)%n!A5G8azj>GS{Q}}n+k@A}LKCGj^kv5kL<+D2;iJF1c8&*?Z z{s!yrhiKsV*AhawXTN9fB*=900@8p2!H?xfB*=900@8p z2!H?xfB*=900@8p2!H?xfB*=900@8p2!H?xfB*=900@8p2!H?xfB*=900@8p2!H?x zfB*=900@8p2!O!2KRQWJ??pA0V_qMUrZAdrK&0 zAH`fj^EYTOm9dU$qI+}&&Ht?H?`4utYrWUzi^;M1#w5i$b6c#^ilo;Oi|SJIc`xU~ zxv1YWDw2gNjxovcslJ`^Glr=4x0iFLy5n9x8|QaoSPo8iRGp%;C(r5fGQ}J4xQt2R zT5j3%9CnVwUg)qFJM1M6yU?=B0&y8>sSlez888E(a9l)M0y5NQ21OuH-zKU;!ALA% zhP`34(e&>%ee1msMslor;HCC6caB`!%eB7-jjUXs&SI$R+=c6hbE*EfVH^H>T0r=(I!DH z66~f3%8CVB{lPs}08NU;Y;mIkT^#KsO9on`*={z*qNZ#y>wRWeWC!Z~L9u|oQBE6J zc>5wwjD+)CLb`|y?w!CsrOP9mN~rfliqGFccdnPG`A?fV~U<5in^rL;!7*M&H^Df_e2#UEd4-uKJM`rWV8U1>QSZ(UW@|I@p!_LfUs zZ}cBH{eE5O!g$lUj4LA}dt5bjnYTJW?A(9o`?Ifaezo-E-PZL_|5#=8EiOLxe9%`u z`DOm)KM#~V@$HeDFJ2g`+ +#include +#include +#include +#include +#include + +int main() { + const char *name = "/my_shared_memory"; + const int SIZE = 4096; // Size of the shared memory object + + // Open the shared memory object + int shm_fd = shm_open(name, O_RDONLY, 0666); + if (shm_fd == -1) { + perror("shm_open"); + return EXIT_FAILURE; + } + + // Memory map the shared memory + void *ptr = mmap(0, SIZE, PROT_READ, MAP_SHARED, shm_fd, 0); + if (ptr == MAP_FAILED) { + perror("mmap"); + return EXIT_FAILURE; + } + + // Read from the shared memory + printf("Consumer received: %s\n", (char *)ptr); + + // Cleanup + munmap(ptr, SIZE); + close(shm_fd); + shm_unlink(name); // Optionally unlink + + return 0; +} + diff --git a/network-services-pentesting/pentesting-rlogin.md b/network-services-pentesting/pentesting-rlogin.md index 3e0932225..13d182313 100644 --- a/network-services-pentesting/pentesting-rlogin.md +++ b/network-services-pentesting/pentesting-rlogin.md @@ -14,7 +14,7 @@ Other ways to support HackTricks: -
+
{% embed url="https://websec.nl/" %} @@ -51,7 +51,7 @@ rlogin -l find / -name .rhosts ``` -
+
{% embed url="https://websec.nl/" %}