Skip to content

Commit

Permalink
Simplfication Update
Browse files Browse the repository at this point in the history
* Multiple Extenions Names
* Removed all dependencies
* Update UI to be more scary
  • Loading branch information
leeberg committed Jan 18, 2021
1 parent 72ffb67 commit 89d6eb6
Show file tree
Hide file tree
Showing 7 changed files with 185 additions and 102 deletions.
8 changes: 1 addition & 7 deletions CashCat/CashCat.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,6 @@
<ApplicationIcon>Cjdowner-BCH.ico</ApplicationIcon>
</PropertyGroup>
<ItemGroup>
<Reference Include="Newtonsoft.Json, Version=12.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.12.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="RestSharp, Version=106.11.4.0, Culture=neutral, PublicKeyToken=598062e77f915f75, processorArchitecture=MSIL">
<HintPath>..\packages\RestSharp.106.11.4\lib\net452\RestSharp.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Web" />
Expand All @@ -87,6 +81,7 @@
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</ApplicationDefinition>
<Compile Include="RansomFiles.cs" />
<Page Include="MainWindow.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
Expand Down Expand Up @@ -120,7 +115,6 @@
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
</EmbeddedResource>
<None Include="packages.config" />
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
Expand Down
13 changes: 7 additions & 6 deletions CashCat/ConfigurationFile.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using Newtonsoft.Json;
using System;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
Expand All @@ -16,7 +15,9 @@ public partial class ConfigurationFile


// Get Current Config file // return object
public ConfigurationFile ConfigurationFileSetup(string path)
//public ConfigurationFile ConfigurationFileSetup(string path)

public void ConfigurationFileSetup(string path)
{
string jsonPath = path + "\\CashCat.json";
// read JSON directly from a file
Expand All @@ -26,17 +27,17 @@ public ConfigurationFile ConfigurationFileSetup(string path)
{
string json = file.ReadToEnd();

ConfigurationFile CurrentConfig = JsonConvert.DeserializeObject<ConfigurationFile>(json);
//ConfigurationFile CurrentConfig = JsonConvert.DeserializeObject<ConfigurationFile>(json);

return CurrentConfig;
//return CurrentConfig;

}

}
catch
{
Console.WriteLine("Error Loading JSON Config");
return null;
//return null;
}


Expand Down
87 changes: 36 additions & 51 deletions CashCat/FileSystemOperation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ public class FileSystemOperation
/// </summary>
///

private RansomFiles RandomwareFileList = new RansomFiles();


public void WriteLog(string logMessage)
{
Expand Down Expand Up @@ -78,6 +80,29 @@ public FileInfo[] GetLockyFileCount(string path)
return Files;
}

public List<FileInfo> GetRansomedFileCount(string path)
{
DirectoryInfo d = new DirectoryInfo(path);
FileInfo[] Files = d.GetFiles("*");

List<FileInfo> RansomwareFiles = new List<FileInfo>();

int fileCount = 0;

foreach (FileInfo file in Files)
{

if(RandomwareFileList.fileExtensions.Contains(file.Extension))
{
RansomwareFiles.Add(file);
}

}

return RansomwareFiles;
}




public FileInfo[] GetTXTFileCount (string path)
Expand All @@ -90,9 +115,13 @@ public FileInfo[] GetTXTFileCount (string path)
public void LockTXTFile(FileInfo file)
{
string oldfilename = file.Name;
string newfilename = (file.Name).Replace(".txt", ".locky");


string newExtension = RandomwareFileList.GetRandomFileExtension();

string newfilename = (file.Name).Replace(".txt", newExtension);
string oldfileExtension = file.Extension;
string newfilefullname = (file.FullName).Replace(".txt", ".locky");
string newfilefullname = (file.FullName).Replace(".txt", newExtension);

try
{
Expand All @@ -104,37 +133,14 @@ public void LockTXTFile(FileInfo file)
}
}

