<?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: Lokesh Singh</title>
    <description>The latest articles on DEV Community by Lokesh Singh (@lokesh_singh_85d0de17bbc3).</description>
    <link>https://dev.to/lokesh_singh_85d0de17bbc3</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.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3886149%2F010af32b-9e80-4abe-ade5-ac6e50b90dba.png</url>
      <title>DEV Community: Lokesh Singh</title>
      <link>https://dev.to/lokesh_singh_85d0de17bbc3</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/lokesh_singh_85d0de17bbc3"/>
    <language>en</language>
    <item>
      <title>AI Deepfake Detection and Digital Forensics Masterclass — Day 3: Spotting AI-Generated Images</title>
      <dc:creator>Lokesh Singh</dc:creator>
      <pubDate>Wed, 18 Nov 2026 11:50:06 +0000</pubDate>
      <link>https://dev.to/lokesh_singh_85d0de17bbc3/ai-deepfake-detection-and-digital-forensics-masterclass-day-3-spotting-ai-generated-images-3dia</link>
      <guid>https://dev.to/lokesh_singh_85d0de17bbc3/ai-deepfake-detection-and-digital-forensics-masterclass-day-3-spotting-ai-generated-images-3dia</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Originally published on &lt;a href="https://securityelites.com/academy/deepfake-detection-digital-forensics-masterclass/day-3-spotting-ai-generated-images-signals/" rel="noopener noreferrer"&gt;Securityelites — AI Red Team Education&lt;/a&gt;&lt;/strong&gt;, where the full and current version of this course lesson lives.&lt;/p&gt;
&lt;/blockquote&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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fglsvvb5s2q64vphgzmk5.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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fglsvvb5s2q64vphgzmk5.png" alt="AI Deepfake Detection and Digital Forensics Masterclass — Day 3: Spotting AI-Generated Images" width="799" height="420"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Someone sends you a photo of a 'burned out warehouse' that is spreading on social media. The EXIF is empty, the hands look slightly odd, and an online detector says 87 percent AI. Your manager wants a yes or no by lunch.&lt;/p&gt;

&lt;p&gt;Today I teach you to stop asking for a yes or no from one signal. You will collect several small signals, rate how much each one is worth, and write down a confidence level you can defend. We also look at a second question that matters just as much: what is hiding inside the image.&lt;/p&gt;

&lt;h2&gt;
  
  
  One signal never decides
&lt;/h2&gt;

&lt;p&gt;On Day 2 you learned that metadata is a claim, not a fact. Image analysis works the same way. Every technique today produces a signal, and every signal can be wrong. Your job is to collect several, rate each one, and see whether they agree.&lt;/p&gt;

&lt;p&gt;I use four ratings. Strong means hard to fake or explain away. Moderate means suggestive and needs support. Weak means it happens in genuine images all the time. None means you looked and found nothing, which is not the same as proving the image is real.&lt;/p&gt;

&lt;p&gt;A defensible finding says 'three moderate signals agree, no strong signal found, confidence medium'. It never says 'this is definitely AI' on the strength of one tool.&lt;/p&gt;

&lt;h2&gt;
  
  
  Visual tells: look before you run anything
&lt;/h2&gt;

&lt;p&gt;Open the image at full size and zoom in. Do this on your working copy, never the original. Generators are better than they were, but they still slip in four places.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Check hands and teeth.&lt;/strong&gt; Count fingers, look at joints and where fingers meet objects. Teeth that merge into one band are a tell. Rate it moderate at best, because newer models often get hands right.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Read any text.&lt;/strong&gt; Signs, labels and shirt logos. Garbled or inconsistent letters are a good signal, usually moderate. Real photos can have blurred text, so compare sharpness with the rest of the scene.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Compare reflections and shadows.&lt;/strong&gt; Do mirrors, glasses and windows show what should be in front of them? Do all shadows fall the same way? Physical inconsistency is moderate to strong when it is clear.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Scan the background.&lt;/strong&gt; Look for repeating patterns, melting edges, objects that blend into each other, and crowds with identical faces. Weak to moderate.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Do not trust your first impression. Compression, a phone's beauty filter and a cheap lens all produce odd-looking genuine photos. Write down what you see, not what you feel.&lt;/p&gt;

&lt;h2&gt;
  
  
  Watch me do it: ELA and noise residual
&lt;/h2&gt;

