I want my pico W to run python code when plugged in

February 1, 2024, 23:15

zoxxidetermedagain

I just got my Pico W today and I want it to run code when I plug it into my PC, it only runs payloads which I don't want

zoxxidetermedagain

I can send my pico w files as a zip if you would like.

zoxxidetermedagain

I am going to sleep now, I will wake up and read any replies if I get one.

minkleee

I don't really understand what you want to do

minkleee

You want it to execute something on your pc?

zoxxidetermedagain

Forget that, do you have any idea why if I run payloads it doesn't like to press the windows key?

minkleee

So you're trying to make it an hid device

minkleee

Should've started with that

zoxxidetermedagain

Yeah, very new to this lol

zoxxidetermedagain

Can you help me get that to work, I couldn't do it

minkleee

What pico do you have and what part did you get stuck on?

zoxxidetermedagain

Pico w, the part I get stuck on is making it do stuff when I plug it in.

zoxxidetermedagain

Like to start with I want it so when I plug it in it opens Notepad and types Hello!

zoxxidetermedagain

I can code the payload that's easy.

minkleee

Did you copy over the libraries?

zoxxidetermedagain

I'll setup the uf2 quickly

zoxxidetermedagain

Should I just use circuitpy?

minkleee

Yeah you need to use circuitpython for it to work

minkleee

Did you not do that before?

zoxxidetermedagain

I did

zoxxidetermedagain

Still wouldn't work then I tried one called badusb

minkleee

Anything briding gpio 1 and 3?

zoxxidetermedagain

It's still called PICO-BADUSB and has nothing in it

zoxxidetermedagain

I don't have pins on mine

zoxxidetermedagain


zoxxidetermedagain

Quick question, why do you have to put spaces after links?

minkleee

I have no idea

zoxxidetermedagain

Strange

minkleee

Go over there and get the flash_nuke file in green at the bottom

zoxxidetermedagain

I have a flash nuke, want me to just use it?

minkleee

Yeah

zoxxidetermedagain

I redownloaded that uf2 file and it fixed it

zoxxidetermedagain

So, now how do I make it run automatically?

minkleee

Nice

minkleee

Lemme look at the github and see

zoxxidetermedagain

I have the adafruit circuitpy bundle 9x

zoxxidetermedagain

Thank you for helping me by the way :)

minkleee

Copy boot.py from your clone to the root of your Pico. Copy duckyinpython.py, code.py, webapp.py, wsgiserver.py to the root folder of the Pico.

minkleee

For Pico W Only Create the file secrets.py in the root of the Pico W. This contains the AP name and password to be created by the Pico W. secrets = { 'ssid' : "BadAPName", 'password' : "badpassword" } Just go ahead and do this since you have the w

zoxxidetermedagain


minkleee

REM made by J0K3RS-L4UGH
REM Basically it enters chrome and rickrolls with no ads
GUI
DELAY 2000
STRING Chrome
DELAY 2000
ENTER
DELAY 2000
ALT d
DELAY 2000
STRING https://www.youtube.com/watch?v=xvFZjo5PgG0
ENTER
Then slap this in payload.dd

zoxxidetermedagain

Now make a secrets.py?

minkleee

Yeah

minkleee

Web interface will be helpful

minkleee

And the api if you decide to make it work with another device

zoxxidetermedagain

So I just replace everything here with my info? "secrets = { 'ssid' : "BadAPName", 'password' : "badpassword" }"

minkleee

Grabbed this from the hak5 github to be sure it'd work

zoxxidetermedagain

Thanks

minkleee

Yeah

minkleee

You can leave it like that too if you want or just don't care

minkleee

It's making the hotspot not joining wifi

zoxxidetermedagain

Do I even need that file?

zoxxidetermedagain

Imma just leave it as it is for now

zoxxidetermedagain

So do I just put the payload in there and run it?

zoxxidetermedagain

Well it runs

zoxxidetermedagain

But you know what I mean.

minkleee

Should be yes

zoxxidetermedagain

Does it run dd or txt files

minkleee

Just files named payload.dd thru payload4.dd

minkleee

Nope

zoxxidetermedagain

Okay

minkleee

You can pick which payload to run and edit or create scripts through the web interface so I thought you'd probably want it

zoxxidetermedagain

Nothing ran when I plugged it in

zoxxidetermedagain


minkleee

Unplug then plug back in

zoxxidetermedagain

I did

minkleee

Hm

zoxxidetermedagain

Do I not need anything in lib folder? I swear I do

minkleee

You do

zoxxidetermedagain

What is it

minkleee

The whole lib folder I think

minkleee

If using a Pico W board: Copy the adafruit-circuitpython-raspberry_pi_pico_w-en_US-8.0.0.uf2 file to the root of the Pico (RPI-RP2). The device will reboot and after a second or so, it will reconnect as CIRCUITPY. Copy the lib folder to the root of the CIRCUITPY Copy *.py to the root of the CIRCUITPY Follow the instructions in README.md to enter setup mode Copy your payload as payload.dd to the root of the CIRCUITPY Unplug the device from the USB port and remove the setup jumper.

minkleee

Assuming that's from their file and not everything circuitpython library avaliable

zoxxidetermedagain

I don't have enough space for the lib folder

zoxxidetermedagain

Where's the *.py

minkleee

You already have those

zoxxidetermedagain


minkleee

Try using one from here

zoxxidetermedagain

I don't see it...

minkleee

Download that then select everything and drag over

minkleee

Select overwrite for all but payload.dd

zoxxidetermedagain

Replace everything in my pico w with them?

zoxxidetermedagain

Okay

zoxxidetermedagain

How do I pick what payload I want it to run

zoxxidetermedagain

Found that, it's not running anything

minkleee

Hmm

minkleee

It looks like it's returning the filename for another function to run it

zoxxidetermedagain

I wish it was as simple as putting a file in and it runs...

minkleee

To select a payload, ground one of these pins: GP4 - payload.dd GP5 - payload2.dd GP10 - payload3.dd GP11 - payload4.dd

minkleee

Pico W Web Service The Pico W AP defaults to ip address 192.168.4.1. You should be able to find the webservice at http://192.168.4.1:80 The following endpoints are available on the webservice: / /new /ducky /edit/<filename> /write/<filename> /run/<filename> API endpoints /api/run/<filenumber>

minkleee

It should just work

zoxxidetermedagain

Do you mean a pin on my pico?

minkleee

Yes

zoxxidetermedagain

I don't have pins

minkleee

Or through the web service

minkleee

You still have the holes for the pins

zoxxidetermedagain

holes

zoxxidetermedagain

My Wi-Fi router is blocking that website, not even a VPN works...

minkleee

It's on the pico wifi

minkleee

The one this made

zoxxidetermedagain

How do I run it on that

minkleee

Connect to the wifi you made with secrets and then go to the ip

minkleee

I'm sorry I can't get mine out and troubleshoot more

minkleee

I gotta go soon

zoxxidetermedagain

Okay, how do I connect to the Wi-Fi I can't find it

minkleee

I can help more later today if you still need it

zoxxidetermedagain

Will probably

minkleee

It must not be running code at all if you don't see it

zoxxidetermedagain

Yeah

minkleee

Just tried it and it worked first try

minkleee

It looks like the project isn't that stable but it did turn on

minkleee

You might want to find something else

minkleee

Im sure there's more

zoxxidetermedagain

I'll try later