1808: "Hacking"

This forum is for the individual discussion thread that goes with each new comic.

Moderators: Moderators General, Prelates, Magistrates

Mikeski
Posts: 1044
Joined: Sun Jan 13, 2008 7:24 am UTC
Location: Minnesota, USA

1808: "Hacking"

Postby Mikeski » Wed Mar 08, 2017 5:52 am UTC

Image

Title text: "The dump also contains a list of millions of prime factors, a 0-day Tamagotchi exploit, and a technique for getting gcc and bash to execute arbitrary code."

The CIA got wikileaks to redact the part about the tool knowing what to do with the words "at" and "dot". Sinister!

User avatar
rhomboidal
Posts: 791
Joined: Wed Jun 15, 2011 5:25 pm UTC
Contact:

Re: 1808: "Hacking"

Postby rhomboidal » Wed Mar 08, 2017 6:01 am UTC

No data is safe from the savage, merciless ravages of regex.

User avatar
The Moomin
Posts: 343
Joined: Wed Oct 13, 2010 6:59 am UTC
Location: Yorkshire

Re: 1808: "Hacking"

Postby The Moomin » Wed Mar 08, 2017 9:35 am UTC

They've found out that POKE 35136,0 gets you infinite lives.
I possibly don't pay enough attention to what's going on.
I help make architect's dreams flesh.

User avatar
Soupspoon
You have done something you shouldn't. Or are about to.
Posts: 3728
Joined: Thu Jan 28, 2016 7:00 pm UTC
Location: 53-1

Re: 1808: "Hacking"

Postby Soupspoon » Wed Mar 08, 2017 10:03 am UTC

"Sudo tell me all your passwords"

itaibn
Posts: 141
Joined: Mon Dec 29, 2008 7:06 pm UTC

Re: 1808: "Hacking"

Postby itaibn » Wed Mar 08, 2017 11:44 am UTC

Does gcc have any features that let you run arbitrary code? After all it's a compiler, not an interpreter.
I NEVER use all-caps.

Lucia
Posts: 95
Joined: Sun May 09, 2010 1:35 am UTC

Re: 1808: "Hacking"

Postby Lucia » Wed Mar 08, 2017 12:16 pm UTC

I don't know if the title text is sincere or not but I do know there's a secret CIA emoji file in the vault.
Wildhound wrote:Nobody ever sigs me. I think it's because I never say anything clever.

speising
Posts: 2288
Joined: Mon Sep 03, 2012 4:54 pm UTC
Location: wien

Re: 1808: "Hacking"

Postby speising » Wed Mar 08, 2017 12:26 pm UTC

itaibn wrote:Does gcc have any features that let you run arbitrary code? After all it's a compiler, not an interpreter.

https://en.wikipedia.org/wiki/Template_metaprogramming

User avatar
cellocgw
Posts: 1956
Joined: Sat Jun 21, 2008 7:40 pm UTC

Re: 1808: "Hacking"

Postby cellocgw » Wed Mar 08, 2017 1:33 pm UTC

rhomboidal wrote:No data is safe from the savage, merciless ravages of regex.


Except for XHTML
https://app.box.com/witthoftresume
Former OTTer
Vote cellocgw for President 2020. #ScienceintheWhiteHouse http://cellocgw.wordpress.com
"The Planck length is 3.81779e-33 picas." -- keithl
" Earth weighs almost exactly π milliJupiters" -- what-if #146, note 7

Spambot5546
Posts: 1466
Joined: Thu Apr 29, 2010 7:34 pm UTC

Re: 1808: "Hacking"

Postby Spambot5546 » Wed Mar 08, 2017 2:11 pm UTC

TIL you can have a space in your email address.
"It is bitter – bitter", he answered,
"But I like it
Because it is bitter,
And because it is my heart."

User avatar
orthogon
Posts: 3006
Joined: Thu May 17, 2012 7:52 am UTC
Location: The Airy 1830 ellipsoid

Re: 1808: "Hacking"

Postby orthogon » Wed Mar 08, 2017 2:57 pm UTC

itaibn wrote:Does gcc have any features that let you run arbitrary code? After all it's a compiler, not an interpreter.

It really ought to have a switch to execute the output file automatically. Another thing it ought to have is a warning when you're about to overwrite the input source file with the output. That's a favourite trick of mine. It's ok if you get it right first time and don't need to modify it later.
xtifr wrote:... and orthogon merely sounds undecided.

