Compare commits
71 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1470cc8f43 | ||
|
|
12da359803 | ||
|
|
a0e8557d6d | ||
|
|
9dd19e1486 | ||
|
|
61352ce2c1 | ||
|
|
a6f4fedf63 | ||
|
|
2c63f7380b | ||
|
|
48a7a8b922 | ||
|
|
19dcd4564b | ||
|
|
2fd45e793e | ||
|
|
a24db673f7 | ||
|
|
a1937e776b | ||
|
|
b0e1c49399 | ||
|
|
69a111eedc | ||
|
|
19bf5b2789 | ||
|
|
1c1a4d1310 | ||
|
|
bf6e9b7fbf | ||
|
|
2f3339b1ab | ||
|
|
b8f82b6df6 | ||
|
|
77651b3a3b | ||
|
|
d1eb473c1a | ||
|
|
45627f39c3 | ||
|
|
8922fa8407 | ||
|
|
a126e48c8b | ||
|
|
d15ebb2ffe | ||
|
|
2d24b341bd | ||
|
|
2d450ee4c5 | ||
|
|
06eee6396f | ||
|
|
a813843b45 | ||
|
|
f597e2f3fd | ||
|
|
4c3ec0e908 | ||
|
|
7e39e7ca57 | ||
|
|
38ce3556d5 | ||
|
|
1c9d4954bd | ||
|
|
d1cc423b6f | ||
|
|
0a98849b51 | ||
|
|
96079d9852 | ||
|
|
adb9c26e9d | ||
|
|
7bed27828d | ||
|
|
890150296b | ||
|
|
afc7641507 | ||
|
|
53650bf566 | ||
|
|
5ec5ae079a | ||
|
|
5aec55c1d8 | ||
|
|
71e0f09200 | ||
|
|
5c3d9a0698 | ||
|
|
e117aecce3 | ||
|
|
fe63556a6b | ||
|
|
aaab48817e | ||
|
|
779af87faf | ||
|
|
71cacd8d7c | ||
|
|
5e38762db7 | ||
|
|
0d7f657da3 | ||
|
|
0ac03ebd21 | ||
|
|
d790829821 | ||
|
|
c103cc113e | ||
|
|
08691fccc4 | ||
|
|
319fbae448 | ||
|
|
f8a079eb6c | ||
|
|
f0a58090f6 | ||
|
|
45c64b1372 | ||
|
|
30b3a134a9 | ||
|
|
4cb7b35521 | ||
|
|
ce6685b105 | ||
|
|
7225126a8f | ||
|
|
ec41f3a2b4 | ||
|
|
4dd5627635 | ||
|
|
8a52d7b2f2 | ||
|
|
23f62982e6 | ||
|
|
14866d70ed | ||
|
|
f4922f9f7b |
55
CHANGELOG.md
55
CHANGELOG.md
@@ -1,28 +1,61 @@
|
||||
# Changelog for ishare2
|
||||
|
||||
All notable changes to this project will be documented in this file. You can upgrade ishare2 to the latest version using `ishare2 upgrade` and then selecting `option 1`
|
||||
|
||||
## [v1.7.2] - 2023-Feb-12
|
||||
|
||||
1) Added: `--overwrite` flag. Users can specify they want to overwrite an image by passing this 4th argument. Useful when download gets interrupted or you want to restore it to the initial state. Syntax: `ishare pull <type> <id> --overwrite`
|
||||
|
||||
## [v1.7.1] - 2023-Feb-08
|
||||
|
||||
1) Modified: Minor changes were made in the check_user_is_root() function in order to be more precise on user privileges when executing ishare2
|
||||
|
||||
## [v1.7.0] - 2023-Feb-04
|
||||
|
||||
1) Modified: About `ishare2 upgrade` > `option 2`: Now, there are 2 stable versions of PNETLab available to use. Other releases were BETA type and they are not available anymore
|
||||
|
||||
## [v1.6.9] - 2023-Feb-04
|
||||
|
||||
1) Modified: PNETLab version 5.3.11 changed state from BETA to STABLE. This upgrade can be implemented using this command: `ishare2 upgrade` > `option 2` and selecting the correspondant option
|
||||
|
||||
## [v1.6.8] - 2023-Feb-03
|
||||
|
||||
1) Added: A new option was added to `ishare2 upgrade` > `option 2`: Now, it is possible to upgrade PNETLab from almost any version to v5.3.11 (Not possible for this case: 6.x to 5.3.11)
|
||||
|
||||
## [v1.6.7] - 2023-Feb-03
|
||||
|
||||
1) Added: A new option was added to `ishare2 upgrade` > `option 2`: Now, it is possible to upgrade PNETLab from almost any version to v5.3.10 (Not possible for this case: 6.x to 5.3.10)
|
||||
|
||||
## [v1.6.6] - 2023-Feb-02
|
||||
|
||||
1) Added: A new option was added to `ishare2 upgrade` > `option 2`: Now, it is possible to upgrade PNETLab from almost any version to v5.3.8 (Not possible for this case: 6.x to 5.3.8)
|
||||
|
||||
## [v1.6.5] - 2023-Feb-02
|
||||
|
||||
1) Added: Now, menu `ishare2 upgrade` > `option 2` displays a message next to each version to distinguish between the STABLE and BETA versions of PNETLab
|
||||
|
||||
## [v1.6.4] - 2023-Feb-02
|
||||
|
||||
1) Added: A new option was added to `ishare2 upgrade` > `option 2`: Now, it is possible to upgrade PNETLab from almost any version to v5.3.7 (Not possible for this case: 6.x to 5.3.7)
|
||||
|
||||
## [v1.6.3] - 2023-Jan-31
|
||||
|
||||
1) Added: A new option was added to `ishare2 upgrade` > `option 2`: Now, it is possible to upgrade PNETLab from almost any version to v5.3.5 (Not possible for this case: 6.x to 5.3.5)
|
||||
|
||||
## [v1.6.2] - 2023-Jan-31
|
||||
|
||||
1) Added: A new option was added to `ishare2 upgrade` > `option 2`: Now, it is possible to upgrade PNETLab from almost any version to v5.3.4 (Not possible for this case: 6.x to 5.3.4)
|
||||
|
||||
## [v1.6.1] - 2023-Jan-30
|
||||
|
||||
1) Added: Some instructions were added to `ishare2_gui_download()` function in order to avoid some errors related to missing packages (pip install uvicorn, pip install fastapi and pip install jinja2 instructions were added)
|
||||
|
||||
## [v1.6.0] - 2023-Jan-30
|
||||
|
||||
1) Added: Command `ishare2 gui stop` was added into `ishare2_gui_download()` function in order to avoid errors when downloading/upgrading ishare2 GUI
|
||||
|
||||
## [v1.5.9] - 2023-Jan-30
|
||||
|
||||
1) Added: A new version control was added for ishare2 GUI. It can be seen using the `ishare2` command and looking at the bottom of it. New functions and variables were implemented. Also, using `ishare2 upgrade` > `option 3` it is possible to upgrade it.
|
||||
|
||||
## [v1.5.8] - 2023-Jan-29
|
||||
@@ -30,7 +63,8 @@ All notable changes to this project will be documented in this file. You can upg
|
||||
1) Added: A new option was added to `ishare2 upgrade` > `option 2`: Now, it is possible to upgrade PNETLab from almost any version to v5.3.2 (Not possible for this case: 6.x to 5.3.2)
|
||||
|
||||
## [v1.5.7] - 2023-Jan-27
|
||||
1) Added: A new feature has been added to ishare2: It is a web app to use ishare2 in browser and it is called `ishare2 GUI`. You can download it by using `ishare2 gui download` and then start it with `ishare2 gui start`. Open your web browser using http://localhost:5000, http://127.0.01:5000 or http://pnetlab_ip_address:5000 to access. Also, it can be stopped by using `ishare2 gui stop` and restarted with `ishare2 gui restart`
|
||||
|
||||
1) Added: A new feature has been added to ishare2: It is a web app to use ishare2 in browser and it is called `ishare2 GUI`. You can download it by using `ishare2 gui download` and then start it with `ishare2 gui start`. Open your web browser using <http://localhost:5000>, <http://127.0.01:5000> or <http://pnetlab_ip_address:5000> to access. Also, it can be stopped by using `ishare2 gui stop` and restarted with `ishare2 gui restart`
|
||||
|
||||
## [v1.5.6] - 2023-Jan-25
|
||||
|
||||
@@ -76,12 +110,12 @@ All notable changes to this project will be documented in this file. You can upg
|
||||
|
||||
## [v1.4.7] - 2023-Jan-16
|
||||
|
||||
1) Added: A function called set_url_constants() was added to the code and to the main() execution. This function contains all of the URL needed in the project.
|
||||
1) Added: A function called set_url_constants() was added to the code and to the main() execution. This function contains all of the URL needed in the project.
|
||||
2) Modified: Function called set_color_variables() was renamed to set_color_constants()
|
||||
|
||||
## [v1.4.6] - 2023-Jan-16
|
||||
|
||||
1) Modified: Minor changes in code: A function called set_color_variables() was created to define all color variables in there. Added to main() execution
|
||||
1) Modified: Minor changes in code: A function called set_color_variables() was created to define all color variables in there. Added to main() execution
|
||||
2) Deleted: Minor changes in code: Every definition of those variables was removed to get a cleaner code
|
||||
|
||||
Note: This update does not change how the code works in any way
|
||||
@@ -137,16 +171,16 @@ Note: This update does not change how the code works in any way
|
||||
|
||||
## [v1.3.6] - 2022-Dec-19
|
||||
|
||||
1) Added code in show_ishare2_usage() function:
|
||||
1) Added code in show_ishare2_usage() function:
|
||||
|
||||
This code shows a message when a newer ishare2 upgrade is available when using `ishare2` command
|
||||
|
||||
|
||||

