justicerage / ffm Goto Github PK
View Code? Open in Web Editor NEWFreedom Fighting Mode: open source hacking harness
License: GNU General Public License v3.0
Freedom Fighting Mode: open source hacking harness
License: GNU General Public License v3.0
It would be pretty neat to have a client-side logging functionality. I can already do this with script
, on the client, but perhaps something baked into FFM? When freedom fighting, it might be useful to do !log on /path/to/hacklog.txt
and !log off
to enable/disable logging of freedom fighting activities locally.
The following presentation has a bunch of hints on stuff we should look at doing (in the same vein as the SSH processor) to prevent target-side logging of various stuff. I'll have a go myself, but I'm still stuck trying to get the thing from #9 working.
https://github.com/wvu/talks/blob/master/defcon/26/One-Liners%20to%20Rule%20Them%20All.pdf
Notably the less, wget, vim... stuff to prevent logging on the pwned box of your activities.
!elf3 /tmp/payload
100%|████████████████████████████████████████| 336/336 [00:00<00:00, 3.20Mo/s]
Timeout reached; giving up on trying to capture the output.
!info
System Info:
!elf
or !elf3
from running successfully, they payloads are loaded and executed just finemeterpreter > sysinfo
Computer : 10.0.0.39
OS : Ubuntu 22.04 (Linux 5.15.0-72-generic)
Architecture : x64
BuildTuple : x86_64-linux-musl
Meterpreter : x64/linux
ssh
connection that is now hung if you have a tool like a C2, however this is still not ideal behavior and should be corrected.Going to try implement this myself, but if someone else gets there first, that would be neat. While sure, you could just paste them in, we want efficiency, and pasting stuff into a root shell elsewhere is an amazing way to go from "freedom fighting" to "no freedom" if your clipboard buffer hygiene isn't on point every single time.
Basically recreating !py except for shell scripts. We could also have this for Ruby/Perl/etc scripts quite easily, I think?
I've got a upload freeze for both Debian & CentOS. I use docker to make test, but also real remote server.
I guess it's an issue from my client, but I cannot debug it easily.
Create a server (172.18.0.2):
$ docker run -it --rm debian /bin/bash
apt-get update
apt-get install netcat -y
nc.traditional -lvvp 7777 -e /bin/bash
On my client :
$ ls
ffm.py
$ nc 172.18.0.2 7777 !bypass
$ !upload
Usage: !upload [local file] [remote destination]
Received 1 argument(s), expected 3.
$ !upload test.py test.py
Usage: !upload [local file] [remote destination]
test.py not found!
$ !upload ffm.py test.py
<FREEZE>
HI,
When I try to use !download from remote machine(my ubuntu18.04) to local machine(Kali),it return this error, also the !upload is the same. Which step is wrong?
Traceback (most recent call last):
File "ffm.py", line 167, in <module>
main()
File "ffm.py", line 117, in main
context.active_session.input_driver.handle_input(typed_char)
File "/root/Tools/FFM/model/driver/input.py", line 87, in handle_input
self.state(c)
File "/root/Tools/FFM/model/driver/input.py", line 584, in _state_ground
if parse_commands(self.input_buffer):
File "/root/Tools/FFM/commands/command_manager.py", line 43, in parse_commands
command_instance = c(*args)
File "/root/Tools/FFM/commands/download_file.py", line 42, in __init__
if not check_command_existence("xxd") and not check_command_existence("od"):
File "/root/Tools/FFM/model/driver/input_api.py", line 182, in check_command_existence
return int(output) == 0
ValueError: invalid literal for int() with base 10: 'command -v xxd >/dev/null ; echo $?\r\necho -n ihxYcJZQkfBctzLVDBDMrMhgqiiNkuGF\r\n0'
Replace the Python invocation with script /dev/null
, it is far more portable, and doesn't leave obvious python processes hanging about.
https://github.com/JusticeRage/FFM/blob/master/commands/replacement_commands.py#L66
Just remembered that OpenSSH will often try use $HOME/.ssh/id_rsa
key to auth, which leads to you being identifiable thanks to this. It might be worthwhile to block this (how?) by forcing some SSH arguments unless a specific -i keyfile
flag is set.
end_marker
in the input_api.py
file.terminator
and zsh
and terminator
and bash
on another host. Tested on both, see below.pty
and in a pty
on a local kali
system with zsh
python3 ffm.py
!os
cat /etc/*release*
PRETTY_NAME="Kali GNU/Linux Rolling"
NAME="Kali GNU/Linux"
VERSION="2023.1"
VERSION_ID="2023.1"
VERSION_CODENAME="kali-rolling"
ID=kali
ID_LIKE=debian
HOME_URL="https://www.kali.org/"
SUPPORT_URL="https://forums.kali.org/"
BUG_REPORT_URL="https://bugs.kali.org/"
ANSI_COLOR="1;31"
┌──(kali㉿kali)-[/opt/justice-ffm/FFM]
echo -n
IJVzPmNFQumMGiuPRRpyZMPFRUVkHHeo
echo -n
commandpty
!os
cat /etc/*release*
echo -n WNGwrqHpyzOhRwRghOvenIHUzGXWNsVk
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=22.04
DISTRIB_CODENAME=jammy
DISTRIB_DESCRIPTION="Ubuntu 22.04.2 LTS"
PRETTY_NAME="Ubuntu 22.04.2 LTS"
NAME="Ubuntu"
VERSION_ID="22.04"
VERSION="22.04.2 LTS (Jammy Jellyfish)"
VERSION_CODENAME=jammy
ID=ubuntu
ID_LIKE=debian
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
UBUNTU_CODENAME=jammy
Taking the functions for a walk, noticed this... Basically I am not using the -T flag, so it should raise an alert and add it. Instead, it doesn't. Seems the regex doesn't fire or something?
user@box:~/FFM$ torsocks ssh -lroot [redacted]
root@[redacted]'s password: [redacted]
[redacted]
root@[redacted]:~#
TL;DR you should also check for the "-l username" / "-lusername" option.
user@box:~/tools/FFM$ torsocks ssh -lroot redacted
FFM blocked a command that may leak your local username. Please specify the remote user explicitly.
user@box:~/tools/FFM$ torsocks ssh -l root redacted
FFM blocked a command that may leak your local username. Please specify the remote user explicitly.
!sh /home/neo/linpeas.sh
Traceback (most recent call last):
File "/opt/FFM/ffm.py", line 167, in <module>
main()
File "/opt/FFM/ffm.py", line 117, in main
context.active_session.input_driver.handle_input(typed_char)
File "/opt/FFM/model/driver/input.py", line 87, in handle_input
self.state(c)
File "/opt/FFM/model/driver/input.py", line 584, in _state_ground
if parse_commands(self.input_buffer):
File "/opt/FFM/commands/command_manager.py", line 43, in parse_commands
command_instance = c(*args)
TypeError: Can't instantiate abstract class RunShScript with abstract method _get_output_cleaner
!sh
with no args and it will throw the TypeError
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.