public void LockTXTFiles(string path)
{
DirectoryInfo d = new DirectoryInfo(path);
FileInfo[] Files = d.GetFiles("*.txt"); //Getting Txt files

foreach (FileInfo file in Files)
{
//Console.WriteLine(file.Name);
string oldfilename = file.Name;
string newfilename = (file.Name).Replace(".txt", ".locky");
string oldfileExtension = file.Extension;
string newfilefullname = (file.FullName).Replace(".txt", ".locky");

try
{
System.IO.File.Move(file.Name, newfilename);
}
catch
{
//can't touch this
}


}
}

public void UnlockLockyFile(FileInfo file)
public void UnlockRansomwareFile(FileInfo file)
{
//Console.WriteLine(file.Name);
string newfilename = (file.Name).Replace(".locky", ".txt");
string newfilefullname = (file.FullName).Replace(".locky", ".txt");


string newfilename = (file.Name).Replace(file.Extension, ".txt");
// string newfilefullname = (file.FullName).Replace(".locky", ".txt");
try
{
System.IO.File.Move(file.Name, newfilename);
Expand All @@ -145,27 +151,6 @@ public void UnlockLockyFile(FileInfo file)
}
}

public void UnlockLockyFiles(string path)
{
DirectoryInfo d = new DirectoryInfo(path);
FileInfo[] Files = d.GetFiles("*.locky"); //Getting locky files

foreach (FileInfo file in Files)
{
//Console.WriteLine(file.Name);
string newfilename = (file.Name).Replace(".locky", ".txt");
string newfilefullname = (file.FullName).Replace(".locky", ".txt");
try
{
System.IO.File.Move(file.Name, newfilename);
}
catch
{
//can't touch this
}

}
}

}
}
27 changes: 20 additions & 7 deletions CashCat/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
xmlns:local="clr-namespace:CashCat"
mc:Ignorable="d"
Title="CryptoLocker Simulator" Height="575" Width="820" ResizeMode="CanMinimize" WindowStartupLocation="CenterScreen" ContentRendered="Window_ContentRendered">
<Grid Name="maingrid" Margin="0,0,-7,-3" Background="Red" OverridesDefaultStyle="True">
<Grid Name="maingrid" Margin="0,0,-7,-3" Background="#7E0F0D" OverridesDefaultStyle="True">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="47*"/>
<ColumnDefinition Width="256*"/>
Expand All @@ -18,28 +18,41 @@
</Grid.RowDefinitions>

<Image Name="CashCatBackground" Visibility="Collapsed" HorizontalAlignment="Left" Height="609" Margin="0,0,-1,-67" VerticalAlignment="Top" Width="822" Source="cashcat.jpg" Grid.ColumnSpan="3"/>
<Image Name="LockerIcon" HorizontalAlignment="Left" Height="132" VerticalAlignment="Top" Width="151" Source="font-awesome_4-7-0_lock_100_0_ffffff_none.png" Margin="0,71,0,0" Grid.Column="1" RenderTransformOrigin="0.5,0.5">
<Image Name="LockerIcon" HorizontalAlignment="Left" Height="136" VerticalAlignment="Top" Width="136" Source="font-awesome_4-7-0_lock_100_0_ffffff_none.png" Margin="0,26,0,0" Grid.Column="1" RenderTransformOrigin="0.5,0.5">
<Image.RenderTransform>
<RotateTransform/>
</Image.RenderTransform>
</Image>
<Label Name="lblLockingFile" Content="" HorizontalContentAlignment="Center" HorizontalAlignment="Left" Margin="19,222,0,0" VerticalAlignment="Top" FontSize="12" Foreground="White" FontWeight="Normal" Height="36" Width="188" Grid.ColumnSpan="2"/>
<Label Name="lblLockingFile" Content="" HorizontalContentAlignment="Center" HorizontalAlignment="Left" Margin="19,189,0,0" VerticalAlignment="Top" FontSize="12" Foreground="White" FontWeight="Normal" Height="36" Width="188" Grid.ColumnSpan="2"/>


