[a / b / c / d / e / f / g / gif / h / hr / k / m / o / p / r / s / t / u / v / vg / vm / vmg / vr / vrpg / vst / w / wg] [i / ic] [r9k / s4s / vip] [cm / hm / lgbt / y] [3 / aco / adv / an / bant / biz / cgl / ck / co / diy / fa / fit / gd / hc / his / int / jp / lit / mlp / mu / n / news / out / po / pol / pw / qst / sci / soc / sp / tg / toy / trv / tv / vp / vt / wsg / wsr / x / xs] [Settings] [Search] [Mobile] [Home]
Board
Settings Mobile Home
/g/ - Technology

Name
Options
Comment
Verification
4chan Pass users can bypass this verification. [Learn More] [Login]
File
  • Please read the Rules and FAQ before posting.
  • You may highlight syntax and preserve whitespace by using [code] tags.

08/21/20New boards added: /vrpg/, /vmg/, /vst/ and /vm/
05/04/17New trial board added: /bant/ - International/Random
10/04/16New board for 4chan Pass users: /vip/ - Very Important Posts
[Hide] [Show All]


[Advertise on 4chan]


File: 1724124941627724.webm (1.15 MB, 1080x1920)
1.15 MB
1.15 MB WEBM
previous: >>108244624

#define __NR_uname                63

https://man7.org/linux/man-pages/man2/uname.2.html

tl;dr:
get your kernel version

it's actually a bit more than just kernel version, though
struct utsname {
char sysname[]; /* Operating system name (e.g., "Linux") */
char nodename[]; /* Name within communications network to which the node is attached, if any */
char release[]; /* Operating system release (e.g., "2.6.28") */
char version[]; /* Operating system version */
char machine[]; /* Hardware type identifier */
#ifdef _GNU_SOURCE
char domainname[]; /* NIS or YP domain name */
#endif
};

useful for what it does, and quite literally nothing else lol

if you want to be nice and help keep the thread bumped, run
uname -a
and post the results ITT. or, if you're feeling adventurous, use the syscall together with a
__builtin_dump_struct
and print it nicely formatted into a struct

relevant resources:
man man

man syscalls

https://man7.org/linux/man-pages/
https://linux.die.net/man/
https://elixir.bootlin.com/linux/
https://elixir.bootlin.com/musl/
https://elixir.bootlin.com/glibc/
>>
File: uname.png (15 KB, 1184x170)
15 KB
15 KB PNG
:^)
>>
>>108252317
That bitch inspires so much confidence. I'm glad the world is underpinned by such competent security personnel keeping it from blowing up on itself.
>>
I didn't know that uname is a syscall nor that it's defined in posix. I thought it was linux specific and that uname read data from /proc
>>
>>108252317
>
__builtin_dump_struct