User avatar
pogrmman
Posts: 552
Joined: Wed Jun 29, 2016 10:53 pm UTC
Location: Probably outside

Re: 1808: "Hacking"

Postby pogrmman » Wed Mar 08, 2017 2:59 pm UTC

itaibn wrote:Does gcc have any features that let you run arbitrary code? After all it's a compiler, not an interpreter.


Because it mentions gcc and bash in tandem, I was thinking something simple like:

Code: Select all

$ gcc code.c -o code
$ ./code


Not some way to get just gcc to execute code.
Last edited by pogrmman on Wed Mar 08, 2017 3:07 pm UTC, edited 1 time in total.

Mutex
Posts: 1388
Joined: Wed Jan 09, 2008 10:32 pm UTC

Re: 1808: "Hacking"

Postby Mutex » Wed Mar 08, 2017 3:05 pm UTC

Spambot5546 wrote:TIL you can have a space in your email address.

I too was thinking "huh, a space can be a valid character in an email address?" - but then it occurred to me they probably mean when someone posts their email address somewhere, and writes it "username @ domain.com" to try and avoid any bots harvesting it.

User avatar
ahammel
My Little Cabbage
Posts: 2135
Joined: Mon Jan 30, 2012 12:46 am UTC
Location: Vancouver BC
Contact:

Re: 1808: "Hacking"

Postby ahammel » Wed Mar 08, 2017 3:10 pm UTC

Spambot5546 wrote:TIL you can have a space in your email address.

Fun fact: this_is(technically a perfectly valid address)@accordingtotheoriginalspec.com
He/Him/His/Alex
God damn these electric sex pants!

User avatar
Xenomortis
Not actually a special flower.
Posts: 1426
Joined: Thu Oct 11, 2012 8:47 am UTC

Re: 1808: "Hacking"

Postby Xenomortis » Wed Mar 08, 2017 3:23 pm UTC

orthogon wrote:
itaibn wrote:Does gcc have any features that let you run arbitrary code? After all it's a compiler, not an interpreter.

It really ought to have a switch to execute the output file automatically. Another thing it ought to have is a warning when you're about to overwrite the input source file with the output. That's a favourite trick of mine. It's ok if you get it right first time and don't need to modify it later.

Real Programmers get it right first time.
Or if they don't, it's easier to patch the binary.
Image

Cave Wizard
Posts: 35
Joined: Sat Jan 16, 2010 2:10 am UTC

Re: 1808: "Hacking"

Postby Cave Wizard » Wed Mar 08, 2017 3:26 pm UTC

Anyone got a link to that tamagotchi exploit?

User avatar
pogrmman
Posts: 552
Joined: Wed Jun 29, 2016 10:53 pm UTC
Location: Probably outside

Re: 1808: "Hacking"

Postby pogrmman » Wed Mar 08, 2017 3:34 pm UTC

orthogon wrote:
itaibn wrote:Does gcc have any features that let you run arbitrary code? After all it's a compiler, not an interpreter.

It really ought to have a switch to execute the output file automatically. Another thing it ought to have is a warning when you're about to overwrite the input source file with the output. That's a favourite trick of mine. It's ok if you get it right first time and don't need to modify it later.


That would be a great switch to have -- what's the first thing most people do after compiling? Run the executable they just made. Why not make it easier?

User avatar
Flumble
Yes Man
Posts: 2082
Joined: Sun Aug 05, 2012 9:35 pm UTC

Re: 1808: "Hacking"

Postby Flumble » Wed Mar 08, 2017 3:37 pm UTC

Xenomortis wrote:Or if they don't, it's easier to patch the binary.

Damn, I'll never be a real programmer in any modern language. (I'd rather write the whole code again than figure out where the hell that foldl call has gone)

User avatar
chridd
Has a vermicelli title
Posts: 830
Joined: Tue Aug 19, 2008 10:07 am UTC
Location: ...Earth, I guess?
Contact:

Re: 1808: "Hacking"

Postby chridd » Wed Mar 08, 2017 4:03 pm UTC

cellocgw wrote:
rhomboidal wrote:No data is safe from the savage, merciless ravages of regex.


Except for XHTML

Code: Select all

