Attiny85 | RubberDucky like payloads for DigiSpark Attiny85 | Hacking library

 by   MTK911 C++ Version: Current License: LGPL-3.0

kandi X-RAY | Attiny85 Summary

kandi X-RAY | Attiny85 Summary

Attiny85 is a C++ library typically used in Security, Hacking, Arduino applications. Attiny85 has no bugs, it has no vulnerabilities, it has a Weak Copyleft License and it has medium support. You can download it from GitHub.

For people who can't buy or are too cheap to buy RubberDucky, DigiSpark Attiny85 is the solution to their problems. Because it's possible to use it as HID thanks to "DigiKeyboard.h" it can be use as keyboard to send keystrokes to computer which can be use for pranking your people to creating a backdoor in target system.
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              Attiny85 has a medium active ecosystem.
              It has 970 star(s) with 348 fork(s). There are 40 watchers for this library.
              OutlinedDot
              It had no major release in the last 6 months.
              There are 1 open issues and 23 have been closed. On average issues are closed in 63 days. There are no pull requests.
              It has a neutral sentiment in the developer community.
              The latest version of Attiny85 is current.

            kandi-Quality Quality

              Attiny85 has no bugs reported.

            kandi-Security Security

              Attiny85 has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.

            kandi-License License

              Attiny85 is licensed under the LGPL-3.0 License. This license is Weak Copyleft.
              Weak Copyleft licenses have some restrictions, but you can use them in commercial projects.

            kandi-Reuse Reuse

              Attiny85 releases are not available. You will need to build from source code and install.
              Installation instructions are available. Examples and code snippets are not available.

            Top functions reviewed by kandi - BETA

            kandi's functional review helps you automatically verify the functionalities of the libraries and avoid rework.
            Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of Attiny85
            Get all kandi verified functions for this library.

            Attiny85 Key Features

            No Key Features are available at this moment for Attiny85.

            Attiny85 Examples and Code Snippets

            No Code Snippets are available at this moment for Attiny85.

            Community Discussions

            QUESTION

            How to properly hardcode compiler's define flag (-D) with #define in c (arduino)
            Asked 2020-Dec-07 at 14:47

            What is the best way to hardcode the compiler's -D flag into the source files?

            I want to put the #define in one of the headers and then import bunch of stuff that should react to that define. Does it work like that? Which header should I put it? Or directly to main.c? Or to all of them?

            TMI-details: The environment here is digispark hw-018 (attiny85 with built-in usb programmer) and the #define should replace -DUSE_SOFTWARE_SPI so I can use AVR-CAN library in SPI mode to read stuff from MCP2515.

            EDIT: After some annoying banging head to the wall the top of main.c looks now like this and it still does not work.

            ...

            ANSWER

            Answered 2020-Nov-25 at 17:43

            There are a couple of approaches here.

            If it's just a single main.c source file, then putting this at the top of the file is fine:

            Source https://stackoverflow.com/questions/65008119

            QUESTION

            How to deep sleep an Attiny until an analog value of a photoresistor changes?
            Asked 2020-Jul-25 at 19:41

            for a battery powered project I would like to put an Attiny85 into deep sleep mode immediately after program start and let it wake up only when a sensor value (in this case a photo resistor) changes. Unfortunately I could only find examples for interrupts by a button and not for photo resistors in the internet. Does anyone have an idea how I could implement it, or if it is impossible?

            ...

            ANSWER

            Answered 2020-Jul-25 at 19:41

            Turn out that this is probably a software question.

            Probably to lowest power and simplest way to implement this would be to...

            1. Connect the analog sensor value to any one of the analog input pins on the ATTINY.
            2. Make sure you disable the digital buffer on that pin.
            3. Set up the ADC to point to the pin and set other relevant values like precaller.
            4. Set up a watchdog timer to fire a periodic interrupt.
            5. Go into deep sleep and wait for the watchdog timer to fire.

            Each time the watchdog fires...

            1. Enable the the ADC.
            2. Take a sample.
            3. Jump to main code if the value has changed more than your threshold.
            4. Disable ADC.
            5. Go back to deep sleep.

            How power efficient this will be really depends on how often the timer interrupt fires - the less often the better. If your application can live with only checking the sensor, say, once per second then I bet power usage will be single digits of microamps or less.

            If you really need very low latency when that sensor values changes, then you could instead use the build in analog comparitor... .. to generate an interrupt when the input voltage goes above or below a threshold value, but this will likely use much more power since just the analog comparitor itself uses ~30ua while on, and you will also need to generate the voltage that you are comparing to either with the internal 1.1 voltage reference or an external resistor bridge or buffer capacitor.

            Source https://stackoverflow.com/questions/63087302

            QUESTION

            Arduino DigiSpark NeoPixel BlueTooth C++ Buffer Overflow
            Asked 2020-Jul-21 at 17:55

            i was able to make the following code after about a week of desk head banging, it works, kind of. the problem is that it's not that responsive, most of the times i have to spam the buttons on my phone to send the same command over and over again until it catches up.

            Can you help me clean the code a bit?

            As you will see, at times it seems i over complicated things but that is only cause i found it works better this way then what it seems to be a more "logical" simpler version. i will lay the code and then i will explain and ask my questions.

            ...

            ANSWER

            Answered 2020-Jul-21 at 01:43

            I'm bored and feeling generous so here you go. See if you can follow this. It's uncompiled and untested so I can't guarantee it does exactly what you want, but see if you can understand what I'm trying to do here. Nothing ever stops and waits for anything to happen. There are no delay calls. There is no waiting. Just cycling through and see if it is time to do something.

            One change I made that doesn't affect this, just makes typing easier was to take all your goLED variables and make an array out of them. Anytime you catch yourself putting numbers on variable names, use an array instead so the compiler has access to those numbers and you don't have to repeat yourself. See how much simpler the checkLedData function got.

            Then I made the colorWipe functions so that they will return a boolean, true if they've completed and false if they haven't. Then the runLED function can just check that to see if it is time to move on to the next step. For the first case it is easy, just set the goLED variable to whatever the colorWipe returns. As long as it is still working it returns true and goLED[1] stays true and you keep calling the same colorWipe function. For the others we have to make them state machines, so I added a state variable. When any of them get finished they set their goLED variable back to false. When all of those are false, meaning there's no effect currently running, then runLED will fall all the way through to the last else statement and go to see if there is another command.

            Like I said, there may be a mistake or two in there. But see if you can understand how I am writing a checklist to see what needs to happen instead of a story to tell one thing right after another.

            Source https://stackoverflow.com/questions/63002617

            QUESTION

            XC8 compiler does not recognize __delay macros
            Asked 2020-Jul-08 at 10:50

            I want to program a ATtiny85 microcontroller and have realized that my program needs a bit of delay to work properly. I am using MPLabX and the XC8 compiler. So I should be able to use the __delay_ms() macro and MPLab does recognize the macro and does NOT put the red line under the code. However when I try to compile the programm, there is an error thrown at each line where I use the macro. "Undefined reference to __delay_ms" And also an additional "implicit declaration of __delay_ms" for the first line that uses the macro. I do have _XTAL_FREQ defined correctly and xc.h included.

            The code also compiles just fine without the delay macros, but than it doesn't work correctly, so I need the delay.

            I don't know what the problem is. I have programmed other microcontrollers with the __delay_ms macro before. I am also using the latest version of the XC8 compiler. And according to the documentation of the compiler the version is fully compatible with the ATtiny85.

            I also tried to find a solution on the internet, but didn't find anything that helped with my problem...

            Any ideas where the problem could be?

            ...

            ANSWER

            Answered 2020-Jul-08 at 10:50

            Maybe this should be a comment, but I want to give you an example which compiles fine for me:

            This is the way it works for a PIC

            compiler: xc8 2.0

            Source https://stackoverflow.com/questions/62678400

            QUESTION

            How to use Arduino IDE on Raspberry Pi OS to program a Digispark ATTiny85
            Asked 2020-Jul-06 at 14:20

            everyone, i've been trying to use Arduino IDE 1.8.12 to compile scripts into a Digispark ATTiny85 usb board from a 4GB Raspberry Pi 4 running Raspberry Pi OS.

            First problem i was that when going to the IDEs board manager to install the Digistump, it gave back the "micronucleus is not available for your operating system" error. I managed to work around this by replacing the json url suggested by digistump by the one provided on the second entry of this post. After doing so, a "compatible" version of Digistump was listed on the boards manager and was able to successfully select the Digispark board and the micronucleus programmer under the Arduino IDEs Tools dropdown menu.

            This is where the second problem appeared: As i compile the script, the Arduino IDE console returns the following message:

            " Arduino: 1.8.12 (Linux), Board: "Digispark (Default - 16.5mhz)" Sketch uses 2788 bytes (46%) of program storage space. Maximum is 6012 bytes. Global variables use 124 bytes of dynamic memory. An error occurred while uploading the sketch /home/pi/.arduino15/packages/digistump/tools/micronucleus/2.0a4/launcher: 1: /home/pi/.arduino15/packages/digistump/tools/micronucleus/2.0a4/launcher: Syntax error: word unexpected (expecting ")") " And that's as far as i could go without getting messy or going into stuff i didn't quite understand.

            Now, a few considerations:

            -As I said, im running raspberry pi os on a 4GB raspberry pi 4 and using Arduino IDE 1.8.12

            -Also, im kind of a newbie, even though i've been coding on an arduino UNO for about a year, i've never tried any other boards, also, I got the pi on march this year and it IS my first encounter with linux based systems, I've noticed things can get really messy or complex very fast so please have patience with me :)

            -This is my first stackoverflow question and even though i've read the guidelines to posting questions here, something might have escaped my attention, also, i did search for this before asking but again, maybe i didn't see the right post, if my question is either poorly detailed, already answeed elsewhere, or anyhing can be improved about it, please let me know.

            thank you all in advance for the amazing community you carry upon your shoulders.

            cheers from argetina Yeti.

            ...

            ANSWER

            Answered 2020-Jul-06 at 14:20

            To anyone out there who might run into this problem, I was able to fix this by following a comment on the post linked on the question, by doing:

            sudo apt install git
            git clone https://github.com/micronucleus/micronucleus
            cd micronucleus/commandline/ sudo apt install libusb-dev make cp micronucleus ~/.arduino15/packages/digistump/tools/micronucleus/2.0a4

            sudo cp 49-micronucleus.rules /etc/udev/rules.d/.

            git clone https://github.com/digistump/avr-dummy cd avr-dummy make cp avrdude ~/.arduino15/packages/digistump/tools/micronucleus/2.0a4/launcher

            Note: I had already done this before, but I think it didn't work because i had gotten messy with the alternatives, this option worked for me only after doing a fresh installation Arduino IDE.

            Like on that arduino.cc post, I am now able to upload my payloads to the digispark with no problem what so ever.

            Cheers

            Source https://stackoverflow.com/questions/62734729

            QUESTION

            _delay_ms seems not to work when using pwm
            Asked 2020-May-04 at 09:56

            I'm relatively new to programming microcontrollers, so I started experimenting on an ATtiny85.

            First program was simply turning on an LED and off with a little delay (classic blinky program).

            Now I wanted to slowly increase the brightness of the LED. Here is the code:

            ...

            ANSWER

            Answered 2020-May-01 at 18:12

            __delay_ms() is converted to cycle-wasting instructions by the compiler, so as long as your F_CPU matches the current speed of the processor, then it should work as expected.

            I would look for other places in your code that are not working as you expect them to.

            A half second delay at power up is not a great diagnostic test since it happens quickly, only once, and there may be other things going on then as well.

            Maybe instead try blinking between two different brightness levels with a 500ms delay between. Visually this should be unambiguous.

            if that works as expected, then maybe try doing a brightness ramp and changing the delay inside the loop to see if that works as expected.

            Eventually you will work your way up to something that is not as expected, and then you will know where the problem is. It is still possible you will not understand what is going on, but at least you will be able to ask a much more specific question here and be more likely to get a helpful answer.

            Report back with your results!

            Source https://stackoverflow.com/questions/61547827

            QUESTION

            ATTiny85 - Software UART with Timer1
            Asked 2020-Apr-02 at 19:16

            So recently I tried to implement Software UART (TX only) for the ATTiny85. I want to drive it with the internal Timer1.

            The timer shall interrupt with the frequency of the Baudrate. Every ISR one bit will be transmitted, until there is nothing left to send and the interrupt will be disabled again.

            (Note: F_CPU=1000000 ; Fuses are the factory default (E:FF, H:DF, L:62) )

            ...

            ANSWER

            Answered 2020-Apr-02 at 19:16

            I think I found a problem that could cause what you are seeing.

            In CTC mode, this timer clears the counter after it reaches OCR1C...

            You do not seem to be setting OCR1C in your code so the period of the timer will be based on whatever happens to be in OCR1C (which is 0 at power up).

            This is an easy thing to miss (OCR1C vs OCR1A)!

            I think you can make your code work by adding a line to set this register here...

            Source https://stackoverflow.com/questions/60997804

            QUESTION

            'prog_uint8_t' does not name a type - ARDUINO IDE
            Asked 2020-Feb-06 at 12:38

            A very novice question I'm afraid, but I've tried my best to understand this and have got nowhere as I have little experience with C programming.

            I'm currently picking up an old project from a year or two ago from Instructables: https://www.instructables.com/id/Jar-of-Fireflies/

            This includes a C file for firmware written for a Firefly pattern, however this was written a good 12 years ago.

            However... I am not following the instructable to the Nth degree. Instead I am using a DIP AtTiny85, which I have previously programmed using an Arduino as ISP. And hence want to be able to compile the code in Arduino IDE or Atmel Studio, with Visual Micro plugin.

            Every time this is compiled in Arduino IDE, I receive the following error: 'prog_uint8_t' does not name a type, and this causes lots of errors to roll through.

            From what I understand, this deceleration was removed/changed as part of the AVR GCC in around 2010ish... Is there anyway I can get this to compile correctly to run the code? Maybe using a macro or including a library. I have tried a few libraries such as #include , but believe this should be taken care of as part of automated include. I'm sure if I brought the proper programmer my problem may go away but I'm sure there is an easy fix for this..?

            Code provided as .tgz in instructable link above which includes headers, c executables, hex etc.,

            for quick reading of the main c executable declarations....

            ...

            ANSWER

            Answered 2019-Jul-14 at 01:48

            It was depreciated however you should be able to get it to work by adding the following code before your usage of prog_uint8_t

            Source https://stackoverflow.com/questions/57023846

            QUESTION

            ATTINY 85 SLEEP MODE
            Asked 2020-Jan-29 at 14:35

            I am new to programming microcontrollers and I've just started using Attiny85. I am trying to build a circuit for LED with tactile switch. Every time the tactile switch is pressed it jumps the LED to next state of operation. Since it is battery operated, when the LED is OFF I want the attiny 85 to consume as low current as possible. As of now it is consuming 4mA when the LED is OFF without sleep mode. So I tried the power down mode for Attiny 85 but some how i am stuck in the power down mode

            ...

            ANSWER

            Answered 2020-Jan-29 at 14:35

            Please refer to the datasheet, section 7.1 Sleep Modes at page 34.

            In the table you can see, in Power-down mode only 3 sources can wake up the CPU:

            1. INT0, only level interrupt and pin change interrupt
            2. USI module start condition
            3. Watchdog interrupt

            That means, if you want the part to wake up when button has been pressed, then best option will be to configure the pin change interrupt.

            First you need to configure an interrupt service routine (ISR). The ISR is required just to handle the interrupt event, without it the program will be restarted. Since there is no action required, the ISR can be empty:

            Source https://stackoverflow.com/questions/59908541

            QUESTION

            ATtiny85 I2C SSD1306 screen not working
            Asked 2020-Jan-15 at 01:50

            I have been on this issue for more than 3 days now after I got my SSD1306 I2C in the mail. I have a Tiny Programmer from Sparkfun, which I use with a breadboard.

            This is my pin layout: pin2-->SDA, pin3-->SCL. The documentation on the SSD1306 Arduino library states that I have to use these pins even though I know the SDA is pin5 and SCL is pin7. The power and ground are being jumped to the OLED from the Tiny Programmer.

            The main issue I am having is that the OLED is not coming on or displaying the text.

            The code I am using for this is:

            ...

            ANSWER

            Answered 2018-Jan-31 at 16:12

            I think you have to use pins 5 and 7 with the attiny85. You also need to use tinywirem.h for I2C communication.

            Source https://stackoverflow.com/questions/48133734

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install Attiny85

            For people like me who are new to this i would suggest visiting Maker.pro for instruction on setting up development environment for Attiny85.

            Support

            For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            CLONE
          • HTTPS

            https://github.com/MTK911/Attiny85.git

          • CLI

            gh repo clone MTK911/Attiny85

          • sshUrl

            git@github.com:MTK911/Attiny85.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link

            Explore Related Topics

            Consider Popular Hacking Libraries

            wifiphisher

            by wifiphisher

            routersploit

            by threat9

            XSStrike

            by s0md3v

            pwntools

            by Gallopsled

            Atmosphere

            by Atmosphere-NX

            Try Top Libraries by MTK911

            KHATA

            by MTK911PHP

            Zkteco-F18-Doorunlock

            by MTK911Python

            mailinator-scraper

            by MTK911PowerShell

            GAUTH

            by MTK911PHP

            scripts

            by MTK911PowerShell