SlideShare une entreprise Scribd logo
1  sur  28
Reply-via-Email service:
experience and hidden traps
Aleksandr Kotov
megakott@gmail.com
Language of Shakespeare?
OK, let’s try 
To be, or not to be, that is the Question:
Whether ’tis Nobler in the mind to ſuffer
The Slings and Arrows of outragious Fortune,
Or to take Armes againſt a Sea of troubles,
And by opposing end them: to dye, to ſleepe
No more; and by a sleep, to say we end
The Heart-ake, and the thouſand Naturall ſhockes
That Flesh is there too? "Tis a consummation
Deuoutly to be d. To dye to sleepe To sleep, perchance to
Dream; I, there's the rub,
For in that sleep of death,dreams may come,
No. That’s not works.
• What’s works here:
– Slides in English
– Speech in Russian
Contents:
1. Reply-via-Email service
2. ____
oDesk.com
oDesk Message Center
Reply via Web-interface
E-Mail notifications
Why not reply here?
Facebook experience
Reply-to:
m+833jkpi000000a8eis0001imtw3ucfg1v6@reply.facebook.com
Reply-via-Email overview
• Alice writes to Bob a message via MC
• Message is delivered to Bob's MC
• Message is delivered to Bob's E-Mail
• Bob checks E-Mail and replies to it
• Bob's mail comes to oDesk mailgate
• oDesk decodes E-Mail and put Bob's reply into MC
the same way as if it was written via web-interface
Postfix mail server configuration
• All incoming E-Mails to odesk.com domain
are routed by Postfix mail server
• Let’s create reply.odesk.com subdomain
• Let’s tune Postfix configuration to pipe all
incoming mails sent to reply.odesk.com into
new script as STDIN
• …
• PROFIT!
MCReply script for Postfix on ____
• ./mcreply.pl < input.txt
PERLPerl
E-Mail address generation
• Requirements to address syntax
– fixed-size string
– hashing, i.e. completely different emails on one-
symbol change in username
– [a-z0-9]+@reply.odesk.com
– http://en.wikipedia.org/wiki/Email_address#Syntax
• What should be encrypted
– Reply-to address should be unique per
combination of recipient_id, thread_id and post_id
– Each of 3 params is 4-bytes unsigned int
• All above is for ‘Reply-To’. ‘From’ is different!
sub EncryptThreadRecipient {
my ($thread_id, $post_id, $recipient_id) = @_;
# 1. Prepare raw encryption unit (12 bytes)
my $raw_unit = pack("LLL", $thread_id, $post_id, $recipient_id);
# 2. Create 16-bytes sequence to encrypt
# 16 = 12:source + 3:checksum + 1:random_salt
my $to_crypt = $raw_unit . _get_checksum($raw_unit) .
pack("C", int(rand(256)));
# 3. Encrypt 16-bytes sequence by AES
my $cipher = _get_cipher();
return lc MIME::Base32::encode($cipher->encrypt($to_crypt));
}
Get w{26}@reply.odesk.com
(MIME::Base32 + Crypt::OpenSSL::AES)
What incoming mails do we block (69)
• Automatically-generated E-Mails from robots
– Including different kind of out-of-office responders
• E-Mails addressed to mc-w{10}@reply.odesk.com (From),
instead of w{26}@reply.odesk.com (Reply-To)
• More than 2 E-Mails per 2 minutes having the same values of
'From:' and 'Subject:' field
(primary as auto-replies ping-pong protection, secondary as spam
protection)
• More than 30 E-Mails per 30 minutes to the same MC thread
• Any E-Mail reply to MC Thread which already has >= 500 posts
• More than 5 replies to the same w{26}@reply.odesk.com
• E-Mail replies from suspended oDesk accounts
E-Mail content processing
• use MIME::Parser;
• Extract part with Content-Type: text/html,
or with text/plain
• Decode charset of Content-Type
• Decode attachments if any
• $reply_text = HTML::FormatText->format_string(
$reply_text,
leftmargin => 0, rightmargin => 65535,
)
• Trim quoted part (one more bicycle)
Starting the service
First problems
• User has no idea whether e-mail was accepted or not
• User has no idea why e-mail was rejected
• w{26}@reply.odesk.com addresses are flooding
user’s mail addressbooks
– But viruses like it and use it
– Even LinkedIn-generated invitations use it
• And it is hard for us to add new blocking rules
• Lack of logging leads to hell of tracking
• Heavy load, or too many rejected spam
Heavy load
Simplify tracking with exit codes
• ./mcreply.pl < input.txt
• echo $?
– use constant EX_SUCCESS => 0;
– use constant EX_TEMPFAIL => 75;
– use constant EX_UNAVAILABLE => 69;
Complexity of tracking
• How to track E-Mails lost before ./mcreply.pl ?
– Lost in internet
– Lost due to oDesk downtime
– Lost due to Postfix misconfiguration
– Lost due to ./mcreply.pl misconfiguration
• Log every e-mail? Or headers only?
Or meta-info only?
– Question of size
– Question of log lifetime
Years passed in illusion of stability
Underwater rake
Anybody wanna Viagra pills?
1. Let’s sell Viagra to bob@gmail.com using oDesk
2. Compose and send E-Mail having fields:
– From: bob@gmail.com
– To: any w{26}@reply.odesk.com
– Subject: You should buy Viagra pills!
3. E-Mail is rejected by mcreply.pl script
4. Not delivered notification goes from odesk.com to
bob@gmail.com, having original message attached
5. Bob is offered to buy Viagra when checking his mail
6. …
7. PROFIT!
oDesk is not a spam relay anymore
– use constant EX_SUCCESS => 0;
– use constant EX_TEMPFAIL => 0;
– use constant EX_UNAVAILABLE => 0;
• Anybody has any better idea?
Thank you!
• Any questions?

