Skip to content
KitploitKITPLOIT
StrumentiBlog
Invia
StrumentiBlog
Invia

Strumenti di Hacking, PenTest e Cybersecurity per il tuo Arsenale di Sicurezza!

Kitploit è una directory di strumenti di hacking, cybersecurity e pentesting. Scopri gli ultimi aggiornamenti dei progetti per trovare vulnerabilità, analizzare sistemi, automatizzare i test e rafforzare la tua sicurezza.

··Feed·Contatto·Privacy·© 2026 Kitploit

Directory degli strumenti

Categorie

Vedi tutte le categorie
Loading categories
SwiftyInsta — Instagram Private API Swift | Kitploit
Strumenti/GitHubGitHub/them4hd1/swiftyinsta
OSINT (Open Source Intelligence)Scripting e AutomazioneRaccolta InformazioniIngegneria Sociale
GitHubthem4hd1/swiftyinsta

SwiftyInsta

Instagram Private API Swift

Vedi Repository
2304974 anni faRevisionato da Kitploit

Più Popolari

Vedi tutti →

Scopri gli strumenti più utilizzati dalla nostra community.

Esplora tutti gli strumenti

Sfoglia la nostra collezione di strumenti

Vedi tutti gli strumenti →
Condividi

SwiftyInsta (obsoleto)

Si prega di notare che SwiftyInsta non è più mantenuto attivamente.
Fare riferimento a #244 per maggiori informazioni.
Dai un'occhiata a Swiftagram se stai cercando alternative aggiornate.


CI Status Version License Platform

Instagram offre due tipi di API agli sviluppatori. La Instagram API Platform (estremamente limitata nelle funzionalità e prossima alla dismissione), e la Instagram Graph API solo per account Business e Creator.

Tuttavia, le app Instagram si basano su un terzo tipo di API, la cosiddetta Private API o API non ufficiale, e SwiftyInsta è un client iOS, macOS, tvOS e watchOS per esse, scritto interamente in Swift. Puoi provare a creare un'esperienza Instagram migliore per i tuoi utenti, o scrivere bot per automatizzare diversi compiti.

Queste Private API non richiedono token o registrazione dell'app ma non sono autorizzate da Instagram per uso esterno. Usalo a tuo rischio.

Installazione

Swift Package Manager (Xcode 11 e versioni successive)

  1. Seleziona File/Swift Packages/Add Package Dependency… dal menu.
  2. Incolla https://github.com/TheM4hd1/SwiftyInsta.git.
  3. Segui i passaggi.

CocoaPods

CocoaPods è un gestore di dipendenze per progetti Cocoa. Puoi installarlo con il seguente comando:

root@kitploit:~
$ gem install cocoapods

Per integrare SwiftyInsta nel tuo progetto Xcode usando CocoaPods, specificalo nel tuo Podfile:

root@kitploit:~
use_frameworks!

target '<Your Target Name>' do
    pod 'SwiftyInsta', '~> 2.0'
end

Quindi, esegui il seguente comando:

root@kitploit:~
$ pod install

SwiftyInsta dipende da CryptoSwift e keychain-swift.

Login

Credentials

root@kitploit:~
// these need to be strong references.
self.credentials = Credentials(username: /* username */, password: /* password */, verifyBy: .text)
self.handler = APIHandler()
handler.authenticate(with: .user(credentials)) {
    switch $0 {
    case .success(let response, _):
        print("Login successful.")
        // persist cache safely in the keychain for logging in again in the future.
        guard let key = response.persist() else { return print("`Authentication.Response` could not be persisted.") }
        // store the `key` wherever you want, so you can access the `Authentication.Response` later.
        // `UserDefaults` is just an example.
        UserDefaults.standard.set(key, forKey: "current.account")
        UserDefaults.standard.synchronize()
    case .failure(let error):
        if error.requiresInstagramCode {
            /* update interface to ask for code */
        } else {
            /* notify the user */
        }
    }
}

Una volta che l'utente ha digitato il codice di autenticazione a due fattori o il codice di verifica, basta fare

root@kitploit:~
self.credentials.code = /* the code */

E il completionHandler nel precedente authenticate(with: completionHandler:) catturerà automaticamente la risposta.

LoginWebViewController

root@kitploit:~
let login = LoginWebViewController { controller, result in
    controller.dismiss(animated: true, completion: nil)
    // deal with authentication response.
    guard let (response, _) = try? result.get() else { return print("Login failed.") }
    print("Login successful.")
    // persist cache safely in the keychain for logging in again in the future.
    guard let key = response.persist() else { return print("`Authentication.Response` could not be persisted.") }
    // store the `key` wherever you want, so you can access the `Authentication.Response` later.
    // `UserDefaults` is just an example.
    UserDefaults.standard.set(key, forKey: "current.account")
    UserDefaults.standard.synchronize()
}
if #available(iOS 13, *) {
    present(login, animated: true, completion: nil) // just swipe down to dismiss.
} else {
    present(UINavigationController(rootViewController: login),  // already adds a `Cancel` button to dismiss it.
            animated: true,
            completion: nil)
}

Oppure implementa il tuo UIViewController personalizzato usando LoginWebView, e passalo a un metodo authenticate di APIHandler usando .webView(/* your login web view */).

Authentication.Response

Se hai già salvato la risposta Authentication.Response di un utente:

root@kitploit:~
// recover the `key` returned by `Authentication.Response.persist()`.
// in our example, we stored it in `UserDefaults`.
guard let key = UserDefaults.standard.string(forKey: "current.account") else { return print("`key` not found.") }
// recover the safely persisted `Authentication.Response`.
guard let cache = Authentication.Response.persisted(with: key) else { return print("`Authentication.Response` not found.") }
// log in.
let handler = APIHandler()
handler.authenticate(with: .cache(cache)) { _ in
    /* do something here */
}

Utilizzo

Tutti gli endpoint sono facilmente accessibili dalla tua istanza APIHandler.

root@kitploit:~
let handler: APIHandler = /* a valid, authenticated handler */
// for instance you can…
// …fetch your inbox.
handler.messages.inbox(with: .init(maxPagesToLoad: .max),
                       updateHandler: nil,
                       completionHandler: { _, _ in /* do something */ })
// …fetch all your followers.
handler.users.following(user: .me,
                        with: .init(maxPagesToLoad: .max),
                        updateHandler: nil,
                        completionHandler: { _, _ in /* do something */ })

Inoltre, le risposte ora mostrano ogni singolo valore contenuto nel file JSON restituito dall'API: basta accedere a qualsiasi ParsedResponse rawResponse e iniziare a navigare, oppure attenersi agli accessori suggeriti (ad esempio username, name di User, ecc. e aspectRatio, takenAt, content di Media, ecc.).

Contributi

Pull request e issue sono più che benvenuti.

Autori

  • Mahdi Makhdumi (@TheM4hd1), 1.* maintainer
  • Stefano Bertagno (@sbertix), 2.* maintainer

Siamo attivamente alla ricerca di manutentori.
Fare riferimento a #244 per maggiori informazioni.

Licenza

SwiftyInsta è concesso in licenza sotto la licenza MIT. Vedi LICENSE per maggiori informazioni.

Scarica lo strumento