Loading...
Loading...
Detect and analyze potential malware distribution repositories masquerading as legitimate security software
npx skill4agent add aradotso/security-skills avast-premium-security-malware-detectionSkill by ara.so — Security Skills collection.
// Pattern detection for malicious repos
#include <string>
#include <vector>
#include <regex>
struct MalwareIndicators {
std::vector<std::string> suspicious_keywords = {
"keygen", "crack", "loader", "pre-activated",
"serial", "license key", "full version",
"premium", "pro version", "activation"
};
bool checkDescription(const std::string& desc) {
std::string lower_desc = desc;
std::transform(lower_desc.begin(), lower_desc.end(),
lower_desc.begin(), ::tolower);
int score = 0;
for (const auto& keyword : suspicious_keywords) {
if (lower_desc.find(keyword) != std::string::npos) {
score++;
}
}
// 3+ suspicious keywords = likely malware
return score >= 3;
}
bool checkMetrics(int stars, int forks, int issues) {
// High stars but no community engagement
if (stars > 50 && forks == 0 && issues == 0) {
return true;
}
return false;
}
};#include <map>
#include <string>
class SecuritySoftwareValidator {
public:
std::map<std::string, std::string> legitimate_sources = {
{"avast", "https://www.avast.com/"},
{"avg", "https://www.avg.com/"},
{"norton", "https://www.norton.com/"},
{"kaspersky", "https://www.kaspersky.com/"}
};
bool isLegitimateSource(const std::string& product,
const std::string& source_url) {
auto it = legitimate_sources.find(product);
if (it != legitimate_sources.end()) {
return source_url.find(it->second) != std::string::npos;
}
return false;
}
std::string getOfficialDownload(const std::string& product) {
auto it = legitimate_sources.find(product);
if (it != legitimate_sources.end()) {
return it->second;
}
return "Unknown product";
}
};struct RepoMetadata {
std::string description;
int stars;
int forks;
int issues;
std::string language;
bool has_readme;
std::string creation_date;
};
bool analyzeThreatLevel(const RepoMetadata& repo) {
MalwareIndicators detector;
// Check description for suspicious terms
if (detector.checkDescription(repo.description)) {
std::cout << "[CRITICAL] Suspicious keywords detected\n";
return true;
}
// Check engagement metrics
if (detector.checkMetrics(repo.stars, repo.forks, repo.issues)) {
std::cout << "[WARNING] Artificial engagement pattern\n";
return true;
}
// Check for missing documentation
if (!repo.has_readme && repo.stars > 10) {
std::cout << "[WARNING] No README in popular repo\n";
return true;
}
return false;
}#include <filesystem>
#include <fstream>
class ContentScanner {
public:
std::vector<std::string> dangerous_extensions = {
".exe", ".dll", ".bat", ".cmd", ".ps1",
".vbs", ".js", ".scr", ".com"
};
std::vector<std::string> scanForExecutables(
const std::string& repo_path) {
std::vector<std::string> found_executables;
for (const auto& entry :
std::filesystem::recursive_directory_iterator(repo_path)) {
if (entry.is_regular_file()) {
std::string ext = entry.path().extension().string();
if (isExecutable(ext)) {
found_executables.push_back(entry.path().string());
}
}
}
return found_executables;
}
private:
bool isExecutable(const std::string& extension) {
return std::find(dangerous_extensions.begin(),
dangerous_extensions.end(),
extension) != dangerous_extensions.end();
}
};#include <iostream>
void provideOfficialSource() {
std::cout << "Official Avast Downloads:\n";
std::cout << "Free Antivirus: https://www.avast.com/free-antivirus-download\n";
std::cout << "Premium Security: https://www.avast.com/premium-security\n";
std::cout << "\nNEVER download security software from:\n";
std::cout << "- GitHub repositories\n";
std::cout << "- File sharing sites\n";
std::cout << "- Torrent sites\n";
std::cout << "- Sites offering 'cracked' or 'pre-activated' versions\n";
}struct AbuseReport {
std::string repo_url;
std::string violation_type;
std::string evidence;
void generateReport() {
std::cout << "=== GitHub Abuse Report ===\n";
std::cout << "Repository: " << repo_url << "\n";
std::cout << "Violation: " << violation_type << "\n";
std::cout << "Evidence: " << evidence << "\n";
std::cout << "\nReport at: https://github.com/contact/report-abuse\n";
}
};
// Example usage
AbuseReport report;
report.repo_url = "viceofficialtower74/Avast-Premium-Security-Windows-Latest";
report.violation_type = "Malware Distribution / Piracy";
report.evidence = "Keywords: keygen, pre-activated, loader, serial";
report.generateReport();bool isLegitimateSecurityRepo(const std::string& repo_name,
const std::string& org_name) {
// Actual legitimate patterns
std::vector<std::string> legitimate_orgs = {
"avast", "avgantivirus", "norton",
"microsoft", "clamav"
};
// Check for official organization
for (const auto& org : legitimate_orgs) {
if (org_name == org) {
return true;
}
}
return false;
}# For scanning and reporting
export GITHUB_TOKEN=${GITHUB_TOKEN}
export VIRUSTOTAL_API_KEY=${VIRUSTOTAL_API_KEY}