<[^<>&="' \t\r\n]+([ \t\r\n]+[^<>&="' \t\r\n]+[ \t\r\n]*=[ \t\r\n]*("[^"]*"|'[^']*'))*[ \t\r\n]*>
(note that this doesn't check that it's valid—there are characters this regular expression allows in names that the spec doesn't allow; it could be modified to check for them, but it would be much longer)
~ chri d. d. /tʃɹɪ.di.di/ (Phonotactics, schmphonotactics) · she(?)(?(?)(?))(?(?(?))(?))(?) · Forum game scores
mittfh wrote:I wish this post was very quotable...
chridd (on Discord) wrote:
Dummy wrote:Sorry You're Gay Dads
SYG'D
marionic (on Discord) wrote:sleep in grave

User avatar
Flumble
Yes Man
Posts: 2082
Joined: Sun Aug 05, 2012 9:35 pm UTC

Re: 1808: "Hacking"

Postby Flumble » Wed Mar 08, 2017 5:08 pm UTC

chridd wrote:
cellocgw wrote:
rhomboidal wrote:No data is safe from the savage, merciless ravages of regex.


Except for XHTML

Code: Select all

<[^<>&="' \t\r\n]+([ \t\r\n]+[^<>&="' \t\r\n]+[ \t\r\n]*=[ \t\r\n]*("[^"]*"|'[^']*'))*[ \t\r\n]*>
(note that this doesn't check that it's valid—there are characters this regular expression allows in names that the spec doesn't allow; it could be modified to check for them, but it would be much longer)

Note that it merely matches a single start or end tag, no self-closing tags, no escaped quotes inside string attributes, doesn't check for semantic constraints (like not having the same attribute multiple times), does allow < in attribute values, doesn't check for valid &entities; in values and probably lots more (mostly semantics).

Yes, you'd better use an XML parser.

User avatar
somitomi
Posts: 656
Joined: Fri Nov 06, 2015 11:21 pm UTC
Location: can be found in Hungary
Contact:

Re: 1808: "Hacking"

Postby somitomi » Wed Mar 08, 2017 5:38 pm UTC

Mutex wrote:
Spambot5546 wrote:TIL you can have a space in your email address.

I too was thinking "huh, a space can be a valid character in an email address?" - but then it occurred to me they probably mean when someone posts their email address somewhere, and writes it "username @ domain.com" to try and avoid any bots harvesting it.

Pros use the format username(at)roundaboutreferencetodomain(dot)TLD. Translating the domain name (example: gmail-->gposta) or spelling it phonetically is also common where I live.
—◯-◯

Tub
Posts: 410
Joined: Wed Jul 27, 2011 3:13 pm UTC

Re: 1808: "Hacking"

Postby Tub » Wed Mar 08, 2017 6:09 pm UTC

pogrmman wrote:That would be a great switch to have -- what's the first thing most people do after compiling? Run the executable they just made. Why not make it easier?

The switch is called

Code: Select all

&& ./a.out

and must be appended at the end of the command line. :roll:

User avatar
chridd
Has a vermicelli title
Posts: 830
Joined: Tue Aug 19, 2008 10:07 am UTC
Location: ...Earth, I guess?
Contact:

Re: 1808: "Hacking"

Postby chridd » Wed Mar 08, 2017 6:17 pm UTC

Flumble wrote:
chridd wrote:
cellocgw wrote:
rhomboidal wrote:No data is safe from the savage, merciless ravages of regex.


Except for XHTML

Code: Select all

<[^<>&="' \t\r\n]+([ \t\r\n]+[^<>&="' \t\r\n]+[ \t\r\n]*=[ \t\r\n]*("[^"]*"|'[^']*'))*[ \t\r\n]*>
(note that this doesn't check that it's valid—there are characters this regular expression allows in names that the spec doesn't allow; it could be modified to check for them, but it would be much longer)

Note that it merely matches a single start or end tag, no self-closing tags, no escaped quotes inside string attributes, doesn't check for semantic constraints (like not having the same attribute multiple times), does allow < in attribute values, doesn't check for valid &entities; in values and probably lots more (mostly semantics).

Yes, you'd better use an XML parser.
(oops, I meant to also exclude /; it's supposed to only match opening tags)
It answers the question that was asked. Given a well-formed XML document, it matches opening tags. The question wasn't asking to validate the document or check for well-formedness. Most of the time, validating the document isn't what people want to do; they want to extract data from a document given the assumption that it's valid. You can extract data from an XML/XHTML/HTML document in a known format with regular expressions. You can find tags in an XML/XHTML/HTML document with regular expressions. You can parse or validate an XML/XHTML/HTML document with the a combination of regular expressions and other code. You can't write a single regular expression that matches valid or well-formed documents and rejects others, but that's okay, because no one's trying to do that in the first place. (The main thing that you can't do that someone might want to do is make a regular expression that matches an entire element that might include nested elements of the same type.)
(Also there needs to be some additional processing to deal with comments and CDATA sections; but that can be done with regular expressions as well. Also, this doesn't necessarily mean that using regular expressions is a better idea than using a parser; that depends more on what one is trying to do and what tools are most readily available.)
~ chri d. d. /tʃɹɪ.di.di/ (Phonotactics, schmphonotactics) · she(?)(?(?)(?))(?(?(?))(?))(?) · Forum game scores
mittfh wrote:I wish this post was very quotable...
chridd (on Discord) wrote:
Dummy wrote:Sorry You're Gay Dads
SYG'D
marionic (on Discord) wrote:sleep in grave

User avatar
Keyman
Posts: 311
Joined: Thu Jun 19, 2014 1:56 pm UTC

Re: 1808: "Hacking"

Postby Keyman » Wed Mar 08, 2017 8:29 pm UTC

somitomi wrote:
Mutex wrote:
Spambot5546 wrote:TIL you can have a space in your email address.

I too was thinking "huh, a space can be a valid character in an email address?" - but then it occurred to me they probably mean when someone posts their email address somewhere, and writes it "username @ domain.com" to try and avoid any bots harvesting it.

Pros use the format username(at)roundaboutreferencetodomain(dot)TLD. Translating the domain name (example: gmail-->gposta) or spelling it phonetically is also common where I live.

Here's one I use often lately, especially when the checkout clerk at the retail stores ask "what's your email?"

nunna@your.biz

Harvest that one all you want!! :mrgreen:
Nothing could be more ill-judged than that intolerant spirit which has, at all times, characterized political parties. - A. Hamilton

User avatar
Soupspoon
You have done something you shouldn't. Or are about to.
Posts: 3728
Joined: Thu Jan 28, 2016 7:00 pm UTC
Location: 53-1

Re: 1808: "Hacking"

Postby Soupspoon » Wed Mar 08, 2017 9:24 pm UTC

invalid@invalid.invalid should work, if you want to legitimately fake a dead-end without then risking landing on a real account. Unless the validation script is actually designed1 to reject that mandated usable-but-GNDN TLD.

Skip straight to <inserttopicaljokehere>@whitehouse.gov, though, if I'm feeling like it and not too worried about a semi-formal memo to the NSA to backtrack my identity... ;)


1 And not so stupid as to reject even stuff like my legitimate ".me.uk" domain, which would normally make me change that to ".me.uk.com" and let someone else (and the "uk.com" domain owner) deal with the fallout of their limited knowledge of secondary-level UK domains.

User avatar
pogrmman
Posts: 552
Joined: Wed Jun 29, 2016 10:53 pm UTC
Location: Probably outside

Re: 1808: "Hacking"

Postby pogrmman » Thu Mar 09, 2017 2:06 am UTC

Tub wrote:
pogrmman wrote:That would be a great switch to have -- what's the first thing most people do after compiling? Run the executable they just made. Why not make it easier?

The switch is called

Code: Select all

&& ./a.out

and must be appended at the end of the command line. :roll:


Of course I know that -- but it's still much, much more to type than a switch like whatever.

jgh
Posts: 116
Joined: Thu Feb 03, 2011 1:04 pm UTC

Re: 1808: "Hacking"

Postby jgh » Thu Mar 09, 2017 3:33 am UTC

My email address on my CV is an image, which results in CV assessment services complaining there's no email address in my CV.

xtifr
Posts: 336
Joined: Wed Oct 01, 2008 6:38 pm UTC

Re: 1808: "Hacking"

Postby xtifr » Thu Mar 09, 2017 7:16 am UTC

pogrmman wrote:That would be a great switch to have -- what's the first thing most people do after compiling? Run the executable they just made. Why not make it easier?


Actually, the first thing I do after compiling is usually linking. So, if anything, it should be a switch to ld. :P

But the next thing I usually do after compiling and linking (which I usually spell "make" or "cmake" or something like that), is run something like "make test".
"[T]he author has followed the usual practice of contemporary books on graph theory, namely to use words that are similar but not identical to the terms used in other books on graph theory."
-- Donald Knuth, The Art of Computer Programming, Vol I, 3rd ed.

User avatar
Carlington
Posts: 1588
Joined: Sun Mar 22, 2009 8:46 am UTC
Location: Sydney, Australia.

Re: 1808: "Hacking"

Postby Carlington » Thu Mar 09, 2017 7:32 am UTC

pogrmman wrote:
Tub wrote:
pogrmman wrote:That would be a great switch to have -- what's the first thing most people do after compiling? Run the executable they just made. Why not make it easier?

The switch is called

Code: Select all

&& ./a.out

and must be appended at the end of the command line. :roll:


Of course I know that -- but it's still much, much more to type than a switch like whatever.

Say you want -R to be the switch to run after compiling. Just append the line -R = && ./a.out to /etc/profile
Problem solved, right?
Kewangji: Posdy zwei tosdy osdy oady. Bork bork bork, hoppity syphilis bork.

Eebster the Great: What specifically is moving faster than light in these examples?
doogly: Hands waving furiously.

Please use he/him/his pronouns when referring to me.

Tub
Posts: 410
Joined: Wed Jul 27, 2011 3:13 pm UTC

Re: 1808: "Hacking"

Postby Tub » Thu Mar 09, 2017 7:45 am UTC

xtifr wrote:Actually, the first thing I do after compiling is usually linking.

Really? The first thing I do after compiling is to fix all the typos that caused the compilation to fail.

If only gcc had a switch to automatically run that step.

User avatar
Xenomortis
Not actually a special flower.
Posts: 1426
Joined: Thu Oct 11, 2012 8:47 am UTC

Re: 1808: "Hacking"

Postby Xenomortis » Thu Mar 09, 2017 10:21 am UTC

xtifr wrote:But the next thing I usually do after compiling and linking (which I usually spell "make" or "cmake" or something like that), is run something like "make test".

Configure gcc to launch gdb straight after compiling and linking - we all know it won't be working right, might as well save some typing.
Image

spilk
Posts: 3
Joined: Fri Jan 06, 2012 4:56 pm UTC

Re: 1808: "Hacking"

Postby spilk » Thu Mar 09, 2017 4:27 pm UTC

Cave Wizard wrote:Anyone got a link to that tamagotchi exploit?


This was something I wanted to look into. I will do some digging and get back to you if I find something. Anyone else care to weigh in?

User avatar
Geitda
Posts: 1
Joined: Mon Mar 13, 2017 3:20 am UTC

Re: 1808: "Hacking"

Postby Geitda » Mon Mar 13, 2017 1:10 pm UTC

Cave Wizard wrote:Anyone got a link to that tamagotchi exploit?

I created an account here just to share, but new users can't post links, so you'll have to find it yourself.
Search for PoC || GTFO issues 0x02 and 0x04.
PoC || GTFO describes itself as,
A friendly little collection of articles for ladies and gentlemen of distinguished ability and taste in the field of software exploitation and the worship of weird machines.

User avatar
Archgeek
Posts: 206
Joined: Wed May 02, 2007 6:00 am UTC
Location: Central US
Contact:

Re: 1808: "Hacking"

Postby Archgeek » Thu Mar 16, 2017 6:54 pm UTC

Geitda wrote:
Cave Wizard wrote:Anyone got a link to that tamagotchi exploit?

I created an account here just to share, but new users can't post links, so you'll have to find it yourself.
Search for PoC || GTFO issues 0x02 and 0x04.
PoC || GTFO describes itself as,
A friendly little collection of articles for ladies and gentlemen of distinguished ability and taste in the field of software exploitation and the worship of weird machines.

Wow...thank you very much for bringing that to my attention. That little publication seems utterly delighftul. I forsee much enjoyment reading the backlog. Looking at the description of issue 1, sec 4, I'm lead to the inevitable joke: weren't the hats secretly green?
"That big tube down the side was officially called a "systems tunnel", which is aerospace contractor speak for "big tube down the side."


Return to “Individual XKCD Comic Threads”

Who is online

Users browsing this forum: Google Feedfetcher and 44 guests