-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2839949
commit 84921e7
Showing
29 changed files
with
1,375 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,179 @@ | ||
# EicarSpam | ||
|
||
## How to use | ||
|
||
### Python | ||
|
||
```python | ||
# Windows | ||
from ctypes import windll as sysdll | ||
filename = "EicarSpam.dll" | ||
|
||
# Linux | ||
from ctypes import cdll as sysdll | ||
filename = "EicarSpam.so" | ||
|
||
from os.path import abspath | ||
eicarspam = sysdll.LoadLibrary(abspath("EicarSpam.dll")) | ||
eicarspam.eicar(300) | ||
``` | ||
|
||
### Ruby | ||
|
||
```rb | ||
# Windows | ||
FILENAME = "EicarSpam.dll" | ||
|
||
# Linux | ||
FILENAME = "EicarSpam.so" | ||
|
||
require 'fiddle/import' | ||
require 'fiddle/types' | ||
|
||
module EicarSpam | ||
extend Fiddle::Importer | ||
dlload File.join(Dir.pwd, FILENAME) | ||
include Fiddle::Win32Types | ||
extern 'int eicar(int)' | ||
end | ||
|
||
EicarSpam.eicar(5) | ||
``` | ||
|
||
### Perl | ||
|
||
```perl | ||
# Windows | ||
use Cwd qw(abs_path); | ||
use File::Spec; | ||
use Win32::API; | ||
|
||
Win32::API->Import(abs_path(File::Spec->canonpath('EicarSpam.dll')),'int eicar(int x)'); | ||
eicar(5); | ||
``` | ||
|
||
### JScript | ||
|
||
```bash | ||
# download dynwrapx.dll (https://dynwrapx.script-coding.com/dwx/pages/download.php?ver=2.2.0.0&lang=en) | ||
regsvr32.exe /i <path>\dynwrapx.dll | ||
cscript EicarSpam.js | ||
``` | ||
|
||
```js | ||
var oDynaWrap = new ActiveXObject( "DynamicWrapper" ) | ||
oDynaWrap.Register( "EicarSpam.dll", "eicar", "I=l", "R=l" ) // I(input)=l(int), R(return)=l(int) | ||
oDynaWrap.eicar(5) | ||
``` | ||
|
||
### VBScript | ||
|
||
```bash | ||
# download dynwrapx.dll (https://dynwrapx.script-coding.com/dwx/pages/download.php?ver=2.2.0.0&lang=en) | ||
regsvr32.exe /i <path>\dynwrapx.dll | ||
cscript EicarSpam.vbs | ||
``` | ||
|
||
```vbs | ||
Set DX = CreateObject("DynamicWrapperX") | ||
DX.Register "EicarSpam.dll", "eicar", "i=l", "r=l" | ||
DX.eicar(5) | ||
``` | ||
|
||
## Sources | ||
|
||
### Rust | ||
|
||
```rs | ||
use std::fs; | ||
|
||
#[no_mangle] | ||
pub extern fn eicar(x: i32) -> i32 { | ||
let eicar = format!( | ||
"{}EICAR-STANDARD-ANTIVIRUS-TEST-FILE{end}", | ||
"X5O!P%@AP[4\\PZX54(P^)7CC)7}$", | ||
end="!$H+H*" | ||
); | ||
|
||
for x in 0..x { | ||
fs::write( | ||
format!("test{}.txt", x), eicar.clone() | ||
); | ||
} | ||
|
||
return 0; | ||
} | ||
``` | ||
|
||
### C | ||
|
||
```c | ||
#include<stdio.h> | ||
|
||
__declspec( dllexport ) int eicar(int x) { | ||
FILE *file; | ||
char filename[12]; | ||
|
||
for(int i = 0; i < x; i++) { | ||
snprintf(filename, 12, "test%d.txt", i); | ||
file = fopen(filename, "w"); | ||
if(file == NULL) { | ||
printf("file can't be opened\n"); | ||
return 1; | ||
} | ||
|
||
fprintf( | ||
file, | ||
"%sEICAR-STANDARD-ANTIVIRUS-TEST-FILE%s", | ||
"X5O!P%@AP[4\\PZX54(P^)7CC)7}$", | ||
"!$H+H*" | ||
); | ||
} | ||
|
||
fclose(file); | ||
|
||
return 0; | ||
} | ||
``` | ||
### Go | ||
```go | ||
package main | ||
import ( | ||
"log" | ||
"os" | ||
"fmt" | ||
"C" | ||
) | ||
//export eicar | ||
func eicar(x C.uint) C.uint { | ||
var datas [3]string | ||
datas[0] = "X5O!P%@AP[4\\PZX54(P^)7CC)7}$" | ||
datas[1] = "EICAR-STANDARD-ANTIVIRUS-TEST-FILE" | ||
datas[2] = "!$H+H*" | ||
var i C.uint | ||
for i = 0; i < x; i++ { | ||
file, err := os.Create(fmt.Sprintf("./test%d.txt", i)) | ||
if err != nil { | ||
log.Fatal(err) | ||
} | ||
defer file.Close() | ||
for _, data := range datas { | ||
file.WriteString(data) | ||
} | ||
} | ||
return C.uint(0) | ||
} | ||
func main () {} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#include<stdio.h> | ||
|
||
// Linux: | ||
// __attribute__((visibility("default"))) int eicar(int x) { | ||
__declspec( dllexport ) int eicar(int x) { | ||
FILE *file; | ||
char filename[12]; | ||
|
||
for(int i = 0; i < x; i++) { | ||
snprintf(filename, 12, "test%d.txt", i); | ||
file = fopen(filename, "w"); | ||
|
||
if(file == NULL) { | ||
printf("file \"test%d.txt\" can't be opened\n", i); | ||
return 1; | ||
} | ||
|
||
fprintf( | ||
file, | ||
"%sEICAR-STANDARD-ANTIVIRUS-TEST-FILE%s", | ||
"X5O!P%@AP[4\\PZX54(P^)7CC)7}$", | ||
"!$H+H*" | ||
); | ||
|
||
fclose(file); | ||
} | ||
|
||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
package main | ||
|
||
import ( | ||
"log" | ||
"os" | ||
"fmt" | ||
"C" | ||
) | ||
|
||
//export eicar | ||
func eicar(x C.uint) C.uint { | ||
var datas [3]string | ||
datas[0] = "X5O!P%@AP[4\\PZX54(P^)7CC)7}$" | ||
datas[1] = "EICAR-STANDARD-ANTIVIRUS-TEST-FILE" | ||
datas[2] = "!$H+H*" | ||
|
||
var i C.uint | ||
|
||
for i = 0; i < x; i++ { | ||
file, err := os.Create(fmt.Sprintf("./test%d.txt", i)) | ||
|
||
if err != nil { | ||
log.Fatal(err) | ||
} | ||
|
||
defer file.Close() | ||
|
||
for _, data := range datas { | ||
file.WriteString(data) | ||
} | ||
} | ||
|
||
return C.uint(0) | ||
} | ||
|
||
func main () {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
use std::fs; | ||
|
||
#[no_mangle] | ||
pub extern fn eicar(x: i32) -> i32 { | ||
let eicar = format!( | ||
"{}EICAR-STANDARD-ANTIVIRUS-TEST-FILE{end}", | ||
"X5O!P%@AP[4\\PZX54(P^)7CC)7}$", | ||
end="!$H+H*" | ||
); | ||
|
||
for x in 0..x { | ||
fs::write( | ||
format!("test{}.txt", x), eicar.clone() | ||
); | ||
} | ||
|
||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#include<stdio.h> | ||
|
||
int main() { | ||
FILE *file; | ||
char filename[12]; | ||
|
||
for(int i = 0; i < 300; i++) { | ||
snprintf(filename, 12, "test%d.txt", i); | ||
file = fopen(filename, "w"); | ||
|
||
if(file == NULL) { | ||
printf("file \"test%d.txt\" can't be opened\n", i); | ||
return 1; | ||
} | ||
|
||
fprintf( | ||
file, | ||
"%sEICAR-STANDARD-ANTIVIRUS-TEST-FILE%s", | ||
"X5O!P%@AP[4\\PZX54(P^)7CC)7}$", | ||
"!$H+H*" | ||
); | ||
|
||
fclose(file); | ||
} | ||
|
||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
open System.IO | ||
let start = "X5O!P%@AP[4\\PZX54(P^)7CC)7}$" | ||
let end_ = "!$H+H*" | ||
let eicar = ( | ||
sprintf | ||
$"{start}EICAR-STANDARD-ANTIVIRUS-TEST-FILE{end_}" | ||
) | ||
for i = 1 to 300 do | ||
File.WriteAllText( | ||
(sprintf "test%i.txt" i), eicar | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package main | ||
|
||
import ( | ||
"log" | ||
"os" | ||
"fmt" | ||
) | ||
|
||
|
||
func main() { | ||
var datas [3]string | ||
datas[0] = "X5O!P%@AP[4\\PZX54(P^)7CC)7}$" | ||
datas[1] = "EICAR-STANDARD-ANTIVIRUS-TEST-FILE" | ||
datas[2] = "!$H+H*" | ||
|
||
for i := 0; i < 300; i++ { | ||
file, err := os.Create(fmt.Sprintf("./test%d.txt", i)) | ||
|
||
if err != nil { | ||
log.Fatal(err) | ||
} | ||
|
||
defer file.Close() | ||
|
||
for _, data := range datas { | ||
file.WriteString(data) | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
$string = 'X5O!P%@AP[4\PZX54(P^)7CC)7}$_!$H+H*'.replace('_', 'EICAR-STANDARD-ANTIVIRUS-TEST-FILE') | ||
|
||
for($i = 0; $i -lt 300; $i++){ | ||
Set-Content "test$i.txt" $string | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
use std::fs; | ||
|
||
fn main() -> std::io::Result<()> { | ||
let eicar = format!( | ||
"{}EICAR-STANDARD-ANTIVIRUS-TEST-FILE{end}", | ||
"X5O!P%@AP[4\\PZX54(P^)7CC)7}$", | ||
end="!$H+H*" | ||
); | ||
|
||
for x in 0..301 { | ||
fs::write( | ||
format!("test{}.txt", x), eicar.clone() | ||
)?; | ||
} | ||
|
||
Ok(()) | ||
} |
Oops, something went wrong.