\documentclass[11pt,twoside]{article}\makeatletter

\IfFileExists{xcolor.sty}%
  {\RequirePackage{xcolor}}%
  {\RequirePackage{color}}
\usepackage{colortbl}
\usepackage{wrapfig}
\usepackage{ifxetex}
\ifxetex
  \usepackage{fontspec}
  \usepackage{xunicode}
  \catcode`⃥=\active \def⃥{\textbackslash}
  \catcode`❴=\active \def❴{\{}
  \catcode`❵=\active \def❵{\}}
  \def\textJapanese{\fontspec{Noto Sans CJK JP}}
  \def\textChinese{\fontspec{Noto Sans CJK SC}}
  \def\textKorean{\fontspec{Noto Sans CJK KR}}
  \setmonofont{DejaVu Sans Mono}
  
\else
  \IfFileExists{utf8x.def}%
   {\usepackage[utf8x]{inputenc}
      \PrerenderUnicode{–}
    }%
   {\usepackage[utf8]{inputenc}}
  \usepackage[english]{babel}
  \usepackage[T1]{fontenc}
  \usepackage{float}
  \usepackage[]{ucs}
  \uc@dclc{8421}{default}{\textbackslash }
  \uc@dclc{10100}{default}{\{}
  \uc@dclc{10101}{default}{\}}
  \uc@dclc{8491}{default}{\AA{}}
  \uc@dclc{8239}{default}{\,}
  \uc@dclc{20154}{default}{ }
  \uc@dclc{10148}{default}{>}
  \def\textschwa{\rotatebox{-90}{e}}
  \def\textJapanese{}
  \def\textChinese{}
  \IfFileExists{tipa.sty}{\usepackage{tipa}}{}
\fi
\def\exampleFont{\ttfamily\small}
\DeclareTextSymbol{\textpi}{OML}{25}
\usepackage{relsize}
\RequirePackage{array}
\def\@testpach{\@chclass
 \ifnum \@lastchclass=6 \@ne \@chnum \@ne \else
  \ifnum \@lastchclass=7 5 \else
   \ifnum \@lastchclass=8 \tw@ \else
    \ifnum \@lastchclass=9 \thr@@
   \else \z@
   \ifnum \@lastchclass = 10 \else
   \edef\@nextchar{\expandafter\string\@nextchar}%
   \@chnum
   \if \@nextchar c\z@ \else
    \if \@nextchar l\@ne \else
     \if \@nextchar r\tw@ \else
   \z@ \@chclass
   \if\@nextchar |\@ne \else
    \if \@nextchar !6 \else
     \if \@nextchar @7 \else
      \if \@nextchar (8 \else
       \if \@nextchar )9 \else
  10
  \@chnum
  \if \@nextchar m\thr@@\else
   \if \@nextchar p4 \else
    \if \@nextchar b5 \else
   \z@ \@chclass \z@ \@preamerr \z@ \fi \fi \fi \fi
   \fi \fi  \fi  \fi  \fi  \fi  \fi \fi \fi \fi \fi \fi}
\gdef\arraybackslash{\let\\=\@arraycr}
\def\@textsubscript#1{{\m@th\ensuremath{_{\mbox{\fontsize\sf@size\z@#1}}}}}
\def\Panel#1#2#3#4{\multicolumn{#3}{){\columncolor{#2}}#4}{#1}}
\def\abbr{}
\def\corr{}
\def\expan{}
\def\gap{}
\def\orig{}
\def\reg{}
\def\ref{}
\def\sic{}
\def\persName{}\def\name{}
\def\placeName{}
\def\orgName{}
\def\textcal#1{{\fontspec{Lucida Calligraphy}#1}}
\def\textgothic#1{{\fontspec{Lucida Blackletter}#1}}
\def\textlarge#1{{\large #1}}
\def\textoverbar#1{\ensuremath{\overline{#1}}}
\def\textquoted#1{‘#1’}
\def\textsmall#1{{\small #1}}
\def\textsubscript#1{\@textsubscript{\selectfont#1}}
\def\textxi{\ensuremath{\xi}}
\def\titlem{\itshape}
\newenvironment{biblfree}{}{\ifvmode\par\fi }
\newenvironment{bibl}{}{}
\newenvironment{byline}{\vskip6pt\itshape\fontsize{16pt}{18pt}\selectfont}{\par }
\newenvironment{citbibl}{}{\ifvmode\par\fi }
\newenvironment{docAuthor}{\ifvmode\vskip4pt\fontsize{16pt}{18pt}\selectfont\fi\itshape}{\ifvmode\par\fi }
\newenvironment{docDate}{}{\ifvmode\par\fi }
\newenvironment{docImprint}{\vskip 6pt}{\ifvmode\par\fi }
\newenvironment{docTitle}{\vskip6pt\bfseries\fontsize{22pt}{25pt}\selectfont}{\par }
\newenvironment{msHead}{\vskip 6pt}{\par}
\newenvironment{msItem}{\vskip 6pt}{\par}
\newenvironment{rubric}{}{}
\newenvironment{titlePart}{}{\par }

\newcolumntype{L}[1]{){\raggedright\arraybackslash}p{#1}}
\newcolumntype{C}[1]{){\centering\arraybackslash}p{#1}}
\newcolumntype{R}[1]{){\raggedleft\arraybackslash}p{#1}}
\newcolumntype{P}[1]{){\arraybackslash}p{#1}}
\newcolumntype{B}[1]{){\arraybackslash}b{#1}}
\newcolumntype{M}[1]{){\arraybackslash}m{#1}}
\definecolor{label}{gray}{0.75}
\def\unusedattribute#1{\sout{\textcolor{label}{#1}}}
\DeclareRobustCommand*{\xref}{\hyper@normalise\xref@}
\def\xref@#1#2{\hyper@linkurl{#2}{#1}}
\begingroup
\catcode`\_=\active
\gdef_#1{\ensuremath{\sb{\mathrm{#1}}}}
\endgroup
\mathcode`\_=\string"8000
\catcode`\_=12\relax

\usepackage[a4paper,twoside,lmargin=1in,rmargin=1in,tmargin=1in,bmargin=1in,marginparwidth=0.75in]{geometry}
\usepackage{framed}

\definecolor{shadecolor}{gray}{0.95}
\usepackage{longtable}
\usepackage[normalem]{ulem}
\usepackage{fancyvrb}
\usepackage{fancyhdr}
\usepackage{graphicx}
\usepackage{marginnote}

\renewcommand{\@cite}[1]{#1}


\renewcommand*{\marginfont}{\itshape\footnotesize}

\def\Gin@extensions{.pdf,.png,.jpg,.mps,.tif}

  \pagestyle{fancy}

\usepackage[pdftitle={Bluelock a Tool to Prevent Bluetooth Attacks},
 pdfauthor={}]{hyperref}
\hyperbaseurl{}

	 \paperwidth210mm
	 \paperheight297mm
              
\def\@pnumwidth{1.55em}
\def\@tocrmarg {2.55em}
\def\@dotsep{4.5}
\setcounter{tocdepth}{3}
\clubpenalty=8000
\emergencystretch 3em
\hbadness=4000
\hyphenpenalty=400
\pretolerance=750
\tolerance=2000
\vbadness=4000
\widowpenalty=10000

\renewcommand\section{\@startsection {section}{1}{\z@}%
     {-1.75ex \@plus -0.5ex \@minus -.2ex}%
     {0.5ex \@plus .2ex}%
     {\reset@font\Large\bfseries}}
\renewcommand\subsection{\@startsection{subsection}{2}{\z@}%
     {-1.75ex\@plus -0.5ex \@minus- .2ex}%
     {0.5ex \@plus .2ex}%
     {\reset@font\Large}}
\renewcommand\subsubsection{\@startsection{subsubsection}{3}{\z@}%
     {-1.5ex\@plus -0.35ex \@minus -.2ex}%
     {0.5ex \@plus .2ex}%
     {\reset@font\large}}
\renewcommand\paragraph{\@startsection{paragraph}{4}{\z@}%
     {-1ex \@plus-0.35ex \@minus -0.2ex}%
     {0.5ex \@plus .2ex}%
     {\reset@font\normalsize}}
\renewcommand\subparagraph{\@startsection{subparagraph}{5}{\parindent}%
     {1.5ex \@plus1ex \@minus .2ex}%
     {-1em}%
     {\reset@font\normalsize\bfseries}}


\def\l@section#1#2{\addpenalty{\@secpenalty} \addvspace{1.0em plus 1pt}
 \@tempdima 1.5em \begingroup
 \parindent \z@ \rightskip \@pnumwidth 
 \parfillskip -\@pnumwidth 
 \bfseries \leavevmode #1\hfil \hbox to\@pnumwidth{\hss #2}\par
 \endgroup}
\def\l@subsection{\@dottedtocline{2}{1.5em}{2.3em}}
\def\l@subsubsection{\@dottedtocline{3}{3.8em}{3.2em}}
\def\l@paragraph{\@dottedtocline{4}{7.0em}{4.1em}}
\def\l@subparagraph{\@dottedtocline{5}{10em}{5em}}
\@ifundefined{c@section}{\newcounter{section}}{}
\@ifundefined{c@chapter}{\newcounter{chapter}}{}
\newif\if@mainmatter 
\@mainmattertrue
\def\chaptername{Chapter}
\def\frontmatter{%
  \pagenumbering{roman}
  \def\thechapter{\@roman\c@chapter}
  \def\theHchapter{\roman{chapter}}
  \def\thesection{\@roman\c@section}
  \def\theHsection{\roman{section}}
  \def\@chapapp{}%
}
\def\mainmatter{%
  \cleardoublepage
  \def\thechapter{\@arabic\c@chapter}
  \setcounter{chapter}{0}
  \setcounter{section}{0}
  \pagenumbering{arabic}
  \setcounter{secnumdepth}{6}
  \def\@chapapp{\chaptername}%
  \def\theHchapter{\arabic{chapter}}
  \def\thesection{\@arabic\c@section}
  \def\theHsection{\arabic{section}}
}
\def\backmatter{%
  \cleardoublepage
  \setcounter{chapter}{0}
  \setcounter{section}{0}
  \setcounter{secnumdepth}{2}
  \def\@chapapp{\appendixname}%
  \def\thechapter{\@Alph\c@chapter}
  \def\theHchapter{\Alph{chapter}}
  \appendix
}
\newenvironment{bibitemlist}[1]{%
   \list{\@biblabel{\@arabic\c@enumiv}}%
       {\settowidth\labelwidth{\@biblabel{#1}}%
        \leftmargin\labelwidth
        \advance\leftmargin\labelsep
        \@openbib@code
        \usecounter{enumiv}%
        \let\p@enumiv\@empty
        \renewcommand\theenumiv{\@arabic\c@enumiv}%
	}%
  \sloppy
  \clubpenalty4000
  \@clubpenalty \clubpenalty
  \widowpenalty4000%
  \sfcode`\.\@m}%
  {\def\@noitemerr
    {\@latex@warning{Empty `bibitemlist' environment}}%
    \endlist}

\def\tableofcontents{\section*{\contentsname}\@starttoc{toc}}
\parskip0pt
\parindent1em
\def\Panel#1#2#3#4{\multicolumn{#3}{){\columncolor{#2}}#4}{#1}}
\newenvironment{reflist}{%
  \begin{raggedright}\begin{list}{}
  {%
   \setlength{\topsep}{0pt}%
   \setlength{\rightmargin}{0.25in}%
   \setlength{\itemsep}{0pt}%
   \setlength{\itemindent}{0pt}%
   \setlength{\parskip}{0pt}%
   \setlength{\parsep}{2pt}%
   \def\makelabel##1{\itshape ##1}}%
  }
  {\end{list}\end{raggedright}}
\newenvironment{sansreflist}{%
  \begin{raggedright}\begin{list}{}
  {%
   \setlength{\topsep}{0pt}%
   \setlength{\rightmargin}{0.25in}%
   \setlength{\itemindent}{0pt}%
   \setlength{\parskip}{0pt}%
   \setlength{\itemsep}{0pt}%
   \setlength{\parsep}{2pt}%
   \def\makelabel##1{\upshape ##1}}%
  }
  {\end{list}\end{raggedright}}
\newenvironment{specHead}[2]%
 {\vspace{20pt}\hrule\vspace{10pt}%
  \phantomsection\label{#1}\markright{#2}%

  \pdfbookmark[2]{#2}{#1}%
  \hspace{-0.75in}{\bfseries\fontsize{16pt}{18pt}\selectfont#2}%
  }{}
      \def\TheFullDate{2021-12-29 (revised: 29 December 2021)}
\def\TheID{\makeatother }
\def\TheDate{2021-12-29}
\title{Bluelock a Tool to Prevent Bluetooth Attacks}
\author{}\makeatletter 
\makeatletter
\newcommand*{\cleartoleftpage}{%
  \clearpage
    \if@twoside
    \ifodd\c@page
      \hbox{}\newpage
      \if@twocolumn
        \hbox{}\newpage
      \fi
    \fi
  \fi
}
\makeatother
\makeatletter
\thispagestyle{empty}
\markright{\@title}\markboth{\@title}{\@author}
\renewcommand\small{\@setfontsize\small{9pt}{11pt}\abovedisplayskip 8.5\p@ plus3\p@ minus4\p@
\belowdisplayskip \abovedisplayskip
\abovedisplayshortskip \z@ plus2\p@
\belowdisplayshortskip 4\p@ plus2\p@ minus2\p@
\def\@listi{\leftmargin\leftmargini
               \topsep 2\p@ plus1\p@ minus1\p@
               \parsep 2\p@ plus\p@ minus\p@
               \itemsep 1pt}
}
\makeatother
\fvset{frame=single,numberblanklines=false,xleftmargin=5mm,xrightmargin=5mm}
\fancyhf{} 
\setlength{\headheight}{14pt}
\fancyhead[LE]{\bfseries\leftmark} 
\fancyhead[RO]{\bfseries\rightmark} 
\fancyfoot[RO]{}
\fancyfoot[CO]{\thepage}
\fancyfoot[LO]{\TheID}
\fancyfoot[LE]{}
\fancyfoot[CE]{\thepage}
\fancyfoot[RE]{\TheID}
\hypersetup{citebordercolor=0.75 0.75 0.75,linkbordercolor=0.75 0.75 0.75,urlbordercolor=0.75 0.75 0.75,bookmarksnumbered=true}
\fancypagestyle{plain}{\fancyhead{}\renewcommand{\headrulewidth}{0pt}}

\date{}
\usepackage{authblk}

\providecommand{\keywords}[1]
{
\footnotesize
  \textbf{\textit{Index terms---}} #1
}

\usepackage{graphicx,xcolor}
\definecolor{GJBlue}{HTML}{273B81}
\definecolor{GJLightBlue}{HTML}{0A9DD9}
\definecolor{GJMediumGrey}{HTML}{6D6E70}
\definecolor{GJLightGrey}{HTML}{929497} 

\renewenvironment{abstract}{%
   \setlength{\parindent}{0pt}\raggedright
   \textcolor{GJMediumGrey}{\rule{\textwidth}{2pt}}
   \vskip16pt
   \textcolor{GJBlue}{\large\bfseries\abstractname\space}
}{%   
   \vskip8pt
   \textcolor{GJMediumGrey}{\rule{\textwidth}{2pt}}
   \vskip16pt
}

\usepackage[absolute,overlay]{textpos}

\makeatother 
      \usepackage{lineno}
      \linenumbers
      
\begin{document}

             \author[1]{Gerardo Alberto Castang  Montiel.}

             \author[2]{Fernando Betancourt  Duque}

             \author[3]{Luz  Adriana Peña  Salazar}

\renewcommand\Authands{ and }

\date{\small \em Received: 28 November 2021 Accepted: 19 December 2021 Published: 29 December 2021}

\maketitle


\begin{abstract}
        


The mobile device manufacturers and Internet Of Things are searching for more compatible and easy to connect protocols that increase coverage, which generates the user an effective experience when using different devices. Nevertheless, the constant updating process opens a security gap that exposes the users' personal information. Bluetooth is a communication protocol openly used by manufacturers because of their excellent information transfer capacities, allowing hackers to exploit it. The manufacturers work daily, generating security patches for communication protocols but this hasn't been enough to mitigate vulnerabilities. The security has always been on the manufacturer's side but the final user is limited to use a few security customization options to protect his network perimeter. Based on the wireless devices' background we wonder, Is there any way in which the user has the chance to reduce the possible dangers that wireless devices face? We can answer this question through the development of a research in the more vulnerable areas, simulating the attacks on a mobile device to generate a possible solution that allows the user to have more control over his bluetooth connections.

\end{abstract}


\keywords{bluetooth, android, security, attacks.}

\begin{textblock*}{18cm}(1cm,1cm) % {block width} (coords) 
\textcolor{GJBlue}{\LARGE Global Journals \LaTeX\ JournalKaleidoscope\texttrademark}
\end{textblock*}

\begin{textblock*}{18cm}(1.4cm,1.5cm) % {block width} (coords) 
\textcolor{GJBlue}{\footnotesize \\ Artificial Intelligence formulated this projection for compatibility purposes from the original article published at Global Journals. However, this technology is currently in beta. \emph{Therefore, kindly ignore odd layouts, missed formulae, text, tables, or figures.}}
\end{textblock*}


\let\tabcellsep& 	 	 		 
\section[{Introduction}]{Introduction}\par
dvances in wireless communication have faced compatibility issues, which has forced technology manufacturers to regulate communication protocols. One of the most popular has been Bluetooth used to interconnect mobile devices and IoT technology. This protocol was created in 1994 by the electric engineer Jaap Haartsen and it has been updated throughout the years that has allowed it to be one the best protocols due to its information transfer rate.\par
Because of its popularity, coming from manufacturers, this has been the target of hackers who have used vulnerabilities to attack other users and obtained their private information from their mobile devices. The response to these attacks is usually reactive. Such attacks have compromised thousands of users' information, even installing apps that act like malware, that allows access to the peripherals connected to the victim's device, like a camera, mic, GPS, and others.\par
Smartphones are the most used devices for Bluetooth technology due to its features and the storage capacity in Android. The manufacturers keep reactive during the attacks, generating patches and updates, saving the security recommendations.\par
To generate a preventive solution, we propose the user is able to manage the Bluetooth interface so it can be used without exposing private information when the device is active. To accomplish this, a testing environment is set up to deploy Bluetooth attacks to identify possible vulnerabilities that could be reduced by an Android app for Smartphones. 
\section[{a) Glossary}]{a) Glossary}\par
Android is a mobile operating system based on a modified version of the Linux kernel and other open source software, designed primarily for touchscreen mobile devices such as smartphones and tablets. Android is developed by a consortium of developers known as the Open Handset Alliance and commercially sponsored by Google.\par
? Attacks: In this project an attack is a cyberattack, and it is the attempt caused by someone who wants to get control over an informatic system once he gets access to it. The attacks have several purposes in order to cause damage through espionage to get money or to find vulnerabilities in the system. ? BlueLock: It is the created tool for Android devices that allows control over the Bluetooth interface by the user to manage connectivity among active devices. ? Bluetooth: It is a short-range wireless technology standard that is used for exchanging data between fixed and mobile devices over short distances using UHF radio waves in the ISM bands, from We use the Bluelog tool from Kali Linux that allows us to see and register detectable devices on the Bluetooth network and it is executed as you will find below:  {\ref -------------------------} Blue Scanner is another Kai Linux tool that allows us to scan through the Bluetooth network adapter, capturing connectivity features from connected devices on the network and it is executed as follows root@kali:\textasciitilde \# btscanner Keyword "i" produces and scans all devices on the network and generates a file directory called by the MAC's device name with all the information obtained, using these tools we can start to validate the attacks and check their functionality. used interchangeably when referring to internal cyber security tests, but they're not exactly the same. Penetration testing is a type of security test in which an organisation hires a certified professional to assess the strength of its cyber security defences. The goal of ethical hacking -like criminal hacking -is to find security vulnerabilities in an organisation's systems. However, as the word 'ethical' suggests, the person conducting the attack must have the organisation's approval before proceeding. ? Information security: The state of being protected against the unauthorized use of information, especially electronic data, or the measures taken to achieve this.root@kali:\textasciitilde \# bluelog Bluelog (v1.1.2) by MS3FGX - 
\section[{Global Journal of Researches in Engineering}]{Global Journal of Researches in Engineering}\par
? Vulnerability: It is a failure in the security system in which the user can access a system to manipulate information, app or take control over the system. 
\section[{II.}]{II.} 
\section[{Attack Deployment}]{Attack Deployment}\par
Knowing the different types of attacks over Bluetooth, they are possible to duplicate through Pentesting. The tests done are known as "white box" (tandem), because we implement the attack environment using the platform pentesting Kali Linux, keeping track of every tool and designing the hacking tests for Bluetooth.\par
To begin, through Kali Linux we ensure that Bluetooth is activated using the following commands:\par
? Bluejacking attack: To make this possible, we need to create a contact user, instead of the name, the message will be written, in the directory folder that will act as the attacker and the contact user is saved. After That, an area with several mobile devices is found and the option "send via Bluetooth'' is chosen, and it is sent to the target devices. ? Bluesmack: a line executed directly from the attacker's console device. which deploys several calls in a specific frame of time, causing the Bluetooth denial service in the host or hacked device. The script is: lroot@kali:\textasciitilde \# while read r; do l2ping -s 50 84:C7:EA:57:36:D7; done < numscans we created a file called: numscans with a timer from 1 to n, to be used in the script and avoid memory leaking in the attacker's device.\par
root@kali:\textasciitilde \# while read r; do l2ping -s 50 84:C7 We can see the Bluetooth protocol is designed to facilitate device connection, and it is a mandatory approach for IoT communication devices, so through the software we designed we do not want to limit or block the protocol's functionality automatically by a service or app, but we want to give the user this option, designing an app that allows him to see the connectivity events, paired devices, and allows the user the chance to block any device at anytime. The diagram shows the device and the app running, participating in different communications with different devices, the device is in a susceptible environment when it is often attacked via Bluetooth. The device has a Bluetooth interface that communicates with the app (Bluelock) that manages the Bluetooth adapter. 
\section[{III.}]{III.} 
\section[{Design Phase}]{Design Phase}\par
The app (BlueLock) has an event filter that detects specific changes in the Bluetooth adapter, such as incoming connections, and registering all the information in a database, and the app log.\par
IV. 
\section[{Development Phase}]{Development Phase} 
\section[{App development}]{App development}\par
As a solution a mobile app for Android is proposed that allow people to control the Bluetooth interface communication, turn on and off the Bluetooth controller, enable finding new devices, consult paired devices, check the Bluetooth event's logs, block access to multiple devices. 
\section[{App features}]{App features}\par
1. User's interface to control the Bluetooth device.   The state the device is found, is extremely important for the app. Therefore, if the app finds a device and this is active, when establishing a connection, it can be blocked to avoid negative actions to our device from this unwanted device. The following method blockDevice validates the state from this device and updates the blocked column from the Devices chart.  
\section[{i. Bluejacking attack results}]{i. Bluejacking attack results}\par
After executing the test, we can see the app blocks the contact sent, blocking all the communication channels between those devices. 
\section[{b) Bluesnarfing attack test i. Deploying attack}]{b) Bluesnarfing attack test i. Deploying attack}\par
This attack is similar to the previous one, but it enters and steals information from the attacked device. We execute the same previous commands and we get the results shown in the console. root@kali:\textasciitilde \# sdptool browse --tree --l2cap C0:8C:71:84:94:A1 Failed to connect to SDP server on C0:8C:71:84:94:A1: Connection timed out root@kali:\textasciitilde \# sdptool browse --tree --l2cap C0:8C:71:84:94:A1 Failed to connect to SDP server on C0:8C:71:84:94:A1: Operation already in progress root@kali:\textasciitilde \# sdptool browse --tree --l2cap C0:8C:71:84:94:A1 Failed to connect to SDP server on C0:8C:71:84:94:A1: Connection timed out root@kali:\textasciitilde \# 
\section[{ii. Bluesnarfing attack results}]{ii. Bluesnarfing attack results}\par
The attacked device avoids the description services reading and keeps inaccessible to the attacker device. 
\section[{VI.}]{VI.} 
\section[{Analysis Results}]{Analysis Results}\par
When we deployed the attacks and used the app Bluelock, we got a positive result due to the effectiveness when blocking attacker devices trying to deploy their attacks. In the bluejacking, it does not allow incoming notifications from the corrupted contact, and in the Bluesnarfing it was completely stopped since the device tried to start communication.\par
The app, through the blocking device functionality, offers better security and control of the device Bluetooth connections, because it allows the user to choose the devices that will be able to establish a connection and keep track of the bluetooth connections events. After testing the file transfer and Bluetooth attacks we see in the app the functionality filter for the bluetooth adapter states works as expected, so its functionalities could be expanded, defining protocols for every single state of the Bluetooth adapter, increasing the app's usability and security to protect our information from Bluetooth attacks.\par
The log registration allows us to access the Bluetooth adapter communication events in a short time range and to detect unusual events that take place in the Bluetooth interface range.\par
The functionality of the app consists in the device's bluetooth adapter control. In case the interface does not respond, it will need to be reseted to get control again, this action can be done by BlueLock.\par
An app that allows us to see the Bluetooth interface actions is not easily found, because they happen under a transparent communication cape for the user. So with the app BlueLock we can offer a better control of the use that bluetooth connections represent and the events at the moment of establishing connections.\par
V. 
\section[{Conclusions}]{Conclusions}\par
The synergy between hacking and the bluetooth attacks, along with software development, allows them to complement each other, facilitating the design, development, testing and deploying of software solutions that improve security in device communication interface, and allow the implementation of closed mobile communication systems.\par
Most Bluetooth attacks are done while the device's interface is active, due to the protocol working as a receptor waiting for incoming communications and in that state attacks like Bluesnarfing can take place and steal information, taking advantage of the human factor to reach closeness of the target device.\par
Software solutions for mobile devices focused on connection validation and data packages can improve Android devices' security in places like apartment buildings where there are a lot of mobile devices active and we have a higher chance to be hacked in such environments. BlueLock is a security app oriented to connectivity events that allows unwanted device detection and offers the chance to block them at any time. This is possible by validating the Bluetooth interface state through Intent filters, that is sensible to the Bluetooth adapter changes.\par
The robustness of the testing set for BlueLock solution, has given positive security results that allow us to block BLuejacking or Bluesnarfing attacks coming from previously blocked devices. In conclusion, we are allowing the user to be responsible for managing the device he allows or not to connect.\begin{figure}[htbp]
\noindent\textbf{}\includegraphics[]{image-2.png}
\caption{\label{fig_1}}\end{figure}
 \begin{figure}[htbp]
\noindent\textbf{2}\includegraphics[]{image-3.png}
\caption{\label{fig_2}2 .}\end{figure}
 \begin{figure}[htbp]
\noindent\textbf{8}\includegraphics[]{image-4.png}
\caption{\label{fig_3}Fig. 8 :}\end{figure}
  \begin{figure}[htbp]
\noindent\textbf{} \par 
\begin{longtable}{P{0.016196129289704708\textwidth}P{0.8176077414205906\textwidth}P{0.016196129289704708\textwidth}}
Global Journal of Researches in Engineering ( ) F 1 Year 2022 18 Volume XXII Issue ersion I V I Year 2022 1 20 ersion I V I Issue Volume XXII ( ) F Global Journal of Researches in Engineering\tabcellsep //BroadcastReceiver private final BroadcastReceiver mBR = new BroadcastReceiver() \{ @Override public void onReceive(Context context, Intent intent) \{ final String action = intent.getAction(); String evento = ""; boolean bloqueo = false; final Uri uriData = intent.getData(); event evt = validaUri(uriData, action); eventsDBHelper dbHelper = new eventsDBHelper(getApplicationContext()); String log = "", showToastLog = ""; boolean logger; if(action.equals(BluetoothAdapter.ACTION\textunderscore STATE\textunderscore CHANGED) ||action.equals(BluetoothAdapter.ACTION\textunderscore DISCOVERY\textunderscore STARTED) ||action.equals(BluetoothAdapter.ACTION\textunderscore DISCOVERY\textunderscore FINISHED) ||action.equals(BluetoothAdapter.ACTION\textunderscore SCAN\textunderscore MODE\textunderscore CHANGED)) \{ final int estado = intent.getIntExtra(BluetoothAdapter.EXTRA\textunderscore STATE, BluetoothAdapter.ERROR); switch (estado) \{ case BluetoothAdapter.STATE\textunderscore OFF: evento = "<font color='blue'>BluetoothAdapter.STATE\textunderscore OFF"; log += logAdapter(uriData,evento); break; case BluetoothAdapter.STATE\textunderscore ON: evento = "<font color='blue'>BluetoothAdapter.STATE\textunderscore ON"; log += logAdapter(uriData,evento); break; case BluetoothAdapter.STATE\textunderscore TURNING\textunderscore OFF: evento = "<font color='purple'>BluetoothAdapter.STATE\textunderscore TURNING\textunderscore OFF"; log += logAdapter(uriData,evento); break; case BluetoothAdapter.STATE\textunderscore TURNING\textunderscore ON: evento = "<font color='purple'>BluetoothAdapter.STATE\textunderscore TURNING\textunderscore ON"; log += logAdapter(uriData,evento); break; Fig. 3: case BluetoothAdapter.STATE\textunderscore CONNECTING: evento = "<font color='purple'>BluetoothAdapter.STATE\textunderscore CONNECTING"; log += logAdapter(uriData,evento); BluetoothDevice device = intent.getParcelableExtra(BluetoothDevice.EXTRA\textunderscore DEVICE); bloqueo = validaBloqueo(device.getAddress()); UUID uuid = UUID.randomUUID(); if(bloqueo)\{ try \{ Log.w("ACTION\textunderscore ACL\textunderscore CONNECTED","Entró a removeBond"); log += logAdapter(uriData,evento); showToast("Dispositivo bloqueado ("+uuid+") : "+device.getAddress()+" : "+ device.getName()); \} catch (Exception e) \{ Log.w("ACTION\textunderscore ACL\textunderscore CONNECTED", e.getMessage()); evento = "<font color='red'>Error de Dispositivo Bloqueado ("+uuid+"): "+device.getAddress()+"; "+device.getName(); \} log += logAdapter(uriData,evento); \} break; Fig. 4: case BluetoothAdapter.STATE\textunderscore CONNECTED: evento = "<font color='green'>BluetoothAdapter.STATE\textunderscore CONNECTED"; log += logAdapter(uriData,evento); break; case BluetoothAdapter.STATE\textunderscore DISCONNECTING: evento = "<font color='green'>BluetoothAdapter.STATE\textunderscore DISCONNECTING"; log += logAdapter(uriData,evento); break; case BluetoothAdapter.STATE\textunderscore DISCONNECTED: evento = "<font color='purple'>BluetoothAdapter.STATE\textunderscore DISCONNECTED"; log += logAdapter(uriData,evento); break; case BluetoothAdapter.SCAN\textunderscore MODE\textunderscore CONNECTABLE\textunderscore DISCOVERABLE: evento = "<font color='purple'>BluetoothAdapter.SCAN\textunderscore MODE\textunderscore CONNECTABLE\textunderscore DISCOVERABLE"; © 2022 Global Journals log += logAdapter(uriData,evento); break; case BluetoothAdapter.SCAN\textunderscore MODE\textunderscore CONNECTABLE: evento = "<font color='purple'>BluetoothAdapter.SCAN\textunderscore MODE\textunderscore CONNECTABLE"; log += logAdapter(uriData,evento); break; case BluetoothAdapter.SCAN\textunderscore MODE\textunderscore NONE: evento = "<font color='purple'>BluetoothAdapter.SCAN\textunderscore MODE\textunderscore NONE"; log += logAdapter(uriData,evento); break; default: break; \} logger = writeLog(log, "BluetoothAdapter.txt"); evt.setEventLog(evento); dbHelper.saveEvent(evt); \} logger = writeLog(log, "BluetoothAdapter.txt"); showToast(showToastLog); \} Log.© 2022 Global Journals dbHelper.saveEvent(evt); try \{ evt.setEventLog(evento); if(bloqueo)\{ log += logAdapter(uriData, evento); UUID uuid = UUID.randomUUID(); evento = "<font color='red'>BluetoothAdapter.ACTION\textunderscore CONNECTION\textunderscore STATE\textunderscore CHANGED :" + estado; bloqueo = validaBloqueo(device.getAddress()); final int estado = intent.getIntExtra(BluetoothAdapter.EXTRA\textunderscore CONNECTION\textunderscore STATE, BluetoothAdapter.ERROR); BluetoothDevice device = intent.getParcelableExtra(BluetoothDevice.EXTRA\textunderscore DEVICE); if(action.equals(BluetoothAdapter.ACTION\textunderscore CONNECTION\textunderscore STATE\textunderscore CHANGED)) \{ if(action.equals(BluetoothAdapter.ERROR))\{ evento = "<font color='red'>Dispositivo Bloqueado ("+uuid+"): log += String.valueOf(BluetoothAdapter.ERROR); "+device.getAddress()+"; "+device.getName(); evento = "<font color='red'>BluetoothAdapter.ERROR"; log += logAdapter(uriData,evento); log += logAdapter(uriData,evento); showToast("Dispositivo bloqueado ("+uuid+") : "+device.getAddress()+" : "+ evt.setEventLog(evento); dbHelper.saveEvent(evt); showToastLog = "BluetoothAdapter.ERROR"; logger = writeLog(log, "BluetoothAdapter.txt"); showToast(showToastLog); \} Fig. 5: if(action.equals(BluetoothDevice.ACTION\textunderscore FOUND))\{ BluetoothDevice device = intent.getParcelableExtra(BluetoothDevice.EXTRA\textunderscore DEVICE); int rssi = intent.getShortExtra(BluetoothDevice.EXTRA\textunderscore RSSI, Short.MIN\textunderscore VALUE); Log.w("ACTION\textunderscore ACL\textunderscore CONNECTED","Entróa ACTION\textunderscore ACL\textunderscore CONNECTED"+device.getName()+"\textbackslash n"+device.getAddress()+"\textbackslash n"+rssi); device dev = new device(); dev.setId(0); dev.setName(device.getName()); dev.setAddress(device.getAddress()); dev.setContentDesc(String.valueOf(rssi)); dev.setBloqueado(String.valueOf(false)); dev.setTime(String.valueOf(Calendar.getInstance().getTime())); dev.setBonded(String.valueOf(false)); dev.setHashCode(String.valueOf(device.hashCode())); boolean result = guardaDispositivo(dev); evento = "<font color='green'>BluetoothDevice.ACTION\textunderscore FOUND"; log += logAdapter(uriData,evento); evt.setEventLog(evento); dbHelper.saveEvent(evt); logger = writeLog(log, "BluetoothAdapter.txt"); showToastLog = "BluetoothAdapter.ACTION\textunderscore FOUND"; showToast(showToastLog); \} Fig. 6: if(action.equals(BluetoothDevice.ACTION\textunderscore ACL\textunderscore CONNECTED)) \{ Log.d("ACTION\textunderscore ACL\textunderscore CONNECTED","Entró a ACTION\textunderscore ACL\textunderscore CONNECTED"); log += logAdapter(uriData,"BluetoothDevice."+BluetoothDevice.EXTRA\textunderscore NAME+" -"+BluetoothDevice.ACTION\textunderscore ACL\textunderscore CONNECTED); evento = "<font color='green'>BluetoothDevice.ACTION\textunderscore ACL\textunderscore CONNECTED"; evt.setEventLog(evento); device.getName()); /* \} catch (Exception e) \{ * Valida el estado del dispositivo y actualiza la columna bloqueado Log.e("ACTION\textunderscore ACL\textunderscore CONNECTED", e.getMessage()); * */ evento = "<font color='red'>Error de Dispositivo Bloqueado ("+uuid+"): public boolean blockDevice(device dev)\{ "+device.getAddress()+"; "+device.getName(); boolean result = false; \} String estado = "bloqueado"; \}else\{ try \{ try \{ Log.d("ACTION\textunderscore ACL\textunderscore CONNECTED", "Start Pairing..."); Method m = device.getClass() .getMethod("createBond", (Class[]) null); String args [] = new String[1]; args[0] = dev.getAddress(); Cursor cursor = this.getDevice(devicesContract.deviceEntry.tableName,null,devicesContract.deviceEntry.address+ m.invoke(device, (Object[]) null); "=?",args,null,null,null); Log.w("ACTION\textunderscore ACL\textunderscore CONNECTED", "Pairing finished."); if (cursor.getCount() > 0)\{ evento = "<font color='green'>Dispositivo Conectado ("+uuid+"): "+device.getAddress()+"; "+device.getName(); log += logAdapter(uriData,evento); \} catch (Exception e) \{ cursor.moveToFirst(); String bloqueado = cursor.getString(cursor.getColumnIndex(devicesContract.deviceEntry.bloqueado)); if(bloqueado == null)\{ Log.w("ACTION\textunderscore ACL\textunderscore CONNECTED", e.getMessage()); estado = "bloqueado"; evento = "<font color='red'>Error Dispositivo Conectado ("+uuid+"): "+device.getAddress()+"; "+device.getName(); \} else if(bloqueado.equals("bloqueado")) \{ \} \} if(action.equals(BluetoothDevice.ACTION\textunderscore ACL\textunderscore DISCONNECTED)) \{ log += logAdapter(uriData,"BluetoothDevice."+BluetoothDevice.EXTRA\textunderscore NAME+" -"+BluetoothDevice.ACTION\textunderscore ACL\textunderscore DISCONNECTED); evento = "<font color='green'>BluetoothDevice.ACTION\textunderscore ACL\textunderscore DISCONNECTED"; evt.setEventLog(evento); estado = "desbloqueado"; \} \}else\{ Log.e("deviceDBHelper", "Error bloqueando Dispositivo no emparejado:"+dev.getAddress() ); \} ContentValues cv = new ContentValues(); dbHelper.saveEvent(evt); logger = writeLog(log, "BluetoothAdapter.txt"); showToastLog = "BluetoothDevice."+BluetoothDevice.EXTRA\textunderscore NAME+" -"+BluetoothDevice.ACTION\textunderscore ACL\textunderscore DISCONNECTED; showToast(showToastLog); \} \} \}; Fig. 7: Adapter State Connection Validation function cv.put(devicesContract.deviceEntry.bloqueado, estado); SQLiteDatabase db = getWritableDatabase(); db.update(devicesContract.deviceEntry.tableName, cv, devicesContract.deviceEntry.address + "='" + dev.getAddress()+"'", null); result = true; \}catch (Exception e)\{ Log.e("deviceDBHelper", "Error bloqueando Dispositivo: " + e.toString());\tabcellsep Global Journal of Researches in Engineering ( ) F 1 Year 2022 17 Volume XXII Issue ersion I V I Global Journal of Researches in Engineering ( ) F 1 Year 2022 19 Volume XXII Issue ersion I V I\end{longtable} \par
  {\small\itshape [Note: Method m = device.getClass()   .getMethod("removeBond", (Class[]) null); m.invoke(device, (Object[]) null); evento = "<font color='red'>Dispositivo Bloqueado ("+uuid+"): "+device.getAddress()+"; "+device.getName(); w("ACTION\textunderscore ACL\textunderscore CONNECTED","Entró a removeBond"); Method m = device.getClass() .getMethod("removeBond", (Class[]) null); m.invoke(device, (Object[]) null);]} 
\caption{\label{tab_3}}\end{figure}
 			\footnote{© 2022 Global Journals} 		 		\backmatter  			  				\begin{bibitemlist}{1}
\bibitem[Segunda Edición and México]{b12}\label{b12} 	 		\textit{},  		 			Segunda Edición 		,  		 			México 		.  		Pearson.  	 
\bibitem[Clarín ()]{b14}\label{b14} 	 		\textit{Advierten sobre los peligros de utilizar el Bluetooth de tu celular},  		 			Clarín 		.  		 \url{https://www.clarin.com/tecnologia/advierten-peligros-utilizar-bluetooth-celular\textunderscore 0\textunderscore \textunderscore WpofinjL.html}  		2019. Buenos Aires, Argentina. Recuperado de.  	 
\bibitem[Weed ()]{b6}\label{b6} 	 		\textit{Bluetooth IoT Applications: From BLE to Mesh. USA: IoT for all},  		 			M Weed 		.  		 \url{https://www.iotforall.com/bluetooth-iot-applications/}  		2018.  	 
\bibitem[Haataja et al. ()]{b3}\label{b3} 	 		\textit{Bluetooth Security Attacks: Comparative analysis, attacks and countermeasures},  		 			K Haataja 		,  		 			K Hypponen 		,  		 			S Pasanen 		,  		 			P Toivanen 		.  		2013. Finlandia: Springer.  	 
\bibitem[Minar and Tarique ()]{b5}\label{b5} 	 		‘Bluetooth Security Threats and Solutions: A Survey’.  		 			N Minar 		,  		 			M Tarique 		.  	 	 		\textit{International Journal of Distributed and Parallel Systems}  		2012.  	 	 (IJDPS) 
\bibitem[Mitra ()]{b9}\label{b9} 	 		‘Conoce android studio. USA: Developers Android’.  		 			A Mitra 		.  		 \url{https://developer.android.com/studio/intro/?hl=es-419}  	 	 		\textit{What is Bluestack Attack},  				2017. 2019.  	 	 (The Security Buddy. Recuperado de) 
\bibitem[Del Cid et al. ()]{b11}\label{b11} 	 		 			Alma Del Cid 		,  		 			R Méndez 		,  		 			F Sandoval 		.  		\textit{Investigación. Fundamentos y metodología},  				2011.  	 
\bibitem[Nolasco ()]{b1}\label{b1} 	 		\textit{Desarrollo de aplicaciones móviles con Android. Segunda edición. Colombia: Ediciones U, Ra -Ma},  		 			J Nolasco 		.  		2016.  	 
\bibitem[
			Android
		 ()]{b10}\label{b10} 	 		\textit{Documentation, android.bluetooth. USA: Developers Android},  		 			Android 		.  		 \url{https://developer.android.com/reference/android/bluetooth/package-summary}  		2019.  	 
\bibitem[Adn Sureste ()]{b13}\label{b13} 	 		\textit{Este "error" en el Bluetooth pone en riesgo tu celular},  		 			Adn Sureste 		.  		 \url{https://www.adnsureste.info/este-es-error-en-el-bluetooth-pone-en-riesgo-tu-celular-2130-h/}  		2019.  	 
\bibitem[Carro ()]{b16}\label{b16} 	 		‘Esto es lo que puede pasar si tienes el bluetooth del móvil siempre conectado’.  		 			G Carro 		.  		 \url{https://www.revistagq.com/noticias/articulo/bluetooth-movil-siempre-conectado-peligros-hackers}  	 	 		\textit{Revista GQ. España}  		2019.  	 	 (Recuperado de) 
\bibitem[García ()]{b7}\label{b7} 	 		\textit{Hablemos de Spoofing. Hacking Ético},  		 			C García 		.  		 \url{https://hacking-etico.com/2010/08/26/hablemos-de-spoofing}  		2010.  	 
\bibitem[Ramos et al. ()]{b0}\label{b0} 	 		‘Hacking y seguridad de páginas web’.  		 			A Ramos 		,  		 			C Barbero 		,  		 			R Martínez 		,  		 			A García 		,  		 			J González 		.  	 	 		\textit{Colombia: Ediciones U}  		2015.  	 
\bibitem[Conkin et al. ()]{b4}\label{b4} 	 		\textit{Principles of Computer Security: CompTIA Security+ and Beyond},  		 			A Conkin 		,  		 			G White 		,  		 			C Cothren 		,  		 			R Davis 		,  		 			D Williams 		.  		2018. USA: McGraw Hill Professional.  	 
\bibitem[Álvarez ()]{b15}\label{b15} 	 		\textit{Se descubre una "grave vulnerabilidad" en Bluetooth que deja expuestos los dispositivos a posibles ataques},  		 			R Álvarez 		.  		 \url{https://www.xataka.com/seguridad/se-descubre-grave-vulnerabilidad-bluetooth-que-deja-expuestos-dispositivos-a-posibles-ataques}  		2017.  	 
\bibitem[Ciampa ()]{b2}\label{b2} 	 		\textit{Security+ Guide to Networks Security Fundamentals. Sexta edición},  		 			M Ciampa 		.  		2018. Boston, USA: Cengage.  	 
\bibitem[Occupytheweb ()]{b8}\label{b8} 	 		\textit{The Hacks of Mr. Robot: How to Hack Bluetooth},  		 			Occupytheweb 		.  		 \url{https://null-byte.wonderhowto.com/how-to/hacks-mr-robot-hack-bluetooth-0163586/}  		2016. Los Angeles, California.  	 	 (Wonder How To. Recuperado de) 
\end{bibitemlist}
 			 		 	 
\end{document}