Contenu connexe

En vedette

Successful email phrases, by Helena Tomé
Successful email phrases, by Helena ToméSuccessful email phrases, by Helena Tomé
Successful email phrases, by Helena ToméHelena M. Tomé
 
Managing Emails using MS Office Outlook
Managing Emails using MS Office Outlook Managing Emails using MS Office Outlook
Managing Emails using MS Office Outlook Jaiveer Singh
 
Berlitz Tip - Negotiations in English
Berlitz Tip - Negotiations in EnglishBerlitz Tip - Negotiations in English
Berlitz Tip - Negotiations in EnglishBerlitz Corporation
 
Berlitz Tip - Meetings in English
Berlitz Tip - Meetings in EnglishBerlitz Tip - Meetings in English
Berlitz Tip - Meetings in EnglishBerlitz Corporation
 

En vedette (9)

Conference Calls in English
Conference Calls in EnglishConference Calls in English
Conference Calls in English
 
Art of language learning abroad
Art of language learning abroadArt of language learning abroad
Art of language learning abroad
 
Successful email phrases, by Helena Tomé
Successful email phrases, by Helena ToméSuccessful email phrases, by Helena Tomé
Successful email phrases, by Helena Tomé
 
Managing Emails using MS Office Outlook
Managing Emails using MS Office Outlook Managing Emails using MS Office Outlook
Managing Emails using MS Office Outlook
 
Berlitz Tip - Negotiations in English
Berlitz Tip - Negotiations in EnglishBerlitz Tip - Negotiations in English
Berlitz Tip - Negotiations in English
 
Speaking Time
Speaking TimeSpeaking Time
Speaking Time
 
Berlitz Tip - Meetings in English
Berlitz Tip - Meetings in EnglishBerlitz Tip - Meetings in English
Berlitz Tip - Meetings in English
 
500 real-english-phrases
500 real-english-phrases500 real-english-phrases
500 real-english-phrases
 
Time for english 4 2015
Time for english 4   2015Time for english 4   2015
Time for english 4 2015
 

Similaire à Reply via-email service: hidden traps

Eventful Email in Ruby
Eventful Email in RubyEventful Email in Ruby
Eventful Email in Rubyhassox
 
