Rednote
GuidebooksTerminalCode
  • Welcome!
  • Utility
    • General
    • Server
    • Transferring File
      • Main
      • Code
      • Miscellaneous
    • Reverse & Bind Shells
      • Havoc
    • Metasploit
    • Service
      • FTP (21)
      • SSH (22)
      • DNS (53)
      • HTTP/HTTPS (80-443)
      • SMTP (25-465-587)
      • POP3 (110-995)
      • IMAP (143-993)
      • MySQL (3306)
      • MSSQL (1433-2433)
      • SMB (139-445)
      • RDP (3389)
      • WinRM (5985-5986)
      • WMI (135)
      • LLMNR & NBT-NS (5355-137)
      • NFS (111-2049)
      • SNMP (161-162)
      • VNC (5900)
      • Rsync (873)
      • R-Service (512-513-514)
      • IPMI (623)
      • Oracle TNS (1521)
  • Pentesting Process
    • Information Gathering
      • Passive
      • Active
      • OSINT
    • Vulnerability
    • Web Attacks
      • GENERAL
      • Crawling/Spidering & Fuzzing
      • Information Disclosure
      • Command Injection
      • Unrestricted File Upload
      • File Inclusion/Path Traversal
      • Request Smuggling
      • Clickjacking
      • Web Cache Poisoning
      • Web Cache Deception
      • Insecure Deserialization
      • Prototype Pollution
      • OAuth 2.0
      • JWT
      • SQLi
        • sqlmap
      • NoSQLi
      • GraphQL
      • XSS
      • SSRF
      • XXE
      • IDOR
      • API
      • SSTI
      • CSRF
      • CORS
      • AJP
      • SSI
      • ESI
      • XSLT
      • Cloud
      • LLM Prompt Security
    • Software Attacks
      • Binary
      • Shellcode
      • AV Evasion & Obfuscation
    • Network Attacks
      • ARP Poisoning
      • Local DNS Cache Poisoning
      • Baby Local DoS
    • Crypto Attacks
      • Utility
      • RSA
      • DSA/DSS
      • PRNG
        • LGC
        • MT
        • LFSR
    • Misc Attacks
    • Social Engineering
    • Password Cracking
      • Wordlist
      • Offline
      • Online
    • Pivoting & Tunneling
    • Local Enumeration
      • Linux
      • Windows
    • Privilege Escalation
      • Linux
        • Linux Privilege Escalation with Groups
        • Linux Privilege Escalation with Library
      • Windows
        • Windows Privilege Escalation with Groups and Privileges
        • Windows Privilege Escalation with DLL Hijacking
    • Active Directory
      • Enumeration
      • Abuse ACL
      • Extract Hash & Password
      • Pass The Hash
      • Pass The Ticket
      • Overpass the Hash
      • Relay Attack
      • Password Spraying Attack
      • AS-REP Roasting
      • Kerberoasting
      • Silver Ticket
      • Golden Ticket
      • DC Synchronization
      • AD Certificates
      • Attacking Domain Trusts
    • Reports
      • Bug Bounty Report
    • CVE
      • Linux
      • Windows
    • OTHER
      • CMS
        • WordPress
        • Joomla
        • Drupal
      • Tomcat
      • Jenkins
      • Splunk
      • Web Service
      • Navigating Python Objects
      • JavaScript Deobfuscation
  • Extra
    • My Books
    • My Exploits
    • Compiled Binaries
Powered by GitBook
On this page
  • Repeat K Attack
  • K with Linear Increment Attack
  • K, K + 1, K + 2, K + 3, ...
  • K, K + N, K + 2N, K + 3N, ...

Was this helpful?

  1. Pentesting Process
  2. Crypto Attacks

DSA/DSS

Digital Signature Algorithm / Digital Signature Standard.

Public key (p, q, g, y) where y = g·x mod p Private key (p, q, g, x)

SIGN:
k = random in [1, q-1]
r = g^k mod p mod q
s = k-1 (H(M) + x·r) mod q
--> (r, s)

VERIFY:
a = g^( H(M) · s-1 mod q ) mod p
b = y^( r ·    s-1 mod q ) mod p 
r == (a·b mod p) mod q

Repeat K Attack

s1 = k-1 (H(M1) + x·r) mod q
s2 = k-1 (H(M2) + x·r) mod q

x = (H(M1)s2 - H(M2)s1) · (r·(s1 - s2))-1  mod q
Demonstration
s1 = k-1 (H(M1) + x·r) mod q
s2 = k-1 (H(M2) + x·r) mod q

s1·k = H(M1) + x·r mod q
s2·k = H(M2) + x·r mod q

s1·k - x·r = H(M1) mod q
s2·k - x·r = H(M2) mod q

H(M1) - H(M2) = (s1·k - x·r)-(s2·k - x·r)  mod q
H(M1) - H(M2) = s1·k - x·r -s2·k + x·r     mod q
H(M1) - H(M2) = s1·k - s2·k                mod q
H(M1) - H(M2) = (s1 - s2)·k                mod q

