Giter Club home page Giter Club logo

ctf's Introduction

CTF challenge name : Hammered

at the first we have to know something about what is the inside this logs
1- /var/log/auth.log โ€“ Contains system authorization information, including user logins and authentication machinsm that were used, successful and failed attemps.
2- /var/log/apache/access.log is a log file that stores information about incoming requests
3- '/var/log/dmesg' file provides a snapshot of the kernel messages at boot time
4- var/log/kern.log: stores information from the Ubuntu Linux kernel
4- /var/log/daemon Daemon logs contains information about events related running the Linux operation.
5- /var/log/apt/term.log: store records of actions such as package installations and updates. , history of apt command

18

Q1 Which service did the attackers use to gain access to the system?


the only log file will help us to know which service attacker used for gain access (auth.log)
because it Contains system authorization information, including user logins and authentication machinsm that were used.
we will use this command to gain more info about it
cat auth.log | grep "Failed"
the attacker was been using brute force attack to gain access using ssh service 1

Q2 What is the operating system version of the targeted system?


in this Q we can recognition about the operating system with two ways
first one we will check dmesg file ( dmesg' file provides a snapshot of the kernel messages at boot time )
with command line cat dmesg | less
we will see the the operating system version is 4.2.4-1ubuntu3 2
second one we will check kern.log
with command line cat kern.log | less
we will see the the operating system version is 4.2.4-1ubuntu3 3

Q3 What is the name of the compromised account?


in this Q we need to know which accound was compromised so only log file will help us is auth.log because it
Contains system authorization information, including user logins and authentication machinsm that were used.
we will use command line cat auth.log | grep 'Accepted password'
so root account was compromised
how we detect it if we go back to this command cat auth.log | grep "Failed"
we will see the ip 219.150.161.20
At Apr 19 05:38:37 gain Failed password more than one time that mean the attacker was been using brute force attack to gain access until
did it and compromised root account At Apr 19 05:55:20 4 5

Q4 Consider that each unique IP represents a different attacker. How many attackers were able to get access to the system?


we need to know how many attackers were able to get access to the system so we need to know how many
ip get Failed password for root Then get Accepted password for root
with comparing to commands we will get the number of attackers were able to get access to the system
cat auth.log | grep 'Failed password for root' | awk '{print $11}' | sort | uniq -c
cat auth.log | grep 'Accepted password for root' | awk '{print $11}' | sort | uniq -c
we will see 6 7 8

Q5 Which attacker's IP address successfully logged into the system the most number of times

19

Q6 How many requests were sent to the Apache Server?


to know how many requsests were sent to the apache server
we will find it inside access.log because it is stores information about incoming requests
wc -l will count number of lines then we get number of requestes
command line wc -l www-access.log
9

Q7 How many rules have been added to the firewall?


Iptables is a standard firewall included in most Linux distributions by default.
command line cat auth.log | grep 'iptable' 10

Q8 One of the downloaded files to the target system is a scanning tool. Provide the tool name.


will help us in this Q to know which tool downloaded is term.log ( store records of actions such as package installations and updates.)
we will use this command cat term.log | grep -A 5 -B 5 'install'
nmap is most popular scanning tools 11

Q9 When was the last login from the attacker with IP 219.150.161.20? Format: MM/DD/YYYY HH:MM:SS AM


using this command cat auth.log | grep 'Accepted password for root' will know last login
but we will not see the year get it from auth.log properties 12 13

Q10 The database displayed two warning messages, provide the most important and dangerous one.


data about database will stored in daemon.log (Daemon logs contains information about events related running the Linux operation.)
with command line cat daemon.log grep 'WARNING' 20

Q11 Multiple accounts were created on the target system. Which one was created on Apr 26 04:43:15?


we will search in auth.log about new user with this command cat auth.log | grep 'new user' | grep 'Apr 26 04:43:1' 22

Q12 Few attackers were using a proxy to run their scans. What is the corresponding user-agent used by this proxy?


The HTTP CONNECT method starts two-way communications with the requested resource. It can be used to open a tunnel. 17


command line cat www-access.log | grep 'CONNECT'
ans pxyscand/2.1 16

ctf's People

Contributors

0xt7n avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.