Code Fast, Die Young, Throw Structured Exceptions
Code Fast, Die Young, Throw Structured ExceptionsCode Fast, Die Young, Throw Structured Exceptions
Code Fast, Die Young, Throw Structured ExceptionsJohn Anderson
 
Угадываем пароль за минуту
Угадываем пароль за минутуУгадываем пароль за минуту
Угадываем пароль за минутуPositive Hack Days
 
Sending email with perl
Sending email with perlSending email with perl
Sending email with perlapeiron
 
Introduction to cryptography part2-final
Introduction to cryptography  part2-finalIntroduction to cryptography  part2-final
Introduction to cryptography part2-finalTaymoor Nazmy
 
PROTECTED CONTENT: END-TO-END PGP ENCRYPTION FOR DRUPAL
PROTECTED CONTENT: END-TO-END PGP ENCRYPTION FOR DRUPALPROTECTED CONTENT: END-TO-END PGP ENCRYPTION FOR DRUPAL
PROTECTED CONTENT: END-TO-END PGP ENCRYPTION FOR DRUPALDrupalCamp Kyiv
 
7-cryptography.ppt
7-cryptography.ppt7-cryptography.ppt
7-cryptography.pptGhamdan5
 
the art of the fking dum crypto_basic.ppt
the art of the fking dum crypto_basic.pptthe art of the fking dum crypto_basic.ppt
the art of the fking dum crypto_basic.pptjamkhan10
 
This is the presentation ofcryptography.ppt
This is the presentation ofcryptography.pptThis is the presentation ofcryptography.ppt
This is the presentation ofcryptography.pptvimalguptaofficial
 
Crytography CertCourse Module 1 & 2.ppt
Crytography CertCourse Module 1 & 2.pptCrytography CertCourse Module 1 & 2.ppt
Crytography CertCourse Module 1 & 2.pptMuhammadShajid1
 
Best book for the cryptography doctor.ppt
Best book for the cryptography doctor.pptBest book for the cryptography doctor.ppt
Best book for the cryptography doctor.pptnicolausalex722
 
detailed presentation on cryptography analysis
detailed presentation on cryptography analysisdetailed presentation on cryptography analysis
detailed presentation on cryptography analysisBARATH800940
 
7-cryptography.pptfffffffffffffffffffffffffffffffffff
7-cryptography.pptfffffffffffffffffffffffffffffffffff7-cryptography.pptfffffffffffffffffffffffffffffffffff
7-cryptography.pptfffffffffffffffffffffffffffffffffffmaninthemirrorrror
 
Modeling Tricks My Relational Database Never Taught Me
Modeling Tricks My Relational Database Never Taught MeModeling Tricks My Relational Database Never Taught Me
Modeling Tricks My Relational Database Never Taught MeDavid Boike
 

Similaire à Reply via-email service: hidden traps (20)

Eventful Email in Ruby
Eventful Email in RubyEventful Email in Ruby
Eventful Email in Ruby
 
cryptography.ppt
cryptography.pptcryptography.ppt
cryptography.ppt
 
Code Fast, Die Young, Throw Structured Exceptions
Code Fast, Die Young, Throw Structured ExceptionsCode Fast, Die Young, Throw Structured Exceptions
Code Fast, Die Young, Throw Structured Exceptions
 
Угадываем пароль за минуту
Угадываем пароль за минутуУгадываем пароль за минуту
Угадываем пароль за минуту
 
ProgrammingKatas
ProgrammingKatasProgrammingKatas
ProgrammingKatas
 
Sending email with perl
Sending email with perlSending email with perl
Sending email with perl
 
Introduction to cryptography part2-final
Introduction to cryptography  part2-finalIntroduction to cryptography  part2-final
Introduction to cryptography part2-final
 
PROTECTED CONTENT: END-TO-END PGP ENCRYPTION FOR DRUPAL
PROTECTED CONTENT: END-TO-END PGP ENCRYPTION FOR DRUPALPROTECTED CONTENT: END-TO-END PGP ENCRYPTION FOR DRUPAL
PROTECTED CONTENT: END-TO-END PGP ENCRYPTION FOR DRUPAL
 