<Rectangle Name ="rectInstructionsBackground" Fill="Black" HorizontalAlignment="Left" Height="442" Margin="195,71,0,0" Stroke="Black" VerticalAlignment="Top" Width="548" Opacity="0.5" Grid.Column="1" Grid.ColumnSpan="2"/>
<Label Name="lblMainLabel" Content="CASHCAT HAS ENCRYPTED YOUR FILES" HorizontalAlignment="Left" Margin="0,10,0,0" VerticalAlignment="Top" FontSize="33" Foreground="White" FontWeight="Bold" Grid.Column="1" Grid.ColumnSpan="2"/>
<Label Name="lblMainLabel" Content="Ooops, your files have been encrypted!" HorizontalAlignment="Left" Margin="195,10,0,0" VerticalAlignment="Top" FontSize="24" Foreground="White" FontWeight="Bold" Grid.Column="1" Grid.ColumnSpan="2"/>
<TextBox Name="txtbox_Bitcoingaddess" HorizontalAlignment="Left" Height="42" Margin="216,399,0,0" TextWrapping="Wrap" Text="Unlock Code Here" VerticalAlignment="Top" Width="511" FontSize="20" RenderTransformOrigin="0.5,0.5" GotFocus="txtbox_Bitcoingaddess_GotFocus" Grid.Column="1" Grid.ColumnSpan="2" MaxLines="1"/>

<TextBox Name="txtbox_Instructions" HorizontalAlignment="Left" Height="280" Margin="216,96,0,0" TextWrapping="Wrap" Text="Your important files are now encrypted! &#xD;&#xA;&#xD;&#xA;The lock was produced using a unique public RSA-4096 generated for this computer. To decrypt files you need to obtain the private key. The Single copy of the private key which allow you to decrypt the files is on a secret server on the internet dark web. The server will destroy the key after a time specified in this window.&#xD;&#xA;&#xD;&#xA;To obtain the private key for this computer, you need dot pay 300 USD / 300 EUR similar amount in other currency. " VerticalAlignment="Top" Width="511" FontSize="20" RenderTransformOrigin="0.207,0.738" GotFocus="txtbox_Bitcoingaddess_GotFocus" Grid.Column="1" Grid.ColumnSpan="2"/>
<TextBox Name="txtbox_Instructions" HorizontalAlignment="Left" Height="280" Margin="216,96,0,0" TextWrapping="Wrap" Text="Your important files are now encrypted! &#xD;&#xA;&#xD;&#xA;To decrypt files you need to obtain the private key. The Single copy of the private key which allow you to decrypt the files is on a secret server on the internet dark web. The server will destroy the key after a time specified in this window.&#xD;&#xA;&#xD;&#xA;To obtain the private key for this computer, you need dot pay 300 USD / 300 EUR similar amount in other currency. " VerticalAlignment="Top" Width="511" FontSize="20" RenderTransformOrigin="0.207,0.738" GotFocus="txtbox_Bitcoingaddess_GotFocus" Grid.Column="1" Grid.ColumnSpan="2"/>
<Button Name ="btn_send" Content="Send" HorizontalAlignment="Left" Margin="216,446,0,0" VerticalAlignment="Top" Width="511" Height="48" FontSize="18" Click="Button_Click" Grid.Column="1" Grid.ColumnSpan="2"/>
<RichTextBox HorizontalAlignment="Left" Height="25" VerticalAlignment="Top" Width="116" Background="Transparent" MouseDown="RichTextBox_MouseDown" IsTabStop="False" BorderBrush="#00ABADB3" IsReadOnly="True" Cursor="Hand" SelectionBrush="#000078D7" BorderThickness="0" Grid.Column="1" Margin="0,484,0,0">
<RichTextBox HorizontalAlignment="Left" Height="25" VerticalAlignment="Top" Width="116" Background="Transparent" MouseDown="RichTextBox_MouseDown" IsTabStop="False" BorderBrush="#00ABADB3" IsReadOnly="True" Cursor="Hand" SelectionBrush="#000078D7" BorderThickness="0" Margin="19,484,0,0" Grid.ColumnSpan="2">
<FlowDocument>
<Paragraph>
<Run Text="Contact Us" Foreground="White" FontWeight="Bold" FontSize="20" TextDecorations="Underline"/>
<Run Text="Contact Us" Foreground="White" FontWeight="Bold" FontSize="20" TextDecorations="Underline" MouseDown="Run_MouseDown"/>
</Paragraph>
</FlowDocument>
</RichTextBox>


