Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
e17b920
tui: add minimal TTY prototype skeleton
giveen Jan 6, 2026
0358858
chore: add tty gems for TUI prototype
giveen Jan 6, 2026
fed222e
feat: optionally launch TTY TUI from banner when options[:tui] set
giveen Jan 6, 2026
9887113
tui: add flag-scan screen and expose run_flag_scan; add test script
giveen Jan 6, 2026
1656ece
cli: add --tui flag to enable interactive TTY UI
giveen Jan 6, 2026
911254f
fix(tools): remove duplicated header and stray block causing syntax e…
giveen Jan 6, 2026
c746b4a
chore(cli): auto-require bundler/setup when --tui present to load ven…
giveen Jan 6, 2026
51d6862
tui: add Rainfrog-inspired layout and interactive loop; add demo runner
giveen Jan 6, 2026
0511ad2
tui: add interactive left-menu navigation and keybindings (starter)
giveen Jan 6, 2026
df78e1e
tui: wire left-menu items to Tools/Uploader/Session helpers
giveen Jan 6, 2026
e973eda
tui: add Rainfrog-style TTY dashboard with live panels and session st…
giveen Jan 6, 2026
6cf289d
Add execution, app_state, utils modules and refactor session/tools/tu…
giveen Feb 11, 2026
9174e32
Add wrapper script for convenient bundle exec usage
giveen Feb 11, 2026
0289431
Make /etc/hosts modification graceful on permission errors
giveen Feb 11, 2026
53ecfd7
Refactor session dispatch and harden connection/upload reliability
giveen Apr 21, 2026
005ef15
Modernize Ruby 4 stack, harden TUI/dispatcher, and stabilize bypass s…
giveen Apr 21, 2026
54b138e
Refactor TUI flow and harden lsass_dump fallback/download
giveen Apr 21, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions .bundle/config

This file was deleted.

10 changes: 10 additions & 0 deletions .github/copilot-instructions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<todos title="ruby 4 dependency modernization" rule="Review steps frequently throughout the conversation and DO NOT stop between steps unless they explicitly require it.">
- [x] audit-current-gemfile-and-usage: Inspect current Gemfile/Gemfile.lock and code usage that depends on pinned gems 🔴
- [x] implement-rubyzip3-resolution: Decouple winrm-fs or point to compatible fork to allow rubyzip >= 3 🔴
- [x] update-gemfile-and-warning-shim: Modernize Gemfile constraints and harden silence_warnings layer 🔴
- [x] regenerate-lockfile-linux-bundler410: Generate Gemfile.lock with x86_64-linux platform and BUNDLED WITH 4.0.10 🔴
- [x] deliver-migration-script-and-summary: Provide updated Gemfile content and safe migration shell script 🟡
</todos>

<!-- Auto-generated todo section -->
<!-- Add your custom Copilot instructions below -->
13 changes: 13 additions & 0 deletions .github/instructions/todos.instructions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
applyTo: '**'
---

<todos title="awinrm code review" agentRequirement="Review steps frequently throughout the conversation and DO NOT stop between steps unless they explicitly require it. Keep the todos updated using the todo_write tool (do not edit this file).">
- [x] scope-review-targets: Identify critical files and review scope for bug/performance audit 🔴
- [x] inspect-runtime-paths: Review core runtime modules for logic bugs and inefficiencies 🔴
- [x] run-validation: Run available tests/commands to confirm suspected issues 🟡
- [x] report-findings: Summarize findings by severity with file/line references 🔴
</todos>