&lt;p&gt;Error level analysis (ELA) re-saves a JPEG at a known quality and shows how much each area changed. Regions that were edited or pasted in often respond differently from the rest. A noise residual subtracts a blurred copy to expose the fine grain a camera sensor leaves. Everything here runs on a file on your own machine.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Make a working folder and copy.&lt;/strong&gt; Run the commands in the next block. Pick any JPEG of your own, such as a phone photo, and replace photo.jpg with its name. You should see a hash line printed.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Save the script.&lt;/strong&gt; Create a file called ela.py with the code two blocks down. Pillow and NumPy come from your Day 1 setup. If you get ModuleNotFoundError, run pip install pillow numpy.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Run it.&lt;/strong&gt; Run python3 ela.py work/photo.jpg. You should see two lines of numbers and two new PNG files in work/.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Read the output images.&lt;/strong&gt; Open the ELA and noise PNGs. Look for a patch that is much brighter or smoother than its surroundings. Uniform brightness across the whole picture is normal and means nothing.
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;mkdir -p work &amp;amp;&amp;amp; cp ~/Pictures/photo.jpg work/photo.jpg
sha256sum ~/Pictures/photo.jpg work/photo.jpg
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import io, os, sys
import numpy as np
from PIL import Image, ImageChops, ImageFilter

path = sys.argv[1]
img = Image.open(path).convert("RGB")

buf = io.BytesIO()
img.save(buf, "JPEG", quality=90)
buf.seek(0)
resaved = Image.open(buf).convert("RGB")
diff = np.asarray(ImageChops.difference(img, resaved)).astype(float)
print("ELA mean", round(diff.mean(), 2), "max", diff.max())
scale = 255.0 / max(diff.max(), 1)
out = Image.fromarray((diff * scale).astype("uint8"))
out.save(path + ".ela.png")

blur = img.filter(ImageFilter.GaussianBlur(2))
res = np.asarray(img).astype(float) - np.asarray(blur).astype(float)
print("Noise std", round(res.std(), 2))
noise = np.clip(np.abs(res) * 8, 0, 255).astype("uint8")
Image.fromarray(noise).save(path + ".noise.png")
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;What just happened: the script amplified tiny differences so your eyes can compare regions. A bright edge around a face, or one smooth patch in a grainy photo, is worth a note. But screenshots, heavy filters and repeated re-uploads also create odd ELA, so I rate ELA as weak to moderate. Fully generated images often show unusually smooth, even noise, which is another moderate signal at best.&lt;/p&gt;

&lt;h2&gt;
  
  
  Detector tools and their false positives
&lt;/h2&gt;

&lt;p&gt;Online AI-image detectors give you a percentage. It feels scientific, but it is a classifier's guess trained on particular generators. A new model, a screenshot, a resize or a heavy filter can fool it in either direction.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;&lt;a href="https://securityelites.com/academy/deepfake-detection-digital-forensics-masterclass/day-3-spotting-ai-generated-images-signals/" rel="noopener noreferrer"&gt;Continue reading the full course lesson on Securityelites — AI Red Team Education&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

</description>
      <category>cybersecurity</category>
      <category>ethicalhacking</category>
      <category>infosec</category>
      <category>security</category>
    </item>
    <item>
      <title>AI Security Testing with Burp Suite: Practical Introduction — Day 5: Parameter Manipulation and Role Tampering</title>
      <dc:creator>Lokesh Singh</dc:creator>
      <pubDate>Wed, 18 Nov 2026 11:50:05 +0000</pubDate>
      <link>https://dev.to/lokesh_singh_85d0de17bbc3/ai-security-testing-with-burp-suite-practical-introduction-day-5-parameter-manipulation-and-2464</link>
      <guid>https://dev.to/lokesh_singh_85d0de17bbc3/ai-security-testing-with-burp-suite-practical-introduction-day-5-parameter-manipulation-and-2464</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Originally published on &lt;a href="https://securityelites.com/academy/ai-security-testing-burp-suite-intro/day-5-parameter-manipulation-role-tampering-burp/" rel="noopener noreferrer"&gt;Securityelites — AI Red Team Education&lt;/a&gt;&lt;/strong&gt;, where the full and current version of this course lesson lives.&lt;/p&gt;
&lt;/blockquote&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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fkdyz4qbk4er8spnibnt3.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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fkdyz4qbk4er8spnibnt3.png" alt="AI Security Testing with Burp Suite: Practical Introduction — Day 5: Parameter Manipulation and Role Tampering" width="799" height="420"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Yesterday you changed the words in a prompt. A chat request carries more than words, though. It also holds a model name, a temperature, a user ID and a role for each message. Each one is a small instruction to the server, and the page only ever sends the values its developer chose.&lt;/p&gt;

&lt;p&gt;Today you learn to ask a plain question of each value: if I change this, does the server believe me? A server that trusts a role field or an ID it should have checked is a real finding. You will practise on a tiny server on your own machine, then on the SecurityElites lab.&lt;/p&gt;

&lt;h2&gt;
  
  
  Parameters beyond the prompt
&lt;/h2&gt;