<Rectangle Name="rect_pricetime" HorizontalAlignment="Left" Height="100" Margin="17,189,0,0" Stroke="White" VerticalAlignment="Top" Width="200" Grid.ColumnSpan="2"/>
<TextBlock Name="txtblk_paymentRaiseHeader" HorizontalAlignment="Center" Margin="17,190,86,0" TextAlignment="Center" TextWrapping="Wrap" Text="Payment Price increases on" VerticalAlignment="Top" Foreground="#FFFFFA00" FontWeight="Bold" Width="200" Grid.Column="0" Grid.ColumnSpan="2" FontSize="14"/>
<TextBlock Name="txtblk_paymentRaiseTime" HorizontalAlignment="Center" Margin="19,209,84,0" TextAlignment="Center" TextWrapping="Wrap" Text="TimeLostStamp" VerticalAlignment="Top" Foreground="#FFFFFF" Width="200" Grid.Column="0" Grid.ColumnSpan="2"/>
<TextBlock Name="txtblk_paymentRaiseLeftLabel" HorizontalAlignment="Center" Margin="19,246,84,0" TextAlignment="Center" TextWrapping="Wrap" Text="Time Left" VerticalAlignment="Top" Foreground="#FFFFFF" Width="200" Grid.Column="0" Grid.ColumnSpan="2" FontWeight="Bold"/>
<TextBlock Name="txtblk_paymentRaiseCountDown" HorizontalAlignment="Center" Margin="19,267,84,0" TextAlignment="Center" TextWrapping="Wrap" Text="05:20:04:50" VerticalAlignment="Top" Foreground="#FFFFFF" Width="200" Grid.Column="0" Grid.ColumnSpan="2" FontFamily="Consolas" Height="22" FontSize="18"/>

<Rectangle Name="rect_losttime" HorizontalAlignment="Left" Height="100" Margin="17,346,0,0" Stroke="White" VerticalAlignment="Top" Width="200" Grid.ColumnSpan="2"/>
<TextBlock Name="txtblk_fileLostHeader" HorizontalAlignment="Center" Margin="16,349,87,0" TextAlignment="Center" TextWrapping="Wrap" Text="Your files will be lost on" VerticalAlignment="Top" Foreground="#FFFFFA00" FontWeight="Bold" Width="200" Grid.Column="0" Grid.ColumnSpan="2" FontSize="14"/>
<TextBlock Name="txtblk_fileLostTime" HorizontalAlignment="Center" Margin="17,370,86,0" TextAlignment="Center" TextWrapping="Wrap" Text="TimeLostStamp" VerticalAlignment="Top" Foreground="#FFFFFF" Width="200" Grid.Column="0" Grid.ColumnSpan="2"/>
<TextBlock Name="txtblk_fileLostLeftLabel" HorizontalAlignment="Center" Margin="19,398,84,0" TextAlignment="Center" TextWrapping="Wrap" Text="Time Left" VerticalAlignment="Top" Foreground="#FFFFFF" Width="200" Grid.Column="0" Grid.ColumnSpan="2" FontWeight="Bold"/>
<TextBlock Name="txtblk_fileLostCountDown" HorizontalAlignment="Center" Margin="19,419,84,0" TextAlignment="Center" TextWrapping="Wrap" Text="05:20:04:50" VerticalAlignment="Top" Foreground="#FFFFFF" Width="200" Grid.Column="0" Grid.ColumnSpan="2" FontFamily="Consolas" Height="22" FontSize="18"/>


</Grid>
</Window>
Loading

0 comments on commit 89d6eb6

Please sign in to comment.