Hardware How to Make Your Own ESP8266 Host

randy_w

Well-Known Member
OP
Member
Joined
Feb 27, 2021
Messages
709
Trophies
0
Age
34
XP
1,374
Country
United States
There are many different esp8266 bins around but people always have different needs, some people want one with linux loader, others want one with GTA mod menu, some want one for 6.72, others want one for 7.55, and it's impossible to please everyone. So I decided to make an arduino sketch so you can change the settings yourself and upload your own exploit host. Thanks to treyjazz for codes related to setting up AP/Client mode. Here are some main features:
  • WiFi AP/Client mode: You can use your esp8266 as an access point or a client (esp8266 connects to your home WiFi network as an http/dns/ftp server)
  • HTTP server
  • FTP server: You can update payloads with FTP
  • DNS server: All requests will be resolved to esp8266
Here's how to get it working:
  • Setup arduino, install COM port driver for esp8266 and add esp8266 board manager. I won't go into details here as there are many other good guides you can find on google
  • Install all required libraries and copy tools folder to your arduino folder. This is the esp8266 sketch data upload too
  • Open the arduino sketch and change settings such as AP/Client mode, IP address, password etc
  • Select correct board type and COM port, upload sketch
Now we need to prepare the exploit web page. Grab a copy of your favorite exploit host on github. Here I'm using the wolf game's host as an example. Download the whole repo and extract the zip. Now open an exploit page and analyze it (this one loads goldhen):
Code:
<html><head>
<meta http-equiv="content-type" content="text/html; charset=windows-1256">
<style>
body{color: white; background-image:url(WOLF.jpg); background-attachment:fixed; background-size:100%; background-repeat:no-repeat;}
}</style>
        <title>THE WOLF HACK</title>           
        <script src="utils.js"></script>
        <script src="int64.js"></script>
        <script src="rop.js"></script>
        <script src="goldhen.js"></script>
        <script src="userland.js"></script>
        <script src="ps4.js"></script>
    </head>
    <body onload="go()">
<button id="input1" onfocus="handle2()"></button>
<button id="input2"></button>
<button id="input3" onfocus="handle2()"></button>
<select id="select1">
<option value="value1">Value1</option>
</select>
</body>
</html>

We don't have to actually modify anything here, but I'll remove css (delete <style>...</style>)and change html title (<title>...</title>). Now pay attention to all javascript files it loads:
Code:
        <script src="utils.js"></script>
        <script src="int64.js"></script>
        <script src="rop.js"></script>
        <script src="goldhen.js"></script>
        <script src="userland.js"></script>
        <script src="ps4.js"></script>