7-cryptography.ppt
7-cryptography.ppt7-cryptography.ppt
7-cryptography.ppt
 
7-cryptography.ppt
7-cryptography.ppt7-cryptography.ppt
7-cryptography.ppt
 
7-cryptography.ppt
7-cryptography.ppt7-cryptography.ppt
7-cryptography.ppt
 
the art of the fking dum crypto_basic.ppt
the art of the fking dum crypto_basic.pptthe art of the fking dum crypto_basic.ppt
the art of the fking dum crypto_basic.ppt
 
This is the presentation ofcryptography.ppt
This is the presentation ofcryptography.pptThis is the presentation ofcryptography.ppt
This is the presentation ofcryptography.ppt
 
7 cryptography
7 cryptography7 cryptography
7 cryptography
 
Crytography CertCourse Module 1 & 2.ppt
Crytography CertCourse Module 1 & 2.pptCrytography CertCourse Module 1 & 2.ppt
Crytography CertCourse Module 1 & 2.ppt
 
Best book for the cryptography doctor.ppt
Best book for the cryptography doctor.pptBest book for the cryptography doctor.ppt
Best book for the cryptography doctor.ppt
 
detailed presentation on cryptography analysis
detailed presentation on cryptography analysisdetailed presentation on cryptography analysis
detailed presentation on cryptography analysis
 
7-cryptography.pptfffffffffffffffffffffffffffffffffff
7-cryptography.pptfffffffffffffffffffffffffffffffffff7-cryptography.pptfffffffffffffffffffffffffffffffffff
7-cryptography.pptfffffffffffffffffffffffffffffffffff
 
RSA.ppt
RSA.pptRSA.ppt
RSA.ppt
 
Modeling Tricks My Relational Database Never Taught Me
Modeling Tricks My Relational Database Never Taught MeModeling Tricks My Relational Database Never Taught Me
Modeling Tricks My Relational Database Never Taught Me
 

Plus de megakott

Middleware
MiddlewareMiddleware
Middlewaremegakott
 
Perl resources
Perl resourcesPerl resources
Perl resourcesmegakott
 
Piano on-perl
Piano on-perlPiano on-perl
Piano on-perlmegakott
 
Office vs. Remote
Office vs. RemoteOffice vs. Remote
Office vs. Remotemegakott
 
Anaglyph 3D-images: trends and demo
Anaglyph 3D-images: trends and demoAnaglyph 3D-images: trends and demo
Anaglyph 3D-images: trends and demomegakott
 
Aspect-oriented programming in Perl
Aspect-oriented programming in PerlAspect-oriented programming in Perl
Aspect-oriented programming in Perlmegakott
 
Saint Perl 2009: CGI::Ajax demo
Saint Perl 2009: CGI::Ajax demoSaint Perl 2009: CGI::Ajax demo
Saint Perl 2009: CGI::Ajax demomegakott
 

Plus de megakott (8)

Hackathon
HackathonHackathon
Hackathon
 
Middleware
MiddlewareMiddleware
Middleware
 
Perl resources
Perl resourcesPerl resources
Perl resources
 
Piano on-perl
Piano on-perlPiano on-perl
Piano on-perl
 
Office vs. Remote
Office vs. RemoteOffice vs. Remote
Office vs. Remote
 
Anaglyph 3D-images: trends and demo
Anaglyph 3D-images: trends and demoAnaglyph 3D-images: trends and demo
Anaglyph 3D-images: trends and demo
 
Aspect-oriented programming in Perl
Aspect-oriented programming in PerlAspect-oriented programming in Perl
Aspect-oriented programming in Perl
 
Saint Perl 2009: CGI::Ajax demo
Saint Perl 2009: CGI::Ajax demoSaint Perl 2009: CGI::Ajax demo
Saint Perl 2009: CGI::Ajax demo
 

Dernier

Call Girls In Saket Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Saket Delhi 💯Call Us 🔝8264348440🔝Call Girls In Saket Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Saket Delhi 💯Call Us 🔝8264348440🔝soniya singh
 
