svenstaro / genact Goto Github PK
View Code? Open in Web Editor NEW🌀 A nonsense activity generator
Home Page: https://svenstaro.github.io/genact/
License: MIT License
🌀 A nonsense activity generator
Home Page: https://svenstaro.github.io/genact/
License: MIT License
It would be fun to have it running on Android using Termux and do some Watch_Dogs stuff!
When run with cargo run
, fails like this
cargo version: 0.18.0
system: ubuntu16.04, x86_64
kenan@ubuntu16:~/Git/Genact$ cargo run
Updating registry `https://github.com/rust-lang/crates.io-index`
Downloading humantime v1.0.0
Downloading regex v0.2.5
Downloading pbr v1.0.0
Downloading rand v0.4.2
Downloading yansi v0.3.4
Downloading lazy_static v1.0.0
Downloading url v1.6.0
Downloading chrono v0.4.0
Downloading quick-error v1.2.1
Downloading thread_local v0.3.5
Downloading utf8-ranges v1.0.0
Downloading aho-corasick v0.6.4
Downloading regex-syntax v0.4.2
Downloading memchr v2.0.1
Downloading unreachable v1.0.0
Downloading void v1.0.2
Downloading libc v0.2.36
Downloading kernel32-sys v0.2.2
Downloading time v0.1.39
Downloading winapi v0.2.8
Downloading winapi-build v0.1.1
Downloading percent-encoding v1.0.1
Downloading idna v0.1.4
Downloading matches v0.1.6
Downloading unicode-bidi v0.3.4
Downloading unicode-normalization v0.1.5
Downloading num v0.1.41
Downloading num-iter v0.1.34
Downloading num-integer v0.1.35
Downloading num-traits v0.1.41
Downloading ctrlc v3.1.0
Downloading clap v2.29.2
Downloading nix v0.9.0
Downloading cfg-if v0.1.2
Downloading bitflags v0.9.1
Downloading textwrap v0.9.0
Downloading vec_map v0.8.0
Downloading strsim v0.6.0
Downloading ansi_term v0.10.2
Downloading unicode-width v0.1.4
Downloading bitflags v1.0.1
Downloading atty v0.2.6
Compiling utf8-ranges v1.0.0
Compiling winapi v0.2.8
Compiling winapi-build v0.1.1
Compiling quick-error v1.2.1
Compiling yansi v0.3.4
Compiling matches v0.1.6
Compiling cfg-if v0.1.2
Compiling strsim v0.6.0
Compiling bitflags v1.0.1
Compiling ansi_term v0.10.2
error: expected ident, found #
--> /home/kenan/.cargo/registry/src/github.com-1ecc6299db9ec823/bitflags-1.0.1/src/lib.rs:423:29
|
423 | #[allow(deprecated)]
| ^
|
::: /home/kenan/.cargo/registry/src/github.com-1ecc6299db9ec823/bitflags-1.0.1/src/example_generated.rs
|
4 | bitflags! {
| - in this macro invocation
error: Could not compile `bitflags`.
Build failed, waiting for other jobs to finish...
error: build failed
Thanks!
I love this little program it added some fun boot gibberish top a little fake program i am writing together. Provided a little screenshot from it below.
One thing i would love to have is a param similar to the -s
that limits amount of blocks used instead of a set time.
This especially useful for the botnet
or downloading
simulations were you want it to stop after a set amount of gibberish.
The Terraform module hangs with the message "Acquiring state lock. This may take a few moments..." when accessed via the web version at https://svenstaro.github.io/genact/
The issue appears to be with the code, where the sleep command doesn't terminate:
print("Acquiring state lock. This may take a few moments...\r\n").await;
csleep(500).await;
Or could the problem lie with a subsequent operation that fails to execute?
The implementation of the sleep function is consistent with its use in other modules.
Would it be possible to turn this into a screensaver for macOS?
Thanks!
Is there a way to have the first n lines printed immediately upon execution, so it appears that the activity is already in progress? I'd imagine something like setting any pauses to 0 for the first n lines of code.
Implement a module that runs anti malware checks, for example like rhunter:
Performing file properties checks
Checking for prerequisites [ OK ]
/usr/sbin/adduser [ OK ]
/usr/sbin/chroot [ OK ]
/usr/sbin/cron [ WARNING ]
/usr/sbin/groupadd [ OK ]
/usr/sbin/groupdel [ OK ]
/usr/sbin/groupmod [ OK ]
...
Performing check of known rootkit files and directories
55808 Trojan - Variant A [ Not found ]
ADM Worm [ Not found ]
AjaKit Rootkit [ Not found ]
Adore Rootkit [ Not found ]
aPa Kit [ Not found ]
Apache Worm [ Not found ]
Ambient (ark) Rootkit [ Not found ]
Balaur Rootkit [ Not found ]
BeastKit Rootkit [ Not found ]
beX2 Rootkit [ Not found ]
...
Could also display bold warnings like "Machine infected" or something like that.
Cargo:
> cargo -V
cargo 0.21.0
Rust:
> rustc -V
rustc 1.20.0
Git Commit: "878ff15e319ed8ffe1c65ff1b978b515bcbaac6c"
Full Log:
> cargo run --verbose
Fresh unicode-width v0.1.4
Fresh num-traits v0.1.41
Fresh unicode-normalization v0.1.5
Fresh libc v0.2.36
Fresh strsim v0.6.0
Fresh winapi-build v0.1.1
Fresh bitflags v1.0.1
Fresh percent-encoding v1.0.1
Fresh matches v0.1.6
Fresh yansi v0.3.4
Fresh winapi v0.2.8
Fresh vec_map v0.8.0
Fresh lazy_static v1.0.0
Fresh ansi_term v0.10.2
Fresh textwrap v0.9.0
Fresh num-integer v0.1.35
Fresh atty v0.2.6
Fresh rand v0.4.2
Fresh time v0.1.39
Fresh unicode-bidi v0.3.4
Fresh num-iter v0.1.34
Fresh clap v2.29.2
Fresh idna v0.1.4
Fresh num v0.1.41
Fresh kernel32-sys v0.2.2
Fresh url v1.6.0
Fresh chrono v0.4.0
Fresh pbr v1.0.0
Compiling genact v0.2.2 (file:///Users/user/Projects/genact)
Running `rustc --crate-name genact src/main.rs --crate-type bin --emit=dep-info,link -C debuginfo=2 -C metadata=305c7506b7616774 -C extra-filename=-305c7506b7616774 --out-dir /Users/user/Projects/genact/target/debug/deps -L dependency=/Users/user/Projects/genact/target/debug/deps --extern clap=/Users/user/Projects/genact/target/debug/deps/libclap-d10104bdf2c6682a.rlib --extern pbr=/Users/user/Projects/genact/target/debug/deps/libpbr-d1d1ce28f23234fd.rlib --extern yansi=/Users/user/Projects/genact/target/debug/deps/libyansi-d18d1a0a9528bc95.rlib --extern url=/Users/user/Projects/genact/target/debug/deps/liburl-ed813f95a64cd49c.rlib --extern rand=/Users/user/Projects/genact/target/debug/deps/librand-8d6cf73b7d10cb96.rlib --extern chrono=/Users/user/Projects/genact/target/debug/deps/libchrono-cf7651806cb835ce.rlib --extern lazy_static=/Users/user/Projects/genact/target/debug/deps/liblazy_static-8411524b8178aea7.rlib`
error[E0597]: borrowed value does not live long enough
--> src/bootlog.rs:14:62
|
14 | let choice = rng.choose(&BOOTLOG_LIST).unwrap_or(&"");
| -- ^ temporary value dropped here while still borrowed
| |
| temporary value created here
...
33 | }
| - temporary value needs to live until here
|
= note: consider using a `let` binding to increase its lifetime
error[E0597]: borrowed value does not live long enough
--> src/cargo.rs:18:59
|
18 | let package_name = rng.choose(packages).unwrap_or(&"");
| -- ^ temporary value dropped here while still borrowed
| |
| temporary value created here
19 | (package_name.to_string(), package_version.to_string())
20 | }
| - temporary value needs to live until here
|
= note: consider using a `let` binding to increase its lifetime
error[E0597]: borrowed value does not live long enough
--> src/download.rs:16:55
|
16 | let chosen_file = rng.choose(files).unwrap_or(&"");
| -- ^ temporary value dropped here while still borrowed
| |
| temporary value created here
...
19 | }
| - temporary value needs to live until here
|
= note: consider using a `let` binding to increase its lifetime
error[E0597]: borrowed value does not live long enough
--> src/download.rs:30:62
|
30 | let extension = rng.choose(EXTENSIONS).unwrap_or(&".wat");
| ------ ^ temporary value dropped here while still borrowed
| |
| temporary value created here
...
66 | }
| - temporary value needs to live until here
|
= note: consider using a `let` binding to increase its lifetime
error: aborting due to 4 previous errors
error: Could not compile `genact`.
Caused by:
process didn't exit successfully: `rustc --crate-name genact src/main.rs --crate-type bin --emit=dep-info,link -C debuginfo=2 -C metadata=305c7506b7616774 -C extra-filename=-305c7506b7616774 --out-dir /Users/user/Projects/genact/target/debug/deps -L dependency=/Users/user/Projects/genact/target/debug/deps --extern clap=/Users/user/Projects/genact/target/debug/deps/libclap-d10104bdf2c6682a.rlib --extern pbr=/Users/user/Projects/genact/target/debug/deps/libpbr-d1d1ce28f23234fd.rlib --extern yansi=/Users/user/Projects/genact/target/debug/deps/libyansi-d18d1a0a9528bc95.rlib --extern url=/Users/user/Projects/genact/target/debug/deps/liburl-ed813f95a64cd49c.rlib --extern rand=/Users/user/Projects/genact/target/debug/deps/librand-8d6cf73b7d10cb96.rlib --extern chrono=/Users/user/Projects/genact/target/debug/deps/libchrono-cf7651806cb835ce.rlib --extern lazy_static=/Users/user/Projects/genact/target/debug/deps/liblazy_static-8411524b8178aea7.rlib` (exit code: 101)
Feel free to request more information
As the title says, module list output of genact --help
or genact --list-modules
is unordered,
will change of each run. Also, I noticed the random module choice does not rely on HashMap
's randomness.
When you scan the windows binaries on virustotal 5 scanners detect a trojan. Are these false positives or is this actual malware?
With these Terminal applications this happens quite often to me that these get flagged.
https://github.com/fdehau/tui-rs https://github.com/ratatui-org/ratatui
This might be a problem in the web version.
If you work a lot with Docker you probably used the prune function. Docker then deletes old stuff, the deletion of images is the most interesting one as if generates a lot of output.
Example:
Untagged: someregistry.com/somepackage/someversion:sometag
Untagged: someregistry.com/somepackage/someversion:sometag@sha256:7d94f9d338bbfe1764837983cbac0b7afaed7b03a1064d13491fc719687e8eb5
Deleted: sha256:ea3937bfd194e28e2c1993cee3f41fdd13acd223b68f9e7b340b6acd9d7d873f
Deleted: sha256:71a54a283dd7e2b57e2e90bda523738a98ef1c8473f0bbc986d5b3ac8e9d7f43
Deleted: sha256:b22b0a17fc0a6c561a162a201c42200bcac94a119c60adce010ff595a72685d7
Deleted: sha256:8aac053cfb44e3cd41f95332d5202c8f7d04cc3da23ae283399b7ad5f58f1a21
Deleted: sha256:6f2d30f883ddbe4fc64d9ec112b15001140d5b31ffc57aa4bab8b79c1c727d11
Deleted: sha256:992edefa1da8d3baf92b1432f8c7146abe2b14913e5dc50845981d7d75b3ee9b
Deleted: sha256:2080c5f6c0037a836f5d8477dcd30e49cc4219c8bcdaf8cf33ccb894d00cfc64
Deleted: sha256:d955c9f22c43dad4eef9f68c2544a532cb608c49ecac15ff1f79f9ce0ad6a25d
Deleted: sha256:1fa69807fe43f0c90b57bc941a07f015ccba6a5787ee4b86f543e3585928583a
Deleted: sha256:e4259b2a108e0673e40b14f41d38ecd471eb42edf6de91cf5cda92526f7d1be4
...
So it's basically two lines with a randomly generated package name and then a bunch of lines with SHA256 hashes. The number of lines depends on the size of the image.
Inspirations for package names can be found in the Docker Hub.
FYI, genact is going to be included in the FreeBSD ports collection soon.
The PR is available here: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=228306
When it's pulled it will be able to install a prebuilt genact package with:
pkg install genact
Nice and easy. You can start generating nonsense in no time.
Cheers! 😄
It will be perfect if we have a ttl
feature. We could setup something like -t 15m
and the program will stop dumping after 15 minutes.
It would be cool if the bootlog module behaved a bit more realistically in the way that it would sometimes burst a bunch of lines really quickly.
Thanks for creating such a handy little tool. It would be great if a percentage could be shown on the screen that correlated with the time given in the -e or -exitafter switches, so that the percentage complete was calculated based on the remaining time until the process will stop.
Maybe it can use a fixed row at the bottom of the terminal, with the output continuing above it?
Maybe I can cut the size down by compressing stuff in data/
during build time (with build.rs) and then decompressing it during runtime. Gotta investigate.
Could you create a docker image and push to docker hub for running it without downloading any additional files? This seems to be quick option to get new users as they only have to run single command instead of trying to download correct binaries and then figure out how to launch them.
Just put this to /etc/bash_completion.d/genact
.
#!/bin/bash
_genact_completions()
{
local cur prev opts modules shells
COMPREPLY=()
cur="${COMP_WORDS[COMP_CWORD]}"
prev="${COMP_WORDS[COMP_CWORD-1]}"
opts="-l --list-modules -m --modules -s --speed-factor --exit-after-time --exit-after-modules --print-completions --print-manpage -h --help -V --version"
modules="mkinitcpio kernel_compile cryptomining simcity composer cc download docker_build botnet memdump ansible bootlog julia docker_image_rm rkhunter weblog cargo bruteforce"
shells="bash elvish fish powershell zsh"
case "${prev}" in
-m|--modules)
COMPREPLY=( $(compgen -W "${modules}" -- ${cur}) )
return 0
;;
--print-completions)
COMPREPLY=( $(compgen -W "${shells}" -- ${cur}) )
return 0
;;
*)
if [[ ${cur} == -* ]] ; then
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
fi
return 0
;;
esac
}
complete -F _genact_completions genact
using gpt-2/transformer pretrain NLP mdoel to generat more real log
and deep network trainning process generator
Running an average ansible playbook lakes a lots of outputs and takes a good amount of time.
That would make a great module IMHO.
All sleep calls have a base speed but I think it'd be pretty cool if a global speed factor could be provided to slow down/speed up everything.
There should modules simulating web server logs.
Hi, completely new to Rust, never even written it, just wanted to try out this tool so I installed it but the build failed with the following error
Compiling zoneinfo_compiled v0.4.8
error[E0599]: no method named `copied` found for type `std::option::Option<&u8>` in the current scope
--> /home/palash25/.cargo/registry/src/github.com-1ecc6299db9ec823/zoneinfo_compiled-0.4.8/src/lib.rs:131:49
|
131 | let std_flag = tz.standard_flags.get(i).copied().unwrap_or_default() != 0;
| ^^^^^^
error[E0599]: no method named `copied` found for type `std::option::Option<&u8>` in the current scope
--> /home/palash25/.cargo/registry/src/github.com-1ecc6299db9ec823/zoneinfo_compiled-0.4.8/src/lib.rs:132:44
|
132 | let gmt_flag = tz.gmt_flags.get(i).copied().unwrap_or_default() != 0;
| ^^^^^^
error: aborting due to 2 previous errors
For more information about this error, try `rustc --explain E0599`.
error: Could not compile `zoneinfo_compiled`.
warning: build failed, waiting for other jobs to finish...
error: failed to compile `exa v0.9.0`, intermediate artifacts can be found at `/tmp/cargo-installLu1JlG`
Caused by:
build failed
Cargo version: 1.32.0
OS: Ubuntu 16.04
Wanted to know if someone else has faced this issue before and ways to solve this.
I think it's just so cool.
This might be obvious, but I couldn't find a key combination to exit.
Of course I could kill the process from another terminal, but...
This felt like just the first time that I typed the command "vi" in terminal
EDIT: nevermind... OSX messed with my keyboard again and CTR-C didn't work as expected.. sorry!
But Can I get a App format so that I can install and run on MacOSX . also supports M1 /. M2 chips? Thanks.
As I tried to compile it on Android 9 with Last Termux and last rust and cargo
Cargo It's fine and rust is working
Android : 9
Rust : 1.40.0
The error was this :
I think its need some changes in Cargo.toml
~/Gits/genact master
❯ cargo run
Downloading crates ...
Downloaded lazy_static v1.0.0
Downloaded rand v0.4.2
Downloaded yansi v0.3.4
Downloaded humantime v1.0.0
Downloaded ctrlc v3.1.0
Downloaded url v1.6.0
Downloaded chrono v0.4.0
Downloaded regex v0.2.6
Downloaded clap v2.29.4
Downloaded nix v0.9.0
Downloaded percent-encoding v1.0.1
Downloaded quick-error v1.2.1
Downloaded matches v0.1.6
Downloaded num v0.1.42
Downloaded bitflags v0.9.1
Downloaded strsim v0.7.0
Downloaded void v1.0.2
Downloaded vec_map v0.8.0
Downloaded thread_local v0.3.5
Downloaded memchr v2.0.1
Downloaded idna v0.1.4
Downloaded unicode-width v0.1.4
Downloaded utf8-ranges v1.0.0
Downloaded aho-corasick v0.6.4
Downloaded cfg-if v0.1.2
Downloaded atty v0.2.6
Downloaded bitflags v1.0.1
Downloaded textwrap v0.9.0
Downloaded regex-syntax v0.4.2
Downloaded time v0.1.39
Downloaded libc v0.2.36
Downloaded ansi_term v0.10.2
Downloaded num-integer v0.1.36
Downloaded unicode-bidi v0.3.4
Downloaded pbr v1.0.0
Downloaded unreachable v1.0.0
Downloaded num-traits v0.2.0
Downloaded num-iter v0.1.35
Downloaded unicode-normalization v0.1.5
Downloaded kernel32-sys v0.2.2
Downloaded winapi-build v0.1.1
Downloaded winapi v0.2.8
Compiling libc v0.2.36
Compiling void v1.0.2
Compiling num-traits v0.2.0
Compiling winapi-build v0.1.1
Compiling matches v0.1.6
Compiling bitflags v0.9.1
Compiling unicode-width v0.1.4
Compiling cfg-if v0.1.2
Compiling winapi v0.2.8
Compiling unicode-normalization v0.1.5
Compiling lazy_static v1.0.0
Compiling bitflags v1.0.1
Compiling percent-encoding v1.0.1
Compiling quick-error v1.2.1
Compiling regex-syntax v0.4.2
Compiling strsim v0.7.0
Compiling utf8-ranges v1.0.0
Compiling vec_map v0.8.0
Compiling ansi_term v0.10.2
Compiling yansi v0.3.4
Compiling unreachable v1.0.0
Compiling unicode-bidi v0.3.4
Compiling kernel32-sys v0.2.2
Compiling textwrap v0.9.0
Compiling time v0.1.39
Compiling memchr v2.0.1
Compiling atty v0.2.6
Compiling nix v0.9.0
Compiling rand v0.4.2
Compiling humantime v1.0.0
Compiling num-integer v0.1.36
Compiling thread_local v0.3.5
Compiling idna v0.1.4
Compiling aho-corasick v0.6.4
Compiling clap v2.29.4
Compiling num-iter v0.1.35
Compiling regex v0.2.6
Compiling url v1.6.0
error[E0713]: borrow may still be in use when destructor runs
--> /data/data/com.termux/files/home/.cargo/registry/src/github.com-1ecc6299db9ec823/url-1.6.0/src/form_urlencoded.rs:261:40
|
259 | impl<'a> Target for ::UrlQuery<'a> {
| -- lifetime `'a` defined here
260 | fn as_mut_string(&mut self) -> &mut String { &mut self.url.serialization }
261 | fn finish(self) -> &'a mut ::Url { self.url }
| ^^^^^^^^ - here, drop of `self` needs exclusive access to `*self.url`, because the type `UrlQuery<'_>` implements the `Drop` trait
| |
| returning this value requires that `*self.url` is borrowed for `'a`
error: aborting due to previous error
For more information about this error, try `rustc --explain E0713`.
error: could not compile `url`.
warning: build failed, waiting for other jobs to finish...
error: build failed
In cargo.toml the url dependency is : 1.6
make genact-osx available in package manager for macOS Homebrew so it can be installed like:
brew install genact
It looks like the OSX binaries are missing from the releases page: https://github.com/svenstaro/genact/releases
When I use trunk build --release
build a web page, The resource path of the index.html file contains /genact.
This would make installation better.
I already implemented the Docker image/container deletion but just had the idea of an even better module: the Docker build process. Building images with Docker usually takes a lot of time and there's many generic output.
$ docker build .
Uploading context 10240 bytes
Step 1/3 : FROM busybox
Pulling repository busybox
---> e9aa60c60128MB/2.284 MB (100%) endpoint: https://cdn-registry-1.docker.io/v1/
Step 2/3 : RUN ls -lh /
---> Running in 9c9e81692ae9
total 24
drwxr-xr-x 2 root root 4.0K Mar 12 2013 bin
drwxr-xr-x 5 root root 4.0K Oct 19 00:19 dev
drwxr-xr-x 2 root root 4.0K Oct 19 00:19 etc
drwxr-xr-x 2 root root 4.0K Nov 15 23:34 lib
lrwxrwxrwx 1 root root 3 Mar 12 2013 lib64 -> lib
dr-xr-xr-x 116 root root 0 Nov 15 23:34 proc
lrwxrwxrwx 1 root root 3 Mar 12 2013 sbin -> bin
dr-xr-xr-x 13 root root 0 Nov 15 23:34 sys
drwxr-xr-x 2 root root 4.0K Mar 12 2013 tmp
drwxr-xr-x 2 root root 4.0K Nov 15 23:34 usr
---> b35f4035db3f
Step 3/3 : CMD echo Hello world
---> Running in 02071fceb21b
---> f52f38b7823e
Successfully built f52f38b7823e
Removing intermediate container 9c9e81692ae9
Removing intermediate container 02071fceb21b
Certainly seems no need for cryptographic security here. I've got code for it if you like.
When I Download The Genact-Master And Run The Index.html File Half Of The Webpage Is Black And The Other Side Is White
Please Fix This
Btw Im On Chromebook So That Might Explain The Problem
which compile tools do you prebuilt binaries for Linux?
Hi, @svenstaro
Thanks for your brilliant works. genact is an awesome project and I have ported the code to the Go language named oscar
here is the project link: https://github.com/chenjiandongx/oscar
Now I can take a rest and drink coffee seriously. lol 🐶
Once trunk is a little more mature, we should switch from wasm-pack as it's more in line with what we're doing here. wasm-pack never was a perfect fit.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.