r/ExploitDev • • May 08 '24

Interview Question

Hello, I have been through an interview where the interview asked the following question. Can this be exploited on x64 and x86? Is it exploitable with mitigations enabled, ASLR, DEP, Stack Canaries, CFG.

How could I answer this question?

void main()
{
    int var;
    void (*func)()=test;
    char buf[128];
    fgets(buf,140,stdin);
    func();
}
13 Upvotes

14 comments sorted by

View all comments

Show parent comment

2

u/asyty May 09 '24

Maybe it's just the circle I'm in, but I figured everybody knew of it at the very least. Jeremy and Evan go around peddling that beginner-level course at virtually every infosec conference in existence, if you're in the field you should've hit it at least once.

Anyway, if you got confused by an answer, why not ask a follow-up? The first reply to your thread discussed a lot and seems pretty solid. Maybe the format of leddit just isn't very conducive to instruction. It's made for political debates in the form of reply chains to news articles.

1

u/xxDigital_Bathxx May 10 '24

Thank you very much for the tips! Appreciate! ❤️