k = (H(M1) - H(M2)) · (s1 - s2)-1  mod q

x·r = s1·k - H(M1)       mod q
x = s1·k - H(M1) · r-1   mod q

x = s1·( (H(M1) - H(M2)) · (s1 - s2)-1 ) - H(M1) · r-1.   mod q

x = (H(M1)s2 - H(M2)s1) · (r·(s1 - s2))-1  mod q

K with Linear Increment Attack

K, K + 1, K + 2, K + 3, ...

s1·k = H(M1) + x·r1 mod q
s2·k + s2 = H(M2) + x·r2 mod q

x = s1·( (H(M2) - s2 - H(M1)·r1-1·r2) · (s2 - s1·r1-1·r2)-1 )·r1-1 - H(M1)·r1-1 mod q
Demonstration
s1·k = H(M1) + x·r1 mod q
s2·k + s2 = H(M2) + x·r2 mod q

Gaussian elimination (x)
s1·k·r1-1 = H(M1)·r1-1 + x mod q       # Poniamo sola la x, divido per r1
s2·k + s2 - s1·k·r1-1 = H(M2) + x·r2 - (H(M1)·r1-1 + x)         mod q  # secondo passaggio meno terzo
s2·k + s2 - s1·k·r1-1·r2 = H(M2) + x·r2 - (H(M1)·r1-1 + x)·r2   mod q  # moltiplico per r2 la seconda componente
s2·k + s2 - s1·k·r1-1·r2 = H(M2) + x·r2 - H(M1)·r1-1·r2 - x·r2  mod q
s2·k + s2 - s1·k·r1-1·r2 = H(M2) - H(M1)·r1-1·r2 mod q

x = s1·k·r1-1 - H(M1)·r1-1 mod q    # Guardando la terza

# Divido la terza con s2 - s1·r1-1·r2
k = (H(M2) - s2 - H(M1)·r1-1·r2) · (s2 - s1·r1-1·r2)-1      mod q     # Divido la terza con s2 - s1·r1-1·r2
k = (s2·k + s2 - s2 - s1·k·r1-1·r2) · (s2 - s1·r1-1·r2)-1   mod q
k = (s2·k - s1·k·r1-1·r2) · (s2 - s1·r1-1·r2)-1             mod q
k = k·(s2 - s1·r1-1·r2) · (s2 - s1·r1-1·r2)-1               mod q
k = k 

x = s1·( (H(M2) - s2 - H(M1)·r1-1·r2) · (s2 - s1·r1-1·r2)-1 )·r1-1 - H(M1)·r1-1 mod q

K, K + N, K + 2N, K + 3N, ...

s1·k = H(M1) + x·r1 mod q
s2·k + Ns2 = H(M2) + x·r2 mod q

x = s1·( (H(M2) - Ns2 - H(M1)·r1-1·r2) · (s2 - s1·r1-1·r2)-1 )·r1-1 - H(M1)·r1-1 mod q
Demonstration
s1·k = H(M1) + x·r1 mod q
s2·k + Ns2 = H(M2) + x·r2 mod q

Gaussian elimination (x)
s1·k·r1-1 = H(M1)·r1-1 + x mod q       # Poniamo sola la x, divido per r1
s2·k + Ns2 - s1·k·r1-1 = H(M2) + x·r2 - (H(M1)·r1-1 + x)         mod q  # secondo passaggio meno terzo
s2·k + Ns2 - s1·k·r1-1·r2 = H(M2) + x·r2 - (H(M1)·r1-1 + x)·r2   mod q  # moltiplico per r2 la seconda componente
s2·k + Ns2 - s1·k·r1-1·r2 = H(M2) + x·r2 - H(M1)·r1-1·r2 - x·r2  mod q
s2·k + Ns2 - s1·k·r1-1·r2 = H(M2) - H(M1)·r1-1·r2 mod q

x = s1·k·r1-1 - H(M1)·r1-1 mod q    # Guardando la terza

# Divido la terza con s2 - s1·r1-1·r2
k = (H(M2) - Ns2 - H(M1)·r1-1·r2) · (s2 - s1·r1-1·r2)-1       mod q     # Divido la terza con s2 - s1·r1-1·r2
k = (s2·k + Ns2 - Ns2 - s1·k·r1-1·r2) · (s2 - s1·r1-1·r2)-1   mod q
k = (s2·k - s1·k·r1-1·r2) · (s2 - s1·r1-1·r2)-1               mod q
k = k·(s2 - s1·r1-1·r2) · (s2 - s1·r1-1·r2)-1                 mod q
k = k 

x = s1·( (H(M2) - Ns2 - H(M1)·r1-1·r2) · (s2 - s1·r1-1·r2)-1 )·r1-1 - H(M1)·r1-1 mod q

Last updated 7 months ago

Was this helpful?