|
||||
|
||||
Message is displayed in yellow and is located at the bottom part of this command output
|
||||
|
||||
|
||||
Code looks cleaner and organized in that function now
|
||||
|
||||
|
||||
## [v1.3.5] - 2022-Dec-13
|
||||
|
||||
1) Added docker as an option of param1 (type) when using `ishare2`
|
||||
@@ -158,7 +192,7 @@ Note: This update does not change how the code works in any way
|
||||
## [v1.3.3] - 2022-Dec-13
|
||||
|
||||
1) Added a bin image to ishare2: "i86bi_LinuxL3-AdvEnterpriseK9-M2_157_3_May_2018.bin". This image was already available in ishare2 but the name was a little bit different (specifically it was: "i86bi_Linux-L3-AdvEnterpriseK9-M2_157_3_May_2018.bin"). So, this was made in order to be able to find and download this image in some labs that had this new name. So, it was decided to upload the same image but with a different name.
|
||||
2) Added support to download dockers from eveng docker hub (https://hub.docker.com/u/eveng) when present in lab files
|
||||
2) Added support to download dockers from eveng docker hub (<https://hub.docker.com/u/eveng>) when present in lab files
|
||||
3) Added `ishare2 installed docker` command. Also, available from `ishare2 installed all`
|
||||
4) Added green colors when using `ishare2 installed all` for better readabillity
|
||||
5) Added green colors when using `ishare2 labs` and `ishare2 mylabs` for better readabillity
|
||||
@@ -173,11 +207,11 @@ Note: This update does not change how the code works in any way
|
||||
1) Added a better description message when user tries to upgrade ishare2 and it already has the last version:
|
||||
|
||||
Before
|
||||
|
||||
|
||||
echo "You have the latest available version: $REMOTE_VALUE"
|
||||
|
||||
After
|
||||
|
||||
|
||||
echo "ishare2 $REMOTE_VALUE is currently the newest version available"
|
||||
|
||||
2) Added some validation related to check if the user is root when executing `ishare2`. If not root, an error message will be prompt and the script will finish
|
||||
@@ -200,4 +234,5 @@ Added some code to check docker service status in order to avoid problems when t
|
||||
* `ishare2 mylabs all`
|
||||
|
||||
## [v1.0] - 2022-Nov-22
|
||||
|
||||
Initial release
|
||||
|
||||
71
README.md
71
README.md
@@ -10,22 +10,33 @@
|
||||
</h2>
|
||||
|
||||
## :hammer_and_wrench: Language
|
||||
|
||||
<div>
|
||||
<img src="https://raw.githubusercontent.com/devicons/devicon/master/icons/bash/bash-original.svg" title="Bash" alt="Bash" width="40" height="40"/>
|
||||
</div>
|
||||
|
||||
## 🚀 Installation
|
||||
Apply this command using the terminal
|
||||
|
||||
There are two methods to install `ishare2` in your terminal. Choose one of the following options:
|
||||
|
||||
### wget
|
||||
|
||||
```linux
|
||||
wget -O /usr/sbin/ishare2 https://raw.githubusercontent.com/pnetlabrepo/ishare2/main/ishare2 > /dev/null 2>&1 && chmod +x /usr/sbin/ishare2 && ishare2
|
||||
```
|
||||
|
||||
### curl
|
||||
|
||||
```linux
|
||||
curl -o /usr/sbin/ishare2 https://raw.githubusercontent.com/pnetlabrepo/ishare2/main/ishare2 > /dev/null 2>&1 && chmod +x /usr/sbin/ishare2 && ishare2
|
||||
```
|
||||
|
||||
`Note: There is no need to be in the same directory where ishare2 file is installed in order to execute it`
|
||||
|
||||
## ✅ Syntax
|
||||
|
||||
|
||||
ishare2 [action] [param1] [param2]
|
||||
|
||||
|
||||
action:
|
||||
search : Search for images by type
|
||||
pull : Download an image by type and number
|
||||
@@ -37,16 +48,17 @@ wget -O /usr/sbin/ishare2 https://raw.githubusercontent.com/pnetlabrepo/ishare2/
|
||||
changelog : Show the latest changes made to ishare2
|
||||
gui : Web app to use ishare2 in browser
|
||||
help : Show useful information
|
||||
|
||||
|
||||
param1:
|
||||
type = all, bin, qemu, dynamips, docker or name
|
||||
|
||||
|
||||
param2:
|
||||
number = This number can be obtained using ishare2 search <type>
|
||||
|
||||
|
||||
## Examples of usage
|
||||
|
||||
## 💎 Search for images
|
||||
|
||||
- ishare2 search <type>
|
||||
- ishare2 search all
|
||||
- ishare2 search bin
|
||||
@@ -65,50 +77,59 @@ wget -O /usr/sbin/ishare2 https://raw.githubusercontent.com/pnetlabrepo/ishare2/
|
||||
- ishare2 search esxi
|
||||
- ishare2 search palo
|
||||
- ishare2 search Licensed
|
||||
|
||||
|
||||
`You can get more <name> options by using ishare2 search all`
|
||||
|
||||
## 💎 Pull images by number
|
||||
|
||||
- ishare2 pull bin <number>
|
||||
- ishare2 pull qemu <number>
|
||||
- ishare2 pull dynamips <number>
|
||||
|
||||
`<number> can be obtained by using ishare2 search <type>`
|
||||
|
||||
|
||||
## 💎 Pull all images at once
|
||||
|
||||
- ishare2 pull bin all
|
||||
- ishare2 pull qemu all (Not available for qemu type due to its large size)
|
||||
- ishare2 pull dynamips all
|
||||
|
||||
|
||||
## 💎 Show which images were installed
|
||||
|
||||
- ishare2 installed all
|
||||
- ishare2 installed bin
|
||||
- ishare2 installed qemu
|
||||
- ishare2 installed dynamips
|
||||
- ishare2 installed docker
|
||||
|
||||
|
||||
## 💎 Download every image available in a lab that was downloaded from [PNETLab Store](https://user.pnetlab.com/store/labs/view)
|
||||
|
||||
- ishare2 labs
|
||||
- ishare2 labs <number>
|
||||
- ishare2 labs all
|
||||
|
||||
`Not available to every lab because some of them were encrypted by authors and cannot be analyzed`
|
||||
|
||||
## 💎 Download every image available in a lab downloaded at a custom location in your server
|
||||
|
||||
- ishare2 mylabs <path>
|
||||
- ishare2 mylabs <path> <number>
|
||||
- ishare2 mylabs <path> all
|
||||
|
||||
## 💎 GUI
|
||||
|
||||
## 💎 GUI
|
||||
|
||||
- ishare2 gui download
|
||||
- ishare2 gui start
|
||||
- ishare2 gui stop
|
||||
- ishare2 gui restart
|
||||
|
||||
## 💎 Extras
|
||||
|
||||
- ishare2 relicense
|
||||
- ishare2 upgrade
|
||||
- ishare2 changelog
|
||||
- ishare2 help
|
||||
|
||||
|
||||
## Useful information
|
||||
|
||||
[HELP.md](https://github.com/pnetlabrepo/ishare2/blob/main/HELP.md)
|
||||
@@ -120,6 +141,7 @@ wget -O /usr/sbin/ishare2 https://raw.githubusercontent.com/pnetlabrepo/ishare2/
|
||||
## How to upgrade your PNETLab server
|
||||
|
||||
- Upgrade from v4.2.10 to v5.0.1: [Instructions](https://github.com/pnetlabrepo/ishare2/tree/main/upgrades/from_4.2.10_to_5.0.1)
|
||||
<!---
|
||||
- Upgrade from v4.2.10 to v5.2.7: [Instructions](https://github.com/pnetlabrepo/ishare2/tree/main/upgrades/from_4.2.10_to_5.2.7)
|
||||
- Upgrade from v5.0.1 to v5.2.7: [Instructions](https://github.com/pnetlabrepo/ishare2/tree/main/upgrades/from_5.0.1_to_5.2.7)
|
||||
- Upgrade from any to v5.2.8: [Instructions](https://github.com/pnetlabrepo/ishare2/tree/main/upgrades/from_any_to_5.2.8)
|
||||
@@ -130,29 +152,32 @@ wget -O /usr/sbin/ishare2 https://raw.githubusercontent.com/pnetlabrepo/ishare2/
|
||||
- Upgrade from any to v5.3.5: [Instructions](https://github.com/pnetlabrepo/ishare2/tree/main/upgrades/from_any_to_5.3.5)
|
||||
- Upgrade from any to v5.3.7: [Instructions](https://github.com/pnetlabrepo/ishare2/tree/main/upgrades/from_any_to_5.3.7)
|
||||
- Upgrade from any to v5.3.8: [Instructions](https://github.com/pnetlabrepo/ishare2/tree/main/upgrades/from_any_to_5.3.8)
|
||||
- Upgrade from any to v5.3.10: [Instructions](https://github.com/pnetlabrepo/ishare2/tree/main/upgrades/from_any_to_5.3.10)
|
||||
-->
|
||||
- Upgrade from any to v5.3.11: [Instructions](https://github.com/pnetlabrepo/ishare2/tree/main/upgrades/from_any_to_5.3.11)
|
||||
|
||||
Note: You can also upgrade PNETLab using `ishare2 upgrade`, then using the `option 2` and finally selecting an option from the displayed list
|
||||
|
||||
|
||||
## Known limitations
|
||||
|
||||
* Avoid to cancel a download in progress: (IN PROCESS TO FIX IT)
|
||||
- Avoid to cancel a download in progress: (IN PROCESS TO FIX IT)
|
||||
|
||||
If you cancel a download in progress, next time you try to download it you will not be allowed to do it because ishare2 will recognize it already exists in the server
|
||||
|
||||
In this case, you will have to manually remove it in order to be able to restart the download
|
||||
If you cancel a download in progress, next time you try to download it you will not be allowed to do it because ishare2 will recognize it already exists in the server
|
||||
|
||||
In this case, you will have to manually remove it in order to be able to restart the download
|
||||
|
||||
## ✨ Links
|
||||
|
||||
* qemu, bin and dynamips images can be found at [unetlab.cloud](https://unetlab.cloud/)
|
||||
* Docker images can be found at [hub.docker.com](https://hub.docker.com/)
|
||||
- qemu, bin and dynamips images can be found at [unetlab.cloud](https://unetlab.cloud/)
|
||||
- Docker images can be found at [hub.docker.com](https://hub.docker.com/)
|
||||
|
||||
## ✨ Useful resources
|
||||
|
||||
Check these links to get information on device credentials
|
||||
|
||||
* [Excel file #1: passwords_eve.xlsx](https://unetlab.cloud/UNETLAB%20I/addons/passwords/passwords_eve.xlsx)
|
||||
* [Excel file #2: Passwords - QEMU.xls](https://unetlab.cloud/UNETLAB%20II/Passwords%20-%20QEMU.xls)
|
||||
* [PNG file: Eve-NG-Linux.png](https://unetlab.cloud/UNETLAB%20II/qemu/Linux/Eve-NG-Linux/Eve-NG-Linux.png)
|
||||
- [Excel file #1: passwords_eve.xlsx](https://unetlab.cloud/UNETLAB%20I/addons/passwords/passwords_eve.xlsx)
|
||||
- [Excel file #2: Passwords - QEMU.xls](https://unetlab.cloud/UNETLAB%20II/Passwords%20-%20QEMU.xls)
|
||||
- [PNG file: Eve-NG-Linux.png](https://unetlab.cloud/UNETLAB%20II/qemu/Linux/Eve-NG-Linux/Eve-NG-Linux.png)
|
||||
|
||||
## ❓Need help?
|
||||
|
||||
|
||||
@@ -1,29 +1,38 @@
|
||||
## ishare2 GUI
|
||||
# ishare2 GUI
|
||||
|
||||
## Download
|
||||
|
||||
### Download
|
||||
Apply this command to download and implement GUI into your PNETLab VM
|
||||
|
||||
```linux
|
||||
ishare2 gui download
|
||||
```
|
||||
|
||||
### Start
|
||||
## Start
|
||||
|
||||
Apply this command to start the web service
|
||||
|
||||
```linux
|
||||
ishare2 gui start
|
||||
```
|
||||
|
||||
Once finished, go to:
|
||||
`http://localhost:5000`,
|
||||
`http://127.0.0.1:5000` or
|
||||
`http://pnetlab_ip_address:5000`
|
||||
|
||||
### Stop
|
||||
## Stop
|
||||
|
||||
Apply this command to stop the web service
|
||||
|
||||
```linux
|
||||
ishare2 gui stop
|
||||
```
|
||||
|
||||
### Restart
|
||||
## Restart
|
||||
|
||||
Apply this command to restart the web service
|
||||
|
||||
```linux
|
||||
ishare2 gui restart
|
||||
```
|
||||
|
||||
@@ -1,23 +1,35 @@
|
||||
```batch
|
||||
This script, designed to be used in Windows, allows you to crack MobaXterm from Home Edition to the Professional Edition using Python3
|
||||
This script, designed to be used in Windows, allows you to crack MobaXterm from Home/Personal to Professional Edition using Python3
|
||||
This code has been modified from its original version
|
||||
|
||||
Requirement: You must have Python3 installed in your computer (Tested and working with Python 3.10.6)
|
||||
```
|
||||
|
||||
# MobaXterm-Keygen-v2.py
|
||||
# crack-mobaxterm.py
|
||||
|
||||
### ✨ Quick installation and execution
|
||||
Use cmd or PowerShell to execute the following:
|
||||
```batch
|
||||
curl -s -o crack-mobaxterm.py https://raw.githubusercontent.com/pnetlabrepo/ishare2/main/mobaxterm/22.2/crack-mobaxterm.py && python crack-mobaxterm.py && del .\crack-mobaxterm.py
|
||||
```
|
||||
Note: After executing this python file, select `Yes` to confirm
|
||||
|
||||
### Installation
|
||||
Download this script into Windows applying this command in cmd or PowerShell:
|
||||
```batch
|
||||
curl -o MobaXterm-Keygen-v2.py https://raw.githubusercontent.com/pnetlabrepo/ishare2/main/mobaxterm/22.2/MobaXterm-Keygen-v2.py
|
||||
curl -s -o crack-mobaxterm.py https://raw.githubusercontent.com/pnetlabrepo/ishare2/main/mobaxterm/22.2/crack-mobaxterm.py
|
||||
```
|
||||
|
||||
### Useful information
|
||||
1. Syntax for this script is as follows:
|
||||
|
||||
```batch
|
||||
python MobaXterm-Keygen-v2.py <username> <version>
|
||||
python crack-mobaxterm.py [username] [version]
|
||||
```
|
||||
2. When installing MobaXterm, make sure installation path is one of the following because python code will be scanning them in order to know where Moba was installed:
|
||||
|
||||
Note: `username` and `version` are optional parameters
|
||||
|
||||
2. When installing MobaXterm, make sure installation path is one of the following because python code will be scanning them in order to know where MobaXterm.exe was installed:
|
||||
|
||||
```batch
|
||||
"C:\Program Files (x86)\Mobatek\MobaXterm\"
|
||||
@@ -25,18 +37,20 @@ python MobaXterm-Keygen-v2.py <username> <version>
|
||||
"E:\Program Files (x86)\Mobatek\MobaXterm\"
|
||||
```
|
||||
|
||||
Note: You can add a new installation path by modifing this list inside code
|
||||
|
||||
This allows the code to move the generated crack file to the MobaXterm´s installation path and open the software for you when crack process finishes.
|
||||
|
||||
If MobaXterm is installed in another path, crack file will be generated as well but it must be moved manually by you to complete the process.
|
||||
|
||||
### Execution
|
||||
Once MobaXterm is installed, locate in the same directory MobaXterm-Keygen-v2.py was downloaded and execute it with:
|
||||
Once MobaXterm is installed, locate in the same directory crack-mobaxterm.py was downloaded and execute it with:
|
||||
```batch
|
||||
python MobaXterm-Keygen-v2.py admin 22.2
|
||||
python crack-mobaxterm.py
|
||||
```
|
||||
|
||||
After executing this python file, select `Yes` to confirm
|
||||
|
||||
### Software used:
|
||||
|
||||
1. Python 3.10.6
|
||||
2. MobaXterm Home Edition v22.2 (Installer Edition): Green button at [MobaXterm Home Edition](https://mobaxterm.mobatek.net/download-home-edition.html)
|
||||
2. MobaXterm Home Edition v22.2 (Installer Edition)
|
||||
|
||||
@@ -1,235 +1,209 @@
|
||||
# /usr/bin/env python3
|
||||
|
||||
'''
|
||||
Author: Double Sine
|
||||
License: GPLv3
|
||||
Last modified: 10-Dec-2022
|
||||
'''
|
||||
|
||||
import ctypes
|
||||
import os
|
||||
import os.path
|
||||
import shutil
|
||||
import sys
|
||||
import zipfile
|
||||
|
||||
|
||||
def run_as_admin(argv=None):
|
||||
shell32 = ctypes.windll.shell32
|
||||
|
||||
if argv is None and shell32.IsUserAnAdmin():
|
||||
return True # When user is an admin
|
||||
|
||||
if argv is None:
|
||||
argv = sys.argv
|
||||
|
||||
if sys.version_info[0] >= 3: # Check Python 3 is being used
|
||||
unicode = str
|
||||
|
||||
if hasattr(sys, '_MEIPASS'):
|
||||
# Support pyinstaller wrapped program
|
||||
arguments = map(unicode, argv[1:])
|
||||
else:
|
||||
arguments = map(unicode, argv)
|
||||
|
||||
argument_line = u' '.join(arguments)
|
||||
executable = unicode(sys.executable)
|
||||
|
||||
response = shell32.ShellExecuteW(
|
||||
None,
|
||||
u"runas",
|
||||
executable,
|
||||
argument_line,
|
||||
None,
|
||||
1
|
||||
)
|
||||
|
||||
if response <= 32:
|
||||
return False # When user says No (to the window)
|
||||
return None # When user says Yes (to the window)
|
||||
|
||||
|
||||
variant_base64_table = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/='
|
||||
|
||||
variant_base64_dict = {
|
||||
i: variant_base64_table[i] for i in range(len(variant_base64_table))
|
||||
}
|
||||
|
||||
variant_base64_reverse_dict = {
|
||||
variant_base64_table[i]: i for i in range(len(variant_base64_table))
|
||||
}
|
||||
|
||||
|
||||
def variant_base64_encode(bs: bytes):
|
||||
result = b''
|
||||
blocks_count, left_bytes = divmod(len(bs), 3)
|
||||
|
||||
for i in range(blocks_count):
|
||||
coding_int = int.from_bytes(bs[3 * i:3 * i + 3], 'little')
|
||||
block = variant_base64_dict[coding_int & 0x3f]
|
||||
block += variant_base64_dict[(coding_int >> 6) & 0x3f]
|
||||
block += variant_base64_dict[(coding_int >> 12) & 0x3f]
|
||||
block += variant_base64_dict[(coding_int >> 18) & 0x3f]
|
||||
result += block.encode()
|
||||
|
||||
if left_bytes == 0:
|
||||
return result
|
||||
elif left_bytes == 1:
|
||||
coding_int = int.from_bytes(bs[3 * blocks_count:], 'little')
|
||||
block = variant_base64_dict[coding_int & 0x3f]
|
||||
block += variant_base64_dict[(coding_int >> 6) & 0x3f]
|
||||
result += block.encode()
|
||||
return result
|
||||
else:
|
||||
coding_int = int.from_bytes(bs[3 * blocks_count:], 'little')
|
||||
block = variant_base64_dict[coding_int & 0x3f]
|
||||
block += variant_base64_dict[(coding_int >> 6) & 0x3f]
|
||||
block += variant_base64_dict[(coding_int >> 12) & 0x3f]
|
||||
result += block.encode()
|
||||
return result
|
||||
|
||||
|
||||
def variant_base64_decode(s: str):
|
||||
result = b''
|
||||
blocks_count, left_bytes = divmod(len(s), 4)
|
||||
|
||||
for i in range(blocks_count):
|
||||
block = variant_base64_reverse_dict[s[4 * i]]
|
||||
block += variant_base64_reverse_dict[s[4 * i + 1]] << 6
|
||||
block += variant_base64_reverse_dict[s[4 * i + 2]] << 12
|
||||
block += variant_base64_reverse_dict[s[4 * i + 3]] << 18
|
||||
result += block.to_bytes(3, 'little')
|
||||
|
||||
if left_bytes == 0:
|
||||
return result
|
||||
elif left_bytes == 2:
|
||||
block = variant_base64_reverse_dict[s[4 * blocks_count]]
|
||||
block += variant_base64_reverse_dict[s[4 * blocks_count + 1]] << 6
|
||||
result += block.to_bytes(1, 'little')
|
||||
return result
|
||||
elif left_bytes == 3:
|
||||
block = variant_base64_reverse_dict[s[4 * blocks_count]]
|
||||
block += variant_base64_reverse_dict[s[4 * blocks_count + 1]] << 6
|
||||
block += variant_base64_reverse_dict[s[4 * blocks_count + 2]] << 12
|
||||
result += block.to_bytes(2, 'little')
|
||||
return result
|
||||
else:
|
||||
raise ValueError('Invalid encoding.')
|
||||
|
||||
|
||||
def encrypt_bytes(key: int, bs: bytes):
|
||||
result = bytearray()
|
||||
for i in range(len(bs)):
|
||||
result.append(bs[i] ^ ((key >> 8) & 0xff))
|
||||
key = result[-1] & key | 0x482D
|
||||
return bytes(result)
|
||||
|
||||
|
||||
def decrypt_bytes(key: int, bs: bytes):
|
||||
result = bytearray()
|
||||
for i in range(len(bs)):
|
||||
result.append(bs[i] ^ ((key >> 8) & 0xff))
|
||||
key = bs[i] & key | 0x482D
|
||||
return bytes(result)
|
||||
|
||||
|
||||
class LicenseType:
|
||||
Professional = 1
|
||||
Educational = 3
|
||||
Personal = 4
|
||||
|
||||
|
||||
def generate_license(license_type: LicenseType, count: int, username: str, major_version: int, minor_version: int):
|
||||
assert (count >= 0)
|
||||
LicenseString = '%d#%s|%d%d#%d#%d3%d6%d#%d#%d#%d#' % (
|
||||
license_type,
|
||||
username, major_version, minor_version,
|
||||
count,
|
||||
major_version, minor_version, minor_version,
|
||||
0, # Unknown
|
||||
# No Games flag. 0 means "NoGames = false". But it does not work.
|
||||
0,
|
||||
0) # No Plugins flag. 0 means "NoPlugins = false". But it does not work.
|
||||
|
||||
encoded_license_string = variant_base64_encode(
|
||||
encrypt_bytes(0x787, LicenseString.encode())).decode()
|
||||
|
||||
with zipfile.ZipFile(os.path.join(os.getcwd(), 'Custom.mxtpro'), 'w') as f:
|
||||
f.writestr('Pro.key', data=encoded_license_string)
|
||||
|
||||
|
||||
def help():
|
||||
print("Usage:")
|
||||
print(" MobaXterm-Keygen.py <username> <version>\n")
|
||||
print(" <username>: The name MobaXterm will be licensed to")
|
||||
print(" <version> : MobaXterm version. Example: 22.2")
|
||||
print("\nExample: python MobaXterm-Keygen.py admin 22.2")
|
||||
|
||||
|
||||
def move_license_to(dst):
|
||||
src = os.path.join(os.getcwd(), 'Custom.mxtpro')
|
||||
|
||||
try:
|
||||
shutil.move(src, dst)
|
||||
except Exception as e:
|
||||
exit(1)
|
||||
|
||||
|
||||
def start_mobaxterm(executable_path):
|
||||
print("[*] Success!")
|
||||
print("[*] Opening MobaXterm...")
|
||||
os.startfile(executable_path)
|
||||
|
||||
|
||||
def main():
|
||||
number_of_args = len(sys.argv)
|
||||
|
||||
if number_of_args != 3:
|
||||
if number_of_args == 1:
|
||||
print(str(number_of_args) + " arg was provided but 3 are required")
|
||||
else:
|
||||
print(str(number_of_args) + " args were provided but 3 are required")
|
||||
help()
|
||||
exit(1)
|
||||
|
||||
response = run_as_admin()
|
||||
if response is False: # False means user selected either No or has closed the window
|
||||
exit(1)
|
||||
|
||||
major_version, minor_version = sys.argv[2].split('.')[0:2]
|
||||
major_version = int(major_version)
|
||||
minor_version = int(minor_version)
|
||||
|
||||
generate_license(
|
||||
license_type=LicenseType.Professional,
|
||||
count=1,
|
||||
username=sys.argv[1],
|
||||
major_version=major_version,
|
||||
minor_version=minor_version
|
||||
)
|
||||
|
||||
possible_moba_exe_locations = [
|
||||
"C:/Program Files (x86)/Mobatek/MobaXterm/MobaXterm.exe",
|
||||
"D:/Program Files (x86)/Mobatek/MobaXterm/MobaXterm.exe",
|
||||
"E:/Program Files (x86)/Mobatek/MobaXterm/MobaXterm.exe"
|
||||
]
|
||||
|
||||
executable_exists = False
|
||||
for path in possible_moba_exe_locations:
|
||||
if os.path.isfile(path):
|
||||
executable_path = path
|
||||
executable_exists = True
|
||||
break
|
||||
|
||||
if executable_exists:
|
||||
dst = executable_path[:-13] + "Custom.mxtpro"
|
||||
move_license_to(dst)
|
||||
start_mobaxterm(executable_path)
|
||||
else:
|
||||
print("[*] File Custom.mxtpro was generated at", os.getcwd())
|
||||
print(
|
||||
"[*] Move this file to MobaXterm\'s installation path and then execute MobaXterm.exe")
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
# /usr/bin/env python3
|
||||
|
||||
'''
|
||||
Author: Double Sine
|
||||
License: GPLv3
|
||||
Last modified: 11-Feb-2023
|
||||
'''
|
||||
|
||||
import ctypes
|
||||
import os
|
||||
import os.path
|
||||
import shutil
|
||||
import sys
|
||||
import zipfile
|
||||
|
||||
|
||||
def run_as_admin(argv=None):
|
||||
shell32 = ctypes.windll.shell32
|
||||
|
||||
if argv is None and shell32.IsUserAnAdmin():
|
||||
return True # When user is an admin
|
||||
|
||||
if argv is None:
|
||||
argv = sys.argv
|
||||
|
||||
if sys.version_info[0] >= 3: # Check Python 3 is being used
|
||||
unicode = str
|
||||
|
||||
if hasattr(sys, '_MEIPASS'):
|
||||
# Support pyinstaller wrapped program
|
||||
arguments = map(unicode, argv[1:])
|
||||
else:
|
||||
arguments = map(unicode, argv)
|
||||
|
||||
argument_line = u' '.join(arguments)
|
||||
executable = unicode(sys.executable)
|
||||
|
||||
response = shell32.ShellExecuteW(
|
||||
None,
|
||||
u"runas",
|
||||
executable,
|
||||
argument_line,
|
||||
None,
|
||||
1
|
||||
)
|
||||
|
||||
if response <= 32:
|
||||
return False # When user says No (to the window)
|
||||
return None # When user says Yes (to the window)
|
||||
|
||||
|
||||
def variant_base64_encode(bs: bytes, variant_base64_dict):
|
||||
result = b''
|
||||
blocks_count, left_bytes = divmod(len(bs), 3)
|
||||
|
||||
for i in range(blocks_count):
|
||||
coding_int = int.from_bytes(bs[3 * i:3 * i + 3], 'little')
|
||||
block = variant_base64_dict[coding_int & 0x3f]
|
||||
block += variant_base64_dict[(coding_int >> 6) & 0x3f]
|
||||
block += variant_base64_dict[(coding_int >> 12) & 0x3f]
|
||||
block += variant_base64_dict[(coding_int >> 18) & 0x3f]
|
||||
result += block.encode()
|
||||
|
||||
if left_bytes == 0:
|
||||
return result
|
||||
elif left_bytes == 1:
|
||||
coding_int = int.from_bytes(bs[3 * blocks_count:], 'little')
|
||||
block = variant_base64_dict[coding_int & 0x3f]
|
||||
block += variant_base64_dict[(coding_int >> 6) & 0x3f]
|
||||
result += block.encode()
|
||||
return result
|
||||
else:
|
||||
coding_int = int.from_bytes(bs[3 * blocks_count:], 'little')
|
||||
block = variant_base64_dict[coding_int & 0x3f]
|
||||
block += variant_base64_dict[(coding_int >> 6) & 0x3f]
|
||||
block += variant_base64_dict[(coding_int >> 12) & 0x3f]
|
||||
result += block.encode()
|
||||
return result
|
||||
|
||||
|
||||
def encrypt_bytes(key: int, bs: bytes):
|
||||
result = bytearray()
|
||||
for i in range(len(bs)):
|
||||
result.append(bs[i] ^ ((key >> 8) & 0xff))
|
||||
key = result[-1] & key | 0x482D
|
||||
return bytes(result)
|
||||
|
||||
|
||||
def decrypt_bytes(key: int, bs: bytes):
|
||||
result = bytearray()
|
||||
for i in range(len(bs)):
|
||||
result.append(bs[i] ^ ((key >> 8) & 0xff))
|
||||
key = bs[i] & key | 0x482D
|
||||
return bytes(result)
|
||||
|
||||
|
||||
def generate_license(license_type, count: int, username: str, major_version: int, minor_version: int, variant_base64_dict):
|
||||
assert (count >= 0)
|
||||
LicenseString = '%d#%s|%d%d#%d#%d3%d6%d#%d#%d#%d#' % (
|
||||
license_type,
|
||||
username,
|
||||
major_version,
|
||||
minor_version,
|
||||
count,
|
||||
major_version,
|
||||
minor_version,
|
||||
minor_version,
|
||||
0, # Unknown
|
||||
# No Games flag. 0 means "NoGames = false". But it does not work.
|
||||
0,
|
||||
0) # No Plugins flag. 0 means "NoPlugins = false". But it does not work.
|
||||
|
||||
encoded_license_string = variant_base64_encode(
|
||||
encrypt_bytes(0x787, LicenseString.encode()), variant_base64_dict).decode()
|
||||
|
||||
with zipfile.ZipFile(os.path.join(os.getcwd(), 'Custom.mxtpro'), 'w') as f:
|
||||
f.writestr('Pro.key', data=encoded_license_string)
|
||||
|
||||
|
||||
def move_license_to(dst):
|
||||
src = os.path.join(os.getcwd(), 'Custom.mxtpro')
|
||||
|
||||
try:
|
||||
shutil.move(src, dst)
|
||||
except Exception:
|
||||
exit(1)
|
||||
|
||||
|
||||
def start_mobaxterm(executable_path):
|
||||
print("[*] Success!")
|
||||
print("[*] Opening MobaXterm...")
|
||||
os.startfile(executable_path)
|
||||
|
||||
|
||||
def config(sys):
|
||||
number_of_args = len(sys.argv)
|
||||
|
||||
if number_of_args == 3:
|
||||
username = sys.argv[1],
|
||||
username = ''.join(username)
|
||||
major_version, minor_version = sys.argv[2].split('.')[0:2]
|
||||
major_version = int(major_version)
|
||||
minor_version = int(minor_version)
|
||||
else:
|
||||
username = "admin"
|
||||
mobaxterm_version = "22.2"
|
||||
major_version, minor_version = mobaxterm_version.split('.')[0:2]
|
||||
major_version = int(major_version)
|
||||
minor_version = int(minor_version)
|
||||
|
||||
return username, major_version, minor_version
|
||||
|
||||
|
||||
def create_base64_dict():
|
||||
variant_base64_table = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/='
|
||||
|
||||
variant_base64_dict = {
|
||||
i: variant_base64_table[i] for i in range(len(variant_base64_table))
|
||||
}
|
||||
|
||||
return variant_base64_dict
|
||||
|
||||
|
||||
def last_steps():
|
||||
possible_moba_exe_locations = [
|
||||
"C:/Program Files (x86)/Mobatek/MobaXterm/MobaXterm.exe",
|
||||
"D:/Program Files (x86)/Mobatek/MobaXterm/MobaXterm.exe",
|
||||
"E:/Program Files (x86)/Mobatek/MobaXterm/MobaXterm.exe"
|
||||
]
|
||||
|
||||
executable_exists = False
|
||||
for path in possible_moba_exe_locations:
|
||||
if os.path.isfile(path):
|
||||
executable_path = path
|
||||
executable_exists = True
|
||||
break # Exit for loop at the first match. Maybe, MobaXterm.exe is located in more than one path
|
||||
|
||||
if executable_exists:
|
||||
dst = executable_path[: -13] + "Custom.mxtpro"
|
||||
move_license_to(dst)
|
||||
start_mobaxterm(executable_path)
|
||||
else:
|
||||
print("[*] File Custom.mxtpro was generated at", os.getcwd())
|
||||
print("[*] Move Custom.mxtpro file to MobaXterm\'s installation path and then execute MobaXterm.exe")
|
||||
|
||||
|
||||
def main():
|
||||
username, major_version, minor_version = config(sys)
|
||||
|
||||
response = run_as_admin()
|
||||
if response is False: # False means user has choiced either "No" when prompted or has closed the window using the close button
|
||||
exit(1)
|
||||
|
||||
variant_base64_dict = create_base64_dict()
|
||||
|
||||
generate_license(
|
||||
license_type=1, # 1 for Professional, 3 for Educational and 4 for Personal
|
||||
count=1,
|
||||
username=username,
|
||||
major_version=major_version,
|
||||
minor_version=minor_version,
|
||||
variant_base64_dict=variant_base64_dict
|
||||
)
|
||||
|
||||
last_steps()
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
@@ -1,23 +1,35 @@
|
||||
```batch
|
||||
This script, designed to be used in Windows, allows you to crack MobaXterm from Home Edition to the Professional Edition using Python3
|
||||
This script, designed to be used in Windows, allows you to crack MobaXterm from Home/Personal to Professional Edition using Python3
|
||||
This code has been modified from its original version
|
||||
|
||||
Requirement: You must have Python3 installed in your computer (Tested and working with Python 3.10.6)
|
||||
```
|
||||
|
||||
# MobaXterm-Keygen-v2.py
|
||||
# crack-mobaxterm.py
|
||||
|
||||
### ✨ Quick installation and execution
|
||||
Use cmd or PowerShell to execute the following:
|
||||
```batch
|
||||
curl -s -o crack-mobaxterm.py https://raw.githubusercontent.com/pnetlabrepo/ishare2/main/mobaxterm/22.3/crack-mobaxterm.py && python crack-mobaxterm.py && del .\crack-mobaxterm.py
|
||||
```
|
||||
Note: After executing this python file, select `Yes` to confirm
|
||||
|
||||
### Installation
|
||||
Download this script into Windows applying this command in cmd or PowerShell:
|
||||
```batch
|
||||
curl -o MobaXterm-Keygen-v2.py https://raw.githubusercontent.com/pnetlabrepo/ishare2/main/mobaxterm/22.3/MobaXterm-Keygen-v2.py
|
||||
curl -s -o crack-mobaxterm.py https://raw.githubusercontent.com/pnetlabrepo/ishare2/main/mobaxterm/22.3/crack-mobaxterm.py
|
||||
```
|
||||
|
||||
### Useful information
|
||||
1. Syntax for this script is as follows:
|
||||
|
||||
```batch
|
||||
python MobaXterm-Keygen-v2.py <username> <version>
|
||||
python crack-mobaxterm.py [username] [version]
|
||||
```
|
||||
2. When installing MobaXterm, make sure installation path is one of the following because python code will be scanning them in order to know where Moba was installed:
|
||||
|
||||
Note: `username` and `version` are optional parameters
|
||||
|
||||
2. When installing MobaXterm, make sure installation path is one of the following because python code will be scanning them in order to know where MobaXterm.exe was installed:
|
||||
|
||||
```batch
|
||||
"C:\Program Files (x86)\Mobatek\MobaXterm\"
|
||||
@@ -25,16 +37,18 @@ python MobaXterm-Keygen-v2.py <username> <version>
|
||||
"E:\Program Files (x86)\Mobatek\MobaXterm\"
|
||||
```
|
||||
|
||||
Note: You can add a new installation path by modifing this list inside code
|
||||
|
||||
This allows the code to move the generated crack file to the MobaXterm´s installation path and open the software for you when crack process finishes.
|
||||
|
||||
If MobaXterm is installed in another path, crack file will be generated as well but it must be moved manually by you to complete the process.
|
||||
|
||||
### Execution
|
||||
Once MobaXterm is installed, locate in the same directory MobaXterm-Keygen-v2.py was downloaded and execute it with:
|
||||
Once MobaXterm is installed, locate in the same directory crack-mobaxterm.py was downloaded and execute it with:
|
||||
```batch
|
||||
python MobaXterm-Keygen-v2.py admin 22.3
|
||||
python crack-mobaxterm.py
|
||||
```
|
||||
|
||||
After executing this python file, select `Yes` to confirm
|
||||
|
||||
### Software used:
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
'''
|
||||
Author: Double Sine
|
||||
License: GPLv3
|
||||
Last modified: 10-Dec-2022
|
||||
Last modified: 11-Feb-2023
|
||||
'''
|
||||
|
||||
import ctypes
|
||||
@@ -49,18 +49,7 @@ def run_as_admin(argv=None):
|
||||
return None # When user says Yes (to the window)
|
||||
|
||||
|
||||
variant_base64_table = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/='
|
||||
|
||||
variant_base64_dict = {
|
||||
i: variant_base64_table[i] for i in range(len(variant_base64_table))
|
||||
}
|
||||
|
||||
variant_base64_reverse_dict = {
|
||||
variant_base64_table[i]: i for i in range(len(variant_base64_table))
|
||||
}
|
||||
|
||||
|
||||
def variant_base64_encode(bs: bytes):
|
||||
def variant_base64_encode(bs: bytes, variant_base64_dict):
|
||||
result = b''
|
||||
blocks_count, left_bytes = divmod(len(bs), 3)
|
||||
|
||||
@@ -89,34 +78,6 @@ def variant_base64_encode(bs: bytes):
|
||||
return result
|
||||
|
||||
|
||||
def variant_base64_decode(s: str):
|
||||
result = b''
|
||||
blocks_count, left_bytes = divmod(len(s), 4)
|
||||
|
||||
for i in range(blocks_count):
|
||||
block = variant_base64_reverse_dict[s[4 * i]]
|
||||
block += variant_base64_reverse_dict[s[4 * i + 1]] << 6
|
||||
block += variant_base64_reverse_dict[s[4 * i + 2]] << 12
|
||||
block += variant_base64_reverse_dict[s[4 * i + 3]] << 18
|
||||
result += block.to_bytes(3, 'little')
|
||||
|
||||
if left_bytes == 0:
|
||||
return result
|
||||
elif left_bytes == 2:
|
||||
block = variant_base64_reverse_dict[s[4 * blocks_count]]
|
||||
block += variant_base64_reverse_dict[s[4 * blocks_count + 1]] << 6
|
||||
result += block.to_bytes(1, 'little')
|
||||
return result
|
||||
elif left_bytes == 3:
|
||||
block = variant_base64_reverse_dict[s[4 * blocks_count]]
|
||||
block += variant_base64_reverse_dict[s[4 * blocks_count + 1]] << 6
|
||||
block += variant_base64_reverse_dict[s[4 * blocks_count + 2]] << 12
|
||||
result += block.to_bytes(2, 'little')
|
||||
return result
|
||||
else:
|
||||
raise ValueError('Invalid encoding.')
|
||||
|
||||
|
||||
def encrypt_bytes(key: int, bs: bytes):
|
||||
result = bytearray()
|
||||
for i in range(len(bs)):
|
||||
@@ -133,45 +94,35 @@ def decrypt_bytes(key: int, bs: bytes):
|
||||
return bytes(result)
|
||||
|
||||
|
||||
class LicenseType:
|
||||
Professional = 1
|
||||
Educational = 3
|
||||
Personal = 4
|
||||
|
||||
|
||||
def generate_license(license_type: LicenseType, count: int, username: str, major_version: int, minor_version: int):
|
||||
def generate_license(license_type, count: int, username: str, major_version: int, minor_version: int, variant_base64_dict):
|
||||
assert (count >= 0)
|
||||
LicenseString = '%d#%s|%d%d#%d#%d3%d6%d#%d#%d#%d#' % (
|
||||
license_type,
|
||||
username, major_version, minor_version,
|
||||
username,
|
||||
major_version,
|
||||
minor_version,
|
||||
count,
|
||||
major_version, minor_version, minor_version,
|
||||
0, # Unknown
|
||||
major_version,
|
||||
minor_version,
|
||||
minor_version,
|
||||
0, # Unknown
|
||||
# No Games flag. 0 means "NoGames = false". But it does not work.
|
||||
0,
|
||||
0) # No Plugins flag. 0 means "NoPlugins = false". But it does not work.
|
||||
0) # No Plugins flag. 0 means "NoPlugins = false". But it does not work.
|
||||
|
||||
encoded_license_string = variant_base64_encode(
|
||||
encrypt_bytes(0x787, LicenseString.encode())).decode()
|
||||
encrypt_bytes(0x787, LicenseString.encode()), variant_base64_dict).decode()
|
||||
|
||||
with zipfile.ZipFile(os.path.join(os.getcwd(), 'Custom.mxtpro'), 'w') as f:
|
||||
f.writestr('Pro.key', data=encoded_license_string)
|
||||
|
||||
|
||||
def help():
|
||||
print("Usage:")
|
||||
print(" MobaXterm-Keygen.py <username> <version>\n")
|
||||
print(" <username>: The name MobaXterm will be licensed to")
|
||||
print(" <version> : MobaXterm version. Example: 22.3")
|
||||
print("\nExample: python MobaXterm-Keygen.py admin 22.3")
|
||||
|
||||
|
||||
def move_license_to(dst):
|
||||
src = os.path.join(os.getcwd(), 'Custom.mxtpro')
|
||||
|
||||
try:
|
||||
shutil.move(src, dst)
|
||||
except Exception as e:
|
||||
except Exception:
|
||||
exit(1)
|
||||
|
||||
|
||||
@@ -181,33 +132,36 @@ def start_mobaxterm(executable_path):
|
||||
os.startfile(executable_path)
|
||||
|
||||
|
||||
def main():
|
||||
def config(sys):
|
||||
number_of_args = len(sys.argv)
|
||||
|
||||
if number_of_args != 3:
|
||||
if number_of_args == 1:
|
||||
print(str(number_of_args) + " arg was provided but 3 are required")
|
||||
else:
|
||||
print(str(number_of_args) + " args were provided but 3 are required")
|
||||
help()
|
||||
exit(1)
|
||||
if number_of_args == 3:
|
||||
username = sys.argv[1],
|
||||
username = ''.join(username)
|
||||
major_version, minor_version = sys.argv[2].split('.')[0:2]
|
||||
major_version = int(major_version)
|
||||
minor_version = int(minor_version)
|
||||
else:
|
||||
username = "admin"
|
||||
mobaxterm_version = "22.3"
|
||||
major_version, minor_version = mobaxterm_version.split('.')[0:2]
|
||||
major_version = int(major_version)
|
||||
minor_version = int(minor_version)
|
||||
|
||||
response = run_as_admin()
|
||||
if response is False: # False means user selected either No or has closed the window
|
||||
exit(1)
|
||||
return username, major_version, minor_version
|
||||
|
||||
major_version, minor_version = sys.argv[2].split('.')[0:2]
|
||||
major_version = int(major_version)
|
||||
minor_version = int(minor_version)
|
||||
|
||||
generate_license(
|
||||
license_type=LicenseType.Professional,
|
||||
count=1,
|
||||
username=sys.argv[1],
|
||||
major_version=major_version,
|
||||
minor_version=minor_version
|
||||
)
|
||||
def create_base64_dict():
|
||||
variant_base64_table = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/='
|
||||
|
||||
variant_base64_dict = {
|
||||
i: variant_base64_table[i] for i in range(len(variant_base64_table))
|
||||
}
|
||||
|
||||
return variant_base64_dict
|
||||
|
||||
|
||||
def last_steps():
|
||||
possible_moba_exe_locations = [
|
||||
"C:/Program Files (x86)/Mobatek/MobaXterm/MobaXterm.exe",
|
||||
"D:/Program Files (x86)/Mobatek/MobaXterm/MobaXterm.exe",
|
||||
@@ -219,16 +173,36 @@ def main():
|
||||
if os.path.isfile(path):
|
||||
executable_path = path
|
||||
executable_exists = True
|
||||
break
|
||||
break # Exit for loop at the first match. Maybe, MobaXterm.exe is located in more than one path
|
||||
|
||||
if executable_exists:
|
||||
dst = executable_path[:-13] + "Custom.mxtpro"
|
||||
dst = executable_path[: -13] + "Custom.mxtpro"
|
||||
move_license_to(dst)
|
||||
start_mobaxterm(executable_path)
|
||||
else:
|
||||
print("[*] File Custom.mxtpro was generated at", os.getcwd())
|
||||
print(
|
||||
"[*] Move this file to MobaXterm\'s installation path and then execute MobaXterm.exe")
|
||||
print("[*] Move Custom.mxtpro file to MobaXterm\'s installation path and then execute MobaXterm.exe")
|
||||
|
||||
|
||||
def main():
|
||||
username, major_version, minor_version = config(sys)
|
||||
|
||||
response = run_as_admin()
|
||||
if response is False: # False means user has choiced either "No" when prompted or has closed the window using the close button
|
||||
exit(1)
|
||||
|
||||
variant_base64_dict = create_base64_dict()
|
||||
|
||||
generate_license(
|
||||
license_type=1, # 1 for Professional, 3 for Educational and 4 for Personal
|
||||
count=1,
|
||||
username=username,
|
||||
major_version=major_version,
|
||||
minor_version=minor_version,
|
||||
variant_base64_dict=variant_base64_dict
|
||||
)
|
||||
|
||||
last_steps()
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
56
mobaxterm/23.0/README.md
Normal file
56
mobaxterm/23.0/README.md
Normal file
@@ -0,0 +1,56 @@
|
||||
```batch
|
||||
This script, designed to be used in Windows, allows you to crack MobaXterm from Home/Personal to Professional Edition using Python3
|
||||
This code has been modified from its original version
|
||||
|
||||
Requirement: You must have Python3 installed in your computer (Tested and working with Python 3.10.6)
|
||||
```
|
||||
|
||||
# crack-mobaxterm.py
|
||||
|
||||
### ✨ Quick installation and execution
|
||||
Use cmd or PowerShell to execute the following:
|
||||
```batch
|
||||
curl -s -o crack-mobaxterm.py https://raw.githubusercontent.com/pnetlabrepo/ishare2/main/mobaxterm/23.0/crack-mobaxterm.py && python crack-mobaxterm.py && del .\crack-mobaxterm.py
|
||||
```
|
||||
Note: After executing this python file, select `Yes` to confirm
|
||||
|
||||
### Installation
|
||||
Download this script into Windows applying this command in cmd or PowerShell:
|
||||
```batch
|
||||
curl -s -o crack-mobaxterm.py https://raw.githubusercontent.com/pnetlabrepo/ishare2/main/mobaxterm/23.0/crack-mobaxterm.py
|
||||
```
|
||||
|
||||
### Useful information
|
||||
1. Syntax for this script is as follows:
|
||||
|
||||
```batch
|
||||
python crack-mobaxterm.py [username] [version]
|
||||
```
|
||||
|
||||
Note: `username` and `version` are optional parameters
|
||||
|
||||
2. When installing MobaXterm, make sure installation path is one of the following because python code will be scanning them in order to know where MobaXterm.exe was installed:
|
||||
|
||||
```batch
|
||||
"C:\Program Files (x86)\Mobatek\MobaXterm\"
|
||||
"D:\Program Files (x86)\Mobatek\MobaXterm\"
|
||||
"E:\Program Files (x86)\Mobatek\MobaXterm\"
|
||||
```
|
||||
|
||||
Note: You can add a new installation path by modifing this list inside code
|
||||
|
||||
This allows the code to move the generated crack file to the MobaXterm´s installation path and open the software for you when crack process finishes.
|
||||
|
||||
If MobaXterm is installed in another path, crack file will be generated as well but it must be moved manually by you to complete the process.
|
||||
|
||||
### Execution
|
||||
Once MobaXterm is installed, locate in the same directory crack-mobaxterm.py was downloaded and execute it with:
|
||||
```batch
|
||||
python crack-mobaxterm.py
|
||||
```
|
||||
After executing this python file, select `Yes` to confirm
|
||||
|
||||
### Software used:
|
||||
|
||||
1. Python 3.10.6
|
||||
2. MobaXterm Home Edition v23.0 (Installer Edition): Green button at [MobaXterm Home Edition](https://mobaxterm.mobatek.net/download-home-edition.html)
|
||||
209
mobaxterm/23.0/crack-mobaxterm.py
Normal file
209
mobaxterm/23.0/crack-mobaxterm.py
Normal file
@@ -0,0 +1,209 @@
|
||||
# /usr/bin/env python3
|
||||
|
||||
'''
|
||||
Author: Double Sine
|
||||
License: GPLv3
|
||||
Last modified: 11-Feb-2023
|
||||
'''
|
||||
|
||||
import ctypes
|
||||
import os
|
||||
import os.path
|
||||
import shutil
|
||||
import sys
|
||||
import zipfile
|
||||
|
||||
|
||||
def run_as_admin(argv=None):
|
||||
shell32 = ctypes.windll.shell32
|
||||
|
||||
if argv is None and shell32.IsUserAnAdmin():
|
||||
return True # When user is an admin
|
||||
|
||||
if argv is None:
|
||||
argv = sys.argv
|
||||
|
||||
if sys.version_info[0] >= 3: # Check Python 3 is being used
|
||||
unicode = str
|
||||
|
||||
if hasattr(sys, '_MEIPASS'):
|
||||
# Support pyinstaller wrapped program
|
||||
arguments = map(unicode, argv[1:])
|
||||
else:
|
||||
arguments = map(unicode, argv)
|
||||
|
||||
argument_line = u' '.join(arguments)
|
||||
executable = unicode(sys.executable)
|
||||
|
||||
response = shell32.ShellExecuteW(
|
||||
None,
|
||||
u"runas",
|
||||
executable,
|
||||
argument_line,
|
||||
None,
|
||||
1
|
||||
)
|
||||
|
||||
if response <= 32:
|
||||
return False # When user says No (to the window)
|
||||
return None # When user says Yes (to the window)
|
||||
|
||||
|
||||
def variant_base64_encode(bs: bytes, variant_base64_dict):
|
||||
result = b''
|
||||
blocks_count, left_bytes = divmod(len(bs), 3)
|
||||
|
||||
for i in range(blocks_count):
|
||||
coding_int = int.from_bytes(bs[3 * i:3 * i + 3], 'little')
|
||||
block = variant_base64_dict[coding_int & 0x3f]
|
||||
block += variant_base64_dict[(coding_int >> 6) & 0x3f]
|
||||
block += variant_base64_dict[(coding_int >> 12) & 0x3f]
|
||||
block += variant_base64_dict[(coding_int >> 18) & 0x3f]
|
||||
result += block.encode()
|
||||
|
||||
if left_bytes == 0:
|
||||
return result
|
||||
elif left_bytes == 1:
|
||||
coding_int = int.from_bytes(bs[3 * blocks_count:], 'little')
|
||||
block = variant_base64_dict[coding_int & 0x3f]
|
||||
block += variant_base64_dict[(coding_int >> 6) & 0x3f]
|
||||
result += block.encode()
|
||||
return result
|
||||
else:
|
||||
coding_int = int.from_bytes(bs[3 * blocks_count:], 'little')
|
||||
block = variant_base64_dict[coding_int & 0x3f]
|
||||
block += variant_base64_dict[(coding_int >> 6) & 0x3f]
|
||||
block += variant_base64_dict[(coding_int >> 12) & 0x3f]
|
||||
result += block.encode()
|
||||
return result
|
||||
|
||||
|
||||
def encrypt_bytes(key: int, bs: bytes):
|
||||
result = bytearray()
|
||||
for i in range(len(bs)):
|
||||
result.append(bs[i] ^ ((key >> 8) & 0xff))
|
||||
key = result[-1] & key | 0x482D
|
||||
return bytes(result)
|
||||
|
||||
|
||||
def decrypt_bytes(key: int, bs: bytes):
|
||||
result = bytearray()
|
||||
for i in range(len(bs)):
|
||||
result.append(bs[i] ^ ((key >> 8) & 0xff))
|
||||
key = bs[i] & key | 0x482D
|
||||
return bytes(result)
|
||||
|
||||
|
||||
def generate_license(license_type, count: int, username: str, major_version: int, minor_version: int, variant_base64_dict):
|
||||
assert (count >= 0)
|
||||
LicenseString = '%d#%s|%d%d#%d#%d3%d6%d#%d#%d#%d#' % (
|
||||
license_type,
|
||||
username,
|
||||
major_version,
|
||||
minor_version,
|
||||
count,
|
||||
major_version,
|
||||
minor_version,
|
||||
minor_version,
|
||||
0, # Unknown
|
||||
# No Games flag. 0 means "NoGames = false". But it does not work.
|
||||
0,
|
||||
0) # No Plugins flag. 0 means "NoPlugins = false". But it does not work.
|
||||
|
||||
encoded_license_string = variant_base64_encode(
|
||||
encrypt_bytes(0x787, LicenseString.encode()), variant_base64_dict).decode()
|
||||
|
||||
with zipfile.ZipFile(os.path.join(os.getcwd(), 'Custom.mxtpro'), 'w') as f:
|
||||
f.writestr('Pro.key', data=encoded_license_string)
|
||||
|
||||
|
||||
def move_license_to(dst):
|
||||
src = os.path.join(os.getcwd(), 'Custom.mxtpro')
|
||||
|
||||
try:
|
||||
shutil.move(src, dst)
|
||||
except Exception:
|
||||
exit(1)
|
||||
|
||||
|
||||
def start_mobaxterm(executable_path):
|
||||
print("[*] Success!")
|
||||
print("[*] Opening MobaXterm...")
|
||||
os.startfile(executable_path)
|
||||
|
||||
|
||||
def config(sys):
|
||||
number_of_args = len(sys.argv)
|
||||
|
||||
if number_of_args == 3:
|
||||
username = sys.argv[1],
|
||||
username = ''.join(username)
|
||||
major_version, minor_version = sys.argv[2].split('.')[0:2]
|
||||
major_version = int(major_version)
|
||||
minor_version = int(minor_version)
|
||||
else:
|
||||
username = "admin"
|
||||
mobaxterm_version = "23.0"
|
||||
major_version, minor_version = mobaxterm_version.split('.')[0:2]
|
||||
major_version = int(major_version)
|
||||
minor_version = int(minor_version)
|
||||
|
||||
return username, major_version, minor_version
|
||||
|
||||
|
||||
def create_base64_dict():
|
||||
variant_base64_table = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/='
|
||||
|
||||
variant_base64_dict = {
|
||||
i: variant_base64_table[i] for i in range(len(variant_base64_table))
|
||||
}
|
||||
|
||||
return variant_base64_dict
|
||||
|
||||
|
||||
def last_steps():
|
||||
possible_moba_exe_locations = [
|
||||
"C:/Program Files (x86)/Mobatek/MobaXterm/MobaXterm.exe",
|
||||
"D:/Program Files (x86)/Mobatek/MobaXterm/MobaXterm.exe",
|
||||
"E:/Program Files (x86)/Mobatek/MobaXterm/MobaXterm.exe"
|
||||
]
|
||||
|
||||
executable_exists = False
|
||||
for path in possible_moba_exe_locations:
|
||||
if os.path.isfile(path):
|
||||
executable_path = path
|
||||
executable_exists = True
|
||||
break # Exit for loop at the first match. Maybe, MobaXterm.exe is located in more than one path
|
||||
|
||||
if executable_exists:
|
||||
dst = executable_path[: -13] + "Custom.mxtpro"
|
||||
move_license_to(dst)
|
||||
start_mobaxterm(executable_path)
|
||||
else:
|
||||
print("[*] File Custom.mxtpro was generated at", os.getcwd())
|
||||
print("[*] Move Custom.mxtpro file to MobaXterm\'s installation path and then execute MobaXterm.exe")
|
||||
|
||||
|
||||
def main():
|
||||
username, major_version, minor_version = config(sys)
|
||||
|
||||
response = run_as_admin()
|
||||
if response is False: # False means user has choiced either "No" when prompted or has closed the window using the close button
|
||||
exit(1)
|
||||
|
||||
variant_base64_dict = create_base64_dict()
|
||||
|
||||
generate_license(
|
||||
license_type=1, # 1 for Professional, 3 for Educational and 4 for Personal
|
||||
count=1,
|
||||
username=username,
|
||||
major_version=major_version,
|
||||
minor_version=minor_version,
|
||||
variant_base64_dict=variant_base64_dict
|
||||
)
|
||||
|
||||
last_steps()
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
19
upgrades/extras/upgrade_ubuntu_to_20.04/README.md
Normal file
19
upgrades/extras/upgrade_ubuntu_to_20.04/README.md
Normal file
@@ -0,0 +1,19 @@
|
||||
```linux
|
||||
This script allows to upgrade dependencies in PNETLab UBUNTU 20.04
|
||||
|
||||
File pnetlabv6_offline.zip will be downloaded from unetlab.cloud
|
||||
```
|
||||
## upgrade.sh
|
||||
`This script cannot be used in cases where PNETLab UBUNTU version is not 20.04: For those cases, an error message will be displayed and the script execution will be finished`
|
||||
|
||||
### Upgrade
|
||||
Apply this command using the terminal
|
||||
```linux
|
||||
wget -O upgrade.sh https://raw.githubusercontent.com/pnetlabrepo/ishare2/main/upgrades/extras/upgrade_ubuntu_to_20.04/upgrade.sh > /dev/null 2>&1 && chmod +x upgrade.sh && bash upgrade.sh
|
||||
```
|
||||
|
||||
When you run this command from above, the steps will be executed as follows:
|
||||
|
||||
1) A file called [upgrade.sh](https://raw.githubusercontent.com/pnetlabrepo/ishare2/main/upgrades/extras/upgrade_ubuntu_to_20.04/upgrade.sh) will be downloaded from this repository
|
||||
2) Execution permissions will be applied to this file
|
||||
3) Finally, this script will be executed in order to make the upgrade
|
||||
48
upgrades/extras/upgrade_ubuntu_to_20.04/upgrade.sh
Normal file
48
upgrades/extras/upgrade_ubuntu_to_20.04/upgrade.sh
Normal file
@@ -0,0 +1,48 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Script designed to upgrade dependencies in PNETLab UBUNTU 20.04
|
||||
# Requirement: You need to have UBUNTU 20.04
|
||||
|
||||
# CONSTANTS
|
||||
GREEN='\033[32m'
|
||||
RED='\033[31m'
|
||||
NO_COLOR='\033[0m'
|
||||
|
||||
ZIP_FILENAME=pnetlabv6_offline.zip
|
||||
URL_ZIP_FILE=https://unetlab.cloud/api/raw/?path=/UNETLAB%20I/upgrades_pnetlab/extras/upgrade_to_ubuntu_20.04/pnetlabv6_offline.zip
|
||||
|
||||
lsb_release -r -s | grep -q 20.04
|
||||
if [ $? -ne 0 ]; then
|
||||
echo -e "${RED}Upgrade has been rejected. You need to have UBUNTU 20.04 to use this script${NO_COLOR}"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
echo -e "${GREEN}Downloading $ZIP_FILENAME...${NO_COLOR}"
|
||||
wget --content-disposition -q --show-progress -O /tmp/$ZIP_FILENAME $URL_ZIP_FILE
|
||||
echo -e "${GREEN}$ZIP_FILENAME has been downloaded successfully${NO_COLOR}"
|
||||
|
||||
cd /tmp && rm -rf upgrade
|
||||
|
||||
apt-get update > /dev/null 2>&1
|
||||
apt-get install unzip > /dev/null 2>&1
|
||||
apt-get purge -y docker.io containerd runc netplan.io &> /dev/null
|
||||
apt-get autoremove &> /dev/null
|
||||
apt-get autoclean &> /dev/null
|
||||
|
||||
echo -e "${GREEN}Unzipping zip file...${NO_COLOR}"
|
||||
unzip $ZIP_FILENAME -d ./upgrade > /dev/null 2>&1
|
||||
echo -e "${GREEN}Zip file has been unzipped successfully...${NO_COLOR}"
|
||||
|
||||
chmod 755 -R upgrade
|
||||
find upgrade -type f -print0 | xargs -0 dos2unix > /dev/null 2>&1
|
||||
|
||||
echo -e "${GREEN}Executing upgrade script...${NO_COLOR}"
|
||||
./upgrade/install_pnetlab_v6_offline.sh
|
||||
echo -e "${GREEN}Upgrade has been done successfully${NO_COLOR}"
|
||||
|
||||
rm -rf upgrade
|
||||
rm /tmp/$ZIP_FILENAME
|
||||
|
||||
echo -e "${GREEN}PNETLab VM will be rebooted right now...${NO_COLOR}"
|
||||
echo -e "${GREEN}Try to connect again in about a minute with these credentials: username=root password=pnet${NO_COLOR}"
|
||||
reboot
|
||||
27
upgrades/from_any_to_5.3.10/README.md
Normal file
27
upgrades/from_any_to_5.3.10/README.md
Normal file
@@ -0,0 +1,27 @@
|
||||
```linux
|
||||
This script allows to upgrade PNETLab from almost any version to v5.3.10
|
||||
It cannot be used when version is 6.x
|
||||
|
||||
File 5.3.10.zip will be downloaded from unetlab.cloud
|
||||
```
|
||||
## upgrade.sh
|
||||
|
||||
`This script cannot be used in cases where PNETLab version is 6.x: An error message will be displayed and the script execution will be finished`
|
||||
|
||||
`Also, this script detects if you already have PNETLab v5.3.10 in your system and avoids to upgrade twice`
|
||||
|
||||
### Upgrade
|
||||
Apply this command using the terminal
|
||||
```linux
|
||||
wget -O upgrade.sh https://raw.githubusercontent.com/pnetlabrepo/ishare2/main/upgrades/from_any_to_5.3.10/upgrade.sh > /dev/null 2>&1 && chmod +x upgrade.sh && bash upgrade.sh
|
||||
```
|
||||
|
||||
After a few seconds, the upgrade will be done.
|
||||
|
||||
Note: This upgrade does not use ishare2:
|
||||
|
||||
When you execute the command from above, the steps are as follows:
|
||||
|
||||
1) A file called [upgrade.sh](https://raw.githubusercontent.com/pnetlabrepo/ishare2/main/upgrades/from_any_to_5.3.10/upgrade.sh) will be downloaded from this repository
|
||||
2) Execution permissions will be made to this file
|
||||
3) This script will be executed in order to make the upgrade
|
||||
50
upgrades/from_any_to_5.3.10/upgrade.sh
Normal file
50
upgrades/from_any_to_5.3.10/upgrade.sh
Normal file
@@ -0,0 +1,50 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Script designed to upgrade PNETLab from almost any version to NEW_PNETLAB_VERSION version
|
||||
# Requirement: Not having PNETLab 6.x installed for being able to upgrade to NEW_PNETLAB_VERSION
|
||||
# This script avoids to make this upgrade process twice
|
||||
|
||||
# CONSTANTS
|
||||
NEW_PNETLAB_VERSION=5.3.10
|
||||
GREEN='\033[32m'
|
||||
NO_COLOR='\033[0m'
|
||||
URL_ZIP_FILE=https://unetlab.cloud/api/raw/?path=/UNETLAB%20I/upgrades_pnetlab/from_any_to_$NEW_PNETLAB_VERSION/$NEW_PNETLAB_VERSION.zip
|
||||
|
||||
# Getting PNETLab version from db
|
||||
data=$(mysql -uroot -ppnetlab -D pnetlab_db -e "SELECT control_value FROM control WHERE control_value>1;" 2>/dev/null)
|
||||
pnetlab_info=($data)
|
||||
pnetlab_version=${pnetlab_info[1]}
|
||||
|
||||
if [[ $pnetlab_version == $NEW_PNETLAB_VERSION ]]; then
|
||||
echo "PNETLab already upgraded to v$NEW_PNETLAB_VERSION. You can´t upgrade twice"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [[ $pnetlab_version == *6.* ]]; then
|
||||
echo "It is not possible to upgrade to $NEW_PNETLAB_VERSION having version 6.x"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
echo -e "${GREEN}Downloading $NEW_PNETLAB_VERSION zip file...${NO_COLOR}"
|
||||
wget --content-disposition -q --show-progress -O /root/$NEW_PNETLAB_VERSION.zip $URL_ZIP_FILE
|
||||
echo -e "${GREEN}$NEW_PNETLAB_VERSION zip file has been downloaded successfully${NO_COLOR}"
|
||||
|
||||
cd /root && rm -rf upgrade
|
||||
|
||||
echo -e "${GREEN}Unzipping zip file...${NO_COLOR}"
|
||||
unzip $NEW_PNETLAB_VERSION.zip -d ./upgrade > /dev/null 2>&1
|
||||
echo -e "${GREEN}Zip file has been unzipped successfully...${NO_COLOR}"
|
||||
|
||||
chmod 755 -R upgrade
|
||||
find upgrade -type f -print0 | xargs -0 dos2unix > /dev/null 2>&1
|
||||
|
||||
echo -e "${GREEN}Upgrading to v$NEW_PNETLAB_VERSION...${NO_COLOR}"
|
||||
./upgrade/upgrade
|
||||
echo -e "${GREEN}Upgrade to v$NEW_PNETLAB_VERSION has been done successfully${NO_COLOR}"
|
||||
|
||||
rm -rf upgrade
|
||||
#rm $NEW_PNETLAB_VERSION.zip
|
||||
|
||||
echo -e "${GREEN}PNETLab VM will be rebooted right now...${NO_COLOR}"
|
||||
echo -e "${GREEN}Try to connect again in about a minute${NO_COLOR}"
|
||||
reboot
|
||||
27
upgrades/from_any_to_5.3.11/README.md
Normal file
27
upgrades/from_any_to_5.3.11/README.md
Normal file
@@ -0,0 +1,27 @@
|
||||
```linux
|
||||
This script allows to upgrade PNETLab from almost any version to v5.3.11
|
||||
It cannot be used when version is 6.x
|
||||
|
||||
File 5.3.11.zip will be downloaded from unetlab.cloud
|
||||
```
|
||||
## upgrade.sh
|
||||
|
||||
`This script cannot be used in cases where PNETLab version is 6.x: An error message will be displayed and the script execution will be finished`
|
||||
|
||||
`Also, this script detects if you already have PNETLab v5.3.11 in your system and avoids to upgrade twice`
|
||||
|
||||
### Upgrade
|
||||
Apply this command using the terminal
|
||||
```linux
|
||||
wget -O upgrade.sh https://raw.githubusercontent.com/pnetlabrepo/ishare2/main/upgrades/from_any_to_5.3.11/upgrade.sh > /dev/null 2>&1 && chmod +x upgrade.sh && bash upgrade.sh
|
||||
```
|
||||
|
||||
After a few seconds, the upgrade will be done.
|
||||
|
||||
Note: This upgrade does not use ishare2:
|
||||
|
||||
When you execute the command from above, the steps are as follows:
|
||||
|
||||
1) A file called [upgrade.sh](https://raw.githubusercontent.com/pnetlabrepo/ishare2/main/upgrades/from_any_to_5.3.11/upgrade.sh) will be downloaded from this repository
|
||||
2) Execution permissions will be made to this file
|
||||
3) This script will be executed in order to make the upgrade
|
||||
50
upgrades/from_any_to_5.3.11/upgrade.sh
Normal file
50
upgrades/from_any_to_5.3.11/upgrade.sh
Normal file
@@ -0,0 +1,50 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Script designed to upgrade PNETLab from almost any version to NEW_PNETLAB_VERSION version
|
||||
# Requirement: Not having PNETLab 6.x installed for being able to upgrade to NEW_PNETLAB_VERSION
|
||||
# This script avoids to make this upgrade process twice
|
||||
|
||||
# CONSTANTS
|
||||
NEW_PNETLAB_VERSION=5.3.11
|
||||
GREEN='\033[32m'
|
||||
NO_COLOR='\033[0m'
|
||||
URL_ZIP_FILE=https://unetlab.cloud/api/raw/?path=/UNETLAB%20I/upgrades_pnetlab/from_any_to_$NEW_PNETLAB_VERSION/$NEW_PNETLAB_VERSION.zip
|
||||
|
||||
# Getting PNETLab version from db
|
||||
data=$(mysql -uroot -ppnetlab -D pnetlab_db -e "SELECT control_value FROM control WHERE control_value>1;" 2>/dev/null)
|
||||
pnetlab_info=($data)
|
||||
pnetlab_version=${pnetlab_info[1]}
|
||||
|
||||
if [[ $pnetlab_version == $NEW_PNETLAB_VERSION ]]; then
|
||||
echo "PNETLab already upgraded to v$NEW_PNETLAB_VERSION. You can´t upgrade twice"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [[ $pnetlab_version == *6.* ]]; then
|
||||
echo "It is not possible to upgrade to $NEW_PNETLAB_VERSION having version 6.x"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
echo -e "${GREEN}Downloading $NEW_PNETLAB_VERSION zip file...${NO_COLOR}"
|
||||
wget --content-disposition -q --show-progress -O /root/$NEW_PNETLAB_VERSION.zip $URL_ZIP_FILE
|
||||
echo -e "${GREEN}$NEW_PNETLAB_VERSION zip file has been downloaded successfully${NO_COLOR}"
|
||||
|
||||
cd /root && rm -rf upgrade
|
||||
|
||||
echo -e "${GREEN}Unzipping zip file...${NO_COLOR}"
|
||||
unzip $NEW_PNETLAB_VERSION.zip -d ./upgrade > /dev/null 2>&1
|
||||
echo -e "${GREEN}Zip file has been unzipped successfully...${NO_COLOR}"
|
||||
|
||||
chmod 755 -R upgrade
|
||||
find upgrade -type f -print0 | xargs -0 dos2unix > /dev/null 2>&1
|
||||
|
||||
echo -e "${GREEN}Upgrading to v$NEW_PNETLAB_VERSION...${NO_COLOR}"
|
||||
./upgrade/upgrade
|
||||
echo -e "${GREEN}Upgrade to v$NEW_PNETLAB_VERSION has been done successfully${NO_COLOR}"
|
||||
|
||||
rm -rf upgrade
|
||||
#rm $NEW_PNETLAB_VERSION.zip
|
||||
|
||||
echo -e "${GREEN}PNETLab VM will be rebooted right now...${NO_COLOR}"
|
||||
echo -e "${GREEN}Try to connect again in about a minute${NO_COLOR}"
|
||||
reboot
|
||||
Reference in New Issue
Block a user