--- Log opened Wed Nov 13 00:00:32 2019 |
00:01 | | ErikMesoy [Bruker@Nightstar-tqvql0.bb.online.no] has quit [Ping timeout: 121 seconds] |
00:06 | | Kindamoody is now known as Kindamoody[zZz] |
00:16 | | ErikMesoy [Bruker@Nightstar-tqvql0.bb.online.no] has joined #code |
00:16 | | mode/#code [+o ErikMesoy] by ChanServ |
01:37 | | Vornicus [Vorn@ServerAdministrator.Nightstar.Net] has quit [Connection closed] |
01:44 | | celmin|away is now known as celticminstrel |
02:30 | | Degi [Degi@Nightstar-d005jg.dyn.telefonica.de] has quit [Ping timeout: 121 seconds] |
02:31 | | Degi [Degi@Nightstar-dl5rba.dyn.telefonica.de] has joined #code |
02:33 | | Vorntastic [uid293981@Nightstar-6br85t.irccloud.com] has quit [[NS] Quit: Connection closed for inactivity] |
05:24 | | Derakon is now known as Derakon[AFK] |
06:02 | | celticminstrel [celticminst@Nightstar-lbhgah.dsl.bell.ca] has quit [[NS] Quit: And lo! The computer falls into a deep sleep, to awake again some other day!] |
06:20 | | himi [sjjf@Nightstar-1drtbs.anu.edu.au] has quit [Ping timeout: 121 seconds] |
07:21 | | Derakon [Derakon@Nightstar-f1lpvo.ca.comcast.net] has joined #code |
07:21 | | mode/#code [+ao Derakon Derakon] by ChanServ |
07:23 | | Derakon[AFK] [Derakon@Nightstar-f1lpvo.ca.comcast.net] has quit [Ping timeout: 121 seconds] |
08:24 | | himi [sjjf@Nightstar-v37cpe.internode.on.net] has joined #code |
08:24 | | mode/#code [+o himi] by ChanServ |
09:37 | | Vornicus [Vorn@ServerAdministrator.Nightstar.Net] has joined #code |
09:37 | | mode/#code [+qo Vornicus Vornicus] by ChanServ |
10:05 | < Yossarian> | Does #code have a specific pastebin or do we use termbin here? |
10:08 | <~Vornicus> | we don't have a specific pastebin |
10:09 | < Yossarian> | Looking for some C help, reading the excellent "orange" book, Expert C Programming: Deep C Secrets. |
10:13 | < Yossarian> | There is a cdecl implementation in the original The C Programming Language, but incomplete. A basical sytnax or lexer, if you will. |
10:13 | < Yossarian> | https://termbin.com/jy1ug |
10:13 | < Yossarian> | line 63, gcc gives me crap about the enum'd function classify.string() |
10:14 | < Yossarian> | cdecl.c: In function ???gettoken???: |
10:14 | < Yossarian> | cdecl.c:63:21: error: ???classify??? undeclared (first use in this function) |
10:14 | < Yossarian> | this.type = classify.string() |
10:15 | < Yossarian> | Sorry if you got question-marks around gettoken and classify in my output message, I don't know that I have UTF-8 support going through my ssh session through to screen and then weechat. |
10:18 | < Yossarian> | oh wait |
10:19 | < Yossarian> | ln 63 I'm calling classify.string instead of the function classify_string |
10:22 | < Yossarian> | got it, except it wants to read code line by line |
10:23 | | Kindamoody[zZz] is now known as Kindamoody |
10:24 | < Yossarian> | there is a cdecl website! https://cdecl.org/?q=void+%28*sqlite3OsDlSym%28void+*%2C+void+*%2C+const+char+*%29%29%28void%29%3B |
10:35 | < Yossarian> | Feeling a bit silly, if gettoken() is the input, how would I go about feeding the source to its own binary? |
10:36 | < Yossarian> | uses getchar() |
10:36 | < Yossarian> | https://termbin.com/vv47 fixed cdecl.c |
10:40 | < Yossarian> | ./cdecl.out | cat cdecl.c not the ticket |
10:41 | <&[R]> | ... |
10:41 | < Yossarian> | What? |
10:42 | <&[R]> | You are piping the output of your program into cat, cat is told to output the contents of cdcel.c and not read the standard input |
10:43 | < Yossarian> | so I want to redirect stdin |
10:43 | <&[R]> | Yes |
10:47 | < Yossarian> | I'm afraid I'm going to fuck this up somehow |
10:47 | <&[R]> | That's an inevitable part of learning |
10:48 | < Yossarian> | well I tarballed the files before I decided to start trying |
10:52 | < Yossarian> | ./cdecl.out < cdecl.c |
10:52 | < Yossarian> | it tries |
10:52 | < Yossarian> | it doesn't understand comments |
10:56 | < Yossarian> | and includes |
10:58 | <&[R]> | Preprocessor statements at all |
11:00 | < Yossarian> | well I'll have to add that and while in main() it will only get to one line and quit |
11:17 | < Yossarian> | Well, I copied some code. Maybe I'll end up writing some next. |
11:22 | < Yossarian> | I'd like to write a simple blackjack game, was playing blackjack online and swear to Christ the AIdealer has a priori knowledge of things. Stand on 20? Dealer will hit, get 21. |
12:31 | <&ToxicFrog> | One of the nice things about Blackjack is that you can easily make a pure-text implementation of it. |
12:32 | <@sshine> | https://github.com/sshine/sml-games/blob/master/blackjack.sml (sorry for the language mixture) |
12:34 | <@sshine> | and yes. |
12:34 | <@TheWatcher> | Good gods |
12:35 | <@TheWatcher> | I think it's been 22 years since I last looked at sml code |
12:35 | <@sshine> | :P |
12:35 | <@sshine> | I'm actually helping a friend with his MSc thesis where he's writing a compiler in SML. so I get to look at SML code almost every week. |
12:36 | <@TheWatcher> | ... writing a compiler in sml?! |
12:36 | <@sshine> | if SML is good for anything it's that. |
12:37 | | celticminstrel [celticminst@Nightstar-lbhgah.dsl.bell.ca] has joined #code |
12:37 | | mode/#code [+o celticminstrel] by ChanServ |
12:37 | <@sshine> | I'd have picked Haskell, but he was given a Hermes-to-C compiler and is asked to convert it to a Hermes-to-ARM compiler (where Hermes is an obscure research language) |
12:37 | <@sshine> | so the edit distance is slightly shorter if one sticks to SML. |
12:56 | < Yossarian> | <&ToxicFrog> One of the nice things about Blackjack is that you can easily make a pure-text implementation of it. |
12:57 | < Yossarian> | yeah I'll probably use ncurses or something at some point |
12:59 | <&ToxicFrog> | I wasn't even thinking curses, just simple text prompt to start with |
13:01 | <&[R]> | Setup the logic so the display and the logic are separate |
13:01 | <&[R]> | Do a CLI one first so the logic is solid |
13:01 | <&[R]> | Then start doing the curses one after |
13:01 | < Yossarian> | I have curses applications I wrote, now that I have access to my desktop... maybe I can check out a samba share |
13:14 | < Yossarian> | whoa |
13:14 | < Yossarian> | bad code |
13:14 | < Yossarian> | windows.h won't do |
13:15 | < Yossarian> | /* to invoke Beep(); */ - that's a fair comment, by comment game, yknow? |
13:15 | < Yossarian> | s/by/my/g |
13:20 | < Yossarian> | this uses a function called getch(), so... apparently ncurses has it in it |
13:20 | | You're now known as TheWatcher[d00m] |
13:29 | < Yossarian> | cool curses has beep but had to change the case to lower and the arguments are void, whereas the windows library had beep with argument in frequency |
13:30 | <&[R]> | getch() is a function that DOS programs would use |
13:30 | <&[R]> | Didn't need a special header for it |
13:32 | < Yossarian> | looking for a way to replace the old Beep() to something that will beep with input being frequency and time played |
13:33 | <&ToxicFrog> | Yossarian: https://www.mkssoftware.com/docs/man3/curs_beep.3.asp |
13:33 | <&ToxicFrog> | beep(3) just emits a BEL character (causes the terminal to beep once) |
13:33 | <&ToxicFrog> | It sounds like you're after something that controls the PC speaker instead. |
13:34 | < Yossarian> | possible ioctl call |
13:35 | < Yossarian> | /dev/console can't be reached unless one is root, at least for me |
13:37 | < Yossarian> | sudo sh -c "echo -e '\a' > /dev/console" |
13:37 | < Yossarian> | seems to work |
13:38 | < Yossarian> | but I have a beep in /usr/bin/beep |
13:38 | <&[R]> | With the root escalation vuln? |
13:39 | < Yossarian> | I dunno, This program was written by Johnathan Nightingale (johnath@johnath.com) |
13:39 | < Yossarian> | July 2008, beep-1.3 |
13:40 | <&[R]> | Sounds like it does |
13:41 | < Yossarian> | you sure it wasn't fixed? you need to be superuser or own the current tty (local user) |
13:42 | < Yossarian> | according to the manpage |
13:43 | <&[R]> | CVE-2018-0492 |
13:43 | <&[R]> | Hint: that 2018? That's the year. |
13:43 | <&[R]> | https://holeybeep.ninja/ |
13:45 | <&ToxicFrog> | Yossarian: yeah, beep(1) uses the PC speaker, this is completely different from the beep(3) that curses includes |
13:52 | < Yossarian> | I'm looking at the CVE and the example code, so there is some synch or race condition? |
13:52 | < Yossarian> | does that apply to using ioctl, too? |
13:53 | | celticminstrel is now known as celmin|away |
13:55 | <&[R]> | The issue is in the beep binary |
13:55 | <&[R]> | Which is setuid |
13:55 | | * [R] looks at the patch, and is confused to as what it's actually fixing |
13:56 | <&ToxicFrog> | No, and the fact that you're asking that question in the first place -- along with the rest of this conversation -- really comes across like you're randomly flailing around without making any effort to understand what you're reading. |
13:57 | <&ToxicFrog> | Here's some details on the internals: https://news.ycombinator.com/item?id=16762794 |
13:59 | <&ToxicFrog> | tl;dr beep(1) has a race condition between the code that actually beeps and the signal handler. Properly exploited this lets you get beep to write attacker-controlled data to an arbitrary file. |
14:00 | <&ToxicFrog> | Since beep is traditionally installed setuid-root (runs as root even if invoked by non-root user, to allow it to access the PC speaker), this lets you write as you like to, say, /etc/sudoers or /root/.bashrc and there you have your priviledge escalation. |
14:00 | < Yossarian> | No, I just wanted to see the code. So I have to "port" this by finding another way to beep pc speaker or sound out |
14:08 | < Yossarian> | ToxicFrog: harsh toke, dude |
14:11 | < Yossarian> | whoa, do you guys have speaker-test from ALSA package? |
14:11 | < Yossarian> | one is not limited to... you can have a form of polyphony |
14:13 | < Yossarian> | might be under alsa-utils |
15:54 | | You're now known as TheWatcher |
17:08 | | Emmy [Emmy@Nightstar-9p7hb1.direct-adsl.nl] has joined #code |
17:20 | <&ToxicFrog> | Welp. Past Me has betrayed me yet again. |
17:20 | | * ToxicFrog tries to figure out how to get out of this without some truly disgusting merge conflicts |
17:45 | | * Alek remembers a beep-like in basic on his dos machine that took frequency and duration, he took a sample .bas playing William Tell Overture and made it play The Impossible Dream. |
17:46 | <@Alek> | the speaker was poor, though, not much frequency variation. |
18:02 | | Alek [Alek@Nightstar-o723m2.cicril.sbcglobal.net] has quit [[NS] Quit: brb] |
18:06 | | Alek [Alek@Nightstar-o723m2.cicril.sbcglobal.net] has joined #code |
18:06 | | mode/#code [+o Alek] by ChanServ |
22:43 | | himi [sjjf@Nightstar-v37cpe.internode.on.net] has quit [Ping timeout: 121 seconds] |
23:32 | | Emmy [Emmy@Nightstar-9p7hb1.direct-adsl.nl] has quit [Ping timeout: 121 seconds] |
--- Log closed Thu Nov 14 00:00:34 2019 |