Amazin, I didn't know about this
>>
>>108252521
it's one of my favorite builtins. especially in newer versions of clang, it looks so nice
my biggest complaint is that it doesn't always print out strings correctly, and it prints uintptrs in base 10
>>108252505
i believe proc displays different (but similar) info. there is definitely some overlap, though
>>
>>108252544
>my biggest complaint is that it doesn't always print out strings correctly
I haven't tested it yet but what do you mean specifically?
>>
>>108252317
Wood
>>
>>108252553
i can't remember off the top of my head, but it's something to the effect of not printing when the string is a pointer, only when it's an array
>>
>>108252602
Ah I see, that kinda makes sense. Thanks.
>>
>>108252443
So THIS is the "power" of PowerShell... wow...
>>
>>108252317
How does anyone see shit like this and not go psycho
>>
>>108252317
At my college, the associate's in cyber security requires Python.
>>
>>108252688
what a fucking meme degree. associate's in cyber security. double whammy
>>
>>108252317
Linux localhost 6.1.162-android14 [REDACTED] #1 SMP PREEMPT [REDACTED] aarch64 Android
>>
>>108252317
>you don't need skills
>you don't need a certificate
>just get the skills and certifications
?
Rage bait?
>>
I love to have sex.
>>
>>108253084
proof?
>>
>>108253152
Illegal where I live ("revenge porn").
>>
Linux bazzite 6.17.7-ba25.fc43.x86_64 #1 SMP PREEMPT_DYNAMIC Mon Jan 19 05:47:43 UTC 2026 x86_64 GNU/Linux
>>108252688
Python is useful for cyber security as a scripting language. I don't know if it's the only language you should consider though.
>>
>>108252317
reminds me of the auxv from the sysv abi, that one is similar
>>
uuh well. if they were char pointers clang might try to print them as strings?
>>
>>108252317
I hate tiktok and that whole generation so fucking much it's unreal.
>>
why are women so cringe?
>>
>>108254665
Use puts not printf, you sent it as the format string and it will crash if there is a % anywhere in the strings
>>
>>108252317
Is that the new ceo of XBOX?
>>
>>108252317
any field that starts getting represented by women is a dead field and won't be around in a decade after ai wipes out most white collar work. cybersecurity is done for, start finding work in construction or oil fields.
>>
>>108256276
According to clang documentation you should use printf https://clang.llvm.org/docs/LanguageExtensions.html#builtin-dump-struct
>>
>>108253177
get someone to consent to it
>>108254665
uggghhhh it's so frustrating when it pulls this shit
>>108255908
we just can't help it :^)
>>
bampu
>>
>>108252317
I can pentest her
>>
File: 2nd try.png (61 KB, 760x500)
61 KB
61 KB PNG
>>108256276
no, puts doesn't work, complaining about too many arguments.
>>108257416
char pointers werked
>>
>>108252317
Linux x-MS-7A34 6.17.0-14-generic #14~24.04.1-Ubuntu SMP PREEMPT_DYNAMIC Thu Jan 15 15:52:10 UTC 2 x86_64 x86_64 x86_64 GNU/Linux
>>
>>108261514
yeah okay, that's what it was. really bizarre, right? you'd think a char buffer would be even safer to print than a pointer. who knows why they do the things that they do
but they could at least have the decency to hexdump the buffer
>>
Darwin 192.168.1.42 25.2.0 Darwin Kernel Version 25.2.0: Tue Nov 18 21:09:55 PST 2025; root:xnu-12377.61.12~1/RELEASE_ARM64_T8103 arm64
>>
>>108254665
I've also just noticed that clang gives up on the declarator and just prints the type name using Java-esque type declaration.
>>
>>108263423
what do you mean?
>>
File: crimes.png (42 KB, 749x418)
42 KB
42 KB PNG
>>108263501
look at the type of of sysname etc.
char[65] sysname = [some hex number]

in C the brackets would be on the other side of the variable name, so I thought that clang does aways with accurate type information.

What it actually does it print the abstract declarator, followed by the variable name, see picrel
>>
>>108263588
oh yeah it unwraps all the typedefs
>>
>>108263673
I'm sure it does, but that's not what I meant
>>
>>108263720
well i have no idea what you're talking about then, i'm sorry to say
>>
>>108263748
right so. in C, types you define go somewhat unusually to the left AND the right of the variable you're defining.
so an array of pointers to integers in C is
int *array[]

not
int []*array

as you might expect. Above in >>108254665, the types were listed as char[65], which is why it seemed to me that clang's formatter there disregarded strict allegiance to C typing rules. further experiments in >>108263588 however, concluded that that wasn't the case, and instead clang just prints out the abstract declarator, followed by the variable name.
the abstract declarator is a piece of C grammar, which can be used to describe a type, such as in function prototypes or in the argument of sizeof etc., without an intervening type name.
and it turns out that that is what clang is using when dumping structs.
>>
>>108266987
oohhh i was totally thinking about the wrong brackets
yes, that makes a lot more sense now. thank you for explaining



[Advertise on 4chan]

Delete Post: [File Only] Style:
[Disable Mobile View / Use Desktop Site]

[Enable Mobile View / Use Mobile Site]

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.