
Research
Security News
Malicious PyPI Package Exploits Deezer API for Coordinated Music Piracy
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
@wppconnect/wa-js
Advanced tools
WPPConnect/WA-JS is an open-source project with the aim of exporting functions from WhatsApp Web
WPPConnect/WA-JS is an open-source project with the aim of exporting functions from WhatsApp Web, which can be used to support the creation of any interaction, such as customer service, media sending, intelligence recognition based on phrases artificial and many other things, use your imagination...
This project extract some functions of WhatsApp sources, that uses webpack.
After build, this project generate a file dist/wppconnect-wa.js
to be used for injection in WhatsApp Web. When injected, it will explose a global variable named WPP
.
Some parts of WPP
variable:
WPP.webpack
- Scripts to exports WhatsApp functions.WPP.whatsapp
- Only exported WhatsApp functions.WPP.chat
- Chat functions and events.There are a convection name for some exported modules:
...Model
- Class for data structure (ClassModel
, MsgModel
)...Collection
- Class for collection of models (ChatCollection
, MsgCollection
)...Store
- Default and global instance of a collection (ChatStore
, MsgStore
)Steps to run locally:
# install the depencencies
npm install
# download whatsapp javascript and prettify (optional)
npm run wa-source
# build javascript files
npm run build:prd # or build:dev for development
# lauch a local browser with automatic injection
npm run launch:local
# or only run in VSCode
Basicaly, you need to inject the wppconnect-wa.js
file into the browser after WhatsApp page load.
// ==UserScript==
// @name WA-JS Teste
// @namespace http://tampermonkey.net/
// @version 0.1
// @description Simple example of WA-JS
// @author You
// @match https://web.whatsapp.com/*
// @icon https://www.google.com/s2/favicons?domain=whatsapp.com
// @require https://github.com/wppconnect-team/wa-js/releases/download/nightly/wppconnect-wa.js
// @grant none
// ==/UserScript==
/* globals WPP */
(function () {
'use strict';
WPP.webpack.onReady(function () {
alert('Ready to use WPPConnect WA-JS');
});
// Your code here...
})();
import * as playwright from 'playwright-chromium';
async function start() {
const browser = await playwright.chromium.launch();
const page = browser.newPage();
await page.goto('https://web.whatsapp.com/');
await page.addScriptTag({
path: require.resolve('@wppconnect/wa-js'),
});
// Wait WA-JS load
await page.waitForFunction(() => window.WPP?.isReady);
// Evaluating code: See https://playwright.dev/docs/evaluating/
const isAuthenticated: string = await page.evaluate(() =>
WPP.auth.isAuthenticated()
);
// Sending message: See https://playwright.dev/docs/evaluating/
const sendResult: string = await page.evaluate(
(to, message) => WPP.chat.sendTextMessage(to, message),
to,
message
);
}
start();
Copyright 2021 WPPConnect Team
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
FAQs
WPPConnect/WA-JS is an open-source project with the aim of exporting functions from WhatsApp Web
The npm package @wppconnect/wa-js receives a total of 1,909 weekly downloads. As such, @wppconnect/wa-js popularity was classified as popular.
We found that @wppconnect/wa-js demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.
Security News
Newly introduced telemetry in devenv 1.4 sparked a backlash over privacy concerns, leading to the removal of its AI-powered feature after strong community pushback.