Skip to content

Commit 8b5d435

Browse files
authored
Merge pull request CloudBotIRC#177 from linuxdaemon/gonzobot-yomamma-fix
Fix exploit in jokes.py
2 parents 0eb6b91 + 1c0684c commit 8b5d435

2 files changed

Lines changed: 90 additions & 31 deletions

File tree

data/kero.txt

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
PRIUS JIMMY BUFFET!!!
2+
DISNEY APPLE BEARDS, FUCK COFFEE!
3+
FUCK THINGS THAT ARE GOOD AND NICE!
4+
RED ZONE SCHMED ZONE!
5+
i DONT USE APPLE CPMPUTERS!!!!
6+
???!??!? YOU CLEARLY DONT LISTEN!
7+
WHY ARE PEOPLE CALLING ME A NERD I WAS ON THE iPHONE AND DONT GET IT!!!!
8+
OH MAN FUCK BEARDS!
9+
I AM GOING DOWN THE HALL TO A MEETING UNDER MY OWN POWER RIGHT NOW!!!
10+
NOT A VEGETABLE!!!!!!!
11+
i think thats a vulva euphemism, PW.
12+
THEY START SHOVING CAKES IN EACH OTHERS FACES LIKE ITS A MANATEE WEDDING HOLY SHIT!
13+
I DONT MAKE THE NEWS I JUST REPORT IT!
14+
HURR DURR YOU ARE OLD WITH PRINTED PAGES
15+
pants on head mouthbreather.
16+
HELLO I AM BACK WHAT IS NEW?
17+
YOU ARE A HORRIBLE DEAD FAN!
18+
i try not to be racist, but seriously. there's a mexican guy in our neighborhood. on the 4th like 40 people in his family came over and shot off fireworks and they sat in lawn chairs in the front yard.
19+
there's an old asian woman in our neighborhood who hides in her house and walks 10 feet behind her husband and is a bad driver.
20+
HOW AM I NOT SUPPOSED TO BE RACIST WITH THAT OVERWHELMING EVIDENCE EXACTLY!?!?
21+
???? WTF IS
22+
NO I NEVER THINK THAT I AM VERY HAPPY
23+
HORSES CANT TALK IDIOTS
24+
I WENT TO ZERO STRIP CLUBS AND HAD ZERO STREET BEER
25+
I FUCKING WRITE CURRICULUM ON HOW TO SELL AND NETWORK AND RUN A BUSINESS ALL FUCKING DAY LONG
26+
you gentlemen are hilarious. theres certainly nothing in what you're doing that could be considered "ball busting" or "trolling."
27+
YOU CAN EMAIL FROM YOUR PHONE? MAGIC MAN FROM THE FUTURE, DO THEY HAVE RUBBER VAGINAS MEN CAN PUT THEIR DICKS INTO AS WELL?
28+
really who the fuck cares who the third president was?
29+
why dont you just bore your candidat to tears with talk about subarus and guns and talk about the recruiters that have been calling *you*? Itll be just like irc.
30+
DONT TAKE AWAY MY FUN.
31+
I may beat off on the notes afterward because that turns me on, DONT JUDGE ME ITS NORMAL.
32+
wtf is a homeless guyy gonna do with a speaker SURE WOULD LIKE TO EAT BUT AT LEAST I HAVE MY KOOL JAMZ
33+
thanks for overexplaining that one
34+
Really. I say ejaculating on pictures is weird and somehow that translates to OMG WAT A PRUDE
35+
Had someone ejaculate on a picture of me. Gotta try it once.
36+
apparently theres a thing where people ejaculate on pictures i bet you could monetize that.
37+
'Hey you can talk to this chick and maybe get laid or cum on a picture,' only complete social retards pick the latter.
38+
Hahaha those weirdos with tentacle porn excuse me I need to whack it on a picture and put it on the Internet.
39+
enjoy your penis salad sandwich
40+
im pretty sure ive never said 'OH MY GOODNESS LOOK AT HIS PENIS I WISH I HAD THAT PENIS' then went searching for it to show someone else 24 hours later because i couldn't stop thinking about teddy bridgewater's beautiful penis <3
41+
i don't think "we" have ever "talked a lot of dick."
42+
OMG DID YOU SEE THE BALLS TOO?
43+
be as weird as you want. i dont understand why its so cool now to go "OOOO THATS JUST WHO HE IS DONT JUDGE." if you like to have your balls hit with a hammer while you ejaculate onto pictures of horses i think you should be called fucking weird.

plugins/jokes.py

Lines changed: 47 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,13 @@
55

66
from cloudbot import hook
77

8+
89
@hook.on_start()
910
def load_jokes(bot):
1011
"""
1112
:type bot: cloudbot.bot.Cloudbot
1213
"""
13-
global yo_momma, do_it, pun, confucious, one_liner, wisdom, book_puns, lawyerjoke
14+
global yo_momma, do_it, pun, confucious, one_liner, wisdom, book_puns, lawyerjoke, kero_sayings
1415