These javascript files should be in the same directory as the html file (ESP8266 SPIFFS doesn't support directories), if they are in a subfolder (folder/xxx.js), move the javascript file out of the folder and change its path in html file.
Now move the html file and all javascript files it loads to a new folder. Repeat the same process for all other payloads you want to have on your esp8266.
Finally we need to make a main menu to load different payload html pages, here's an example:
Code:
<html>
<head>
<meta charset="utf-8" />
<title>ESP8266 Exploit Host</title>
</head>   
<body>
    <div>
    <h1>PS4 JAILBREAK</h1>
    <p><b>Payload Selection</b></p>
    <a href="goldhen.html"><button><b>goldhen</b></button></a>
    <a href="payload1.html"><button><b>payload1</b></button></a>
    <a href="payload2.html"><button><b>payload2</b></button></a>
    </div>
</body>
</html>
I like to keep things simple. You can make it fancy and add offline cache manifest.

Next step is optional. You can compress the html and javascript files to save a lot of space. This is useful if you want to have a lot of payloads on your esp8266 as total usable space is only 2-3MB. I use 7zip to compress the html and javascript file, just right click on the file and select add to archive, choose gzip as archive format and click ok.

Now put all compressed files (or original files if they are small and don't need to be compressed) to the data folder in sketch folder, then go back to arduino, select tools-esp8266 sketch data upload. Wait for it to finish and hit reset. You can open terminal to see the progress and its ip address (WiFi client mode). Congratulations, now you have your very own esp8266 exploit host.

Dp92FaN.png


Get the arduino sketch here:
https://gofile.io/d/qdYbvo
 
  • Like
Reactions: Thugnificent

Thugnificent

Member
Newcomer
Joined
Jan 17, 2016
Messages
13
Trophies
0
Age
36
XP
86
Country
United States
I'll just put those files on github, link here:
https://github.com/stanleyws/arduino

Thanks a lot Randy but i am getting this error when compiling ( i am not even trying to upload at this point, just trying to export the bin):

"
Arduino: 1.8.15 (Windows 10), Board: "Generic ESP8266 Module, 80 MHz, Flash, Disabled (new aborts on oom), Disabled, All SSL ciphers (most compatible), 32KB cache + 32KB IRAM (balanced), Use pgm_read macros for IRAM/PROGMEM, dtr (aka nodemcu), 26 MHz, 40MHz, DOUT (compatible), 1MB (FS:64KB OTA:~470KB), 2, nonos-sdk 2.2.1+100 (190703), v2 Lower Memory, Disabled, None, Only Sketch, 115200"
c:/users/arslan/appdata/local/arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/3.0.3-gcc10.3-9bcba0b/bin/../lib/gcc/xtensa-lx106-elf/10.3.0/../../../../xtensa-lx106-elf/bin/ld.exe: sketch\ESP8266.ino.cpp.o:(.text.setup+0x7c): undefined reference to `_ZN9FtpServer5beginE6StringS0_'
c:/users/arslan/appdata/local/arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/3.0.3-gcc10.3-9bcba0b/bin/../lib/gcc/xtensa-lx106-elf/10.3.0/../../../../xtensa-lx106-elf/bin/ld.exe: sketch\ESP8266.ino.cpp.o: in function `setup':
C:\Users\Arslan\Downloads\ExploitHost\ExploitHost\ESP8266/ESP8266.ino:96: undefined reference to `_ZN9FtpServer5beginE6StringS0_'
c:/users/arslan/appdata/local/arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/3.0.3-gcc10.3-9bcba0b/bin/../lib/gcc/xtensa-lx106-elf/10.3.0/../../../../xtensa-lx106-elf/bin/ld.exe: sketch\ESP8266.ino.cpp.o: in function `_ZN10WiFiClient4stopEv':
C:\Users\Arslan\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\3.0.1\libraries\ESP8266WiFi\src/WiFiClient.h:75: undefined reference to `_ZN9FtpServer9handleFTPEv'
c:/users/arslan/appdata/local/arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/3.0.3-gcc10.3-9bcba0b/bin/../lib/gcc/xtensa-lx106-elf/10.3.0/../../../../xtensa-lx106-elf/bin/ld.exe: sketch\ESP8266.ino.cpp.o: in function `_ZN16esp8266webserver24ESP8266WebServerTemplateI10WiFiServerE12handleClientEv':
C:\Users\Arslan\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\3.0.1\libraries\ESP8266WebServer\src/ESP8266WebServer-impl.h:338: undefined reference to `_ZN9FtpServer9handleFTPEv'
collect2.exe: error: ld returned 1 exit status
exit status 1
Error compiling for board NodeMCU 1.0 (ESP-12E Module).
This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.
"

Any suggestions?
 
Last edited by Thugnificent,

randy_w

Well-Known Member
OP
Member
Joined
Feb 27, 2021
Messages
709
Trophies
0
Age
34
XP
1,374
Country
United States
Thanks a lot Randy but i am getting this error when compiling ( i am not even trying to upload at this point, just trying to export the bin):
I'd say there's something wrong with your libraries based on error messages.
Here's the ftp library I used: https://github.com/nailbuster/esp8266FTPServer
Also here's the board manager URL I used: http://arduino.esp8266.com/stable/package_esp8266com_index.json
Other libraries should come with board manager so check yours in case you are using an unofficial one.
Also I'm using esp-12e variant since it has the largest flash size available, so I used NodeMCU1.0(ESP-12E) in boards menu, not sure if this will make any difference.
BTW I've never tried generating a bin file yet, but I'm pretty sure you need to figure out the partition scheme of the flash memory, manually create a SPIFF image file, add exploit host files and merge it with the generated bin file, or just use FTP to upload them.
 
  • Like
Reactions: Thugnificent

Thugnificent

Member
Newcomer
Joined
Jan 17, 2016
Messages
13
Trophies
0
Age
36
XP
86
Country
United States
I'd say there's something wrong with your libraries based on error messages.
Here's the ftp library I used: https://github.com/nailbuster/esp8266FTPServer
Also here's the board manager URL I used: http://arduino.esp8266.com/stable/package_esp8266com_index.json
Other libraries should come with board manager so check yours in case you are using an unofficial one.
Also I'm using esp-12e variant since it has the largest flash size available, so I used NodeMCU1.0(ESP-12E) in boards menu, not sure if this will make any difference.
BTW I've never tried generating a bin file yet, but I'm pretty sure you need to figure out the partition scheme of the flash memory, manually create a SPIFF image file, add exploit host files and merge it with the generated bin file, or just use FTP to upload them.
Thank you so much, appreciate it!

I will give those libraries a go. The one i am using is a generic one i bought for 6 bucks off amazon, but i tried selecting different boards from the ide as well. I was actually thinking to make the bin and flashing it with NodeMCU flasher.

EDIT: It was the libraries, so when i was first trying to compile it gave an error that the ftp.h library is missing so i googled and found one. I am pretty sure that was the culprit and the link you provided fixed the issue and i was able to compile successfully.

Thank you so much! Appreciated!

EDIT 2: This worked so well, you rock man! I was succesfully able to upload and host an exploit for my 7.02 with Goldhen! Cheers!!!!!!!
 
Last edited by Thugnificent,
  • Like
Reactions: randy_w

protivakid

Well-Known Member
Member
Joined
May 6, 2014
Messages
197
Trophies
1
Age
39
XP
660
Country
United States
Hey, dumb question but if the host's source you want to use isn't on gitHub then you probably can't make a .bin file for an ESP8266 right?
 

randy_w

Well-Known Member
OP
Member
Joined
Feb 27, 2021
Messages
709
Trophies
0
Age
34
XP
1,374
Country
United States
Hey, dumb question but if the host's source you want to use isn't on gitHub then you probably can't make a .bin file for an ESP8266 right?
Well you still can, but you need to download the whole site with those website downloader tools or manually download every single file that the html page loads.

For example on karo's host:
1665727222179.png

You can see the javascript within the html file refers to many other js files for different payloads. You need to download all of them and put them in the same directory as the index.html file (or in subfolders, depending on how the js file is loaded). There are also .bin format payloads so you need to get them too. If there are other .html pages you also need to get them. Just skim through the javasctipt label in the main html file and you should get the idea.
1665727438965.png

You can simply take the address from the address bar, change the index.html to the payload name and you should be able to download the file.
 
  • Like
Reactions: protivakid

protivakid

Well-Known Member
Member
Joined
May 6, 2014
Messages
197
Trophies
1
Age
39
XP
660
Country
United States
Well you still can, but you need to download the whole site with those website downloader tools or manually download every single file that the html page loads.

For example on karo's host:
View attachment 331784
You can see the javascript within the html file refers to many other js files for different payloads. You need to download all of them and put them in the same directory as the index.html file (or in subfolders, depending on how the js file is loaded). There are also .bin format payloads so you need to get them too. If there are other .html pages you also need to get them. Just skim through the javasctipt label in the main html file and you should get the idea.
View attachment 331785
You can simply take the address from the address bar, change the index.html to the payload name and you should be able to download the file.
Thank you!
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • No one is chatting at the moment.
  • K3Nv2 @ K3Nv2:
    Slower speeds for gen4
  • K3Nv2 @ K3Nv2:
    I'll reformat and have a 3tb raid0 m. 2 at least
    +1
  • K3Nv2 @ K3Nv2:
    Lmao that sold out fast
    +1
  • Veho @ Veho:
    Yeet the cat.
    +1
  • K3Nv2 @ K3Nv2:
    Good idea
    +1
  • The Real Jdbye @ The Real Jdbye:
    i thought everybody knew cocktails are like 75% ice
  • Veho @ Veho:
    Yeah but not like this.
  • Veho @ Veho:
    It's not like they're complaining that their Slurpee is 99% ice or something, but if the cocktail calls for "shot of vodka, shot of vermouth, shot of gin, shot of Campari, three shots of juice, squirt of lemon" and ends up being a thimbleful of booze, that's a problem.
  • The Real Jdbye @ The Real Jdbye:
    the funny thing is cocktails in norway are only allowed to have 1 20ml shot of booze
  • The Real Jdbye @ The Real Jdbye:
    so..... yeah
  • The Real Jdbye @ The Real Jdbye:
    we're used to only having a thimbleful of booze
  • Veho @ Veho:
    Booo.
  • The Real Jdbye @ The Real Jdbye:
    same thing if you want whisky on the rocks or something, you can't get a double
  • The Real Jdbye @ The Real Jdbye:
    but you could buy as many shots of whisky (or anything else) as you want and ask for a glass of ice and pour them in
  • The Real Jdbye @ The Real Jdbye:
    it's dumb
  • Veho @ Veho:
    Maybe.
  • Veho @ Veho:
    There was a comparison of the number of Ibuprofen poisonings before and after they limited the maximum dosage per box or per pill (i'll look that up). No limit on the number of boxes you can still buy as many as you want, so people argued it was pointless.
  • Veho @ Veho:
    But the number of (accidental) poisonings dropped because drinking an entire package of ibuprofen pills went from "I need a new liver" to "I need a new box of Ibuprofen".
  • Veho @ Veho:
    Here we have ketoprofen that used to be prescription-only because of the risk of toxic dosages, but then they halved the dose per pill and sell them in bottles of six pills apiece instead of twenty and it doesn't need a prescription any more. Yes you can buy more than one bottle but people simply don't.
  • Psionic Roshambo @ Psionic Roshambo:
    Usually accidentally overdose of ibuprofen here is from people taking like cold medicine then ibuprofen for a headache and the combination is over what they need
    Psionic Roshambo @ Psionic Roshambo: https://www.youtube.com/watch?v=1hp24nDVKvY