Merge pull request #141 from aleff-github/patch-8

Change Remote Git Link
pull/178/head
Kalani Helekunihi 2023-06-12 15:27:33 -04:00 committed by GitHub
commit f4ae078fa3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 99 additions and 0 deletions

View File

@ -0,0 +1,57 @@
# Change Remote Git Link
This script can be used to change the remote link from which updates will be downloaded and where new updates will be uploaded.
**Category**: Execution
## Description
This script can be used to change the remote link from which updates will be downloaded and where new updates will be uploaded.
This script turns out to be very useful for aviting data leaks between old cloned repositories and new online repositories.
To make it easier to use below you can find the various tested configurations, at the moment it is not available for macOS because since I do not have one it cannot be tested and therefore I cannot give the certainty that it works, however I hope that in the Hak5 community there may be someone who can contribute to this payload by completing it with this missing part.
## Payload.txt config - Windows 10/11 - Tested on Windows 11
```DuckyScript
DELAY 1000
GUI r
DELAY 1000
STRING powershell
ENTER
DELAY 2000
```
## Payload.txt config - Linux (Debian based) - Tested on Ubuntu 23.04
```DuckyScript
DELAY 1000
CTRL-ALT t
DELAY 2000
```
## Dependencies
* Internet Connection
* git installed
* Full path of the cloned repository
* ExecutionPolicy Bypass
## Settings
- Full path of the local repository i.e. "C:\Users\User\Documents\Repository1"
```DuckyScript
DEFINE #FULL-PATH example
```
- Link from which updates are to be downloaded so the new repository the Repository2
```DuckyScript
DEFINE #NEW-GIT-LINK example.git
```
- REM Define the branch of the new repository Repository2, i.e. "main"
```DuckyScript
DEFINE #BRANCH example
```

View File

@ -0,0 +1,42 @@
REM ###########################################
REM # |
REM # Title : Change Remote Git Link |
REM # Author : Aleff |
REM # Version : 1.0 |
REM # Category : Execution |
REM # Target : Windows 10-11/Linux |
REM # |
REM ###########################################
REM Requirements:
REM - Internet Connection
REM - git installed
REM - Full path of the cloned repository
REM - ExecutionPolicy Bypass if runned on Windows
REM Full path of the local repository i.e. "C:\Users\User\Documents\Repository1"
DEFINE #FULL-PATH example
REM Link from which updates are to be downloaded so the new repository the Repository2
DEFINE #NEW-GIT-LINK example.git
REM Define the branch of the new repository Repository2, i.e. "main"
DEFINE #BRANCH example
DELAY 1000
GUI r
DELAY 1000
STRING powershell
ENTER
DELAY 2000
STRINGLN cd #FULL-PATH
DELAY 1000
STRINGLN git remote set-url origin #NEW-GIT-LINK
DELAY 1000
STRINGLN git pull --force origin #BRANCH
DELAY 1000
STRINGLN git reset --hard origin/#BRANCH
DELAY 1000
ALT F4