You are in: Articles / Security / Mail injection through WebMail applications
 
 
 

Mail injection through WebMail applications

IMAP Injection
 
Supposedly, if the link:

http://<webmail-addr>/show_email.php?m_id=8

would display the eighth message in the current folder, then simply replacing the number in the URL would result in displaying the message with the corresponding number. This is the intended behavior of the application. The actual command to retrieve the eighth message that would be set to the server would be:

FETCH 8 BODY[HEADER]

It is very clear what the variable replaces. If we change the variable itself we get:

FETCH + <variable> + BODY[HEADER]

To perform a code injection into the mail server, such as two fetch operations instead of one, we would need to run these commands on the mail server IMAP service:

FETCH 8 BODY[HEADER]
? FETCH 7 BODY[HEADER]

Starting from the same basic replacement pattern above, we can conclude that the URL required to access two e-mails at once is:

http://<webmail-addr>/show_email.php?m_id=8 BODY[HEADER]%0d%0a? FETCH 7

This particular example makes use of a very handy string inside the actual URL. "%0d%0a" is the newline character (CRLF - carriage-return and line-feed). This character is always required while issuing multiple line commands. In truth, code injection is very rarely used without spanning the code injected over multiple lines.
 
|
|
|
Rating: 12345
 
Page 2 of 4
 
Leave a comment



Note: all fields marked with (*) are required
Comments (0)
 
Close send to email window
 



Verification code

Already a member?
Blacklist monitoring alerts
sign up Signup for our real-time monitoring service and receive email notifications each time one of your IPs gets blacklisted.
Free Signup
Mail Server Operating System Poll
.01

What OS do you use for your email server?
Linux
Windows
Other
disabled next
.02

How many mailboxes do you currently manage?
1-50
51-300
300+
previous next
.03

Would you like to comment upon the choosing of this particular OS?

previous
 
DNS Tools
Get IP status, owner and location, obtain its corresponding hostname or check specific ports.
Ping Statistics
Reverse DNS Lookup
Whois Info (IP owner)
GeoIP Information
Check Port
Open Relay Test
Test if your mail server is an open relay for spammers.
Blacklist Checker
Check if your IP is listed in DNS based email blacklists (DNSBL)