Networking in the Penumbra presented by Geoff Huston at NZNOG
Networking in the Penumbra presented by Geoff Huston at NZNOGNetworking in the Penumbra presented by Geoff Huston at NZNOG
Networking in the Penumbra presented by Geoff Huston at NZNOGAPNIC
 
Radiant Call girls in Dubai O56338O268 Dubai Call girls
Radiant Call girls in Dubai O56338O268 Dubai Call girlsRadiant Call girls in Dubai O56338O268 Dubai Call girls
Radiant Call girls in Dubai O56338O268 Dubai Call girlsstephieert
 
Call Girls In Ashram Chowk Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Ashram Chowk Delhi 💯Call Us 🔝8264348440🔝Call Girls In Ashram Chowk Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Ashram Chowk Delhi 💯Call Us 🔝8264348440🔝soniya singh
 
Challengers I Told Ya ShirtChallengers I Told Ya Shirt
Challengers I Told Ya ShirtChallengers I Told Ya ShirtChallengers I Told Ya ShirtChallengers I Told Ya Shirt
Challengers I Told Ya ShirtChallengers I Told Ya Shirtrahman018755
 
VIP Kolkata Call Girl Salt Lake 👉 8250192130 Available With Room
VIP Kolkata Call Girl Salt Lake 👉 8250192130  Available With RoomVIP Kolkata Call Girl Salt Lake 👉 8250192130  Available With Room
VIP Kolkata Call Girl Salt Lake 👉 8250192130 Available With Roomishabajaj13
 
On Starlink, presented by Geoff Huston at NZNOG 2024
On Starlink, presented by Geoff Huston at NZNOG 2024On Starlink, presented by Geoff Huston at NZNOG 2024
On Starlink, presented by Geoff Huston at NZNOG 2024APNIC
 
Call Girls Service Chandigarh Lucky ❤️ 7710465962 Independent Call Girls In C...
Call Girls Service Chandigarh Lucky ❤️ 7710465962 Independent Call Girls In C...Call Girls Service Chandigarh Lucky ❤️ 7710465962 Independent Call Girls In C...
Call Girls Service Chandigarh Lucky ❤️ 7710465962 Independent Call Girls In C...Sheetaleventcompany
 
VIP Kolkata Call Girl Alambazar 👉 8250192130 Available With Room
VIP Kolkata Call Girl Alambazar 👉 8250192130  Available With RoomVIP Kolkata Call Girl Alambazar 👉 8250192130  Available With Room
VIP Kolkata Call Girl Alambazar 👉 8250192130 Available With Roomdivyansh0kumar0
 
'Future Evolution of the Internet' delivered by Geoff Huston at Everything Op...
'Future Evolution of the Internet' delivered by Geoff Huston at Everything Op...'Future Evolution of the Internet' delivered by Geoff Huston at Everything Op...
'Future Evolution of the Internet' delivered by Geoff Huston at Everything Op...APNIC
 
DDoS In Oceania and the Pacific, presented by Dave Phelan at NZNOG 2024
DDoS In Oceania and the Pacific, presented by Dave Phelan at NZNOG 2024DDoS In Oceania and the Pacific, presented by Dave Phelan at NZNOG 2024
DDoS In Oceania and the Pacific, presented by Dave Phelan at NZNOG 2024APNIC
 
AWS Community DAY Albertini-Ellan Cloud Security (1).pptx
AWS Community DAY Albertini-Ellan Cloud Security (1).pptxAWS Community DAY Albertini-Ellan Cloud Security (1).pptx
AWS Community DAY Albertini-Ellan Cloud Security (1).pptxellan12
 
AlbaniaDreamin24 - How to easily use an API with Flows
AlbaniaDreamin24 - How to easily use an API with FlowsAlbaniaDreamin24 - How to easily use an API with Flows
AlbaniaDreamin24 - How to easily use an API with FlowsThierry TROUIN ☁
 
VIP 7001035870 Find & Meet Hyderabad Call Girls LB Nagar high-profile Call Girl
VIP 7001035870 Find & Meet Hyderabad Call Girls LB Nagar high-profile Call GirlVIP 7001035870 Find & Meet Hyderabad Call Girls LB Nagar high-profile Call Girl
VIP 7001035870 Find & Meet Hyderabad Call Girls LB Nagar high-profile Call Girladitipandeya
 