1516
with codecs.open(os.path.join(bot.data_dir, "yo_momma.txt"), encoding="utf-8") as f:
1617
yo_momma = [line.strip() for line in f.readlines() if not line.startswith("//")]
@@ -36,88 +37,103 @@ def load_jokes(bot):
3637
with codecs.open(os.path.join(bot.data_dir, "lawyerjoke.txt"), encoding="utf-8") as f:
3738
lawyerjoke = [line.strip() for line in f.readlines() if not line.startswith("//")]
3839

40+
with codecs.open(os.path.join(bot.data_dir, "kero.txt"), encoding="utf-8") as f:
41+
kero_sayings = [line.strip() for line in f.readlines() if not line.startswith("//")]
42+
43+
3944
@hook.command()
40-
def yomomma(text, message, conn):
41-
"""input <nick>, tells a yo momma joke to <nick>"""
45+
def yomomma(text):
46+
"""<nick> - tells a yo momma joke to <nick>"""
4247
target = text.strip()
43-
message('{}, {}'.format(target, random.choice(yo_momma).lower()))
48+
return '{}, {}'.format(target, random.choice(yo_momma).lower())
49+
4450

4551
@hook.command(autohelp=False)
46-
def doit(message, conn):
47-
"""prints a do it line, example: mathmaticians do with a pencil"""
52+
def doit(message):
53+
"""- prints a do it line, example: mathmaticians do with a pencil"""
4854
message(random.choice(do_it))
4955

5056

5157
@hook.command(autohelp=False)
52-
def pun(message, conn):
53-
"""Come on everyone loves puns right?"""
58+
def pun(message):
59+
"""- Come on everyone loves puns right?"""
5460
message(random.choice(pun))
5561

62+
5663
@hook.command(autohelp=False)
57-
def confucious(message, conn):
58-
"""confucious say man standing on toilet is high on pot."""
64+
def confucious(message):
65+
"""- confucious say man standing on toilet is high on pot."""
5966
message('Confucious say {}'.format(random.choice(confucious).lower()))
6067

68+
6169
@hook.command(autohelp=False)
62-
def dadjoke(message, conn):
63-
"""love em or hate em, bring on the dad jokes."""
70+
def dadjoke(message):
71+
"""- love em or hate em, bring on the dad jokes."""
6472
message(random.choice(one_liner))
6573

74+
6675
@hook.command(autohelp=False)
67-
def wisdom(message, conn):
68-
"""words of wisdom from various bathroom stalls."""
76+
def wisdom(message):
77+
"""- words of wisdom from various bathroom stalls."""
6978
message(random.choice(wisdom))
7079

80+
7181
@hook.command(autohelp=False)
72-
def bookpun(message, conn):
73-
"""Suggests a pun of a book title/author."""
74-
#suggestions = ["Why not try", "You should read", "You gotta check out"]
82+
def bookpun(message):
83+
"""- Suggests a pun of a book title/author."""
84+
# suggestions = ["Why not try", "You should read", "You gotta check out"]
7585
book = random.choice(book_puns)
7686
title = book.split(':')[0].strip()
7787
author = book.split(':')[1].strip()
7888
message("{} by {}".format(title, author))
7989

90+
8091
@hook.command("boobs", "boobies")
81-
def boobies(text, conn):
82-
"""prints boobies!"""
92+
def boobies(text):
93+
"""- prints boobies!"""
8394
boob = "\u2299"
8495
out = text.strip()
8596
out = out.replace('o', boob).replace('O', boob).replace('0', boob)
8697
if out == text.strip():
8798
return "Sorry I couldn't turn anything in '{}' into boobs for you.".format(out)
8899
return out
89100

101+
90102
@hook.command("awesome", "iscool", "cool")
91-
def awesome(text, message):
92-
"""Prints a webpage to show <nick> how awesome they are."""
103+
def awesome(text):
104+
"""- Prints a webpage to show <nick> how awesome they are."""
93105
nick_re = re.compile("^[A-Za-z0-9_|.\-\]\[]*$", re.I)
94106
link = 'http://is-awesome.cool/{}'
95107
nick = text.split(' ')[0]
96108
if nick_re.match(nick):
97-
message("{}: I am blown away by your recent awesome action(s). Please read \x02{}\x02".format(nick, link.format(nick)))
109+
return "{}: I am blown away by your recent awesome action(s). Please read \x02{}\x02".format(
110+
nick, link.format(nick)
111+
)
98112
else:
99113
return "Sorry I can't tell {} how awesome they are.".format(nick)
100114

115+
101116
@hook.command(autohelp=False)
102117
def triforce(message):
103-
"""returns a triforce!"""
104-
top = ["\u00a0\u25b2","\u00a0\u00a0\u25b2", "\u25b2", "\u00a0\u25b2"]
118+
"""- returns a triforce!"""
119+
top = ["\u00a0\u25b2", "\u00a0\u00a0\u25b2", "\u25b2", "\u00a0\u25b2"]
105120
bottom = ["\u25b2\u00a0\u25b2", "\u25b2 \u25b2", "\u25b2\u25b2"]
106121
message(random.choice(top))
107122
message(random.choice(bottom))
108123