&lt;p&gt;A parameter is a named value sent with a request. In a chat API body you will usually see fields like these next to the messages. Some are harmless settings. Others decide who you are or what you may do.&lt;/p&gt;

&lt;p&gt;The key idea is trust. The server should treat everything in a request as untrusted input, because you control it. If it uses a value without checking it, we call that trusting the client. Our job is to find out which values it trusts.&lt;/p&gt;

&lt;h2&gt;
  
  
  The method: one change, one comparison
&lt;/h2&gt;

&lt;p&gt;You met this rule yesterday and it matters even more now. Send the untouched request first and keep the response as your baseline. Then change exactly one value and send again. If you change three things and the server errors, you cannot tell which one caused it.&lt;/p&gt;

&lt;p&gt;Error messages are clues. A reply like 'role not allowed' proves a server-side check exists and names the rule. A vague 500 error tells you less, but it still shows your edit reached the server code.&lt;/p&gt;

&lt;p&gt;For each change, note three things: the status code (200 means accepted, 400 or 403 usually means refused), the body, and whether the response reflects your value back. A server that accepts and uses your value has trusted you. One that accepts but quietly ignores it has not.&lt;/p&gt;

&lt;h2&gt;
  
  
  Watch me do it: a toy server on your own machine
&lt;/h2&gt;

&lt;p&gt;To see trust and rejection clearly, I want you to run a small fake chat API. It runs only on your computer at 127.0.0.1, which nobody else can reach. It checks the role and the temperature, and it deliberately trusts the user_id. That last part is the flaw we will find.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Check Python is installed.&lt;/strong&gt; Open a terminal and run the command below. You should see a version number such as Python 3.11. If the command is not found on Windows, try python instead of python3. If neither works, install Python from python.org and try again.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Save the toy server.&lt;/strong&gt; In your notes folder create a file named toy_server.py and paste in the script shown after these steps. Save it.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Start it.&lt;/strong&gt; Run python3 toy_server.py in the terminal. It prints nothing and keeps running. Leave that window open. Stop it later with Ctrl+C.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Open Repeater and set the target.&lt;/strong&gt; In Burp go to the Repeater tab, click the plus to make a new tab, then click the pencil icon by Target. Set Host to 127.0.0.1, Port to 8000, and leave the use HTTPS box unticked.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Paste the baseline request.&lt;/strong&gt; Paste the request shown below into the left pane. Click Send. The right pane should show status 200 and a JSON body with reply, temperature_used and profile fields. That is your baseline.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Change one thing at a time.&lt;/strong&gt; Edit one value, click Send, read the result, then put it back. Try role as system, then temperature as 5, then temperature as 0.2, then user_id as 1002. Note each result as you go.
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;python3 --version
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import json
from http.server import BaseHTTPRequestHandler, HTTPServer

class H(BaseHTTPRequestHandler):
    def do_POST(self):
        n = int(self.headers.get('Content-Length', 0))
        try:
            d = json.loads(self.rfile.read(n))
            role = d['messages'][0]['role']
            temp = d.get('temperature', 0.7)
            if role != 'user':
                out, code = {'error': 'role not allowed: ' + role}, 403
            elif not 0 &amp;lt;= temp &amp;lt;= 1:
                out, code = {'error': 'temperature must be 0 to 1'}, 400
            else:
                out, code = {'reply': 'echo', 'temperature_used': temp, 'profile': 'data for user ' + str(d.get('user_id'))}, 200
        except Exception as e:
            out, code = {'error': 'bad request: ' + repr(e)}, 400
        body = json.dumps(out).encode()
        self.send_response(code)
        self.send_header('Content-Type', 'application/json')
        self.send_header('Content-Length', str(len(body)))
        self.end_headers()
        self.wfile.write(body)

HTTPServer(('127.0.0.1', 8000), H).serve_forever()
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;POST /chat HTTP/1.1
Host: 127.0.0.1:8000
Content-Type: application/json

{"model":"demo-1","user_id":1001,"temperature":0.7,"messages":[{"role":"user","content":"hello"}]}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here is what you should see. Role system returns 403 with 'role not allowed: system', so the server checks roles. Temperature 5 returns 400 with a range message, so it checks that too. Temperature 0.2 returns 200 and temperature_used shows 0.2, which is fine because it is a valid value. User_id 1002 returns 200 with 'data for user 1002'. The server never asked whether you are user 1002, so it trusted your ID. That is the finding.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;&lt;a href="https://securityelites.com/academy/ai-security-testing-burp-suite-intro/day-5-parameter-manipulation-role-tampering-burp/" rel="noopener noreferrer"&gt;Continue reading the full course lesson on Securityelites — AI Red Team Education&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

</description>
      <category>cybersecurity</category>
      <category>ethicalhacking</category>
      <category>infosec</category>
      <category>security</category>
    </item>
  </channel>
</rss>