How is AI changing journalism? (v. April 2024)
How is AI changing journalism? (v. April 2024)How is AI changing journalism? (v. April 2024)
How is AI changing journalism? (v. April 2024)Damian Radcliffe
 
FULL ENJOY Call Girls In Mayur Vihar Delhi Contact Us 8377087607
FULL ENJOY Call Girls In Mayur Vihar Delhi Contact Us 8377087607FULL ENJOY Call Girls In Mayur Vihar Delhi Contact Us 8377087607
FULL ENJOY Call Girls In Mayur Vihar Delhi Contact Us 8377087607dollysharma2066
 

Dernier (20)

Call Girls In Saket Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Saket Delhi 💯Call Us 🔝8264348440🔝Call Girls In Saket Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Saket Delhi 💯Call Us 🔝8264348440🔝
 
Networking in the Penumbra presented by Geoff Huston at NZNOG
Networking in the Penumbra presented by Geoff Huston at NZNOGNetworking in the Penumbra presented by Geoff Huston at NZNOG
Networking in the Penumbra presented by Geoff Huston at NZNOG
 
Rohini Sector 6 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
Rohini Sector 6 Call Girls Delhi 9999965857 @Sabina Saikh No AdvanceRohini Sector 6 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
Rohini Sector 6 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
 
Radiant Call girls in Dubai O56338O268 Dubai Call girls
Radiant Call girls in Dubai O56338O268 Dubai Call girlsRadiant Call girls in Dubai O56338O268 Dubai Call girls
Radiant Call girls in Dubai O56338O268 Dubai Call girls
 
Call Girls In Ashram Chowk Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Ashram Chowk Delhi 💯Call Us 🔝8264348440🔝Call Girls In Ashram Chowk Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Ashram Chowk Delhi 💯Call Us 🔝8264348440🔝
 
Challengers I Told Ya ShirtChallengers I Told Ya Shirt
Challengers I Told Ya ShirtChallengers I Told Ya ShirtChallengers I Told Ya ShirtChallengers I Told Ya Shirt
Challengers I Told Ya ShirtChallengers I Told Ya Shirt
 
VIP Kolkata Call Girl Salt Lake 👉 8250192130 Available With Room
VIP Kolkata Call Girl Salt Lake 👉 8250192130  Available With RoomVIP Kolkata Call Girl Salt Lake 👉 8250192130  Available With Room
VIP Kolkata Call Girl Salt Lake 👉 8250192130 Available With Room
 
On Starlink, presented by Geoff Huston at NZNOG 2024
On Starlink, presented by Geoff Huston at NZNOG 2024On Starlink, presented by Geoff Huston at NZNOG 2024
On Starlink, presented by Geoff Huston at NZNOG 2024
 
Dwarka Sector 26 Call Girls | Delhi | 9999965857 🫦 Vanshika Verma More Our Se...
Dwarka Sector 26 Call Girls | Delhi | 9999965857 🫦 Vanshika Verma More Our Se...Dwarka Sector 26 Call Girls | Delhi | 9999965857 🫦 Vanshika Verma More Our Se...
Dwarka Sector 26 Call Girls | Delhi | 9999965857 🫦 Vanshika Verma More Our Se...
 
Call Girls Service Chandigarh Lucky ❤️ 7710465962 Independent Call Girls In C...
Call Girls Service Chandigarh Lucky ❤️ 7710465962 Independent Call Girls In C...Call Girls Service Chandigarh Lucky ❤️ 7710465962 Independent Call Girls In C...
Call Girls Service Chandigarh Lucky ❤️ 7710465962 Independent Call Girls In C...
 
VIP Kolkata Call Girl Alambazar 👉 8250192130 Available With Room
VIP Kolkata Call Girl Alambazar 👉 8250192130  Available With RoomVIP Kolkata Call Girl Alambazar 👉 8250192130  Available With Room
VIP Kolkata Call Girl Alambazar 👉 8250192130 Available With Room
 
