Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
MisterCalvin committed Jun 23, 2024
0 parents commit a372b61
Show file tree
Hide file tree
Showing 16 changed files with 854 additions and 0 deletions.
88 changes: 88 additions & 0 deletions .github/workflows/build-and-release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
name: Build and Release ForceBindIP GUI

on:
push:
branches: [ main ]

jobs:
build:
runs-on: [ubuntu-latest]
if: ${{ !contains(github.event.head_commit.message, '[skip-ci]') }}

steps:
- name: Checkout
uses: actions/checkout@v2

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.9'

- name: Get short SHA
id: get_short_sha
if: ${{ !contains(github.event.head_commit.message, '[release]') }}
run: echo "::set-output name=short_sha::$(echo ${{ github.sha }} | cut -c1-10)"

- name: Get current date and time
id: get_date
if: ${{ !contains(github.event.head_commit.message, '[release]') }}
run: |
utc_date=$(TZ='UTC' date +'%Y-%m-%d @ %H:%M:%S')
echo "::set-output name=date::$utc_date"
- name: Write build details to file
if: ${{ !contains(github.event.head_commit.message, '[release]') }}
run: |
printf "%s\n%s" "${{ steps.get_date.outputs.date }}" "${{ steps.get_short_sha.outputs.short_sha }}" > build_details.txt
- name: Package Application
uses: JackMcKew/pyinstaller-action-windows@main
with:
path: .

- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: ForceBindIPGUI
path: dist/windows/ForceBindIP-GUI.exe

release:
runs-on: [ubuntu-latest]
needs: build

steps:
- name: Checkout
uses: actions/checkout@v2

- name: Download artifact
uses: actions/download-artifact@v3
with:
name: ForceBindIPGUI
path: ./dist

- name: Get short SHA
id: get_short_sha
run: echo "::set-output name=short_sha::$(echo ${{ github.sha }} | cut -c1-10)"

- name: Create Release
id: create_release
uses: softprops/action-gh-release@v2
with:
tag_name: cicd-${{ github.run_number }}
name: cicd-${{ steps.get_short_sha.outputs.short_sha }}
body: |
Release triggered by commit [${{ steps.get_short_sha.outputs.short_sha }}](https://github.com/${{ github.repository }}/commit/${{ github.sha }}): ${{ github.event.head_commit.message }}
files: ./dist/ForceBindIP-GUI.exe
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Run latest-tag
uses: EndBug/latest-tag@latest
with:
ref: latest
description: |
Latest release - triggered by commit [${{ steps.get_short_sha.outputs.short_sha }}](https://github.com/${{ github.repository }}/commit/${{ github.sha }})
force-branch: false
git-directory: '.'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
.vscode
__pycache__/
Scripts/
Lib/
Include/
dist/
build_details.txt
pyvenv.cfg
build/
46 changes: 46 additions & 0 deletions ForceBindIP-GUI.spec
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# -*- mode: python ; coding: utf-8 -*-

block_cipher = None

a = Analysis(
['app.py'],
pathex=['.'],
binaries=[
('assets/ForceBindIP.exe', '.'),
('assets/BindIP.dll', '.'),
('assets/BindIP64.dll', '.'),
('assets/ForceBindIP64.exe', '.'),
('assets/help_icon.png', '.'),
('assets/github_logo.png', '.')
],
datas=[],
hiddenimports=[],
hookspath=['.'],
runtime_hooks=[],
excludes=[],
noarchive=False,
)

pyz = PYZ(a.pure)

exe = EXE(
pyz,
a.scripts,
a.binaries,
a.datas,
[],
name='ForceBindIP-GUI',
debug=False,
bootloader_ignore_signals=False,
strip=False,
upx=True,
upx_exclude=[],
runtime_tmpdir=None,
console=True,
disable_windowed_traceback=False,
argv_emulation=False,
target_arch=None,
codesign_identity=None,
entitlements_file=None,
icon=['assets/FBI.ico'],
)
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2024 MisterCalvin

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
37 changes: 37 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
## ForceBindIP GUI
![example](images/forcebindipgui.png "ForceBindIP GUI")
\
A simple Python GUI for running ForceBindIP

## Features

- ForceBindIP exe and dll files packaged with application, will be extracted to `%USERPRROFILE%\AppData\Local\_MEIxxxx` during runtime and cleaned up afterwards
- Drag and Drop shortcuts or exe files onto application to populate fields (will also parse any launch arguments)
- Mouse-over tooltips will display program name, filepath, or interface name (useful for values cut off in our GUI)
- Persistent configuration saves last 10 Recent Programs with launch arguments, specified interface, and architecture (saved to `%USERPROFILE\forcebindgui_config.json`)
- Switch between x86 or x64 architectures
- Correctly binds to VPN interfaces

## What is ForceBindIP?
From [https://r1ch.net/projects/forcebindip](https://r1ch.net/projects/forcebindip):

```
ForceBindIP is a freeware Windows application that will inject itself into another application and alter how certain Windows socket calls are made, allowing you to force the other application to use a specific network interface / IP address. This is useful if you are in an environment with multiple interfaces and your application has no option to bind to a specific interface.
ForceBindIP works in two stages - the loader, ForceBindIP.exe will load the target application in a suspended state. It will then inject a DLL (BindIP.dll) which loads WS2_32.DLL into memory and intercepts the bind(), connect(), sendto(), WSAConnect() and WSASendTo() functions, redirecting them to code in the DLL which verifies which interface they will be bound to and if not the one specified, (re)binds the socket. Once the function intercepts are complete, the target application is resumed. Note that some applications with anti-debugger / injection techniques may not work correctly when an injected DLL is present; for the vast majority of applications though this technique should work fine.
As of version 1.2, all known functions in WS2_32.DLL that either explicitly or implicitly bind to an interface are intercepted. Please note however that certain programs may still end up using the default interface if they implement connections that do not use the standard winsock functions. ForceBindIP will not prevent information leaks that may occur when using applications over a VPN. For example, all host name lookups (DNS requests) will be resolved through the default gateway as these requests originate from the Microsoft DNS Client, not the program.
```

## Building

```
git clone https://github.com/mistercalvin/forcebindip-gui.git
cd forcebindip-gui
pip install -r requirements.txt
pyinstaller ForceBindIP-GUI.spec
```

## Credits
- [r1ch](https://r1ch.net/projects/forcebindip) for ForceBindIP
- [saeedkhatami/FBI](https://github.com/saeedkhatami/FBI) for FBI.ico
Loading

0 comments on commit a372b61

Please sign in to comment.