You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: README.md
+178-41
Original file line number
Diff line number
Diff line change
@@ -16,9 +16,11 @@ The result then can be transferred to the target machine (It is much easier to e
16
16
17
17
Upon executing exe2hex's output file, the original program is restored by using `DEBUG.exe` or PowerShell (which are pre-installed by default on Windows).
18
18
19
+
Can be automated by using either the in-built Telnet or WinEXE options in exe2hex to transfer the file over to the target machine, else the output can manually be inserted.
20
+
19
21
```Binary EXE -> ASCII Text -> *Transfer* -> Binary EXE```
20
22
21
-

23
+

22
24
23
25
- - -
24
26
@@ -32,7 +34,7 @@ Upon executing exe2hex's output file, the original program is restored by using
Encodes an executable binary file into ASCII text format
71
73
Restore using DEBUG.exe (BATch - x86) or PowerShell (PoSh - x86/x64)
@@ -94,7 +96,8 @@ Options:
94
96
-l INT Maximum HEX values per line
95
97
-c Clones and compress the file before converting (-cc for higher
96
98
compression)
97
-
-t Create a Expect file, to automate to Telnet session.
99
+
-t Create a Expect file, to automate to a Telnet session.
100
+
-w Create a Expect file, to automate to a WinEXE session.
98
101
-v Enable verbose mode
99
102
$
100
103
```
@@ -113,7 +116,7 @@ $
113
116
+ Aimed at more "recent" versions of Windows.
114
117
+ PowerShell was first integrated into core OS with Windows 7/Windows Server 2008 R2.
115
118
+ Windows XP SP2, Windows Server 2003 & Windows Vista requires PowerShell to be pre-installed.
116
-
+ This is **not** a `.ps1` file (pure PowerShell). It only calls PowerShell at the end to convert.
119
+
+ This is **not** a `.ps1` file (pure PowerShell). It only calls PowerShell at the end.
117
120
118
121
- - -
119
122
@@ -129,7 +132,8 @@ $
129
132
+ The option to add prefix and suffix text to each line.
130
133
+ Able to set a maximum HEX length per line.
131
134
+ Can use a binary file or pipe from standard input (`STDIN`).
132
-
+ Automate transfers over Telnet.
135
+
+ Automate transfers over Telnet and/or WinEXE.
136
+
133
137
134
138
Note: This is nothing new. [The core idea (using DEBUG.exe for inline file transfer) has been around since 2003](https://www.blackhat.com/presentations/bh-asia-03/bh-asia-03-chong.pdf)_(if not earlier!)_.
135
139
@@ -139,23 +143,25 @@ Note: This is nothing new. [The core idea (using DEBUG.exe for inline file trans
139
143
140
144
When pasting a large amount of data (100+ lines) directly into a Telnet session, the results can be "unpredictable". Behaviours include lines being executed in a incorrect order or characters are just completely skipped.
141
145
142
-
A solution is to use "[Expect](http://expect.sourceforge.net/)" (which is an extension of [TCL](https://sourceforge.net/projects/tcl/)). Expect can be found in a most major Linux OSs repositories (`apt-get -y install expect` / `yum -y install expect` / `pacman -S expect`). Upon executing exe2hex's Telnet script, Expect will automate the Telnet login (based on the arguments used), look for a writeable folder (e.g. defaults to the system variable, `%TEMP%`) and then start inputting commands from exe2hex's .bat file, line by line one at a time. If required, the variables at the top of the Expect script can be manually edited (to use a different Telnet port, path, or command prompt).
146
+
A solution is to use "[Expect](http://expect.sourceforge.net/)" (which is an extension of [TCL](https://sourceforge.net/projects/tcl/)). Expect can be found in a most major Linux OSs repositories (`apt-get -y install expect` / `yum -y install expect` / `pacman -S expect`). Upon executing exe2hex's Telnet script, Expect will automate the Telnet login (based on the arguments used), look for a writeable folder (e.g. defaults to the system variable, `%TEMP%`) and then start inputting commands from exe2hex's output file, line by line one at a time. If required, the variables at the top of the Expect script can be manually edited (to use a different Telnet port, path, or command prompt).
143
147
144
148
An example of exe2hex's Telnet mode can be seen below:
_NOTE: May need to press enter to get a prompt back at the end._
309
+
310
+
- - -
311
+
312
+
## Install
313
+
314
+
Just exe2hex just requires [Python 3](https://www.python.org/) to function([Expect](http://expect.sourceforge.net/) is optional for Telnet and WinEXE functions).
315
+
316
+
Simply add exe2hex a folder in your `$PATH` variable:
0 commit comments