'Future Evolution of the Internet' delivered by Geoff Huston at Everything Op...
'Future Evolution of the Internet' delivered by Geoff Huston at Everything Op...'Future Evolution of the Internet' delivered by Geoff Huston at Everything Op...
'Future Evolution of the Internet' delivered by Geoff Huston at Everything Op...
 
DDoS In Oceania and the Pacific, presented by Dave Phelan at NZNOG 2024
DDoS In Oceania and the Pacific, presented by Dave Phelan at NZNOG 2024DDoS In Oceania and the Pacific, presented by Dave Phelan at NZNOG 2024
DDoS In Oceania and the Pacific, presented by Dave Phelan at NZNOG 2024
 
Rohini Sector 26 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
Rohini Sector 26 Call Girls Delhi 9999965857 @Sabina Saikh No AdvanceRohini Sector 26 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
Rohini Sector 26 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
 
AWS Community DAY Albertini-Ellan Cloud Security (1).pptx
AWS Community DAY Albertini-Ellan Cloud Security (1).pptxAWS Community DAY Albertini-Ellan Cloud Security (1).pptx
AWS Community DAY Albertini-Ellan Cloud Security (1).pptx
 
AlbaniaDreamin24 - How to easily use an API with Flows
AlbaniaDreamin24 - How to easily use an API with FlowsAlbaniaDreamin24 - How to easily use an API with Flows
AlbaniaDreamin24 - How to easily use an API with Flows
 
VIP 7001035870 Find & Meet Hyderabad Call Girls LB Nagar high-profile Call Girl
VIP 7001035870 Find & Meet Hyderabad Call Girls LB Nagar high-profile Call GirlVIP 7001035870 Find & Meet Hyderabad Call Girls LB Nagar high-profile Call Girl
VIP 7001035870 Find & Meet Hyderabad Call Girls LB Nagar high-profile Call Girl
 
How is AI changing journalism? (v. April 2024)
How is AI changing journalism? (v. April 2024)How is AI changing journalism? (v. April 2024)
How is AI changing journalism? (v. April 2024)
 
Rohini Sector 22 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
Rohini Sector 22 Call Girls Delhi 9999965857 @Sabina Saikh No AdvanceRohini Sector 22 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
Rohini Sector 22 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
 
FULL ENJOY Call Girls In Mayur Vihar Delhi Contact Us 8377087607
FULL ENJOY Call Girls In Mayur Vihar Delhi Contact Us 8377087607FULL ENJOY Call Girls In Mayur Vihar Delhi Contact Us 8377087607
FULL ENJOY Call Girls In Mayur Vihar Delhi Contact Us 8377087607
 

