Skip to content

Commit

Permalink
First commit
Browse files Browse the repository at this point in the history
  • Loading branch information
mauricelambert authored Mar 15, 2022
0 parents commit a35a304
Show file tree
Hide file tree
Showing 8 changed files with 217 additions and 0 deletions.
27 changes: 27 additions & 0 deletions EicarSpam.c
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 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;
}
29 changes: 29 additions & 0 deletions EicarSpam.go
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)
}
}
}
6 changes: 6 additions & 0 deletions EicarSpam.pl
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
foreach my $i ((1..300)) {
# open a filehandle for your file
open my $file, '>', "test$i.txt" or die "test$i.txt: $!";
printf $file '%sEICAR-STANDARD-ANTIVIRUS-TEST-FILE%s', 'X5O!P%@AP[4\PZX54(P^)7CC)7}$', '!$H+H*';
close $file;
}
5 changes: 5 additions & 0 deletions EicarSpam.ps1
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
}
5 changes: 5 additions & 0 deletions EicarSpam.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/usr/bin/env python3

for a in range(300):
with open(f"test{a}","w") as f:
_ = f.write("X5O!P%@AP[4\\PZX54(P^)7CC)7}$_!$H+H*".replace("_", "EICAR-STANDARD-ANTIVIRUS-TEST-FILE"))
7 changes: 7 additions & 0 deletions EicarSpam.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
300.times {
|i| File.open("tmp#{i}.txt", 'w') do |f|
f.write('X5O!P%@AP[4\PZX54(P^)7CC)7}$')
f.write('EICAR-STANDARD-ANTIVIRUS-TEST-FILE')
f.write('!$H+H*')
end
}
6 changes: 6 additions & 0 deletions EicarSpam.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/usr/bin/env bash

a='X5O!P%@AP[4\PZX54(P^)7CC)7}$_!$H+H*'
for i in {0..300}; do
echo "${a/_/EICAR-STANDARD-ANTIVIRUS-TEST-FILE}" > "test${i}.txt"
done
132 changes: 132 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
# Tests antivirus

## Python

```python
for a in range(300):
with open(f"test{a}","w") as f:
_ = f.write("X5O!P%@AP[4\\PZX54(P^)7CC)7}$_!$H+H*".replace("_", "EICAR-STANDARD-ANTIVIRUS-TEST-FILE"))
```

## Powershell

```powershell
$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
}
```

## Bash

```bash
a='X5O!P%@AP[4\PZX54(P^)7CC)7}$_!$H+H*'
for i in {0..300}; do
echo "${a/_/EICAR-STANDARD-ANTIVIRUS-TEST-FILE}" > "test${i}.txt"
done
```

```bash
echo 'X5O!P%@AP[4\PZX54(P^)7CC)7}$'"EICAR-STANDARD-ANTIVIRUS-TEST-FILE"'!$H+H*' > "test.txt"
```

## Batch

```bash
@echo off
SET a=X5O!P%@AP[4\PZX54(P^)7CC)7}$
SET b=EICAR-STANDARD-ANTIVIRUS-TEST-FILE
SET c=!$H+H*

for /L %D in (1,1,300) do echo %a%%b%%c% > test%D.txt
```
## Ruby
```rb
300.times {
|i| File.open("tmp#{i}.txt", 'w') do |f|
f.write('X5O!P%@AP[4\PZX54(P^)7CC)7}$')
f.write('EICAR-STANDARD-ANTIVIRUS-TEST-FILE')
f.write('!$H+H*')
end
}
```
## Perl
```perl
foreach my $i ((1..300)) {
# open a filehandle for your file
open my $file, '>', "test$i.txt" or die "test$i.txt: $!";
printf $file '%sEICAR-STANDARD-ANTIVIRUS-TEST-FILE%s', 'X5O!P%@AP[4\PZX54(P^)7CC)7}$', '!$H+H*';
close $file;
}
```
## Go
```go
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)
}
}
}
```
## C
```c
#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 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;
}
```

0 comments on commit a35a304

Please sign in to comment.