<!-- Auto-generated todo section -->
<!-- Add your custom Copilot instructions below -->
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
# Ignore Ruby, Bundler, and system files
/vendor/
/.bundle/
/tmp/
*.log
*.swp
*.swo
*.DS_Store
/.vscode/
/log/
/loot/
/profiles/*.yaml

Expand Down
34 changes: 20 additions & 14 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,20 +1,26 @@
source 'https://rubygems.org'

gem 'winrm', '~> 2.3'
gem 'socksify', '~> 1.8'
gem 'winrm-fs', '~> 1.3'
gem 'colorize', '~> 0.8'
gem 'concurrent-ruby', '~> 1.2'
gem 'rubyzip', '~> 2.0'
gem 'logging', '~> 2.4'
gem 'nori', '~> 2.7'
gem 'gssapi', '~> 1.3'

# Bundler itself
gem 'bundler', '>= 2.4', '< 3.0'
gem 'winrm', '>= 2.3.9'
gem 'socksify', '>= 1.8'
gem 'colorize', '>= 0.8'
gem 'concurrent-ruby', '>= 1.2'
gem 'rubyzip', '>= 3.0'
gem 'logging', '>= 2.4'
gem 'nori', '>= 2.7'
gem 'gssapi', '>= 1.3.1'
gem 'ffi', '>= 1.17.4'
gem 'readline', '>= 0.0.4'
gem 'syslog', '>= 0.1.2'
gem 'ostruct', '>= 0.6.0'

# Test/dev
group :test do
gem 'rspec', '~> 3.12'
gem 'mocha', '~> 1.15'
gem 'rspec', '>= 3.12'
gem 'mocha', '>= 1.15'
end

group :development do
gem 'tty-prompt'
gem 'tty-table'
gem 'tty-screen'
end
166 changes: 140 additions & 26 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,49 @@ GEM
remote: https://rubygems.org/
specs:
base64 (0.3.0)
bigdecimal (4.0.1)
bigdecimal (4.1.2)
builder (3.3.0)
colorize (0.8.1)
colorize (1.1.0)
concurrent-ruby (1.3.6)
diff-lcs (1.6.2)
erubi (1.13.1)
ffi (1.17.2-x86_64-linux-gnu)
ffi (1.17.4)
ffi (1.17.4-aarch64-linux-gnu)
ffi (1.17.4-aarch64-linux-musl)
ffi (1.17.4-arm-linux-gnu)
ffi (1.17.4-arm-linux-musl)
ffi (1.17.4-arm64-darwin)
ffi (1.17.4-x86-linux-gnu)
ffi (1.17.4-x86-linux-musl)
ffi (1.17.4-x86_64-darwin)
ffi (1.17.4-x86_64-linux-gnu)
ffi (1.17.4-x86_64-linux-musl)
gssapi (1.3.1)
ffi (>= 1.0.1)
gyoku (1.4.0)
builder (>= 2.1.2)
rexml (~> 3.0)
httpclient (2.9.0)
mutex_m
io-console (0.8.2)
little-plugger (1.1.4)
logger (1.7.0)
logging (2.4.0)
little-plugger (~> 1.1)
multi_json (~> 1.14)
mocha (1.16.1)
multi_json (1.18.0)
mocha (3.1.0)
ruby2_keywords (>= 0.0.5)
multi_json (1.20.1)
mutex_m (0.3.0)
nori (2.7.1)
bigdecimal
ostruct (0.6.3)
pastel (0.8.0)
tty-color (~> 0.5)
readline (0.0.4)
reline
reline (0.6.3)
io-console (~> 0.5)
rexml (3.4.4)
rspec (3.13.2)
rspec-core (~> 3.13.0)
Expand All @@ -35,14 +55,38 @@ GEM
rspec-expectations (3.13.5)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.13.0)
rspec-mocks (3.13.7)
rspec-mocks (3.13.8)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.13.0)
rspec-support (3.13.6)
rspec-support (3.13.7)
ruby2_keywords (0.0.5)
rubyntlm (0.6.5)
base64
rubyzip (2.4.1)
rubyzip (3.2.2)
socksify (1.8.1)
strings (0.2.1)
strings-ansi (~> 0.2)
unicode-display_width (>= 1.5, < 3.0)
unicode_utils (~> 1.4)
strings-ansi (0.2.0)
syslog (0.4.0)
logger
tty-color (0.6.0)
tty-cursor (0.7.1)
tty-prompt (0.23.1)
pastel (~> 0.8)
tty-reader (~> 0.8)
tty-reader (0.9.0)
tty-cursor (~> 0.7)
tty-screen (~> 0.8)
wisper (~> 2.0)
tty-screen (0.8.2)
tty-table (0.12.0)
pastel (~> 0.8)
strings (~> 0.2.0)
tty-screen (~> 0.8)
unicode-display_width (2.6.0)
unicode_utils (1.4.0)
winrm (2.3.9)
builder (>= 2.1.2)
erubi (~> 1.8)
Expand All @@ -53,28 +97,98 @@ GEM
nori (~> 2.0, >= 2.7.1)
rexml (~> 3.0)
rubyntlm (~> 0.6.0, >= 0.6.3)
winrm-fs (1.3.5)
erubi (~> 1.8)
logging (>= 1.6.1, < 3.0)
rubyzip (~> 2.0)
winrm (~> 2.0)
wisper (2.0.1)

PLATFORMS
aarch64-linux-gnu
aarch64-linux-musl
arm-linux-gnu
arm-linux-musl
arm64-darwin
ruby
x86-linux-gnu
x86-linux-musl
x86_64-darwin
x86_64-linux
x86_64-linux-gnu
x86_64-linux-musl

DEPENDENCIES
bundler (>= 2.4, < 3.0)
colorize (~> 0.8)
concurrent-ruby (~> 1.2)
gssapi (~> 1.3)
logging (~> 2.4)
mocha (~> 1.15)
nori (~> 2.7)
rspec (~> 3.12)
rubyzip (~> 2.0)
socksify (~> 1.8)
winrm (~> 2.3)
winrm-fs (~> 1.3)
colorize (>= 0.8)
concurrent-ruby (>= 1.2)
ffi (>= 1.17.4)
gssapi (>= 1.3.1)
logging (>= 2.4)
mocha (>= 1.15)
nori (>= 2.7)
ostruct (>= 0.6.0)
readline (>= 0.0.4)
rspec (>= 3.12)
rubyzip (>= 3.0)
socksify (>= 1.8)
syslog (>= 0.1.2)
tty-prompt
tty-screen
tty-table
winrm (>= 2.3.9)

CHECKSUMS
base64 (0.3.0) sha256=27337aeabad6ffae05c265c450490628ef3ebd4b67be58257393227588f5a97b
bigdecimal (4.1.2) sha256=53d217666027eab4280346fba98e7d5b66baaae1b9c3c1c0ffe89d48188a3fbd
builder (3.3.0) sha256=497918d2f9dca528fdca4b88d84e4ef4387256d984b8154e9d5d3fe5a9c8835f
colorize (1.1.0) sha256=30b5237f0603f6662ab8d1fc2bd4a96142b806c6415d79e45ef5fdc6a0cfc837
concurrent-ruby (1.3.6) sha256=6b56837e1e7e5292f9864f34b69c5a2cbc75c0cf5338f1ce9903d10fa762d5ab
diff-lcs (1.6.2) sha256=9ae0d2cba7d4df3075fe8cd8602a8604993efc0dfa934cff568969efb1909962
erubi (1.13.1) sha256=a082103b0885dbc5ecf1172fede897f9ebdb745a4b97a5e8dc63953db1ee4ad9
ffi (1.17.4) sha256=bcd1642e06f0d16fc9e09ac6d49c3a7298b9789bcb58127302f934e437d60acf
ffi (1.17.4-aarch64-linux-gnu) sha256=b208f06f91ffd8f5e1193da3cae3d2ccfc27fc36fba577baf698d26d91c080df
ffi (1.17.4-aarch64-linux-musl) sha256=9286b7a615f2676245283aef0a0a3b475ae3aae2bb5448baace630bb77b91f39
ffi (1.17.4-arm-linux-gnu) sha256=d6dbddf7cb77bf955411af5f187a65b8cd378cb003c15c05697f5feee1cb1564
ffi (1.17.4-arm-linux-musl) sha256=9d4838ded0465bef6e2426935f6bcc93134b6616785a84ffd2a3d82bc3cf6f95
ffi (1.17.4-arm64-darwin) sha256=19071aaf1419251b0a46852abf960e77330a3b334d13a4ab51d58b31a937001b
ffi (1.17.4-x86-linux-gnu) sha256=38e150df5f4ca555e25beca4090823ae09657bceded154e3c52f8631c1ed72cf
ffi (1.17.4-x86-linux-musl) sha256=fbeec0fc7c795bcf86f623bb18d31ea1820f7bd580e1703a3d3740d527437809
ffi (1.17.4-x86_64-darwin) sha256=aa70390523cf3235096cf64962b709b4cfbd5c082a2cb2ae714eb0fe2ccda496
ffi (1.17.4-x86_64-linux-gnu) sha256=9d3db14c2eae074b382fa9c083fe95aec6e0a1451da249eab096c34002bc752d
ffi (1.17.4-x86_64-linux-musl) sha256=3fdf9888483de005f8ef8d1cf2d3b20d86626af206cbf780f6a6a12439a9c49e
gssapi (1.3.1) sha256=c51cf30842ee39bd93ce7fc33e20405ff8a04cda9dec6092071b61258284aee1
gyoku (1.4.0) sha256=389d887384c777f271cb9377bb642f20bbe0c633d1ef5af78569d4db53c1a2cd
httpclient (2.9.0) sha256=4b645958e494b2f86c2f8a2f304c959baa273a310e77a2931ddb986d83e498c8
io-console (0.8.2) sha256=d6e3ae7a7cc7574f4b8893b4fca2162e57a825b223a177b7afa236c5ef9814cc
little-plugger (1.1.4) sha256=d5f347c00d9d648040ef7c17d6eb09d3d0719adf19ca30d1a3b6fb26d0a631bb
logger (1.7.0) sha256=196edec7cc44b66cfb40f9755ce11b392f21f7967696af15d274dde7edff0203
logging (2.4.0) sha256=ba8893a3c211b836f4131bb93b3eb3137a0c3b1fcd0ec3d570e324d8bdc00ccb
mocha (3.1.0) sha256=75f42d69ebfb1f10b32489dff8f8431d37a418120ecdfc07afe3bc183d4e1d56
multi_json (1.20.1) sha256=2f3934e805cc45ef91b551a1f89d0e9191abd06a5e04a2ef09a6a036c452ca6d
mutex_m (0.3.0) sha256=cfcb04ac16b69c4813777022fdceda24e9f798e48092a2b817eb4c0a782b0751
nori (2.7.1) sha256=6166cd336959854762073e2fbae888593809cac1b3e904f4fb009313d7226861
ostruct (0.6.3) sha256=95a2ed4a4bd1d190784e666b47b2d3f078e4a9efda2fccf18f84ddc6538ed912
pastel (0.8.0) sha256=481da9fb7d2f6e6b1a08faf11fa10363172dc40fd47848f096ae21209f805a75
readline (0.0.4) sha256=6138eef17be2b98298b672c3ea63bf9cb5158d401324f26e1e84f235879c1d6a
reline (0.6.3) sha256=1198b04973565b36ec0f11542ab3f5cfeeec34823f4e54cebde90968092b1835
rexml (3.4.4) sha256=19e0a2c3425dfbf2d4fc1189747bdb2f849b6c5e74180401b15734bc97b5d142
rspec (3.13.2) sha256=206284a08ad798e61f86d7ca3e376718d52c0bc944626b2349266f239f820587
rspec-core (3.13.6) sha256=a8823c6411667b60a8bca135364351dda34cd55e44ff94c4be4633b37d828b2d
rspec-expectations (3.13.5) sha256=33a4d3a1d95060aea4c94e9f237030a8f9eae5615e9bd85718fe3a09e4b58836
rspec-mocks (3.13.8) sha256=086ad3d3d17533f4237643de0b5c42f04b66348c28bf6b9c2d3f4a3b01af1d47
rspec-support (3.13.7) sha256=0640e5570872aafefd79867901deeeeb40b0c9875a36b983d85f54fb7381c47c
ruby2_keywords (0.0.5) sha256=ffd13740c573b7301cf7a2e61fc857b2a8e3d3aff32545d6f8300d8bae10e3ef
rubyntlm (0.6.5) sha256=47013402b99ae29ee93f930af51edaec8c6008556f4be25705a422b4430314f5
rubyzip (3.2.2) sha256=c0ed99385f0625415c8f05bcae33fe649ed2952894a95ff8b08f26ca57ea5b3c
socksify (1.8.1) sha256=cf2a01720cc32490cc657b3233730620a03b92e98281726872ebebedfea9a856
strings (0.2.1) sha256=933293b3c95cf85b81eb44b3cf673e3087661ba739bbadfeadf442083158d6fb
strings-ansi (0.2.0) sha256=90262d760ea4a94cc2ae8d58205277a343409c288cbe7c29416b1826bd511c88
syslog (0.4.0) sha256=c4c38ae982fe72903ec41094b5e5f2dcbbc66f510d0225c9702e5e980d827472
tty-color (0.6.0) sha256=6f9c37ca3a4e2367fb2e6d09722762647d6f455c111f05b59f35730eeb24332a
tty-cursor (0.7.1) sha256=79534185e6a777888d88628b14b6a1fdf5154a603f285f80b1753e1908e0bf48
tty-prompt (0.23.1) sha256=fcdbce905238993f27eecfdf67597a636bc839d92192f6a0eef22b8166449ec8
tty-reader (0.9.0) sha256=c62972c985c0b1566f0e56743b6a7882f979d3dc32ff491ed490a076f899c2b1
tty-screen (0.8.2) sha256=c090652115beae764336c28802d633f204fb84da93c6a968aa5d8e319e819b50
tty-table (0.12.0) sha256=fdc27a4750835c1a16efe19a0b857e3ced3652cc7aceafe6dca94908965b9939
unicode-display_width (2.6.0) sha256=12279874bba6d5e4d2728cef814b19197dbb10d7a7837a869bab65da943b7f5a
unicode_utils (1.4.0) sha256=b922d0cf2313b6b7136ada6645ce7154ffc86418ca07d53b058efe9eb72f2a40
winrm (2.3.9) sha256=ef6b767c5772d06e186300b506ea5e65afb849904a551f8482a5cfc2a1be5d06
wisper (2.0.1) sha256=ce17bc5c3a166f241a2e6613848b025c8146fce2defba505920c1d1f3f88fae6

BUNDLED WITH
2.4.20
4.0.10
11 changes: 11 additions & 0 deletions bin/evil-ctf.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
# AWINRM CTF Edition

require 'optparse'
require_relative '../lib/compat/silence_warnings'
require 'winrm'
require 'ipaddr'
require 'socket'
Expand Down Expand Up @@ -41,6 +42,16 @@ module EvilCTF; end
lib_path = File.join(base_path, 'lib')
$LOAD_PATH.unshift(lib_path) unless $LOAD_PATH.include?(lib_path)

# Auto-setup Bundler when the user requested the TUI so gems from
# `vendor/bundle` are available even when running with plain `ruby`.
if ARGV.any? { |a| a.to_s.start_with?('--tui') || a.to_s == '--tui' }
begin
require 'bundler/setup'
rescue LoadError
# bundler not available system-wide; user can run with `bundle exec` instead
end
end


# Load modular components
require 'evil_ctf/session'
Expand Down
12 changes: 12 additions & 0 deletions evil-ctf
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/bash
# Wrapper script to automatically use bundle exec with proper sudo handling

# Check if running with sudo (check SUDO_USER or run without sudo)
if [ -z "$SUDO_USER" ]; then
# Not running with sudo - check if we need it (for /etc/hosts modification)
# Just run with bundle exec
exec bundle exec ruby "$(dirname "${BASH_SOURCE[0]}")/evil-ctf.rb" "$@"
else
# Running with sudo - preserve environment and use bundle exec
exec bundle exec ruby "$(dirname "${BASH_SOURCE[0]}")/evil-ctf.rb" "$@"
fi
38 changes: 38 additions & 0 deletions lib/compat/silence_warnings.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# frozen_string_literal: true

# Ruby 4.0 compatibility helper:
# suppresses only known noisy winrm warnings while leaving all other warnings intact.
module EvilCTF
module Compat
module SilenceWarnings
WINRM_OBJECT_ID_WARNING = /winrm\/psrp\/(fragment|message_fragmenter)\.rb:\d+: warning: redefining 'object_id' may cause serious problems/
WINRM_REDEFINE_WARNING = /winrm\/psrp\/.*warning: redefining 'object_id' may cause serious problems/

module WarningFilter
def warn(message, category: nil, **kwargs)
return if message.to_s.match?(WINRM_OBJECT_ID_WARNING)

super(message, category: category, **kwargs)
rescue ArgumentError
# Older Ruby warning signatures may not support category/kwargs.
super(message)
end
end

def self.enable!
return unless defined?(Warning)
return if @enabled

if Warning.respond_to?(:ignore)
Warning.ignore(WINRM_OBJECT_ID_WARNING)
Warning.ignore(WINRM_REDEFINE_WARNING)
else
Warning.singleton_class.prepend(WarningFilter)
end
@enabled = true
end
end
end
end

EvilCTF::Compat::SilenceWarnings.enable!
Loading