124+
109125
@hook.command("kero", "kerowhack")
110-
def kero(text, message):
111-
"""Returns the text input the way kerouac5 would say it."""
112-
saying = ["PRIUS JIMMY BUFFET!!!", "DISNEY APPLE BEARDS, FUCK COFFEE!", "FUCK THINGS THAT ARE GOOD AND NICE!", "RED ZONE SCHMED ZONE!", "i DONT USE APPLE CPMPUTERS!!!!", "???!??!? YOU CLEARLY DONT LISTEN!", "WHY ARE PEOPLE CALLING ME A NERD I WAS ON THE iPHONE AND DONT GET IT!!!!", "OH MAN FUCK BEARDS!", "I AM GOING DOWN THE HALL TO A MEETING UNDER MY OWN POWER RIGHT NOW!!!", "NOT A VEGETABLE!!!!!!!", "i think thats a vulva euphemism, PW.", "THEY START SHOVING CAKES IN EACH OTHERS FACES LIKE ITS A MANATEE WEDDING HOLY SHIT!", "I DONT MAKE THE NEWS I JUST REPORT IT!", "HURR DURR YOU ARE OLD WITH PRINTED PAGES", "pants on head mouthbreather.", "HELLO I AM BACK WHAT IS NEW?", "YOU ARE A HORRIBLE DEAD FAN!", "i try not to be racist, but seriously. there's a mexican guy in our neighborhood. on the 4th like 40 people in his family came over and shot off fireworks and they sat in lawn chairs in the front yard.", "there's an old asian woman in our neighborhood who hides in her house and walks 10 feet behind her husband and is a bad driver.", "HOW AM I NOT SUPPOSED TO BE RACIST WITH THAT OVERWHELMING EVIDENCE EXACTLY!?!?", "???? WTF IS", "NO I NEVER THINK THAT I AM VERY HAPPY", "HORSES CANT TALK IDIOTS", "I WENT TO ZERO STRIP CLUBS AND HAD ZERO STREET BEER", "I FUCKING WRITE CURRICULUM ON HOW TO SELL AND NETWORK AND RUN A BUSINESS ALL FUCKING DAY LONG", "you gentlemen are hilarious. theres certainly nothing in what you're doing that could be considered \"ball busting\" or \"trolling.\"", "YOU CAN EMAIL FROM YOUR PHONE? MAGIC MAN FROM THE FUTURE, DO THEY HAVE RUBBER VAGINAS MEN CAN PUT THEIR DICKS INTO AS WELL?", "really who the fuck cares who the third president was?", "why dont you just bore your candidat to tears with talk about subarus and guns and talk about the recruiters that have been calling *you*? Itll be just like irc.", "DONT TAKE AWAY MY FUN.", "I may beat off on the notes afterward because that turns me on, DONT JUDGE ME ITS NORMAL.", "wtf is a homeless guyy gonna do with a speaker SURE WOULD LIKE TO EAT BUT AT LEAST I HAVE MY KOOL JAMZ", "thanks for overexplaining that one", "Really. I say ejaculating on pictures is weird and somehow that translates to OMG WAT A PRUDE", "Had someone ejaculate on a picture of me. Gotta try it once.", "apparently theres a thing where people ejaculate on pictures i bet you could monetize that.", "'Hey you can talk to this chick and maybe get laid or cum on a picture,' only complete social retards pick the latter.", "Hahaha those weirdos with tentacle porn excuse me I need to whack it on a picture and put it on the Internet.", "enjoy your penis salad sandwich", "im pretty sure ive never said 'OH MY GOODNESS LOOK AT HIS PENIS I WISH I HAD THAT PENIS' then went searching for it to show someone else 24 hours later because i couldn't stop thinking about teddy bridgewater's beautiful penis <3", "i don't think \"we\" have ever \"talked a lot of dick.\"", "OMG DID YOU SEE THE BALLS TOO?", "be as weird as you want. i dont understand why its so cool now to go \"OOOO THATS JUST WHO HE IS DONT JUDGE.\" if you like to have your balls hit with a hammer while you ejaculate onto pictures of horses i think you should be called fucking weird."]
113-
keror = random.choice(saying).upper()
126+
def kero(text):
127+
"""- Returns the text input the way kerouac5 would say it."""
128+
keror = random.choice(kero_sayings).upper()
114129
if keror == "???? WTF IS":
115130
out = keror + " " + text.upper()
116131
else:
117132
out = text.upper() + " " + keror
118-
message(out)
133+
return out
134+
119135

120136
@hook.command(autohelp=False)
121-
def lawyerjoke(message, conn):
122-
"""returns a lawyer joke, so lawyers know how much we hate them"""
137+
def lawyerjoke(message):
138+
"""- returns a lawyer joke, so lawyers know how much we hate them"""
123139
message(random.choice(lawyerjoke))

0 commit comments

Comments
 (0)