Reply via-email service: hidden traps

  • 1. Reply-via-Email service: experience and hidden traps Aleksandr Kotov megakott@gmail.com
  • 3. OK, let’s try  To be, or not to be, that is the Question: Whether ’tis Nobler in the mind to ſuffer The Slings and Arrows of outragious Fortune, Or to take Armes againſt a Sea of troubles, And by opposing end them: to dye, to ſleepe No more; and by a sleep, to say we end The Heart-ake, and the thouſand Naturall ſhockes That Flesh is there too? "Tis a consummation Deuoutly to be d. To dye to sleepe To sleep, perchance to Dream; I, there's the rub, For in that sleep of death,dreams may come,
  • 4. No. That’s not works. • What’s works here: – Slides in English – Speech in Russian
  • 10. Why not reply here?
  • 12. Reply-via-Email overview • Alice writes to Bob a message via MC • Message is delivered to Bob's MC • Message is delivered to Bob's E-Mail • Bob checks E-Mail and replies to it • Bob's mail comes to oDesk mailgate • oDesk decodes E-Mail and put Bob's reply into MC the same way as if it was written via web-interface
  • 13. Postfix mail server configuration • All incoming E-Mails to odesk.com domain are routed by Postfix mail server • Let’s create reply.odesk.com subdomain • Let’s tune Postfix configuration to pipe all incoming mails sent to reply.odesk.com into new script as STDIN • … • PROFIT!
  • 14. MCReply script for Postfix on ____ • ./mcreply.pl < input.txt PERLPerl
  • 15. E-Mail address generation • Requirements to address syntax – fixed-size string – hashing, i.e. completely different emails on one- symbol change in username – [a-z0-9]+@reply.odesk.com – http://en.wikipedia.org/wiki/Email_address#Syntax • What should be encrypted – Reply-to address should be unique per combination of recipient_id, thread_id and post_id – Each of 3 params is 4-bytes unsigned int • All above is for ‘Reply-To’. ‘From’ is different!
  • 16. sub EncryptThreadRecipient { my ($thread_id, $post_id, $recipient_id) = @_; # 1. Prepare raw encryption unit (12 bytes) my $raw_unit = pack("LLL", $thread_id, $post_id, $recipient_id); # 2. Create 16-bytes sequence to encrypt # 16 = 12:source + 3:checksum + 1:random_salt my $to_crypt = $raw_unit . _get_checksum($raw_unit) . pack("C", int(rand(256))); # 3. Encrypt 16-bytes sequence by AES my $cipher = _get_cipher(); return lc MIME::Base32::encode($cipher->encrypt($to_crypt)); } Get w{26}@reply.odesk.com (MIME::Base32 + Crypt::OpenSSL::AES)
  • 17. What incoming mails do we block (69) • Automatically-generated E-Mails from robots – Including different kind of out-of-office responders • E-Mails addressed to mc-w{10}@reply.odesk.com (From), instead of w{26}@reply.odesk.com (Reply-To) • More than 2 E-Mails per 2 minutes having the same values of 'From:' and 'Subject:' field (primary as auto-replies ping-pong protection, secondary as spam protection) • More than 30 E-Mails per 30 minutes to the same MC thread • Any E-Mail reply to MC Thread which already has >= 500 posts • More than 5 replies to the same w{26}@reply.odesk.com • E-Mail replies from suspended oDesk accounts
  • 18. E-Mail content processing • use MIME::Parser; • Extract part with Content-Type: text/html, or with text/plain • Decode charset of Content-Type • Decode attachments if any • $reply_text = HTML::FormatText->format_string( $reply_text, leftmargin => 0, rightmargin => 65535, ) • Trim quoted part (one more bicycle)
  • 20. First problems • User has no idea whether e-mail was accepted or not • User has no idea why e-mail was rejected • w{26}@reply.odesk.com addresses are flooding user’s mail addressbooks – But viruses like it and use it – Even LinkedIn-generated invitations use it • And it is hard for us to add new blocking rules • Lack of logging leads to hell of tracking • Heavy load, or too many rejected spam
  • 22. Simplify tracking with exit codes • ./mcreply.pl < input.txt • echo $? – use constant EX_SUCCESS => 0; – use constant EX_TEMPFAIL => 75; – use constant EX_UNAVAILABLE => 69;
  • 23. Complexity of tracking • How to track E-Mails lost before ./mcreply.pl ? – Lost in internet – Lost due to oDesk downtime – Lost due to Postfix misconfiguration – Lost due to ./mcreply.pl misconfiguration • Log every e-mail? Or headers only? Or meta-info only? – Question of size – Question of log lifetime
  • 24. Years passed in illusion of stability
  • 26. Anybody wanna Viagra pills? 1. Let’s sell Viagra to bob@gmail.com using oDesk 2. Compose and send E-Mail having fields: – From: bob@gmail.com – To: any w{26}@reply.odesk.com – Subject: You should buy Viagra pills! 3. E-Mail is rejected by mcreply.pl script 4. Not delivered notification goes from odesk.com to bob@gmail.com, having original message attached 5. Bob is offered to buy Viagra when checking his mail 6. … 7. PROFIT!
  • 27. oDesk is not a spam relay anymore – use constant EX_SUCCESS => 0; – use constant EX_TEMPFAIL => 0; – use constant EX_UNAVAILABLE => 0; • Anybody has any better idea?
  • 28. Thank you! • Any questions?